投稿時間:2021-05-02 14:20:40 RSSフィード2021-05-02 14:00 分まとめ(24件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
ROBOT ロボスタ 【ラグビー×AIカメラ】スポーツの試合撮影と編集はAIで自動化 ドコモレッドハリケーンズがNTTSportictのAI自動撮影システムを導入した理由 https://robotstart.info/2021/05/02/nttsportict-aicamera-sport.html nttsportict 2021-05-02 04:53:44
TECH Techable(テッカブル) オハイオ州立大はDNAを材料にしたナノロボットを数分で設計! https://techable.jp/archives/153881 magic 2021-05-02 04:00:28
python Pythonタグが付けられた新着投稿 - Qiita AtCoder Beginner Contest 081 https://qiita.com/reoreoking/items/ab9b53e76b13d6610877 AtCoderBeginnerContest問題文黒板にN個の正の整数AANが書かれているすぬけ君は黒板に書かれている整数がすべて偶数であるとき次の操作を行うことができます黒板に書かれている整数すべてをで割ったものに置き換えるすぬけ君は最大で何回操作を行うことができるかを求めてください答え整数の入力lengthintinputnumbersmapintinputsplitリストを使うと下記のように出力される。 2021-05-02 13:48:52
python Pythonタグが付けられた新着投稿 - Qiita 【個人開発】個人開発したサービスを半年ほど運用して気づいたこと【お絵描きアプリ】 https://qiita.com/osakasho/items/ab829b29048347070b35 リリース当初から、毎週のようにアップデートを行ったおかげでかなり機能が増えました。 2021-05-02 13:26:36
python Pythonタグが付けられた新着投稿 - Qiita AtCoder Beginner Contest 085 A,B,C https://qiita.com/reoreoking/items/32488063be943581d343 2021-05-02 13:21:15
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) JNDIによるData Resource検索でinitContext.lookupが上手く行えない https://teratail.com/questions/336212?rss=all JNDIによるDataResource検索でinitContextlookupが上手く行えない前提・実現したいことJNDIを使ってMySQLとのConnectionを確立したい。 2021-05-02 13:54:47
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) スマホ画面で複数画像を画面内に収めたいです。 https://teratail.com/questions/336211?rss=all スマホ画面で複数画像を画面内に収めたいです。 2021-05-02 13:39:07
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 添付画像のデザインをCSSで再現したい https://teratail.com/questions/336210?rss=all 進行 2021-05-02 13:32:17
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) unity 強化学習 モデルファイルについて(.nn .onnx) https://teratail.com/questions/336209?rss=all unity強化学習モデルファイルについてnnonnx前提・実現したいことunityで機械学習、強化学習を行っているものです。 2021-05-02 13:32:01
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) rotationが-1以下になると、視点が瞬間移動する。 https://teratail.com/questions/336208?rss=all rotationが以下になると、視点が瞬間移動する。 2021-05-02 13:24:15
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) Python3 subprocess関数のshellオプションについて https://teratail.com/questions/336207?rss=all 2021-05-02 13:04:11
Ruby Rubyタグが付けられた新着投稿 - Qiita CapybaraによるSystem specで使用したコマンド振り返り https://qiita.com/Cobochan-O/items/f59b6609f11890960eae まずdataconfirm属性ですが、これはaタグやformタグのsubmitボタンの属性に追加することでダイアログを表示してくれるものですacceptconfirmですがこれはダイアログを認可つまりOKという判定を行なってくれるメソッドです。 2021-05-02 13:23:07
Ruby Rubyタグが付けられた新着投稿 - Qiita railsでorするとき、atter = nil時に不要な sqlを節約する (手元では400倍早くなった) https://qiita.com/tomoki0902/items/f082b42738936424b288 ただし、上記にもあるように、「実践的ではないかも。 2021-05-02 13:10:24
Ruby Railsタグが付けられた新着投稿 - Qiita CapybaraによるSystem specで使用したコマンド振り返り https://qiita.com/Cobochan-O/items/f59b6609f11890960eae まずdataconfirm属性ですが、これはaタグやformタグのsubmitボタンの属性に追加することでダイアログを表示してくれるものですacceptconfirmですがこれはダイアログを認可つまりOKという判定を行なってくれるメソッドです。 2021-05-02 13:23:07
Ruby Railsタグが付けられた新着投稿 - Qiita railsでorするとき、atter = nil時に不要な sqlを節約する (手元では400倍早くなった) https://qiita.com/tomoki0902/items/f082b42738936424b288 ただし、上記にもあるように、「実践的ではないかも。 2021-05-02 13:10:24
海外TECH DEV Community Creating a PDF With Go, Maroto & Gofakeit https://dev.to/divrhino/creating-a-pdf-with-go-maroto-gofakeit-3c7m Creating a PDF With Go Maroto amp GofakeitOriginally posted on divrhino comIn this tutorial we will learn how to use the Maroto package to create a PDF From invoices to certificates being able to generate a PDF from app data is a pretty handy feature In this tutorial we will use the Maroto package to build and save a product list We will also learn how we can use the GoFakeIt package to generate some random dummy data that we can use in our PDF PrerequisitesTo follow along you will need to have Go installed We are using version for this tutorial The packages MarotoThe Maroto package is described as being bootstrap inspired but you don t need to know Bootstrap to use it However if you have used Bootstrap before the approach Maroto takes will feel familiar to you A document is built using rows columns and components The package gives us the ability to include features such as imagessignaturesBarcodes andQR Codes GoFakeItUsing mock data is a great way to speed up the prototyping process We will use the GoFakeIt package to create a little dummy data generator to insert into our PDF We will see how to install these in the Getting Started section Wireframe of what we re buildingWe will be creating an product list for an imaginary fruit shop called Div Rhino Fruit The document will have a header and a table of products Getting startedNow that we ve covered the basic background information we can start setting up our project Inside our Sites directory we can make a new folder which we will call fruitful pdf and we will change into itcd Sitesmkdir fruitful pdfcd fruitful pdfWe will be using go modules to manage our dependencies It is a good idea to name your project using the URL where it can be downloaded so I m going to use my Github repo URL as the name of my package Please feel free to substitute the following command with your own Github account or personal websitego mod init github com divrhino fruitful pdfAfter the command runs successfully you should see a go mod file in your project directory Next we will install the Maroto package This tutorial will be using version v If you re using an older version of the Maroto package certain properties such as text colours may not be available go get u github com johnfercher marotogo get github com johnfercher maroto internal v We will also need to install the GoFakeIt package for our mock data generator We will be using version v for this tutorial You can install it with the following command go get github com brianvoe gofakeit vAfter installing these packages you should see a go sum file has been created in your project folder This can be thought of as a lock file It is used to verify that the checksum of dependencies have not changed Those are the only third party packages we need We are now ready to start creating our PDF structure Skeleton PDFLike with most Go projects we can go ahead and create a main go file at the root of our project directory touch main goInside our main go file let s import all our necessary Maroto sub packages Each package provides us with useful functions that will allow us to use things like colours images fonts and components package mainfunc main Now inside the body of our func main we can create a new maroto using the pdf sub package The NewMaroto method creates a new maroto instance and returns a pointer to pdf Maroto It also expects two arguments i orientation and ii paper size We can get these values from the consts sub package package mainimport github com johnfercher maroto pkg consts github com johnfercher maroto pkg pdf func main m pdf NewMaroto consts Portrait consts A We also want to give our PDF document some margins so the content isn t falling off the sides We can do this by using the SetPageMargins method which takes values i a left ii a top and iii a right margin value package mainimport github com johnfercher maroto pkg consts github com johnfercher maroto pkg pdf func main m pdf NewMaroto consts Portrait consts A m SetPageMargins Our content isn t ready yet but we can go ahead and save an empty file for now using the OutputFileAndClose method Let s tell it that we want to save the output as div rhino fruit pdf in a folder called pdfs package mainimport github com johnfercher maroto pkg consts github com johnfercher maroto pkg pdf func main m pdf NewMaroto consts Portrait consts A m SetPageMargins m OutputFileAndClose pdfs div rhino fruit pdf We ll have to remember to create the pdfs folder too mkdir pdfsThe OutputFileAndClose method returns an error so let s do some quick error handling before we move on If for some reason we re unable to output a PDF file the program immediately aborts because its only purpose is to create this PDF file package mainimport fmt os github com johnfercher maroto pkg consts github com johnfercher maroto pkg pdf func main m pdf NewMaroto consts Portrait consts A m SetPageMargins err m OutputFileAndClose pdfs div rhino fruit pdf if err nil fmt Println ️Could not save PDF err os Exit And just so we know something is actually happening let s print out a little message every time we run our code package mainimport fmt os github com johnfercher maroto pkg consts github com johnfercher maroto pkg pdf func main m pdf NewMaroto consts Portrait consts A m SetPageMargins err m OutputFileAndClose pdfs div rhino fruit pdf if err nil fmt Println ️Could not save PDF err os Exit fmt Println PDF saved successfully If we run our program now we ll get an empty PDF file saved to our pdfs foldergo run main go Building the headerAn empty PDF file isn t all that interesting so let s add some content starting with a header Our header will hold an image of the Div Rhino Fruit logo We don t want to put everything in our func main so let s create a new function to build our header We will pass in our previously created instance of pdf Maroto as an argument This function will perform some transformations on the pdf Maroto instance i e m and we won t be returning any values func buildHeading m pdf Maroto The Maroto package gives us a method that lets us register a header component that will appear on every page of our PDF document This RegisterHeader method accepts an anonymous callback function as the only argument This anonymous function can be thought of as a header container func buildHeading m pdf Maroto m RegisterHeader func Within the body of the header container we can set up a row that contains a column Much like the Bootstrap grid system rows are wrappers for columns Here we ve given our row a height of and we ve indicated that we want a full width column that takes up spaces The number is significant because most grid systems use columns func buildHeading m pdf Maroto m RegisterHeader func m Row func m Col func We have a logo that was created beforehand and we ve named it logo div rhino jpg To keep things organised let s make a new images directory to hold images we use in this project Feel free to use your own logo image instead mkdir imagesWe will also want to import the props subpackage from marotoimport fmt os github com johnfercher maroto pkg consts github com johnfercher maroto pkg pdf github com johnfercher maroto pkg props Inside our full width column we can set up an image component to display our Div Rhino Fruit logo We will centralise it and tell it to take up of the height of the cell func buildHeading m pdf Maroto m RegisterHeader func m Row func m Col func m FileImage images logo div rhino jpg props Rect Center true Percent The FileImage method returns an error so let s do some quick error handling before we move on If the image cannot be loaded we print a message in the console to let the user know func buildHeading m pdf Maroto m RegisterHeader func m Row func m Col func err m FileImage images logo div rhino jpg props Rect Center true Percent if err nil fmt Println Image file was not loaded err Next we want to create another row and full width column to add some descriptive Text ー Prepared for you by the Div Rhino Fruit Company func buildHeading m pdf Maroto m RegisterHeader func m Row func m Col func err m FileImage images logo div rhino jpg props Rect Center true Percent if err nil fmt Println Image file was not loaded err m Row func m Col func m Text Prepared for you by the Div Rhino Fruit Company props Text Top Style consts Bold Align consts Center Color getDarkPurpleColor func getDarkPurpleColor color Color return color Color Red Green Blue We want to use a custom colour here so we will also want to make a new function func getDarkPurpleColor and use the color sub package that Maroto provides to create a dark purple colourimport fmt os github com johnfercher maroto pkg consts github com johnfercher maroto pkg pdf github com johnfercher maroto pkg props github com johnfercher maroto pkg color And that s our header Let s call it inside out func main func main m pdf NewMaroto consts Portrait consts A m SetPageMargins buildHeading m err m OutputFileAndClose pdfs div rhino fruit pdf if err nil fmt Println ️Could not save PDF err os Exit fmt Println PDF saved successfully We can run our code to generate a PDF file to see what this looks like go run main go Lay out a table of productsWe can build our table of fruit next We first want to give the whole table a heading We can create a new teal colour and set the background colour of the cell to this teal colour Then like we ve done previously we can add a row that contains a full width column We are giving the Text component properties such as top position size color etc func buildFruitList m pdf Maroto m SetBackgroundColor getTealColor m Row func m Col func m Text Products props Text Top Size Color color NewWhite Family consts Courier Style consts Bold Align consts Center func getTealColor color Color return color Color Red Green Blue At this point if you d like to see what this looks like you can just generate a PDF and preview it go run main goAlong with content our table should have column headings as well Similar to the HTML table structure we first want to create something that resembles a thead and tbody We also want to set the cell colour of this section to white and set the background colour of alternate rows to a light purple We will need to create a new light purple colour function We can use the TableList component that Maroto provides to get a table We want both the HeaderProps and the ContentProps to have columns We can do this by giving the GridSizes property a value of uint a slice of unsigned integers with the values of and These grid sizes add up to func buildFruitList m pdf Maroto tableHeadings string Fruit Description Price contents string Apple Red and juicy Orange Orange and juicy lightPurpleColor getLightPurpleColor m SetBackgroundColor getTealColor m Row func m Col func m Text Products props Text Top Size Color color NewWhite Family consts Courier Style consts Bold Align consts Center m SetBackgroundColor color NewWhite m TableList tableHeadings contents props TableList HeaderProp props TableListContent Size GridSizes uint ContentProp props TableListContent Size GridSizes uint Align consts Left AlternatedBackground amp lightPurpleColor HeaderContentSpace Line false func getLightPurpleColor color Color return color Color Red Green Blue Just some notes on the code above the tableHeadings if of type slice of stringthe contents are a slice of slice of string Another way of saying slice of slice of string is to say two dimensional slice This type will be important in the next section when we work on our mock data generator Call the buildFruitList in func main func main m pdf NewMaroto consts Portrait consts A m SetPageMargins buildHeading m buildFruitList m err m OutputFileAndClose pdfs div rhino fruit pdf if err nil fmt Println ️Could not save PDF err os Exit fmt Println PDF saved successfully Let s do a quick preview of our PDF again to see what we ve just added so fargo run main go Mock data generatorOkay now let s take a small detour out of our main go file So far we ve used hardcoded content to inject into our table We re going to try something different and use some randomly generated data instead To achieve this we will create our own custom data package and make use of the GoFakeIt package we installed earlier In our project root let s make a new folder called datamkdir dataAnd within this new data folder let s create a new file called products gotouch data products goLet s head into our newly created products go file This is going to be a new package on its own so we can start by indicating that it s part of package data instead of package main Then we can import GoFakeIt package dataimport github com brianvoe gofakeit v The GoFakeIt packages gives us all sorts of functions for concepts such as a File a Person a Number among other things We will be using Fruit in this tutorial We can represent the structure of each fruit item using a Fruit struct type Each Fruit will have a Name a Description and a Price Each of these values will be randomly generated using GoFakeIt package dataimport github com brianvoe gofakeit v type Fruit struct Name string fake fruit Description string fake loremipsumsentence Price float fake price Now that we have our Fruit struct type we can create a function to make use of it Every time the generateFruit function is called we get a new random fruit package dataimport fmt github com brianvoe gofakeit v type Fruit struct Name string fake fruit Description string fake loremipsumsentence Price float fake price func generateFruit string var f Fruit gofakeit Struct amp f froot string froot append froot f Name froot append froot f Description froot append froot fmt Sprintf f f Price return froot Lastly we want to create a function we can access outside this data package We need this in order to generate this random fruit data inside out PDF table that lives in our main go file package dataimport fmt github com brianvoe gofakeit v type Fruit struct Name string fake fruit Description string fake loremipsumsentence Price float fake price func generateFruit string var f Fruit gofakeit Struct amp f froot string froot append froot f Name froot append froot f Description froot append froot fmt Sprintf f f Price return froot func FruitList length int string var fruits string for i i lt length i onefruit generateFruit fruits append fruits onefruit return fruits Just some notes about the code above FruitList is a public function that we can access from outside the data package which is why it starts with a capital letter As we saw earlier our TableList component needs the data to come in as a two dimensional slice of string FruitList takes in one parameter of length so we can dynamically determine how many items of fruit we want to generate We then pass this length value into a little for loop that calls our generateFruit function however many times length determines Then we return a two dimensional slice of string Hooking up the dynamic contentBack in our main go file we can import our data package and replace our contents variable Let s use the FruitList function to generate random fruit package mainimport fmt os github com johnfercher maroto pkg color github com johnfercher maroto pkg consts github com johnfercher maroto pkg pdf github com johnfercher maroto pkg props github com divrhino fruitful pdf data func buildFruitList m pdf Maroto headings string Fruit Description Price contents data FruitList And now if we run our code we have a table of randomly generated fruit go run main goIf we decide to generate many many more random Fruit say our PDF automatically adds pages to accommodate this Going furtherIf you d like to extend this project further you can consider doing the followingtry replacing the mock data with actual data from an APIuse the RegisterFooter method to add a footer to every page of the PDF documentadd a signature barcode page numbers and a QR codeThis repository includes an extended version of this tutorial code in the examples folder You can also look at the Maroto package Github page for even more examples ConclusionIn this tutorial we learnt how to generate some dummy data that we saved in a PDF file We used the maroto and gofakeit packages to help us achieve this If you enjoyed this article and you d like more consider following Div Rhino on YouTube Congratulations you did great Keep learning and keep coding Bye for now lt divrhino fruitful pdf Create a PDF document with Go Maroto and GoFakeIt Video tutorial available on the Div Rhino YouTube channel Create PDFs with Go Maroto and GoFakeItText tutorial Video tutorial View on GitHub 2021-05-02 04:27:37
海外TECH DEV Community Advanced Hover Effect to WOW your visitors! https://dev.to/ruppysuppy/advanced-hover-effect-to-wow-your-visitors-58a3 Advanced Hover Effect to WOW your visitors I came across the hover effect in the cover image at several sites but just could not wrap my head around how to develop it Thankfully after reading this blog I finally got an idea on how to develop it Demo Getting StartedLet s start coding index html lt DOCTYPE html gt lt html lang en gt lt head gt lt meta charset UTF gt lt meta http equiv X UA Compatible content IE edge gt lt meta name viewport content width device width initial scale gt lt title gt Hover Effect lt title gt lt link rel stylesheet href style css gt lt head gt lt body gt lt div class hover container gt lt img src fit crop amp w amp q class img gt lt div class overlay gt lt div gt lt div gt lt script src script js gt lt script gt lt body gt lt html gt style css hover container height max content width max content position relative margin px px img display inline block height px overlay hover container after position absolute top bottom left right hover container after content NOTE Without the after pseudo element hovering the hover container would trigger overlay hover instead of hover container hoverNow to the meat of the hover effect We would be adding the effect to all elements with hover container class First the mouse position over the element will be tracked and the element would be styled accordingly on mousemove script jsdocument querySelectorAll hover container forEach container gt reseting styles for the element when the mouse exits the element container onmouseleave e gt const overlayChild e target querySelector overlay e target style transform rotateY rotateX overlayChild style background transparent adding a listener to style the element when the mouse moves inside the element container addEventListener mousemove e gt const rect e target getBoundingClientRect const x e clientX rect left x position within the element const y e clientY rect top y position within the element const width e target offsetWidth const height e target offsetHeight const overlayChild e target querySelector overlay the values can be tweaked as per personal requirements e target style transform rotateY x width deg rotateX y height deg overlayChild style background radial gradient circle at x px y px rgba rgba NOTE This is a simpler version of the effect shown in the cover image with a few minor tweaks that effect can be obtained ReferenceWindows button hover effect Thanks for readingCheckout my projects ruppysuppy SmartsApp An End to End Encrypted Cross Platform messenger app Smartsapp A fully cross platform messenger app with End to End Encryption EEE Demo NOTE The features shown in the demo is not exhaustive Only the core features are showcased in the demo Platforms SupportedDesktop Windows Linux MacOSMobile Android iOSWebsite Any device with a browserBack end SetupThe back end of the app is handled by Firebase Basic SetupGo to firebase console and create a new project with the name SmartsappEnable Google AnalyliticsApp SetupCreate an App for the project from the overview pageCopy and paste the configurations in the required location given in the readme of the respective apps Auth SetupGo to the project Authentication sectionSelect Sign in method tabEnable Email Password and Google sign inFirestore SetupGo to the project Firestore sectionCreate firestore provisions for the project choose the server nearest to your location Go to the Rules… View on GitHub ruppysuppy Daily Coding Problem Solutions ️Solutions for Interview Questions asked at FAANG and other top tech companies Daily Coding Problem SolutionsThis repository contains the Daily Coding Problem solutions in python SetupInstall the rd party packages perform the following steps cd Daily Coding Problem SolutionsRun pip install r requirements txtContribution GuidelinesPlease go through Contribution Guidelines before you contribute Note Modules numpy and matplotlib are used for presentation purpose only and hence are optional Some solutions require an additional Data Structures module ProblemsProblem Given a list of numbers return whether any two sums to kFor example given and k of return true since is Bonus Can you do this in one pass SolutionProblem This problem was asked by Uber Given an array of integers return a new array such that each element at index i of the new array is the product of all the numbers in the original array except the one at… View on GitHub Reach out to me on GitHub LinkedIn Portfolio For freelance projects reach out through the contact form 2021-05-02 04:26:45
ニュース BBC News - Home The Papers: 'Three steps to normal life' https://www.bbc.co.uk/news/blogs-the-papers-56959898 possible 2021-05-02 04:24:09
ビジネス ダイヤモンド・オンライン - 新着記事 増配を開示した銘柄をまとめて公開![2021年4月版] 2期連続の増配予想で利回り5%超のコネクシオ、5期 連続の増配予想で利回り4.0%のアサヒHDなどを紹介 - 配当【増配・減配】最新ニュース! https://diamond.jp/articles/-/270169 配当利回り 2021-05-02 13:05:00
北海道 北海道新聞 ポケモンと古生物、一緒に理解 三笠市立博物館で7月から巡回展 “実寸”模型や化石で比較 https://www.hokkaido-np.co.jp/article/538840/ 三笠市立博物館 2021-05-02 13:14:14
北海道 北海道新聞 カーリング、中国に敗れ1勝2敗 女子世界選手権1次リーグ https://www.hokkaido-np.co.jp/article/539879/ 世界選手権 2021-05-02 13:11:00
北海道 北海道新聞 安保5条と多国連携で一致 日米制服組トップが会談 https://www.hokkaido-np.co.jp/article/539878/ 山崎幸二 2021-05-02 13:09:00
北海道 北海道新聞 八村塁、2桁の18得点も黒星 米NBA、ウィザーズ https://www.hokkaido-np.co.jp/article/539877/ 黒星 2021-05-02 13:03:00
ビジネス 東洋経済オンライン 愚痴多いけどクール「徳川慶喜」ずば抜けた慧眼 後ろ盾が攘夷派でもなびかない聡明な開国派 | リーダーシップ・教養・資格・スキル | 東洋経済オンライン https://toyokeizai.net/articles/-/425918?utm_source=rss&utm_medium=http&utm_campaign=link_back 徳川慶喜 2021-05-02 14:00:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)