python |
Pythonタグが付けられた新着投稿 - Qiita |
【Python】Mediapipeを使って口紅を塗ってみた |
https://qiita.com/YomamaBanana/items/978689d6ec6c7e7be5d7
|
認識した顔データから「唇」に合わせてマスクを作成する。 |
2021-11-26 01:37:04 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
input関数について |
https://teratail.com/questions/371023?rss=all
|
input関数について前提・実現したいことプログラミング初心者なので非常に初歩的な質問かもしれないですがご容赦くださいinput関数で入力してもらった値の一部を切り抜いて、その切り抜いた値によって条件分岐をする、というプログラムを組みたいのですが、大前提のinputで入力してもらった値を切り抜く方法がよく分かりません。 |
2021-11-26 01:51:16 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
【webpack5】webpack serveで “ReferenceError: WebAssembly is not defined” |
https://teratail.com/questions/371022?rss=all
|
【webpack】webpackserveで“ReferenceErrorWebAssemblyisnotdefined実行環境OSiPadOSnbspIDEplayjs各パッケージのバージョンwebpackwebpackcliwebpackdevserver質問内容nodeでwebpackを使用して開発サーバーを起動したいです。 |
2021-11-26 01:39:38 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
PHPデータベース検索サイトの条件分岐が上手く行われません |
https://teratail.com/questions/371021?rss=all
|
PHPデータベース検索サイトの条件分岐が上手く行われませんデータベース検索サイト現在、とある検索サイトのフォーム処理をPHPとSQLで制作しているのですがデータベースに無い値を入力した際の出力結果をerrorsに代入し条件分岐を用いて処理しているのですが、上手くデータが渡りません。 |
2021-11-26 01:26:38 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
LINE x SageMaker で背景切り抜きアプリつくった |
https://qiita.com/ted-17/items/a4612194c3ebd3eebbef
|
で推論結果の画像情報を抽出して、でpngに保存していますjpggtpngのやり方が遠回りな気がする背景の切り抜きさて、入力画像receivepngと推論画像analysispngを用いて、背景の切り抜きをしてみます。 |
2021-11-26 01:26:24 |
海外TECH |
DEV Community |
Make your website stand out with a custom scrollbar 🌟 |
https://dev.to/lyqht/make-your-website-stand-out-with-a-custom-scrollbar-76m
|
Make your website stand out with a custom scrollbar The scrollbar is easily one of the most neglected UI components out there that are not leveraged by many websites to enhance their users experience By default on all HTML when the content of the website exceeds the viewport height a scrollbar will automatically appear on the right just like the one you re seeing as you read this article now The default scrollbar looks decent but it can be better Let s take a reference from the experts Here s an example of a unique scrollbar found on CSSTricks com Put your eyes to the right of the GIF This scrollbar fits in with the dark theme of the website much more than the default scrollbar It also has a little bevel feel to it How to re create the CSS Tricks ScrollbarAs I ve taught my previous readers before you can navigate the frontend simply by using the Browser Inspector So let s do that Here are the steps for inspecting the scrollbar Inspect the lt html gt element directly This is because there s no lt scrollbar gt tag The scrollbar is not a specific HTML element To find how the scrollbar is styled filter for scrollbar in the styles tab You will see a few pseudo elements that are used to style the scrollbar Here s a preview of how your inspector will look like In the style tab these are the relevant rules that you can find for styling the scrollbar html webkit scrollbar width px height px html webkit scrollbar thumb background border radius px box shadow inset px px px hsla inset px px px rgba html webkit scrollbar track background linear gradient deg px If I simply copy these styles over and use it for a very long HTML page the scrollbar will look as it is in CSSTricks Now that we know the pseudo elements do work let s understand how they work How to style a scrollbarFor the CSS Tricks Scrollbar there were pseudo elements used webkit scrollbar webkit scrollbar thumb webkit scrollbar trackHere s a simple diagram to depict those parts of the scrollbar In addition to these pseudo elements there are other parts of the scrollbar that you can consider styling According to MDN Web Docs these are the pseudo elements that you can utilize to style your scrollbar webkit scrollbar ーthe entire scrollbar webkit scrollbar thumb ーthe draggable scrolling handle webkit scrollbar track ーthe track progress bar of the scrollbar where there is a gray bar on top of a white bar webkit scrollbar button ーthe buttons on the scrollbar arrows pointing upwards and downwards that scroll one line at a time webkit scrollbar track piece ーthe part of the track progress bar not covered by the handle webkit scrollbar corner ーthe bottom corner of the scrollbar where both horizontal and vertical scrollbars meet This is often the bottom right corner of the browser window webkit resizer ーthe draggable resizing handle that appears at the bottom corner of some elements Some of these descriptions may be a little hard to visualize So here s a diagram to help you with that For a gentle introduction to how some of these pseudo elements can be used I have created a scrollbar playground for you to create a simple custom scrollbar and export its CSS Take some time to play around with the settings to deduce how the pseudo elements workVisit the playground in full page view here Important Tip in using Scrollbar PlaygroundClicking the export to CSS button will copy the element s styles to your clipboard Afterwards you can open up an empty codepen and just paste the styles directly to the CSS tab to see the magic Remember to set the height of the body element to a very big value like height px so that there is content overflow for a scrollbar to appear Observations Width of the scrollbarWhen you change Scrollbar Height gt the width of the vertical scrollbar changes Scrollbar Width gt the width of the horizontal scrollbar changes The style is applied at the following pseudo element selector fake window webkit scrollbar width px height px Scrollbar ButtonsIn the playground you can choose to hide or show them If you show them you can choose to show or buttons Although it is much more common to see scrollbar with just the single arrow buttons on both ends of the scrollbar since that s the native behavior if you apply styles to just the webkit scrollbar button element itself you will see buttons on each side This behavior may differ depending on the Chromium version of your browser and also the element you apply the style to For example if you apply the same style on codepen you don t see the double button but if you apply it to a simple html page and open it up on your local machine you will see the double button like what you see on the playground when you choose the button option To enforce that the scrollbar only shows one button on each side the following style needs to be applied webkit scrollbar button vertical start increment webkit scrollbar button vertical end decrement webkit scrollbar button horizontal start increment webkit scrollbar button horizontal end decrement display none Coloring parts of the scrollbarMost of the scrollbar parts can be colored individually fake window webkit scrollbar thumb background var scrollbar thumb color BF fake window webkit scrollbar track background var scrollbar track color AAAA fake window webkit scrollbar button background var scrollbar button color FF fake window webkit scrollbar corner background var scrollbar corner color FFFFFF Exploring furtherNow that you have some basics of setting css properties in terms of sizes and colors for the scrollbar pseudo elements consider special scrollbars like this too ExamplesHere s a very simple example that I made which only has a horizontal scrollbar but the thumb is an animating cat The icon is taken from Gowee s nyan cat SVG on Github Another note worthy scrollbar to be mentioned is the scrollbar on Shawn s portfolio Eyes to the right It is a candy stick moving on a heart palette track and it feels super delightful to look at it Literal eye candy ResourcesThe original Webkit s article on styling scrollbarsThis article talks about even more selectors that you can utilize to style your scrollbar although they are rarely usedCSS Tricks article on styling scrollbarsGreat tons of modern looking examples here Libraries for adding a Custom ScrollbarOf course if you re lazy and prefer a fast and pre made solution here are public packages that I ve found which you can choose to add into your project The way they implemented them is different so do check out their docs to see which you prefer Smooth ScrollbarA simple customizable performant Javascript plugin solutionOverlay Scrollbarscomes with themes and framework wrappers for Angular React and VuePerfect Scrollbarmade by the Material Bootstrap team Bonus Hiding the scrollbar UIAlthough this article is about making your website stand out with a custom scrollbar if for any reason you hate having to see a scrollbar UI take up visual space on your website or you want your website to be look alike on both desktop and mobile websites do not show scrollbars by default on mobile browsers you can simply set the display none to the pseudo element webkit scrollbar html webkit scrollbar display none You will still be able to scroll on a webpage just that you can t see the scrollbar UI For most use cases I do not recommend you to disable the scrolling entirely That s a wrap folks Thank you for reading hope you enjoyed the article If you have tried out the Scrollbar Playground and created a scrollbar that you like do share a screenshot below If you find the article awesome hit the reactions and share it To stay updated whenever I post new stuff follow me on Twitter |
2021-11-25 16:36:56 |
海外TECH |
DEV Community |
QRCode with JavaScript |
https://dev.to/walternascimentobarroso/qrcode-with-javascript-3eon
|
QRCode with JavaScript Clique aqui para ler em português Today we use QRCode for everything and it makes it very easy for us to share small information so we are now going to use a js lib to show how simple and easy it is to create a QRCode with javascript CodeFirst let s create the interface we ll do something simple using just HTML lt h gt Gerar QRcode lt h gt lt input type text id text gt lt input type text id width value gt lt input type text id height value gt lt input type color id dark value gt lt input type color id light value ffffff gt lt button id generate gt Gerar lt button gt lt a id download style display none gt Download lt a gt lt div id qrcode gt lt div gt lt script src qrcode min js gt lt script gt In this first part we have data entries such as height width and colors we also have a button to download our QRCode a div that will display the qrcode and finally we have the script tag that loads the davidshimjs library today there are already several libraries but this is the one that I found the simplest to demonstrate the use but you can use the library that you like best const qrcodeEl document querySelector qrcode const textEl document querySelector text const generateEl document querySelector generate const widthEl document querySelector width const heightEl document querySelector height const darkEl document querySelector dark const lightEl document querySelector light const downloadEl document querySelector download generateEl addEventListener click generate function generate qrcodeEl innerHTML new QRCode qrcodeEl text textEl value width widthEl value height heightEl value colorDark darkEl value colorLight lightEl value download function download const canvasEl qrcodeEl querySelector canvas let data canvasEl toDataURL image png downloadEl setAttribute href data downloadEl setAttribute download qrcode png downloadEl style display inline block In our javascript code first we take all screen elements height width colors etc and then we add the click event to our Gerar button and call the generate functionIn the generate function we first take the element where the qrcode is and we make qrcodeEl innerHTML that way whenever we generate a new qrcode the old one will be removed from the screen then we instantiate the QRCode passing all the necessary parameters height width colors etc and finally we call the download functionIn the download function we look for the canvas element that is generated by the QRCode library and inside it we get the data image with that we add the value captured in the download link and define the download attribute and change the style so that it is displayed on the screen Now whenever a new QRCode is generated the download link will be displayed so that you can download the qrcode as an imageready simple like that DemoSee below for the complete working project if you can t see it click here and see the final result YoutubeIf you prefer to watch it see the development on youtube Thanks for reading If you have any questions complaints or tips you can leave them here in the comments I will be happy to answer See you later Support MeYoutube WalterNascimentoBarrosoGithub WalterNascimentoBarrosoCodepen WalterNascimentoBarroso |
2021-11-25 16:33:25 |
海外TECH |
DEV Community |
How To Create a Simple Bot on Discord |
https://dev.to/jodiee/how-to-create-a-simple-bot-on-discord-4l11
|
How To Create a Simple Bot on DiscordThis tutorial will show you how to set up a simple bot using webhooks on a Discord channel The bot will post a message to a channel I recommend setting up your own personal server for testing purposes before you unleash it on the world CREATE A BOT ON DISCORDFollow this how to and intro to webhooks to the point where you get the webhook URL You can give it a fun name and avatar Have the webhook URL handy so you can use it later Do not do Quick Example GitHub Webhook Integration it is not part of this tutorialYour bot is ready and waiting for input SET UP THE BOTMake sure you have Node js installed on your computer so you can run your script in the terminal You can check if it s installed by checking the version number in your terminal node versionIf you don t have node you can get it here Create a sendmessage js file with a console log function for testing in the terminal We ll build on this function as we go forward sendmessage jsconst sendMessage gt console log Hello sendMessage Run file by executing node sendmessage js in the terminal This should print Hello on the next line node sendmessage jsHelloGreat Your code is working and node is properly installed Now you ll want to get the project started Initialize your project using yarn or npm They work similarly but we ll be using npm for this tutorial because it comes bundled with node Start it up by keying the following npm initThis will create a package json file That s the library ingredient list for your program It keeps track of rules and dependencies that people will use to run your pgoram You will be prompted to fill in various fields at this point Unless you want to link it to github or customize with your information you can accept the defaults i e press Enter return for each This basic tutorial doesn t cover any of this so we are accepting the defaults Now you ll want to get axios so you can simplify sending HTTP requests npm install axiosGreat Now you have your ingredient list and ingredients We are ready to put things together MAKE YOUR BOT TALKWe will be making an HTTP POST to our webhook URL First import axios at the top of your js file This links the axios library to your program so you can use all of the perks you installed const axios require axios Make sure this is the first line of your code Next create a couple of variables to hold the data you are sending Discord requires an object with a content key which is why we ve got the text written in key value format If you tried to send it as a string it would be interpreted as an empty message When your program runs you wouldn t get an error but your bot also would not post a message To make this code resuable we will add the text in a command line argument using Command Line Interface CLI It allows you to send a string when you run the program instead of hardcoding it This will pull the entry in the rd place on your array const commandLineText process argv This object is needed because that is how Discord receives the information to post const messageData content commandLineText Now go to your sendMessage function Remove the console log you had previously and replace it with this axios call The comments will explain what each section does axios This takes care of your HTTP POST It needs two arguments post The webhook URL as a string Paste Your Discord Webhook URL Here The variable that contains the object you are sending messageData axios is a promised based js library so it has then and catch then function response console log response This has been added so you can see all arguments being sent It s not required console log process argv catch function error console log error That s it Save your file and get ready Your code should look something like this const axios require axios const commandLineText process argv const messageData content commandLineText const sendMessage gt axios post https just a placeholder for your webhook url messageData then function response console log response console log process argv catch function error console log error sendMessage RUN YOUR BOT Open the Discord channel where your bot lives Go to your terminal and make sure you are in the folder that holds your code Type node sendmessage js Hello Peek over at your Discord channel If all is well you should see your bot pop up and say hi node sendmessage js Hello Because the code also interprets the bash command as an array it will print the string in the rd position regardless of its size You can sent it whatever text you d like as long as it is all part of the same string Give it a try node sendmessage js What Lovely Weather We Be Havin Way to go Now you can set up a bot on another channel and share have some fun with friends as long as you have the right permissions Note If you d like you can add more to the array but you ll have to adjust process argv in commandLineText to modify your argument display SUMMARYToday we learned how to set up a basic bot using webhooks on Discord Thanks for checking out my tutorial |
2021-11-25 16:16:53 |
Apple |
AppleInsider - Frontpage News |
Get the Elgato Stream Deck for 33% off in a Black Friday special |
https://appleinsider.com/articles/21/11/25/get-the-elgato-stream-deck-for-33-off-in-a-black-friday-special?utm_medium=rss
|
Get the Elgato Stream Deck for off in a Black Friday specialElgato s superb button Stream Deck is in stock and on Amazon a Black Friday discount of off its regular price The button version is on sale but there are also larger and smaller editions AppleInsider s review called it the Mac accessory you didn t realize you need until you ve got it Elgato s Stream Deck is a panel of physical buttons that can be programmed to control just about any aspect of your Mac ーor very many aspects Read more |
2021-11-25 16:45:51 |
Apple |
AppleInsider - Frontpage News |
Black Friday deal: Get Setapp for $41.40, and use 210 Mac apps for a year |
https://appleinsider.com/articles/21/11/25/black-friday-deal-get-setapp-for-4140-and-use-210-mac-apps-for-a-year?utm_medium=rss
|
Black Friday deal Get Setapp for and use Mac apps for a yearSetapp s year subscription is discounted to just a record low price now through Saturday Giving you access to over Mac apps and utilities for a year this Black Friday deal is perfect for Apple fans Setapp is at AppleInsider Read more |
2021-11-25 16:47:19 |
Apple |
AppleInsider - Frontpage News |
Get a 1-year Sam's Club membership for just $19.99 + free gift card |
https://appleinsider.com/articles/21/09/22/deal-alert-1-year-sams-club-membership-discounted-to-1999-free-food?utm_medium=rss
|
Get a year Sam x s Club membership for just free gift cardBlack Friday deal hunters can get a year Sam s Club membership for just in addition to a Sam s Club eGift card Plus get a free rotisserie chicken and cupcakes with your first purchase Sam s Club Membership discounted to The Sam s Club promotion is hosted by StackCommerce in the AppleInsider Shop and offers readers a hefty discount in addition to multiple freebies like a free rotisserie chicken and cupcakes with your first in club purchase Also included is a free Sam s Club eGift card a Black Friday bonus Read more |
2021-11-25 16:05:03 |
Apple |
AppleInsider - Frontpage News |
Best Buy's Black Friday sale has big discounts on OLED TVs, soundbars & much more |
https://appleinsider.com/articles/21/11/24/best-buys-black-friday-sale-has-big-discounts-on-oled-tvs-soundbars-much-more?utm_medium=rss
|
Best Buy x s Black Friday sale has big discounts on OLED TVs soundbars amp much moreThe Black Friday sales event has begun and Best Buy is offering up to off OLED K TVs discounted soundbars and low prices on popular vacuums The Best Buy Black Friday saleBlack Friday may not be for two more days but Best Buy is already offering steep discounts on high demand electronics and gadgets Check out these discounted products and act fast because sales will end soon Read more |
2021-11-25 16:08:12 |
Linux |
OMG! Ubuntu! |
Microsoft Edge Has a Secret Linux Easter Egg |
https://www.omgubuntu.co.uk/2021/11/microsoft-edge-for-linux-has-an-exclusive-easter-egg
|
Microsoft Edge Has a Secret Linux Easter Egga gif of the edge surf game featuring the linux mascotThis post Microsoft Edge Has a Secret Linux Easter Egg is from OMG Ubuntu Do not reproduce elsewhere without permission |
2021-11-25 16:03:55 |
海外科学 |
NYT > Science |
As Young Kids Get Covid Shots, Families Feel a 'Huge Weight' Lifted |
https://www.nytimes.com/2021/11/25/health/covid-vaccine-children-immunocompromised.html
|
As Young Kids Get Covid Shots Families Feel a x Huge Weight x LiftedMany households with immunocompromised or vulnerable relatives are racing to get Covid shots for their to year olds ーand finally experiencing a long awaited sense of relief |
2021-11-25 16:46:16 |
金融 |
金融庁ホームページ |
「デジタル・分散型金融への対応のあり方等に関する研究会」(第3回)議事録について公表しました。 |
https://www.fsa.go.jp/singi/digital/gijiroku/20211006.html
|
Detail Nothing |
2021-11-25 17:00:00 |
金融 |
金融庁ホームページ |
金融安定理事会による「LIBOR公表停止に向けた準備を支援するためのステートメント」について掲載しました。 |
https://www.fsa.go.jp/inter/fsf/20211125/20211125.html
|
libor |
2021-11-25 17:00:00 |
金融 |
金融庁ホームページ |
金融安定理事会による本会合議事要旨について掲載しました。 |
https://www.fsa.go.jp/inter/fsf/20211125_2/20211125_2.html
|
金融安定理事会 |
2021-11-25 17:00:00 |
ニュース |
BBC News - Home |
Channel deaths: More boats arrive after 27 people drown |
https://www.bbc.co.uk/news/uk-59412329?at_medium=RSS&at_campaign=KARANGA
|
dover |
2021-11-25 16:38:18 |
ニュース |
BBC News - Home |
Liverpool bomb: Taxi driver saw red light on bomber's vest, says witness |
https://www.bbc.co.uk/news/uk-england-merseyside-59418932?at_medium=RSS&at_campaign=KARANGA
|
bomber |
2021-11-25 16:16:31 |
ニュース |
BBC News - Home |
Ralf Rangnick: Manchester United set to appoint German on six-month contract |
https://www.bbc.co.uk/sport/football/59421961?at_medium=RSS&at_campaign=KARANGA
|
contract |
2021-11-25 16:29:44 |
ニュース |
BBC News - Home |
Richard Madeley leaves I'm a Celebrity after going to hospital |
https://www.bbc.co.uk/news/entertainment-arts-59414721?at_medium=RSS&at_campaign=KARANGA
|
hospitalthe |
2021-11-25 16:16:40 |
ニュース |
BBC News - Home |
Female Doctor Who robs boys of role models, claims Tory MP |
https://www.bbc.co.uk/news/uk-politics-59421259?at_medium=RSS&at_campaign=KARANGA
|
characters |
2021-11-25 16:53:51 |
ニュース |
BBC News - Home |
Channel deaths: ‘It was inevitable this was going to happen’ |
https://www.bbc.co.uk/news/uk-england-kent-59421671?at_medium=RSS&at_campaign=KARANGA
|
drown |
2021-11-25 16:21:05 |
北海道 |
北海道新聞 |
新変異株、免疫回避の恐れ 南アで発見、専門家検証 |
https://www.hokkaido-np.co.jp/article/615713/
|
南アフリカ |
2021-11-26 01:10:00 |
コメント
コメントを投稿