IT |
気になる、記になる… |
LINE、「iOS 14」のサポートを終了 |
https://taisy0.com/2023/04/19/170899.html
|
終了 |
2023-04-19 11:54:13 |
IT |
気になる、記になる… |
「ウマ娘」などのスマホゲームがPCでプレイ可能に − 「Google Play Games (ベータ)」が日本でも提供開始 |
https://taisy0.com/2023/04/19/170896.html
|
google |
2023-04-19 11:44:13 |
IT |
気になる、記になる… |
Microsoft、認定サービスプロバイダーによる「Surface」の修理サービスを6月から日本でも提供開始へ |
https://taisy0.com/2023/04/19/170893.html
|
microsoft |
2023-04-19 11:34:29 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
Python venv(仮想環境)を使えるようになりたい |
https://qiita.com/yulily/items/bb48b35548b421eccc9c
|
pythonvenv |
2023-04-19 20:55:48 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
Python GUI Programming with Tkinter: Building Desktop Applications |
https://qiita.com/EdenWheeler/items/9cf3dfd158a4de2fffd6
|
applicatio |
2023-04-19 20:26:05 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
asdf + rubocop でエラーが出たとき |
https://qiita.com/mkt1234/items/84a8eb251594161799a7
|
lintexecutingrubocops |
2023-04-19 20:23:04 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
AWSのIAMポリシーに色々な種類があったので調べてみる |
https://qiita.com/Ayumu-y/items/53e6d92243af099b0d92
|
課題 |
2023-04-19 20:30:04 |
海外TECH |
DEV Community |
Object VS Data Structure : The Fight ! |
https://dev.to/codeoz/object-vs-data-structure-the-fight--k0h
|
Object VS Data Structure The Fight As developer we need to hide code implementation for users we don t want to expose the logic of our code Why Because they don t need to know the inner code they only need what we choose to expose Hiding implementation is not just putting getter and setter and make the dedicated variable in private A short example about that Should I use the first example class Vehicule getFuelTankCapacityInGallons getGallonsOfGasoline or this example class Vehicule getPercentFuelRemaining The second option is preferable because we don t want to expose any details about our data to the user he don t need to see that Vehicule is using Gasoline or FuelTankCapacity He just need to know the PercentFuelRemaining So as you can see data abstraction is not only putting setter or getter on private variable So when you need to modeling your data in some case you will be facing two choices choose an Object design model or a Data structure model In this article you will learn what is this and which use depending on the context What is Object and Data structure Data StructureIt exposes their data but it doesn t have meanfull function class Shape class Square extends Shape side number class Rectangle extends Shape height number width number class Circle extends Shape center number radius number class Geometry PI getArea shape Shape if shape instanceof Square return shape side shape side if shape instanceof Rectangle return shape height shape width if shape instanceof Circle return this PI shape radius shape radius throw new Error Unknow Shape So Shape class and subclass expose their Data without any behavior no methods this is the Geometry class that handle all behavior Pro amp Cons for Data StructureOn the first hand data structure make easy to add new behavior new function like adding Perimeter function on the existing data Shape class and subclass without editing them Because we only need to add it in the Geometry class On the second hand data structure is bad if you will need to add new shape Imagine that Geometry class has methods if you add a new subclass from Shape you will need to edit all function in Geometry class ObjectIt hides their data with abstraction but it expose their function class Shape getArea class Square extends Shape side number getArea return this side this side class Rectangle extends Shape height number width number getArea return this height this width class Circle extends Shape PI center number radius number getArea return this radius this radius As you can see with abstraction we don t need the Class Geometry Pro amp Cons for Object On the first hand adding a new Shape is very easy since existing function are not impacted by this effect On the second hand adding new function like adding Perimeter function needs to update all subclass of Shape TLDR When to use Data structure vs Object Use Data structure if you need to add new function to existing data but you don t need to add new data Use Object if you nedd to create a lot of object and you don t need to add new function to it Avoid the mix upA lot of developer made a confusion between both structure So they are creating a mix up data structure and object This leads to have a structure that have all Cons DTO amp BeanDTO Data Transfer Object is a data structure with public variable and no function They are usefull when communicating with database to convert raw data in database or during request payloads in API Call that that defines how the data will be sent over the network For purist the DTO has an another form called Bean It has private variable manipulated by getters amp setters Bean form class Adress private street string private city string private state string private zip string public constructor street string city string state string zip string this street street this city city this state state this zip zip public getStreet return this street public getCity return this city DTO form class Adress public street string public city string public state string public zip string public constructor street string city string state string zip string this street street this city city this state state this zip zip ActiveRecordActiveRecord are special form of DTO but they have methods like save or find Since we are using it for translation our database data to our source code data To avoid mixup we need to treat ActiveRecord as data structure and using an object here we called it Manager that will contains all business logic of methods save or find and this object will hide their internal data that is our ActiveRecord const userActiveRecord id name CodeOz age const manager new Manager userActiveRecord manager save ActiveRecord is not linked to the manager but the Manager needs it to save it in the database ConlusionHide implemention is not only use private data and manipulate it by accessor Use Data structure if you need to add new function to existing data but you don t need to add new data Use Object if you nedd to create a lot of object and you don t need to add new function to it Don t make hybrid between Data structure amp Object DTO are Data structure ActiveRecord are special form of DTO I used example from Clean Code by Robert C Martin in this articleI hope you like this reading ️You can SUPPORT MY WORKS ️You can follow me on Twitter Github For french developper you can check my YoutubeChannelAnd you can mark this article |
2023-04-19 11:50:47 |
海外TECH |
DEV Community |
Top 5 Best Javascript Icons Libraries 🔥 |
https://dev.to/rammcodes/top-5-best-javascript-icons-libraries-6c7
|
Top Best Javascript Icons Libraries 𝗙𝗼𝗹𝗹𝗼𝘄me on Linkedin for more Tips Guides Resources Quizzes related to Programming and Web Development Also Follow me here on dev to |
2023-04-19 11:32:12 |
海外TECH |
DEV Community |
5 Code Refactoring Techniques to Improve Your Code |
https://dev.to/documatic/5-code-refactoring-techniques-to-improve-your-code-2lia
|
Code Refactoring Techniques to Improve Your Code IntroductionWriting code is fun and we enjoyed it a lot Until an error pops out from nowhere which takes quite a time to solve it Sometimes the error is not visible as the code runs as intended but in production can cause an error There can be performance and accessibility based errors which can cause a bad user experience This kind of error can be reduced by refactoring the code Code refactoring involves making improvements to existing code without altering its external functionality It is one of the core parts of programming which can not be overlooked otherwise you will not achieve a better version of your code Code refactoring can enhance the readability maintainability and scalability of the code It is also intended to increase performance and increase developer productivity Today we are going to look into some techniques that can help you in refactoring your code in a better way Now let s get started How to integrate RefactoringBefore looking for techniques to improve refactoring let s see how you can integrate code refactoring into your coding process The below suggestion you can use for the purpose You should allot time specifically for refactoring the code Break down the larger refactoring problem into smaller ones for management Try to involve the whole team in the refactoring process Use automated tools that can help you in finding common refactoring errors Now let s start with the techniques to use for refactoring Extract MethodThis method involves converting code blocks into a separate method function This is done to improve the structure and readability of the code It is achieved by extracting code blocks that are long and complex into smaller and more manageable methods To use this technique we first need to find a code block that performs particular tasks which are a little complex After identification we then extract the code and place it into a new method Also make sure to give a meaningful name to the method Now where we need the code we call them Example Before Refactoring function calculateInvoiceTotal items let total for let i i lt items length i const item items i if item quantity item price console error Invalid item item continue const itemTotal item quantity item price total itemTotal return total After Refactoring function calculateInvoiceTotal items let total for let i i lt items length i const item items i const itemTotal calculateItemTotal item total itemTotal return total function calculateItemTotal item if item quantity item price console error Invalid item item return return item quantity item price You can see how we converted the complex code that runs inside the for loop into another method for simplicity and readability Replace Magic Number with a Symbolic ConstantThis code refactoring is for writing cleaner and more readable code Magic numbers simply mean the hard coded numerical value Writing hardcoded numbers cause confusion for others as their purpose is not defined Converting hard coded values into a variable with a meaningful name will definitely help others to understand it Also you can add comments to it for further explanation It can also help in debugging and reducing the risk of having an error in the future Example Before if temperature gt Do something if temperature is above freezing After const int FREEZING POINT if temperature gt FREEZING POINT Do something if temperature is above freezing Merge Duplicated Codeduplication or identical codes can appear in the code from different places This code does not need to be totally identical but it can perform similar tasks or extend a little bit further from the original code Duplicated code can lead to several problems including increased maintenance costs difficulty in making changes to the codebase and a higher risk of introducing bugs While refactoring your code you have to look out for duplicate codes When finding such code one method to deal with this is converting such codes into a single reusable function method Example Before function calculateTotal numbers let total for let i i lt numbers length i total numbers i return total function calculateAverage numbers let total for let i i lt numbers length i total numbers i const average total numbers length return average After function calculateSum numbers let total for let i i lt numbers length i total numbers i return total function calculateTotal numbers return calculateSum numbers function calculateAverage numbers const total calculateSum numbers const average total numbers length return average In the before code example we were doing the sum and doing it again for finding the average In the after we have replaced that with the function that provides a sum to both of them Simplifying MethodsIt is quite similar to identifying as you are looking for methods functions to optimize Simplifying methods can be done for logic or to make it readable and cleaner This technique can help you in reducing lines of code This method can be broken down into smaller code blocks that you can find in a function to optimize Here are those Remove unnecessary variables and expressions There can be some variables or expressions that you leave out for debugging but forget to remove such as console log in JavaScript Remove those and alsoUsing built in function Sometimes using an in built function of the library or language will be better As the same functionality can be achieved with less code Simplify conditional statements If a method has complex conditional statements consider simplifying them by combining conditions or using the ternary operator Using Lazy LoadIt is a technique where objects are loaded only when they are needed This can improve the performance of your application by reducing the amount of memory used This results in faster loading of the application This technique is quite popular in web development Especially with JavaScript frameworks like React where you can import different components through lazy loading This can also be used to load images as per requirement Example Before import React from react import MyComponent from MyComponent const App gt return lt div gt lt h gt My App lt h gt lt MyComponent gt lt div gt export default App After import React lazy Suspense from react const MyComponent lazy gt import MyComponent const App gt return lt div gt lt h gt My App lt h gt lt Suspense fallback lt div gt Loading lt div gt gt lt MyComponent gt lt Suspense gt lt div gt export default App In the updated version we use the lazy function to import the MyComponent component asynchronously This means that the component is only loaded when it is actually needed improving the overall performance of our app We also use the Suspense component to display a fallback UI while the component is being loaded ConclusionRefactoring is an essential practice for any developer who wants to improve the quality performance and maintainability of their code By taking the time to analyze and optimize your code you can eliminate redundancies reduce complexity and create a more efficient and scalable application By continuously reviewing and improving your code you can create a more robust and resilient application I hope this article has helped you to understand some refactoring techniques Thanks for reading the article |
2023-04-19 11:30:00 |
海外TECH |
DEV Community |
Investing in Developer Experience Could Be The Best Growth Hack for Your Business |
https://dev.to/vue-storefront/investing-in-developer-experience-could-be-the-best-growth-hack-for-your-business-fnn
|
Investing in Developer Experience Could Be The Best Growth Hack for Your BusinessIt was November when we pushed the very first version of Vue Storefront to GitHub At that time there were only two of us working on it after hours One year later we had been invited to almost every Magento event and podcast Vue Storefront had almost agencies around the world implementing it and more than people were on its Slack New live stores were popping up every week and SAP had even approached us asking for help to build its own Enterprise product As crazy as it sounded this was a real story What was our secret ingredient to success Developer Experience Despite having no investment or marketing budget we managed to leverage Developer Experience to our advantage The mechanisms that led to our success can be used by other IT companies both building and consuming developer tools to greatly increase their chances of success Developer Experience is User ExperienceFor a company building tools for developers developers are their users so Developer Experience is just User Experience It s not a secret that improving the experience of your users can be a great way to increase revenue A survey by UserTesting found that of buyers are willing to pay more for a better customer experience Some companies like Amazon have become completely obsessed with their customers and their experience It works the same way with developers we have companies like Vercel Netlify that are known from their obsession with great DX By the way we re obsessed about it in Vue Storefront too Developer Experience drives web tools adoptionDevelopers are constantly looking for new and better tools that will allow them to perform tasks more efficiently or decrease the chances of failure The reason we became so successful with Vue Storefront was quite simple we identified a pain point of a huge amount of developers and shipped something that improved their experience They lifted it up because our success was in their interest Developers often look for tools that are easy to use provide the required functionality have good documentation and have good community support If a tool lacks these qualities developers are more likely to switch to an alternative tool that provides a better experience In our case we gave Magento frontend developers a way to use a modern frontend framework like Vue and decouple their work from the PHP world It was in their interest to advocate for Vue Storefront and convince the companies they worked for to use it This way they could learn a new exciting technology that is much more enjoyable and efficient to work with than what they were used to Let s take another example from the web dev tooling courtyard Webpack a tool that was fueling almost all modern JavaScript projects with daily downloads was almost completely replaced by Vite in most of the modern frameworks and starters last year Of course Webpack won t die any time soon with its massive adoption but Vite is now a go to for the new projects on Vue React and Nuxt Speaking of which Nuxt and Vue also became a market standards because of their amazing DX They had no marketing budget but happy developers advocating for their products were all they needed to get where they are now I know what you re thinking right now is it really worth investing time in a migration just to make my developers happier As a leader or a business owner should I even listen to their whims Developer Experience improves the efficiency of your teamUsing a developer tool with great developer experience is like driving on a well maintained highway where you can smoothly and efficiently cruise at high speeds towards your destination On the other hand using a tool with a poor developer experience is like driving on a bumpy and pothole filled road where you constantly have to slow down and maneuver around obstacles causing delays and frustration Ultimately the former allows you to get to your destination faster and with less stress while the latter can slow you down and impede your progress Developers spend most of their time coding designing and testing software applications The experience they have while doing these tasks can have a significant impact on their performance Good developer experience can make them more productive and more efficient leading to timely delivery of high quality software While a bad developer experience can lead to inefficiencies delays and ultimately higher costs This can also impact the end user experience leading to unhappy customers bad reviews and lost business opportunities A report from McKinsey shows that companies prioritizing developer velocity have four to five times the revenue growth of their counterparts It s not always worth migrating to the next big thingInvesting in tools that can provide better developer experience is an excellent decision especially for large teams However it s essential to consider that not all migrations are worthwhile If your current tool is already delivering good developer experience then it s highly unlikely that migrating to a new tool will bring significant benefits that justify the costs For example people migrated from webpack to Vite in large numbers because webpack was incredibly slow in larger projects leading to a significant waste of time However Vite has addressed this problem by being fast enough so replacing Vite with an even faster build tool may not provide the same benefits as migrating from webpack to Vite Therefore it s crucial to make a well informed decision before making any changes to your current toolset Developer Experience attracts talentGood developer experience can also impact employee retention and recruitment Developers want to work for companies that provide the best tools technologies and working environments Often they switch jobs just to be able to work with the new technology they re excited about According to a survey by Hired a job search platform for tech talent outdated technology is one of the top reasons why developers look for new jobs In their State of Software Engineers report they found that of software engineers surveyed cited outdated technology as a reason for leaving their job making it the second most common reason behind compensation By providing good developer experience businesses can retain and attract top talent leading to better results and growth opportunities SummaryInvesting in Developer Experience DX can be a game changer for IT companies building and consuming developer tools DX is simply User Experience UX for developers and improving it can increase revenue drive adoption and increase team efficiency However not all migrations are worthwhile and it s crucial to make a well informed decision before making any changes to your current toolset Good DX can also impact employee retention and recruitment leading to better results and growth opportunities Overall businesses should consider DX as a growth hack that can drive success and take them to the next level I share how we build best Developer Experience on the market in Vue Storefront every month in my newsletter Follow me on Twitter or Linkedin to stay in the loop and learn something new |
2023-04-19 11:17:52 |
Apple |
AppleInsider - Frontpage News |
Netflix's password sharing crackdown is coming to the US |
https://appleinsider.com/articles/23/04/19/netflixs-password-sharing-crackdown-is-coming-to-the-us?utm_medium=rss
|
Netflix x s password sharing crackdown is coming to the USFollowing its rollout around the world Netflix s plan to stop people sharing their accounts is now due to start in the US before the end of July Netflix logoNetflix inadvertently revealed the details of its strict password policy in February when it said it had accidentally posted information intended for countries outside the US Now in its quarterly earnings report the company has announced its plans for the States as well as given some details of how the policy has fared overseas Read more |
2023-04-19 11:20:45 |
海外TECH |
Engadget |
The Morning After: Netflix is ready to crack down on US account sharers |
https://www.engadget.com/the-morning-after-netflix-is-ready-to-crack-down-on-us-account-sharers-111535227.html?src=rss
|
The Morning After Netflix is ready to crack down on US account sharersSince February Netflix has offered paid account sharing in Canada New Zealand Portugal and Spain The add on allows primary account holders to pay an additional fee every month to share their Netflix service with up to two people outside of their household Now it s coming for US subscribers or non subscribers The company wrote in its Q letter to shareholders “In Q we launched paid sharing in four countries and are pleased with the results It added “We are planning on a broad rollout including in the US in Q Netflix has estimated more than million non paying households have access to its service and it wants them to pay something Netflix will also close its DVD rental business in September Yes that s still a thing Mat SmithThe Morning After isn t just a newsletter it s also a daily podcast Get our daily audio briefings Monday through Friday by subscribing right here The biggest stories you might have missedApple s Mac Mini M falls back to a low of Breville Pizzaiolo review A pricey pizza oven with lots of optionsThe best way to compost your food scraps Mrs Davis review Damon Lindelof s nun vs AI show is a campy blast Twitter quietly reversed its policies to allow for intentional deadnaming and misgenderingWithings latest entry level scale is the Body SmartPanic has sold more than Playdates so farThe Polestar electric SUV arrives with HP and no rear windowIt also supports up to kW DC fast charging PolestarPolestar has revealed its coupe style electric SUV at the Shanghai Auto Show and as expected the Polestar is a head turner but not for the driver There s no rear window so a camera provides the driver s rear view With a large kWh battery it has a plus mile targeted range and starting price with both all wheel and rear wheel drive versions It ll go on sale starting in China by the end of the year and launch in North America in Continue reading Apple s debut VR Headset might include workouts and fitness featuresThe company has reportedly been working with a small number of developers According to Bloomberg s Mark Gurman Apple s mixed reality headset maybe named Reality One or Reality Pro will focus heavily on gaming fitness sports and collaboration tools The headset is rumored to switch between virtual and augmented reality It may even run Apple Fitness workouts in VR as well as support for immersive sports viewing which could include degree views at live events It has the technology Apple bought VR sports startup NextVR back in We re expecting the company to announce the headset at WWDC which isn t far off Continue reading The best e ink tablets for Scribble to your heart s content EngadgetIs it time to replace your notebook with something high tech There s been a boom in e ink tablets to replace your myriad notebooks with something that can connect to the internet detect your handwriting and more We tested a bunch of the most popular e ink tablets available now and we have recommendations Continue reading Xiaomi s Ultra features four Leica tuned camerasThese cover focal lengths across mm mm mm and mm After debuting the first quot inch quot mobile camera sensor with the S Ultra last year Xiaomi is back with a familiar looking new phone with some significant upgrades The Xiaomi Ultra packs not three but four rear Leica cameras with the main camera using the same quot inch quot megapixel sensor but with variable aperture to toggle between f and f The Xiaomi Ultra is already available for pre order in China starting from yuan around While it s unlikely to launch in the US directly we ve been told the phone will reach international markets at some point If you re tempted you may be able to import one Continue reading Paramount greenlights Star Trek film starring Michelle YeohThe recent Oscar winner will reprise her Discovery character Paramount is finally making the long rumored Star Trek Section project starring recent Oscar winner Michelle Yeoh However this won t be a TV show but a feature length movie A Yeoh led Star Trek Section has been in development since transitioning from a series to an “event film with this latest announcement according to Variety Star Trek Section joins multiple forthcoming Trek projects including a just announced Starfleet Academy show and upcoming seasons of Star Trek Prodigy Star Trek Strange New Worlds and Star Trek Lower Decks Star Trek Picard finishes its three season run this week and Star Trek Discovery returns for a final season sometime next year Continue reading This article originally appeared on Engadget at |
2023-04-19 11:15:35 |
Cisco |
Cisco Blog |
Security Analysts, Start Your Engines! |
https://feedpress.me/link/23532/16080721/security-analysts-start-your-engines
|
analysts |
2023-04-19 11:30:06 |
海外TECH |
CodeProject Latest Articles |
ANSI or UTF8 without BOM: Read text with the right encoding |
https://www.codeproject.com/Tips/5359193/ANSI-or-UTF8-without-BOM-Read-text-with-the-right
|
order |
2023-04-19 11:18:00 |
ニュース |
BBC News - Home |
India to have more people than China by mid-2023, UN says |
https://www.bbc.co.uk/news/world-asia-india-65320690?at_medium=RSS&at_campaign=KARANGA
|
suggests |
2023-04-19 11:08:01 |
ニュース |
BBC News - Home |
Lidl wins logo lawsuit against Tesco |
https://www.bbc.co.uk/news/business-65322972?at_medium=RSS&at_campaign=KARANGA
|
customer |
2023-04-19 11:44:24 |
ニュース |
BBC News - Home |
Rebekah Vardy trademarks the phrase Wagatha Christie |
https://www.bbc.co.uk/news/entertainment-arts-65320724?at_medium=RSS&at_campaign=KARANGA
|
coleen |
2023-04-19 11:40:22 |
ニュース |
BBC News - Home |
Rishi Sunak declares wife's shares after financial interests row |
https://www.bbc.co.uk/news/uk-politics-65324307?at_medium=RSS&at_campaign=KARANGA
|
budget |
2023-04-19 11:23:10 |
ニュース |
BBC News - Home |
PrettyLittleThing Eid shop: Young Muslims criticise fashion brand |
https://www.bbc.co.uk/news/newsbeat-65269127?at_medium=RSS&at_campaign=KARANGA
|
ramadan |
2023-04-19 11:47:00 |
ニュース |
BBC News - Home |
Doctor's death due to AstraZeneca Covid vaccine reaction - inquest |
https://www.bbc.co.uk/news/uk-england-london-65321937?at_medium=RSS&at_campaign=KARANGA
|
tragic |
2023-04-19 11:33:01 |
ニュース |
BBC News - Home |
World Snooker Championship 2023: Kyren Wilson makes 147 maximum break in first round |
https://www.bbc.co.uk/sport/snooker/65324614?at_medium=RSS&at_campaign=KARANGA
|
World Snooker Championship Kyren Wilson makes maximum break in first roundEngland s Kyren Wilson completes a memorable maximum break in his first round match against Ryan Day at the World Championship in Sheffield |
2023-04-19 11:51:54 |
コメント
コメントを投稿