投稿時間:2021-06-07 06:17:56 RSSフィード2021-06-07 06:00 分まとめ(23件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
TECH Engadget Japanese 2019年6月7日、個性のある「moto g7 plus」「moto g7」「moto g7 power」3モデルが発売されました:今日は何の日? https://japanese.engadget.com/today-203053072.html motog 2021-06-06 20:30:53
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) iframe x LocalStrage x iOS、値消滅してしまうので代わりとなる保存方法について https://teratail.com/questions/342562?rss=all iframe 2021-06-07 05:59:19
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) mongodb Node.js MongooseError: Operation `user.findOne()` buffering timed out after 10000ms https://teratail.com/questions/342561?rss=all mongodbNodejsMongooseErrorOperationuserfindOnebufferingtimedoutafterms前提・実現したいことpassportjsを使って認証機能を実現しようとしています。 2021-06-07 05:57:29
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) サブコレクションのドキュメントidを取得して対象を削除したい https://teratail.com/questions/342560?rss=all 2021-06-07 05:54:57
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) [Javascript]同じ作りのモーダルを複数設置し、背景を固定した時にTOPに戻るのを回避したい https://teratail.com/questions/342559?rss=all Javascript同じ作りのモーダルを複数設置し、背景を固定した時にTOPに戻るのを回避したい【概要】jqueryが使えない環境でJavascriptにてモーダルの設置を行っていて、モーダルが個であれば問題なく設置できたのですが同じ作りコンテンツの中身は違うのモーダルを動的に複数設置するといった場合に、ID等を自動的に連番で付与して設置していく方法がわからずに困っています。 2021-06-07 05:37:39
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 2つのpythonファイルでloggingの挙動が異なる https://teratail.com/questions/342558?rss=all 2021-06-07 05:12:52
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) rails tutorial 13.4.4 git push herokuでエラー https://teratail.com/questions/342557?rss=all 2021-06-07 05:05:08
Ruby Rubyタグが付けられた新着投稿 - Qiita RubyでオレオレVMとアセンブラとコード生成器を2週間で作ってライフゲームを動かした話 https://qiita.com/sonota88/items/f9cb3fc4a496b354b729 自動テストこれはちょっとした賭けでしたが、テストコードは書かずに進めましたできあがりがどういう形になるのか分からない状態でのスタートだったため、下手にテストコードを書いてしまうとそっちの修正で時間取られそうな気がして……既存の仕様に準拠するならともかく、今回は上から下までオレオレで、作りながら仕様が変わっていくと予想された実際はあまり変わらなかったけど、それも作ってみないと分からないのでバグが出ると「やっぱり書いておけばよかったかな……」とは思ったものの、結果的にはなんとかなった運が良かったとはいえ、まったくの無策だった訳ではなく、↓のようなことはしていました動作確認程度のちょっとしたものはその都度書いたり生成されたアセンブリコード・機械語コードのファイルもgitのトラッキング対象にしておいて、壊れていないことをgitdiffで確かめたりどういう状態から始めたかCPUCPUのことをよく知らなかったので年末年頭頃に何冊か流し読みして、半加算器動かして足し算できる、みたいなのは書いてみたこの頃はアセンブラ、コード生成器まで作る気はなかった。 2021-06-07 05:55:43
海外TECH DEV Community Solution: Longest Consecutive Sequence https://dev.to/seanpgallivan/solution-longest-consecutive-sequence-27ni Solution Longest Consecutive SequenceThis is part of a series of Leetcode solution explanations index If you liked this solution or found it useful please like this post and or upvote my solution post on Leetcode s forums Leetcode Problem Medium Longest Consecutive Sequence Description Jump to Solution Idea Code JavaScript Python Java C Given an unsorted array of integers nums return the length of the longest consecutive elements sequence You must write an algorithm that runs in O n time Examples Example Input nums Output Explanation The longest consecutive elements sequence is Therefore its length is Example Input nums Output Constraints lt nums length lt lt nums i lt Idea Jump to Problem Description Code JavaScript Python Java C In order to accomplish this task in O N time we ll have to have some way of looking up values nmap which means a set or map object We ll also need some way of keeping track of which numbers have already been seen Note We could forego the seen data structure entirely and just follow each path to its end every time but that would cause us to redo the same sections over and over again pushing the time complexity to O N If we use a set for nmap then we would need to use a map for seen in order to be able to look the numbers up by value If we instead use a map for nmap with each number pointing to its index then we can instead use those indexes with an array for seen which will be more efficient Note Since we ll be iterating through nums from front to back in the next section we should make sure that we store only the first index at which a number is found in nmap Later indexes of duplicate numbers can be ignored as by then the number will already be considered seen But now we run into the issue of potentially finding the middle of a sequence before we find the beginning of the sequence For this we can take inspiration from a union find approach and or dynamic programming DP approach We can use seen to store the length of the sequence found when starting at the given number Note We don t need to store path length data in any but the smallest number of a found chain as those nodes can never be actively visited again Only the entry point which is the smallest number needs to have the accurate path length stored For the other numbers we just have to register them as seen so we can just fill them with a or any non zero number to make the check easy Then if we later find an earlier number in the same sequence we can notice the value stored in seen when we link up with an already visited tail end of the same sequence and just add that value representing the tail s length to our count of numbers For example consider nums We start at then track through and filling the seen indexes corresponding to and with a each seen seen Once we reach the end of that chain and have a count of we store that in the seen index corresponding to seen Then because we ve seen and while checking we skip to At we track through and filling them with s seen seen After that we run into which has a value of stored in seen At this point count is from numbers and but we ve just run into another already discovered chain of numbers and so we can fill the seen index corresponding to with a seen Then we skip past and and the will lead us back to so we ll have a result of for the seen index corresponding to seen At each step when we re about to store the count in seen we can also update our best result so far ans Then once we ve reached the end of the iteration we can just return ans Time Complexity O N where N is the length of numsSpace Complexity O N for nmap and seen Javascript Code Jump to Problem Description Solution Idea var longestConsecutive function nums let nmap new Map ans seen new UintArray nums length for let i i lt nums length i if nmap has nums i nmap set nums i i for let n of nums let curr n count if seen nmap get curr continue while nmap has curr let ix nmap get curr if seen ix count seen ix break else seen ix count seen nmap get n count ans Math max ans count return ans Python Code Jump to Problem Description Solution Idea class Solution def longestConsecutive self nums List int gt int nmap seen ans defaultdict int len nums for i in range len nums if nums i not in nmap nmap nums i i for n in nums curr count n if seen nmap n continue while curr in nmap curr ix nmap curr if seen ix count seen ix break else seen ix count seen nmap n ans count max ans count return ans Java Code Jump to Problem Description Solution Idea class Solution public int longestConsecutive int nums Map lt Integer Integer gt nmap new HashMap lt gt int ans int seen new int nums length for int i i lt nums length i if nmap containsKey nums i nmap put nums i i for int n nums int curr n count if seen nmap get curr gt continue while nmap containsKey curr int ix nmap get curr if seen ix gt count seen ix break else seen ix count seen nmap get n count ans Math max ans count return ans C Code Jump to Problem Description Solution Idea class Solution public int longestConsecutive vector lt int gt amp nums unordered map lt int int gt nmap int ans vector lt int gt seen nums size for int i i lt nums size i if nmap find nums i nmap end nmap nums i i for auto amp n nums int curr n count if seen nmap curr continue while nmap find curr nmap end int ix nmap curr if seen ix count seen ix break else seen ix count seen nmap n count ans max ans count return ans 2021-06-06 20:41:41
海外TECH DEV Community Voici comment traduire du text à l'aide de Google Translate en 3 lignes de code seulement !!! https://dev.to/ericlecodeur/voici-comment-traduire-du-text-a-l-aide-de-google-translate-en-3-lignes-de-code-seulement-3382 Voici comment traduire du text àl x aide de Google Translate en lignes de code seulement Suivez moi sur TwitterTruc et Astuce Python Traduire du text àl aide de Google Translate en lignes de code pip install googletrans afrom googletrans import Translatortranslator Translator print translator translate Bonjour ceci est un application web qui permet de truduire un text src fr dest en text Consulter la librairie GoogleTrans pour tous les détails 2021-06-06 20:23:48
海外TECH DEV Community Nginx Serving Compressed Multiple Static Files w/ Unique Paths using Docker for Improved Performance https://dev.to/alxizr/nginx-serving-compressed-multiple-static-files-w-unique-paths-using-docker-for-improved-performance-501g Nginx Serving Compressed Multiple Static Files w Unique Paths using Docker for Improved PerformanceIn this setup we will configure the nginx server to serve multiple static files on different paths with gzip media js and css enabled This scenario may fit well with Microfrontends MFE architechture where each individual route may serve a complete isolated application s production build version and by implementing the concept we will discuss here in this article you will also gain performance improvement This is a simple starter guide on how to get you up and running and in case you should want to implement this kind of setup you will have to add in your additional custom configurations that suits your needs best Prerequisites Visual Studio CodeDockerNginxBash Getting started guide we will be working with vscode and the integrated bash terminal on windows open vscodeopen bash integrated termianl ctrl shift or you can choose the view tab in the menu and then click on Terminal create a project folder and cd into it mkdir lt project name gt amp amp cd lt project name gt create a Dockerfile file touch Dockerfileyou will excuse me if i skip the dockerignore file as we are not focusing on Docker here but rather on what we want to achieve with nginx create a nginx conf file touch nginx confWe now will take a look on the overview of the configuration files and for a more detailed information we will have towards the end of the article or you can read the repo as well Dockerfile file content description base image to build on we use a lightweight imageFROM nginx alpine You may want to clear defaults on producion server set working directory to nginx asset directory and then remove default nginx static assets uncomment these next lines WORKDIR usr share nginx html RUN rm rf repeat this line for each application you fancy serving on different routeCOPY lt app build dir gt usr share nginx html lt app build dir gt override the default nginx configuration file with our ownCOPY nginx conf etc nginx conf d default conf expose the port your server should support EXPOSE lt port gt Pay attention If you come from any Nginx background with Docker do not add this command in the Dockerfile fileENTRYPOINT nginx g daemon off The reason we don t add it is because we override the default configurations and we want to control the custom behaviour of our nginx server nginx conf file content descriptionserver listen default port root usr share nginx html absolute paths only gzip on enable compression nginx default config location index index html index htm repeat this block as many times as you need my application page location lt my app gt index index html index htm try files uri uri index html set up gzip config set up assets javascript css media files Adding in our applications Before we move forward we would actually need to get our project s available for us to use and deploy on to the nginx server We can use basically anything we want for serving html css and javascript for example React or Angular but i am not going to go and implement this extra step as this is out of focus but rather mimic a production build of a frontend framework by just creating folders with an index html file Again in the terminal pointing to the root of the project run these commands mkdir Home Profile Dashboard touch Home Profile Dashboard index htmlNow open all the index html files add some html skeleton for home profile and dashboard applications Here is an example Just copy and paste it and don t forget to update the heading for each directory 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 Profile lt title gt lt head gt lt body gt lt nav gt lt li gt lt a href localhost home gt Home lt a gt lt li gt lt li gt lt a href localhost profile gt Profile lt a gt lt li gt lt li gt lt a href localhost dashboard gt Dashboard lt a gt lt li gt lt nav gt lt h gt Change This page lt h gt lt body gt lt html gt I want to take a moment and explain what just happened in this last step We are acting as we have different frontend projects that we want to serve on different routes In this case we are just implementing the bare minimum for the static html because this article is not about the static assets but rather on how to use them with nginx Mini Recap As for this stage we should have one project folder which contains configuration files Dockerfile and nginx conf and folders Home Profile and Dashboard with index html files in them that represents a full blown production build application project Dockerfile nginx conf Home index html Profile index html Dashboard index htmlThe only part that is missing here before we can apply our settings are the exact contents of the Dockerfile and the nginx conf files Let s quickly see what they are Filling the missing pieces Dockerfile FROM nginx alpine COPY Home usr share nginx html home COPY Profile usr share nginx html profile COPY Dashboard usr share nginx html dashboard COPY nginx conf etc nginx conf d default conf EXPOSE nginx conf server listen root usr share nginx html include etc nginx mime types default type application octet stream gzip on gzip disable msie gzip vary on gzip proxied any gzip comp level gzip buffers k gzip http version gzip min length gzip types font eot font otf font ttf image svg xml text css text javascript text plain text xml application atom xml application geo json application javascript application x javascript application json application ld json application manifest json application rdf xml application rss xml application xhtml xml application xml home page location home index index html index htm try files uri uri index html dashboard page location dashboard index index html index htm try files uri uri index html profile page location profile index index html index htm try files uri uri index html root nginx default location index index html index htm Javascript and CSS files location css js try files uri expires y access log off add header Cache Control public Media images icons video audio HTC location jpg jpeg gif png ico cur gz svg svgz mp ogg ogv webm htc expires M access log off add header Cache Control public Any route containing a file extension e g devicesfile js location try files uri Putting theory practice Now after we set up our Nginx server as for what and how it should behave we will build our very own custom version of it and then run it to see that everything works as expected Let s open a terminal from inside the project root folder and run the next command We would want to tag our custom image so we can address it by name and not by its id to do it simply by adding the t flag docker build t lt my custom tag image gt and for the docker less experienced ones this is what you need to type and run pay attention to spacing and the dot docker build t multi nginx Next step is to run the image in a container and we will accomplish it by running the next command docker run p lt out port gt lt in port gt lt my custom tag image gt Pay attention that we specify the our local port to a container s inner port which can be anything but defaults to or this is the exact port number we exposed inside the Dockerfile configuration file I used port and again for the docker less experienced ones this is what you need to type and run docker run p multi nginxpay a little attention if you do come from a docker background to the fact we don t run the container in a detached mode with the d flag because we want to see the nginx server logs every route it should serve Our final step is to open a browser and browse to the container root path on localhost In this demo we have different paths that are isolated from one another home profile and dashboard Thank you very much for staying all the way through this article and hope that you may have learned something until the next time Goodbye 2021-06-06 20:00:53
海外TECH Engadget Twitter leak hints paid 'Super Follows' might be coming soon https://www.engadget.com/twitter-super-follows-leak-203103686.html?src=rss_b2c native 2021-06-06 20:31:03
ニュース BBC News - Home Prince Harry and Meghan announce birth of baby girl https://www.bbc.co.uk/news/uk-57378117 lilibet 2021-06-06 20:43:24
ニュース BBC News - Home Cricketer Robinson suspended for offensive tweets https://www.bbc.co.uk/sport/cricket/57379184 zealand 2021-06-06 20:16:14
ニュース BBC News - Home Christopher Kapessa: Mum plans legal action over river death https://www.bbc.co.uk/news/uk-wales-57342780 kapessa 2021-06-06 20:49:25
ビジネス ダイヤモンド・オンライン - 新着記事 松山英樹・マスターズ2021制覇の影に「2度の悔し涙」、格闘の10年秘史 - ゴルフ大全 ビジネス×人脈×カネ https://diamond.jp/articles/-/272983 松山英樹 2021-06-07 05:25:00
ビジネス ダイヤモンド・オンライン - 新着記事 柳井正氏、孫正義氏、岡藤正広氏らが集い「ビジネスが動く」名門ゴルフ倶楽部の実名メンバーリスト - ゴルフ大全 ビジネス×人脈×カネ https://diamond.jp/articles/-/272982 集い 2021-06-07 05:20:00
ビジネス ダイヤモンド・オンライン - 新着記事 サントリー新浪社長が導く、「経営者が強欲過ぎて資本主義は死んだ」への答え - トップMBAが教える 新・資本主義 https://diamond.jp/articles/-/273002 新浪剛史 2021-06-07 05:15:00
ビジネス ダイヤモンド・オンライン - 新着記事 医療保険&緩和型医療保険ランキング、「保障の範囲と多様さ」で高評価の商品は? - 保険商品ランキング ベスト&ワースト https://diamond.jp/articles/-/272960 医療保険緩和型医療保険ランキング、「保障の範囲と多様さ」で高評価の商品は保険商品ランキングベストワースト死亡保障を抑えて、今や保険商品の主役となった医療保険。 2021-06-07 05:10:00
ビジネス ダイヤモンド・オンライン - 新着記事 商社エリート「出世の条件」激変!事業部ひも付き“背番号”の廃止、若手大抜てき… - 商社 非常事態宣言 https://diamond.jp/articles/-/272401 総合商社 2021-06-07 05:05:00
ビジネス 電通報 | 広告業界動向とマーケティングのコラム・ニュース Z世代女子は心に推しを持っている~Z世代女子の「推し消費」とは?~ https://dentsu-ho.com/articles/7790 girlsgoodlab 2021-06-07 06:00:00
ビジネス 東洋経済オンライン JT「たばこ事業は人事評価も海外と統一」の大決断 寺畠社長が明かす「本社機能スイス移転」の意味 | 専門店・ブランド・消費財 | 東洋経済オンライン https://toyokeizai.net/articles/-/432627?utm_source=rss&utm_medium=http&utm_campaign=link_back 人事評価 2021-06-07 05:40:00
ビジネス 東洋経済オンライン 今こそ再認識すべき「ワクチン望まぬ人」への配慮 接種は法律で義務づけられているわけではない | 新型コロナ、長期戦の混沌 | 東洋経済オンライン https://toyokeizai.net/articles/-/432338?utm_source=rss&utm_medium=http&utm_campaign=link_back 感染拡大 2021-06-07 05:30:00

コメント

このブログの人気の投稿

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

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

投稿時間:2024-02-12 22:08:06 RSSフィード2024-02-12 22:00分まとめ(7件)