python |
Pythonタグが付けられた新着投稿 - Qiita |
pythonで競技プログラミング(AtCoder)の問題を解くとき、注意すべき落とし穴 |
https://qiita.com/satoyuyapyaa/items/9f047fb2babcd028b002
|
自分はなりましたリストLの中にある要素aが含まれるか判定するには、リストの中身を端から端まで順番にひとつずつ見て行かないといけないので、基本的にはリストの長さ分だけの時間がかかります。 |
2022-01-21 01:25:37 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
stripメソッドとそれに関連するメソッドのまとめ |
https://qiita.com/IshidaKeisuke/items/2c3d9f61afed9d7ecddf
|
空白文字の定義は、「trnfv」があることが他のメソッドと違うところですね今後の課題としては、が何を表しているかを調べていくことですわかる方いらっしゃいましたら、ご教示いただけますと幸いです。 |
2022-01-21 01:33:58 |
golang |
Goタグが付けられた新着投稿 - Qiita |
Go の Generics に対応したライブラリを作ってみた |
https://qiita.com/kitamin/items/13c294b75c89f14d81e4
|
GoのGenericsに対応したライブラリを作ってみた来月リリース予定のGoからGenericsが対応されることで、一つの関数定義で様々な型の処理を担うことができるようになります。 |
2022-01-21 01:25:34 |
Ruby |
Railsタグが付けられた新着投稿 - Qiita |
stripメソッドとそれに関連するメソッドのまとめ |
https://qiita.com/IshidaKeisuke/items/2c3d9f61afed9d7ecddf
|
空白文字の定義は、「trnfv」があることが他のメソッドと違うところですね今後の課題としては、が何を表しているかを調べていくことですわかる方いらっしゃいましたら、ご教示いただけますと幸いです。 |
2022-01-21 01:33:58 |
海外TECH |
Ars Technica |
Developers unearth the bones of an overhauled Task Manager for Windows 11 |
https://arstechnica.com/?p=1827135
|
functionality |
2022-01-20 16:38:37 |
海外TECH |
MakeUseOf |
The Best Sunlight Lamps for Winter Depression and Light Therapy |
https://www.makeuseof.com/tag/light-therapy-beat-winter-depression/
|
sunlight |
2022-01-20 16:53:51 |
海外TECH |
MakeUseOf |
Afraid Your Job Might Be Automated? Here’s How to Pivot Your Career |
https://www.makeuseof.com/job-automated-how-to-pivot-your-career/
|
afraid |
2022-01-20 16:45:23 |
海外TECH |
MakeUseOf |
The 4 Best Apps and Services for Recording a Lecture Remotely |
https://www.makeuseof.com/apps-for-recorded-lectures/
|
lectures |
2022-01-20 16:32:02 |
海外TECH |
MakeUseOf |
The 7 Best Apps for Eco-Friendly Living |
https://www.makeuseof.com/tag/green-eco-friendly-lifestyle-apps/
|
iphone |
2022-01-20 16:15:12 |
海外TECH |
MakeUseOf |
10 Python IDEs Every Programmer Should Know |
https://www.makeuseof.com/python-ides-every-programmer-should-know/
|
knowditch |
2022-01-20 16:15:11 |
海外TECH |
MakeUseOf |
The 8 Best Custom PC Builder Websites |
https://www.makeuseof.com/best-custom-pc-builder-website/
|
sites |
2022-01-20 16:09:55 |
海外TECH |
MakeUseOf |
How to Watch Super Bowl LVI Online for Free |
https://www.makeuseof.com/super-bowl-lvi-watch-online-for-free/
|
legal |
2022-01-20 16:01:29 |
海外TECH |
MakeUseOf |
How to See iMessage Reactions on Your Android Phone |
https://www.makeuseof.com/how-to-display-imessage-reactions-on-android/
|
display |
2022-01-20 16:01:01 |
海外TECH |
DEV Community |
Next JS – optimize blog posts |
https://dev.to/kasperaamodt/next-js-optimize-blog-posts-183m
|
Next JS optimize blog postsThis website is built with Next JS and WordPress I used WP for the blog part of the website as there is no need to reinvent the wheel when it comes to a CMS I worked with WP long before starting with Next JS so it was a natural choice Many writers including me use images in blogs posts So when you import that blog post into Next most people use dangerouslySetInnerHTML to render all the HTML lt div dangerouslySetInnerHTML html post content gt This usually works well but it could be better The problem here is that all of the images in the content will be in a standard tag which is not recommended in Next JS In Next JS you should use the Image component from next image which optimizes images to make them smaller in size therefore reducing the page size and ultimately the loading times html react parserSo how can you fix this Well as the heading suggests html react parser The parser converts an HTML string into one or more React elements We can use this package instead of dangerouslySetInnerHTML to parse the HTML from our post and replace content when it is being parsed Here is how you do it Install the parsernpm i html react parserImport and useParsing the HTML string with the parse function which is taking in the HTML string and options as parameters lt div gt parse blog content replaceImage lt div gt The options I pass to the parser to target the img tag and replace it const replaceImage replace name attribs children gt if name figure amp amp wp block image test attribs class return lt gt domToReact children replaceImage lt gt if name img return lt Image src attribs src width attribs width height attribs height alt attribs alt attribs alt Blog post image gt Now all inserted images in the blog post use the Image component Full Gist PerformanceSo why should you do this As stated above it will optimize all images in posts leading to faster load times and ultimately better SEO Of course the package itself does increase the bundle size But the slight increase that adds compared to the savings on image sizes is a net saving in bundle size Originally posted on aamodt xyz |
2022-01-20 16:38:06 |
海外TECH |
DEV Community |
Creating a Gradient Component in React From Design Tokens |
https://dev.to/michaelmangial1/creating-a-gradient-component-in-react-from-design-tokens-kll
|
Creating a Gradient Component in React From Design TokensIf you re not familiar with design tokens they are simply representations of design specifications in code By representations it is meant that they are key value pairs that represent design specifications Generally speaking there are two types of design tokens Simple tokens Representations of valid values of the design system These tokens usually cover the colors typography spacing etc of the design system i e color red font bold etc Component tokens Representations of the design specs for a component element i e component button background color With a design tokens pipeline you can write out design tokens in JSON format and then translate those raw JSON design tokens into formatted tokens JavaScript modules CSS variables SASS variables etc With that background in mind imagine that a design system had simple design tokens defining valid colors Here s the JSON representation color red FFCC red FFAFAD etc Now imagine that a design tokens pipeline formats the JSON into the following JavaScript modules export colorRed FFCC export colorRed FFAFAD etcAnd let s say these tokens can be consumed in an application via an npm package SomeComponent jsximport as tokens from some design system tokens function SomeComponent const style color tokens colorRed return lt div style style gt Some Component lt div gt Now given such a setup how can we programmatically create gradients when given two color tokens Here s one way SomeComponent jsximport as tokens from some design system tokens function SomeComponent const style background linear gradient deg tokens colorRed tokens colorRed return lt div style style gt Some Component lt div gt Ok but is there a way that we can refactor this Well we could create a helper function that returns the gradient when providing the from and to values get gradient jsexport default function getGradient from to return linear gradient deg from to SomeComponent jsximport as tokens from some design system tokens import getGradient from get gradient js function SomeComponent const style background getGradient tokens colorRed tokens colorRed return lt div style style gt Some Component lt div gt This refactor doesn t save in lines of code but it does guarantee that gradients will be created the same so long as they are created through the getGradient helper function What if we refactored one step further and allowed the gradient to be applied to any child component via a wrapper component Gradient jsximport Children cloneElement from react function getGradient from to return linear gradient deg from to export default function Gradient children from to return Children map children child gt return cloneElement child style child props style background getGradient from to SomeComponent jsximport as tokens from some design system tokens import AnotherComponent from AnotherCompoent jsx import Gradient from Gradient jsx function SomeComponent return lt Gradient from tokens colorRed to tokens colorRed gt lt AnotherComponent gt lt Gradient gt By using Children and cloneElement the Gradient component clones the child element and applies the gradient Awesome Now we have a pattern for applying a gradient via a wrapper component in React |
2022-01-20 16:08:45 |
海外TECH |
DEV Community |
Acra. Features: Tokenization |
https://dev.to/cossacklabs/acra-features-tokenization-57fn
|
Acra Features TokenizationTypically encrypted data is a binary data But in some cases database structure suggests using the original data format string int Data tokenization works for the same goal as encryption but allows storing data in its original format Use Acra Community Edition for free Check out Acra Enterprise Edition tailored for solutions with high security requirements ️⃣TokenizationAcra allows configuring data tokenization to certain database fields Tokenization means that a sensitive data field is substituted with a token and matched to the original only when the original data field is required Acra combines encryption and tokenizationーthe original data fields are encrypted and stored in a separate table database when the original database stores tokens instead Thus the database leakage will reveal only tokens not the original data Tokens look like plaintext dataーthey match the desired row type format and length Acra supports tokens of different formats email string int binary Tokenization is useful for encrypting data in legacy systemsーno need to change database scheme or rewrite legacy applications as they will continue working with tokens instead of original data Note that data encryption data masking and tokenization are different security controls that address similar threats but provide different usability advantages They all work for your sensitive data and build defense in depth on different levels |
2022-01-20 16:00:41 |
Apple |
AppleInsider - Frontpage News |
Apple poised to break holiday quarter financial records despite challenges, Katy Huberty says |
https://appleinsider.com/articles/22/01/20/apple-poised-to-break-holiday-quarter-financial-records-despite-challenges-katy-huberty-says?utm_medium=rss
|
Apple poised to break holiday quarter financial records despite challenges Katy Huberty saysMorgan Stanley s Katy Huberty expects Apple to break holiday quarter earnings and edge out Wall Street s expectations for the quarter thanks to iPhone production improvements and Services performance iPhone ProIn a note to investors seen by AppleInsider Morgan Stanley lead analyst Katy Huberty says she expects Apple to report December quarter earnings that come out ahead of Wall Street estimates She did not update her or Apple estimates however Read more |
2022-01-20 16:38:48 |
海外TECH |
Engadget |
PlayStation's Wrap-Up is back to break down your PS4 and PS5 stats for 2021 |
https://www.engadget.com/playstation-wrap-up-2021-ps4-ps5-free-avatars-163132739.html?src=rss
|
PlayStation x s Wrap Up is back to break down your PS and PS stats for Sony has at last flipped the switch on its PlayStation Wrap Up allowing players to delve into their PlayStation and PS stats for After you log into your PSN account you ll be able to see how many hours you spent on PlayStation games last year the five titles you played the most and how a breakdown of the trophies you scooped up The tool breaks down your playtime by PS and PS games how long you spent playing on a console vs Remote Play and how many hours you used PlayStation VR You ll also see the number of games you played and get a code for four avatars as a bonus Sony took the opportunity to promote some of its games by highlighting some global community stats In Death Stranding Director s Cut for instance players collectively traveled more than million kilometers and delivered more than million packages They played more than million hours of Returnal in total while percent of Ratchet amp Clank Rift Apart players unlocked all of the weapons Users need to be aged or over and have played at least hours of games on PS or PS to access their Wrap Up It may not work for PS players who haven t enabled full data collection and those who haven t consented to quot Additional Data quot collection on PS in Europe the Middle East Africa Australasia India and Russia While the PlayStation s year end wrap up feature is emerging much later than ones for other platforms and services at least it takes the entire year into account Spotify Wrapped for instance only covers listening data from between January and October The latest edition of PlayStation Wrap Up is actually arriving a little earlier than the one for which arrived last February The tool will be available until February th |
2022-01-20 16:31:32 |
海外TECH |
Engadget |
Peacock adds live local news channels to its streaming lineup |
https://www.engadget.com/peacock-live-nbc-news-channels-161716685.html?src=rss
|
Peacock adds live local news channels to its streaming lineupNBCUniversal s Peacock isn t going to let the live news from rivals like CBS go unanswered The streaming service has added free around the clock local news from NBC stations for all users The broadcasts are initially available from stations in Boston including the New England Cable Network Chicago Miami and Philadelphia New York City and Los Angeles channels will be available in the quot months ahead quot The platform already has live and on demand news from NBC s self branded services as well as Sky and Telemundo You can also watch live entertainment TV from local NBC stations including those from cities in the news rollout The decision may have been an easy one to make Airing existing news channels won t cost much more and could help Peacock serve cord cutters who may still want local events in between The Office marathons There s also increasing competition Live news is quickly becoming a selling point including through Amazon s free app on Fire TV devices The NBC stations could reduce the temptation to switch to other channels and services |
2022-01-20 16:17:16 |
Cisco |
Cisco Blog |
The Future of Work Part 1: Reimagine Connectivity |
https://blogs.cisco.com/networking/the-future-of-work-part-1-reimagine-connectivity
|
The Future of Work Part Reimagine ConnectivityPart of this part series on The Future of Work covers connectivity and how the network will become increasingly transparent to the people who depend on it for work and education |
2022-01-20 16:37:32 |
Cisco |
Cisco Blog |
5 Resolutions for Small Businesses in 2022 |
https://blogs.cisco.com/smallbusiness/5-resolutions-for-small-businesses-in-2022
|
Resolutions for Small Businesses in As we start a new year what lessons can small businesses apply from the past months to the year ahead Here are five small business resolutions to consider as we ring in |
2022-01-20 16:11:16 |
Cisco |
Cisco Blog |
Introducing the Cisco Catalyst IE9300 Rugged Series Switches |
https://blogs.cisco.com/partner/introducing-the-cisco-catalyst-ie9300-rugged-series-switches
|
industrial |
2022-01-20 16:00:45 |
海外科学 |
NYT > Science |
Sometimes, Life Stinks. So He Invented the Nasal Ranger. |
https://www.nytimes.com/2022/01/13/climate/nasal-ranger-chuck-mcginley.html
|
Sometimes Life Stinks So He Invented the Nasal Ranger For Chuck McGinley an engineer who devised the go to instrument for measuring odors helping people understand what they smell is serious science |
2022-01-20 16:04:44 |
海外科学 |
NYT > Science |
‘Build Back Better’ Hit a Wall, but Climate Action Could Move Forward |
https://www.nytimes.com/2022/01/20/climate/build-back-better-climate-change.html
|
Build Back Better Hit a Wall but Climate Action Could Move ForwardSome Democrats want to forge ahead with a stand alone climate bill but their solution could mean abandoning other parts of President Biden s agenda |
2022-01-20 16:52:59 |
金融 |
金融庁ホームページ |
金融庁職員の新型コロナウイルス感染について公表しました。 |
https://www.fsa.go.jp/news/r3/sonota/20220120.html
|
新型コロナウイルス |
2022-01-20 18:00:00 |
ニュース |
BBC News - Home |
NI to scrap Covid passports in pubs and restaurants |
https://www.bbc.co.uk/news/uk-northern-ireland-60044349?at_medium=RSS&at_campaign=KARANGA
|
hospitality |
2022-01-20 16:12:44 |
ニュース |
BBC News - Home |
Cancer: Mum diagnosed months after daughter |
https://www.bbc.co.uk/news/uk-wales-60065974?at_medium=RSS&at_campaign=KARANGA
|
daughteralison |
2022-01-20 16:23:34 |
ニュース |
BBC News - Home |
UK refuses permission for £1.2bn cross-Channel cable |
https://www.bbc.co.uk/news/uk-england-hampshire-60073706?at_medium=RSS&at_campaign=KARANGA
|
normandy |
2022-01-20 16:45:23 |
ニュース |
BBC News - Home |
Carhartt facing calls for boycott over vaccine mandates |
https://www.bbc.co.uk/news/business-60073252?at_medium=RSS&at_campaign=KARANGA
|
conservative |
2022-01-20 16:22:57 |
ニュース |
BBC News - Home |
Gateshead's Kieran Reilly lands 'world's first' BMX triple flair |
https://www.bbc.co.uk/news/uk-england-tyne-60073895?at_medium=RSS&at_campaign=KARANGA
|
degree |
2022-01-20 16:37:01 |
ニュース |
BBC News - Home |
The radio station bringing worried Tongans together |
https://www.bbc.co.uk/news/world-australia-60072418?at_medium=RSS&at_campaign=KARANGA
|
australia |
2022-01-20 16:07:38 |
ニュース |
BBC News - Home |
What are the Covid rules in schools and will they stay open this term? |
https://www.bbc.co.uk/news/education-51643556?at_medium=RSS&at_campaign=KARANGA
|
covid |
2022-01-20 16:01:05 |
仮想通貨 |
BITPRESS(ビットプレス) |
[日経] 仮想通貨の無断採掘で逆転無罪判決 最高裁「許容範囲」 |
https://bitpress.jp/count2/3_9_13005
|
許容範囲 |
2022-01-21 01:36:42 |
コメント
コメントを投稿