Google |
Official Google Blog |
17 ways I’ve been using Pixel Fold’s split screen mode |
https://blog.google/products/pixel/how-to-use-pixel-fold-splitscreen/
|
ways I ve been using Pixel Fold s split screen modeA photo of a Pixel Fold opened fully to reveal both screens The screen on the left hand side shows a Chrome browser tab open to a story about Pi Day the screen on the right shows Google Keep open with a checklist on it for pie ingredients |
2023-07-31 17:45:00 |
海外TECH |
MakeUseOf |
8 Tips for Turning Your Internship Into a Full-Time Job |
https://www.makeuseof.com/tips-for-turning-internship-into-full-time-job/
|
internship |
2023-07-31 17:16:25 |
海外TECH |
MakeUseOf |
What Is a Sublimation Printer and What Can You Do With One? |
https://www.makeuseof.com/what-is-a-sublimation-printer/
|
What Is a Sublimation Printer and What Can You Do With One Sublimation printers produce colorful and durable designs Discover how they work to better harness their potential for your creative projects |
2023-07-31 17:01:25 |
海外TECH |
DEV Community |
Applying the Open-Closed Principle To Write Clean React Components |
https://dev.to/mohammadfaisal/applying-the-open-closed-principle-to-write-clean-react-components-400o
|
Applying the Open Closed Principle To Write Clean React ComponentsTo read more articles like this visit my blogSOLID is a set of principles They are mainly guidelines for software professionals who care about their code quality and maintainability React is not object oriented by nature but the main ideas behind these principles can be helpful In this article I will try to demonstrate how we can apply these principles to write better code In a previous article we talked about the single responsibility principle Today we will discuss the second principle of SOLID the Open Closed principle Other Articles in this SeriesSingle Responsibility PrincipleLiskov Substitution PrincipleInterface Segregation PrincipleDependency Inversion Principle What Is the Open Closed Principle According to Thorben Janssen on Stackify “Robert C Martin considered this principle as the most important principle of object oriented design But he wasn t the first one who defined it Bertrand Meyer wrote about it in in his book Object Oriented Software Construction He explained the Open Closed principle as Software entities classes modules functions etc should be open for extension but closed for modification This principle tells you to write code in such a way that you will be able to add additional functionality without changing the existing code Let s see where we can apply this principle Let s Start With an ExampleSay we have a User component where we pass a user s details and the main purpose of this class is to show the details of that particular user import React from react export const User user gt return lt gt lt div gt Name user name lt div gt lt div gt Email user email lt div gt lt gt This is simple enough to start with But our life is not so simple After a few days our manager tells us that there are three types of users in our system SuperAdmin Admin etc And each of them will have different information and functionalities A Bad SolutionWell the first and obvious solution is to have a conditional inside our component and render different information based on the different user types import React from react export const User user gt return lt gt lt div gt Name user name lt div gt lt div gt Email user email lt div gt user type SUPER ADMIN amp amp lt div gt Details about super admin lt div gt user type ADMIN amp amp lt div gt Details about admin lt div gt lt gt Do you see what s wrong here Firstly our code is messy now Secondly what if we need another type of user We would then need to go into User js and add another condition for that particular type of user This is a clear violation of the Open Closed principle because we are not allowed to alter the code inside the User component What s The Solution OK so there are two main techniques that we can apply in this scenario Higher order componentComponent compositionIt s better to go the second route whenever possible but there can be cases where using a HOC is necessary For now we will use a technique recommended by Facebook that is called the composition of components Let s Create Separate User ComponentsNow we need to design our code in such a way that we don t need to add a conditional inside the User js component Let s create a separate component for SuperAdmin import React from react import User from User export const SuperAdmin user gt return lt gt lt User user user gt lt div gt This is super admin user details lt div gt lt gt Similarly another one for Admin users import React from react import User from User export const Admin user gt return lt gt lt User user user gt lt div gt This is admin user details lt div gt lt gt And now our App js file becomesimport React from react import Admin from Admin import SuperAdmin from SuperAdmin export default function App gt const user const userByTypes admin lt Admin gt superadmin lt SuperAdmin gt return lt div gt userByTypes user type lt div gt Now we can create as many user types as we need Our logic for particular users is encapsulated and we don t need to revisit our code for any additional modifications Some might argue we are increasing the number of files unnecessarily Sure you can leave it as is for now but you will definitely feel the pain as the complexity of the application grows CautionSOLID is a set of principles They are not mandatory for you to apply in every scenario As a seasoned developer you should find a good balance between code length and readability Don t obsess too much over these principles In fact there is a famous phrase to explain these scenarios “Too Much SOLID So knowing these principles is good but you have to keep a balance You may not need these compositions for one or two extra fields but keeping them separate will definitely help in the long run ConclusionKnowing these principles will take you a long way because at the end of the day a good piece of code is what matters and there is no single way of doing things Have a great day ResourcesHave something to say Get in touch with me via LinkedIn or Personal Website |
2023-07-31 17:33:44 |
海外TECH |
DEV Community |
Narrow profile LLM |
https://dev.to/aigerim_zhunisbekova_ae0a/narrow-profile-llm-19dl
|
Narrow profile LLMHi everyone my name is Aya short for Aigerim My team is called Aestima project We are deeply involved in complex multidisciplinary research To address the challenges of research we propose to design a specialized LLM driven chatbot The model will be focusing on areas of autism technology and regulation to synthesize knowledge relevant to these topics If you are interested in this idea project please reach out We will be happy to discuss any form of co operations from consultation to partnership We have a great team of experts and we need someone to consult us about tech side Best regards |
2023-07-31 17:00:49 |
Apple |
AppleInsider - Frontpage News |
Daily Deals July 31: 16" MacBook Pro $1,449, Anker Thunderbolt 4 dock $199, iPhone 14 Pro Max $920, more |
https://appleinsider.com/articles/23/07/31/daily-deals-july-31-55-off-2018-mac-mini-46-off-2021-m1-macbook-pro-iphone-14-pro-max-920-more?utm_medium=rss
|
Daily Deals July quot MacBook Pro Anker Thunderbolt dock iPhone Pro Max moreToday s hottest deals include off a JBL GO Bluetooth speaker off an Apple Watch SE off a iMac off a Dell Inspiron laptop refurbished iPads from and more Save on a inch iMacThe AppleInsider crew team scours the web for unbeatable deals at ecommerce stores to create a list of top notch bargains on popular tech products including discounts on Apple products TVs accessories and other gadgets We post the top deals daily to help you get more bang for your buck Read more |
2023-07-31 17:13:07 |
海外TECH |
Engadget |
Sony's latest QD-OLED TV is significantly brighter than last year’s models |
https://www.engadget.com/sonys-latest-qd-oled-tv-is-significantly-brighter-than-last-years-models-175307553.html?src=rss
|
Sony x s latest QD OLED TV is significantly brighter than last year s modelsSony announced pricing and availability today for its high end QD OLED television that the electronics giant says offers its “best color ever The Google TV powered Bravia XR AL will ship in inch inch and inch models starting at The Sony Bravia XR AL has a QD OLED panel that takes the best of OLED screens deep blacks rich contrast while adding the superior brightness and colors you d expect from QLED TVs Earlier this year Engadget s Sam Rutherford found that the new TV “definitely did a better job at preserving details in shadows than the rival LG C “The AL was particularly impressive thanks to its QD OLED panel and Cognitive Processor with Sony claiming brightness that s now two times higher than last year s model The company also says the new set provides up to percent color brightness compared to typical OLED TVs The Cognitive Processor XR powers the set s color range and hues essentially acting as a brain that manages details like color contrast clarity adaptive noise reduction and auto HDR tone mapping In addition the TV includes a Bravia Cam in the box The sensor acts as a webcam for video calls including Zoom support while optimizing the television s picture and sound based on your location in the room SonyThe AL runs Google TV software but includes a few new extras this generation That consists of a Game Menu for managing gaming picture and assistance settings It even lets you add a persistent crosshair for first person shooters It also has exclusive PS friendly features Auto HDR Tone Mapping and Auto Genre Picture Mode to optimize the premium display for your favorite PlayStation games The TV also includes a new Eco Dashboard to help you manage all its energy saving settings in one place Sony s new TV also has Acoustic Surface Audio actuators behind the TV that can “vibrate to produce audio from the entire screen helping make dialog clearer The feature works with Sony Soundbars as select models will sync with the television s built in vibrations to produce “fuller vocals on the center audio channel The company also synced its Soundbars to show their volume sound field and other toggles directly in the TV s Quick Settings menu The Sony Bravia XR AL starts at for the inch model The inch variant will cost while the inch model will total All three models will be available for pre order from Sony authorized dealers starting on August st This article originally appeared on Engadget at |
2023-07-31 17:53:07 |
海外TECH |
Engadget |
Instagram seems to be working on labels for posts 'generated by Meta AI' |
https://www.engadget.com/instagram-seems-to-be-working-on-labels-for-posts-generated-by-meta-ai-173427549.html?src=rss
|
Instagram seems to be working on labels for posts x generated by Meta AI x Meta s consumer facing generative AI tools based on its new Llama model may not be far off The company appears to be working on several new generative AI features for Instagram including labels that allow creators to identify images “generated by Meta AI That s according to screenshots shared by reverse engineer Alessandro Paluzzi who often teases unreleased features from Meta s apps Paluzzi recently posted a screenshot that shows an in app message detailing how posts created with generative AI tools may soon be labeled within Instagram “The creator or Meta said that this content was created or edited with AI the message explains Additional labels indicate it was “generated by Meta AI and that “content created with AI is typically labeled so that it can be easily detected Instagram is working to label the contents created or modified by AI in order to be identified more easily pic twitter com bHvvYuDpQrーAlessandro Paluzzi alexa July Meta didn t immediately respond to a request for comment but the screenshot suggests that the company like Google and others in the AI space is interested in helping users discern when AI was used to create content As generative AI tools have become more widely used researchers and policymakers have raised concerns about how the technology could be used to aid the spread of misinformation or otherwise mislead people Earlier this month seven AI companies ーincluding Meta ーpledged to adopt a series of AI safety measures like watermarks for AI generated content While Meta so far hasn t disclosed many details about its consumer facing generative AI plans Mark Zuckerberg has dropped several hints “We re also building a number of new products ourselves using Llama that will work across our services the CEO said in a quarterly earnings call last week “You can imagine lots of ways AI could help people connect and express themselves in our apps creative tools that make it easier and more fun to share content agents that act as assistants coaches or that can help you interact with businesses and creators and more Elsewhere Paluzzi has spotted signs of other generative AI powered tools for Instagram including a “message summary feature for summarizing long DMs and new artistic tools for editing Stories This article originally appeared on Engadget at |
2023-07-31 17:34:27 |
海外TECH |
Engadget |
The best eco-friendly phone cases for 2023 |
https://www.engadget.com/best-eco-friendly-phone-cases-150016494.html?src=rss
|
The best eco friendly phone cases for No modern smartphone is completely carbon neutral Even the most eco conscious phones are only partially made out of recyclable materials But you can help cut back on plastic usage by at least purchasing an eco friendly case to protect your phone from dings and scratches There are plenty of them from compostable phone cases to ones made from ocean based plastic Best of all eco friendly cases are often just stylish and durable as their mainstream counterparts Here are our favorite environmentally friendly phone cases Pela CaseWithout a doubt our favorite eco friendly phone cases are those made by Pela We absolutely love their colors and designs plus the fact that the entire line is percent plant based and compostable The case material is called “Flaxstic which the company says is made from flax straw and compostable bioplastic elastomer Importantly it s also free of BPA phthalates cadmium and lead If you ever decide to get rid of it you can indeed just chuck in a compost bin and it ll be completely biodegradable What s more Pela cases are available for a wide array of handsets They can accommodate iPhones from iPhone onwards Samsung Galaxies Galaxy S and newer Google Pixels from the Pixel a on and even some OnePlus and Huawei models For iPhone users we should note that Pela cases are not MagSafe compatible by default Strangely too you can only purchase an additional MagSafe module for the iPhone and and not the iPhone Applying it to my phone was pretty straightforward so that s not a big concern but it s something to keep in mind And obviously the MagSafe module with all its magnets is not compostable you ll have to take it off and dispose of it separately Otterbox LifeProof Wake CaseLifeProof is a phone case brand that specializes in recycled materials with each of its products being at least partially made from them But the most eco friendly option is the LifeProof Wake which is made from percent ocean based recycled plastic According to the company a lot of that comes from discarded fishing gear which would otherwise be a fatal hazard for marine life like sharks and turtles In addition we re big fans of the Wake s design It comes in four different colors and features an attractive sculpted wave pattern It feels sturdy and durable and LifeProof says it s drop proof from two meters roughly six and half feet Plus it s MagSafe compatible by default The LifeProof Wake is available for iPhones iPhone onward Samsung Galaxies Galaxy S and newer and Google Pixels Pixel a and up Casetify Ultra CompostableCasetify is mostly known for making durable yet stylish phone cases but it has several eco friendly options too The latest is its Compostable line which is made with a percent compostable and plant based material called “Ecotify Basically it s a blend of bamboo biopolymers and starch The regular Compostable line has a drop protection of around four feet while the Ultra Compostable line with its extra corner bumpers has a drop protection of about feet My recommendation would be to go with the more durable Ultra Compostable option even if it does cost a bit more Unfortunately Casetify s Compostable line is only available for iPhones the iPhone and up Casetify does make other kinds of sustainable cases for both the iPhone and Samsung Galaxy handsets Galaxy S and newer but they re not compostable Instead they re made from percent recycled materials Plus Casetify offers the option to return your old case which they ll then reuse or up cycle to create a new one thus reducing waste The biggest perk of Casetify s cases is that they re very customizable Not only can you pick out your favorite bumper colors and designs Casetify regularly partners with brands and illustrators to come up with unique styles but you can actually add engravings to them too You can also choose to add even more protection with thicker bumpers Casetify says the “Bounce Case offers a foot drop protection Incipio OrganicoreIncipio s Organicore line of cases is one of the most attractive we ve seen plus they are percent compostable You ll find them in clear and opaque designs the latter of which has a buttery texture that makes the case feel more luxurious than you d think Most Organicore cases will protect your handset from drops from up to eight feet and we like the way their raised edges defend against accidental bumps and dings There are also MagSafe options available so you can still use your iPhone with magnetic accessories without taking your case off This article originally appeared on Engadget at |
2023-07-31 17:10:07 |
海外科学 |
NYT > Science |
Louise Levy, Who Was Studied for Her Very Long Life, Is Dead at 112 |
https://www.nytimes.com/2023/07/27/health/louise-levy-dead.html
|
Louise Levy Who Was Studied for Her Very Long Life Is Dead at She was one of hundreds of people all of them Ashkenazi Jews whose good health and cognitive ability at extreme old age were the subject of genetic research |
2023-07-31 17:32:09 |
ニュース |
BBC News - Home |
Teacher strikes in England end as all four unions accept pay deal |
https://www.bbc.co.uk/news/education-66360677?at_medium=RSS&at_campaign=KARANGA
|
annual |
2023-07-31 17:41:22 |
ニュース |
BBC News - Home |
The Ashes 2023: Stuart Broad bowls England to win over Australia |
https://www.bbc.co.uk/sport/cricket/66362287?at_medium=RSS&at_campaign=KARANGA
|
The Ashes Stuart Broad bowls England to win over AustraliaStuart Broad ends his glittering career by bowling England to another dramatic victory in the fifth Test against Australia to leave a memorable Ashes series level at |
2023-07-31 17:51:40 |
ニュース |
BBC News - Home |
Hangzhou Zoo: Our sun bears are real, not humans in disguise |
https://www.bbc.co.uk/news/world-asia-china-66362970?at_medium=RSS&at_campaign=KARANGA
|
bears |
2023-07-31 17:19:19 |
ニュース |
BBC News - Home |
The Ashes: Stuart Broad switches bails again before removing Todd Murphy |
https://www.bbc.co.uk/sport/av/cricket/66360856?at_medium=RSS&at_campaign=KARANGA
|
The Ashes Stuart Broad switches bails again before removing Todd MurphyStuart Broad switches the bails at the bowler s end and immediately has Todd Murphy caught behind on a thrilling day five of the fifth Ashes Test at The Oval |
2023-07-31 17:43:00 |
ビジネス |
ダイヤモンド・オンライン - 新着記事 |
中国経済、政府の過信があだになるか - WSJ発 |
https://diamond.jp/articles/-/327028
|
中国経済 |
2023-08-01 02:12:00 |
コメント
コメントを投稿