投稿時間:2021-04-10 01:38:08 RSSフィード2021-04-10 01:00 分まとめ(49件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT 気になる、記になる… Google、「Pixel 5a」の発売を中止か https://taisy0.com/2021/04/10/138768.html google 2021-04-09 15:39:50
python Pythonタグが付けられた新着投稿 - Qiita Webページのコンテンツからカテゴリを自動類推 https://qiita.com/symmr/items/f68aaca5ae8d08d31aaa Webページのコンテンツからカテゴリを自動類推はじめにURLを元に、そのページのカテゴリを調べる必要がありました何か良いサービスが無いか探すと色々なWebCategorizationサービスがありましたが従量課金のサービスは見当たらず月額ばかりGoogleCloudのNaturalLanguageAPIでコンテンツの分類ができるようなので、Pythonで作ってみましたそこそこ良い感じのものができました処理の流れは以下の通りですBeautifulSoupでWebページから特徴的なテキストを抽出GoogleTranslate無償版で英語に翻訳※時点でコンテンツの分類は英語のみ対応のためNaturalLanguageAPIでコンテンツの分類コンテンツの分類テキストを元にカテゴリを類推してくれるサービスです。 2021-04-10 00:45:04
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) NodeJS socket.io で io.sockets.on の外から socket.broadcast.to(room).emit を使う https://teratail.com/questions/332498?rss=all NodeJSsocketioでiosocketsonの外からsocketbroadcasttoroomemitを使うお世話になります。 2021-04-10 00:58:49
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 一番上のタブ?の戻し方 https://teratail.com/questions/332497?rss=all eeditgameobjectcomponent 2021-04-10 00:41:04
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) pageメソッドについて https://teratail.com/questions/332496?rss=all pageメソッドについて前提・実現したいことここに質問の内容を詳しく書いてください。 2021-04-10 00:28:14
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) htdocsディレクトリに保存した.phpファイルをブラウザで開けず、新規ファイルで保存するウインドウが表示されてしまう。 https://teratail.com/questions/332495?rss=all CApachehtdocstestphpという風にPHPのテストファイルを置いたのですが、httplocalhosttestphpというURLをブラウザChromeで開いてもファイルを開けません。 2021-04-10 00:21:18
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) Sprites-DiffuseシェーダでZ Writeをしたい https://teratail.com/questions/332494?rss=all SpritesDiffuse シェーダ で ZWrite を し たい Unity です 。 2021-04-10 00:19:19
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) Python class のコンストラクタ、デストラクタが作動しない https://teratail.com/questions/332493?rss=all Pythonclassのコンストラクタ、デストラクタが作動しない下記コードのように、classnbspを辞書でハンドルすると、クラスを呼び出し破棄した際に、コンストラクタ、デストラクタが作動しません。 2021-04-10 00:16:18
AWS AWSタグが付けられた新着投稿 - Qiita AWS Route53 独自ドメインがバケットと紐付けされない! https://qiita.com/YutaMatsuura715/items/d48c199044e1a488ee36 DNSPROBEFINISHEDNXDOMAINもしここまでの症状と一致してる人はほぼ私と同じ現象だと思うのでwhoisで対象のドメインを検索する。 2021-04-10 00:27:24
Git Gitタグが付けられた新着投稿 - Qiita husky v5 で消耗している人には simple-git-hooks がお薦め https://qiita.com/acro5piano/items/10f406c3ecc8ea1d14ce huskyディレクトリを作成したり、huskyinstallで何が行われるのかhuskyの中にある謎のファイルは何なのかしかも、Huskyは勝手にgitconfigを変更するから、他のツールと併用すると面倒なことになりそう。 2021-04-10 00:27:41
Ruby Railsタグが付けられた新着投稿 - Qiita rails-serverが起動できない問題 https://qiita.com/kazu628/items/29bc15384d7874a06cd6 railsserverが起動できない問題railstutorialでrailsserverが起動できない問題についてずっと悩まされていました。 2021-04-10 00:37:02
Ruby Railsタグが付けられた新着投稿 - Qiita deviseを使用したログイン機能実装での注意事項 https://qiita.com/takuo_maeda/items/ba559872be31b5142e30 deviseを入れてログイン機能を実装中にターミナルに以下のエラーを発見しました。 2021-04-10 00:23:25
海外TECH Ars Technica The 2021 Honda Accord Hybrid is a mile-munching gas-sipper https://arstechnica.com/?p=1755716 efficiency 2021-04-09 15:40:49
海外TECH Ars Technica Amazon workers in Bessemer have voted not to form a union https://arstechnica.com/?p=1755663 labor 2021-04-09 15:20:04
海外TECH DEV Community SlateJS: Creating a Text Editor https://dev.to/koralarts/slate-creating-a-text-editor-5fok SlateJS Creating a Text EditorHaving a text editor customized can enhance your user s experience Slate is a text editor framework that can be customized to fit your needs Installing SlateWe ll need three modules for our Slate implementation slate The core module of Slateslate react The React wrapper for Slateslate history Allows the user to undo their actionsnpm i save slate slate react slate historyoryarn add slate slate react slate history Setting up SlateTo create a new Editor using createEditor in combination with a couple of plugins withReact and withHistory import createEditor from slate import withReact from slate react import withHistory from slate history const Editor gt const editor useMemo gt withReact withHistory createEditor Two components will then be used to render the Slate editor import Slate Editable slate react const Editor gt return lt Slate editor editor gt lt Editable gt lt Slate gt Adding ContentSlate would crash initially and that s because a default value is necessary const Editor gt const value setValue useState children text This is my paragraph return lt Slate value value setValue setValue gt lt Slate gt It s important for a default Element to exist and not just an empty array Having an empty array will cause a crash as Slate has nothing to attach the cursor to Custom TypesBy default the content will be considered as text but Rich Text Editors can have non text content Each Element can have custom properties to help render said Element const value setValue useState type paragraph children text This is my paragraph type image src path to image alt This is my image children text We can then render these custom elements using the renderElement prop of the Editor component const Paragraph attributes children gt lt p attributes gt children lt p gt const Image attributes element children gt lt div attributes gt lt div contentEditable false gt lt img src element src alt element src gt lt div gt children lt div gt const renderElement props gt switch props element type case image return lt Image props gt default return lt Paragraph props gt const Editor gt return lt Slate gt lt Editor renderElement renderElement gt lt Slate gt It s important that every Element renders the children prop as this is how Slate can keep track of which element currently has focus VoidsVoids are Elements that cannot be edited as if it was text Since our Image cannot be edited as if it was text we need to tell Slate that it s a void Element PluginsThe editor object that we create has an isVoid function which determines whether or not an Element is void or not Slate allows us to create plugins that can modify the functionality of existing editor functions or add new functionality const withImage editor gt const isVoid editor editor isVoid element gt element type image true isVoid element return editor const Editor gt const editor useMemo gt withReact withHistory withImages createEditor TIP Since you can have a lot of plugins especially for more complicated editors you can use the pipe function from lodash fp import pipe from lodash fp pipe const createEditorWithPlugins pipe withReact withHistory withImage const Editor gt const editor useMemo gt createEditorWithPlugins createEditor Handling EventsSince Image is now considered as a void element it loses some keyboard functionality Luckily the editor provides us two functions that we can extend insertBreakThe editor insertBreak function is called when the user presses the enter or return for Mac const isVoid insertBreak editoreditor insertBreak args gt const parentPath Path parent editor selection focus path const parentNode Node get editor parentPath if isVoid parentNode const nextPath Path next parentPath Transforms insertNodes editor type paragraph children text at nextPath select true Focus on this node once inserted else insertBreak args deleteBackwardThe editor deleteBackward function is called when the user presses the backspace or delete for Mac const isVoid deleteBackward editoreditor deleteBackward args gt const parentPath Path parent editor selection focus path const parentNode Node get editor parentPath if isVoid parentNode Node string parentNode length Transforms removeNodes editor at parentPath else deleteBackward args ConclusionAs you can see Slate can be heavily customizable as it gives you the necessary tools to add your own functionality Demo 2021-04-09 15:50:13
海外TECH DEV Community A short story about web apis https://dev.to/abderrahmanemustapha/a-short-story-about-web-apis-2jdf A short story about web apisDeveloping a WEB API Initially I can say I know how to do this or at least I know the basics but this time I wanted to know some history who first used the WEB APIS and who gave this name to it how it developed and what drove these big companies To use WEB APIS This story to my knowledge starts in with salesforce They wanted to change how people work on the Internet In addition they wanted to enter another interface that machines understand and communicate with as well It was not more than a year Ebay say s I m here They launched their own API under the name EBay application programming interface but it was not available to everyoneEbay and Salesforce is not alone here a two years later Amazon and flicker did the sameBut What About Facebook and Twitter they have launched their own web apis because of the people who use the web crawler and web scrapper on their pages or those who create a rogue web apis same thing happened to google map apis Amazon was not the first but it made a step that will lead us later to the world of cloud computing Amazon launched the S through this service everyone will be able to store or extract any amount of data WEb Apis now is a big business in mars twitter was serving call Every Second and in mars million users access their banking accounts from mobiles and of course these phones or applications connect to a web api somewhereAfter reading some history I began to ask about how to successfully develop the API and what are the stages that I must perform I found some blogs they were talking about what they call the API lifecycle and this is what I will talk about in the next post For Further Exploration Architectural Styles andthe Design of Network based Software ArchitecturesHistory of apisWho invented the apis 2021-04-09 15:46:48
海外TECH DEV Community Grokking Applicatives https://dev.to/choc13/grokking-applicatives-44o1 Grokking ApplicativesApplicatives are perhaps the less well known sibling of the monad but are equally important and solve a different but related problem Once you ve discovered them you ll find they re a useful tool for writing code where we don t care about the order of the computations In this post we re going to grok applicatives by discovering them through a worked example Small F primerSkip this if you ve got basic familiarity with F It should be easy enough to follow along if you ve not used F before you ll just need to understand the following bits F has a Result lt T E gt type It represents the result of a computation that might fail It has a Ok case constructor which contains a value of type T and a Error case constructor which contains an error value of type E We can pattern match on a Result like so match aResult with Ok x gt expression based on the good value x Error e gt expression based on the error value e The ScenarioLet s say we ve been asked to write a function that validates a credit card which is modelled like this type CreditCard Number string Expiry string Cvv string The function we need to implement islet validateCreditCard creditCard CreditCard Result lt CreditCard string gt Happily someone else has already written some functions for validating a credit card number expiry and CVV They look like this let validateNumber number Result lt string string gt if String length number gt then Error A credit card number must be less than characters else Ok numberlet validateExpiry expiry Result lt string string gt Some validation checks for an expirylet validateCvv cvv Result lt string string gt Some validation checks for a CVVThe details of the validation checks aren t crucial here I ve just shown a basic example for the card number here The main thing to take note of is that each function takes an unvalidated string and returns a Result lt string string gt which indicates whether or not the value is valid If the value is invalid then it will return a string containing the error message Our first attemptWhat luck All we ve got to do is compose these functions somehow to validate a credit card instance Let s give it a go let validateCreditCard card let validatedNumber validateNumber card Number let validatedExpiry validateExpiry card Expiry let validatedCvv validateCvv card Cvv Number validatedNumber Expiry validatedExpiry Cvv validatedCvv Hmmm that doesn t compile The problem is that we re trying to pass Result lt string string gt to the fields of the CreditCard at the end but the fields of CreditCard have type string I spy with my little eye something beginning with M Seeing as we ve now Grokked Monads we might notice that we could solve our problem using monads Each validation functions takes a string and lifts it up to a Result lt string string gt and we seemingly want to chain several of these functions together We saw in Grokking Monads that we can use bind for exactly this type of chaining For reference bind for a Result would look like this let bind f result match result with Ok x gt f x Error e gt Error eSo let s try and write validateCreditCard as a chain using bind let validateCard card validateNumber card Number gt bind validateExpiry card Expiry gt bind validateCvv card Cvv gt fun number expiry cvv gt Number number Expiry expiry Cvv cvv Looks neat but it still doesn t compile The calls to bind expect a function that take as input the validated value from the previous computation In the first case it would be the validated number being passed to the validateExpiry function However validateExpiry doesn t need the validated number as input it needs the unvalidated expiry but we do need to keep track of that validated number somehow until the end so that we can use it to build the valid CreditCard instance It is possible to remedy these points by accumulating these intermediate validation results as we go let validateCard card validateNumber card Number gt bind fun number gt validateExpiry card Expiry gt Result map fun expiry gt number expiry gt bind fun number expiry gt validateCvv card Cvv gt Result map fun cvv gt Number number Expiry expiry Cvv cvv Yikes Pretty messy and definitely more confusing than we d like At each stage we have to create a lambda that takes as input the validated values from the previous step validates one more piece of data and then accumulates it all in a tuple until we finally have all of the bits to build the whole CreditCard Our simple validation task has been lost in a sea of lambdas and intermediate tuple objects Imagine the mess if we had even more fields on the CreditCard that required validation What we need is a solution that avoids us having to create so many intermediate objects Applicatives to the rescue Another way to accumulate values is through partial application This allows us to take a function of n arguments and return a function of n arguments For example let s define a function called createCreditCard that works with plain string inputs let createCreditCard number expiry cvv Number number Expiry expiry Cvv cvv We can progressively accumulate the values by applying them to the function let number let numberApplied createCreditCard numbernumberApplied is a function with the signature string gt string gt CreditCard or to name those parameters expiry gt cvv gt CreditCard So we ve been able to store the number for later without having to create an intermediate tuple So let s invent a function called apply that makes use of partial application but for values that are wrapped in some other structure such as Result and put it before each argument like this let validateCreditCard card Result lt CreditCard string gt Ok createCreditCard gt apply validateNumber card Number gt apply validateExpiry card Expiry gt apply validateCvv card Cvv You might be wondering why we need to wrap createCreditCard in Ok That s because this function is going to return Result lt CreditCard string gt therefore apply must return Result This means that in order to chain them together it must also accept a Result as input Therefore we need to just initially lift the createCardFunction up into a Result to kick off the chain with the right type It might seem strange to have a Result of a function but remember that we re going to be using partial application to gradually accumulate the state after each call to apply So really what we re doing here is starting with an empty container that is Ok and progressively filling it with data checking at each step whether the new data is Ok or not As usual we can let the types guide us in writing this function At each stage of the chain what we need to do is take two arguments The first is a Result lt T E gt and the second is a Result lt T gt V E gt We want to try and unwrap both the value of type T and the function of type T gt V and if they re both Ok we can apply the value to the function The type T gt V might look like a function of only one argument but there s nothing to say that V can t be another function itself So whilst this might look like it only works when the function input has a single argument in fact it works for functions of any number of arguments providing that the first argument matches the type of value contained in the Result we wish to apply So apply should have the signature Result lt T E gt gt Result lt T gt V E gt gt Result lt V E gt but we ll see that with just that rather abstract information it s quite straight forward to implement let apply a f match f a with Ok g Ok x gt g x gt Ok Error e Ok gt e gt Error Ok Error e gt e gt Error Error e Error gt e gt ErrorBasically all we can really do is pattern match on both the function f and the argument a and then do the case analysis which gives us four cases to scrutinise In the first case both values are Ok so we simply unwrap them both and apply the value to the function and then repackage in Ok In all of the other cases we have at least one error so we return that The final case is interesting because we have two errors we decide to just keep the first one here Testing it outLet s test the apply function in the FSharp repl to make sure it behaves correctly It will also help us improve our understanding gt Ok createCreditCard gt apply Ok Result lt string string gt gt apply Ok gt apply Ok val it Result lt CreditCard string gt Ok Number Expiry Cvv Looks good if all the inputs are valid then we get a valid CreditCard Let s see what happens when one of the inputs is bad gt Ok createCreditCard gt apply Ok gt apply Ok gt apply Error Invalid CVV val it Result lt CreditCard string gt Error Invalid CVV Excellent just as we d hoped Finally what if we have multiple bad inputs gt Ok createCreditCard gt apply Error Invalid card number gt apply Ok gt apply Error Invalid CVV val it Result lt CreditCard string gt Error Invalid card number Again it s what we d designed for Here it s failed on the first bad input Many of you might rightly be wondering whether this is desirable surely it would be better to return all the errors In the next post we ll see how we can do that You just discovered applicatives The apply function is what makes something applicative Hopefully by seeing the problem that they solve you understand them more deeply and intuitively than by just staring at the type signature of apply and reading about the applicative laws A bit more tidy up If you don t like the fact that you have to wrap the createCreditCard function in Ok then we can get rid of this If you ve ready Grokking Functors then you ll see that map can be defined for Result to make it a functor We know that map takes a function and calls it the contents of the Result if it s Ok So we can actually use this to kick off the chain like so let validateCard card validateNumber card Number gt Result map createCreditCard gt apply validateExpiry card Expiry gt apply validateCvv card Cvv That s a little awkward though because the flow seems to be all mixed up with the createCreditCard function in the middle of the arguments To remedy this it s quite common to define an lt gt infix operator for map which then reads let validateCard card createCreditCard lt gt validateNumber card Number gt apply validateExpiry card Expiry gt apply validateCvv card Cvv Finally it s common to also use lt gt for apply which gives us this let validateCard card createCreditCard lt gt validateNumber card Number lt gt validateExpiry card Expiry lt gt validateCvv card CvvDon t be put off by this if you find it confusing they re just symbols Grokking applicatives is about understanding how apply works and what problems it solves not about this slightly esoteric syntax I only point it out here as it s fairly common to see them used in this way Spotting Applicatives in the wild Any time you find yourself needing to call a function with several arguments but the values you have to hand are wrapped in something like a Result then applicatives are likely to help you solve the problem More types than just Result can be made applicative too all we have to do is define the appropriate apply function for it For example we could define it for option As we hinted at above there might be more than one way to implement such a function too so make sure you ve chosen the one with the semantics you need Test yourself ‍See if you can write apply for the option type The answers are below no peeking until you ve had a go first Option solution let applyOpt a f match f a with Some g Some x gt g x gt Some None None gt NoneThis is just like for Result but because we have no additional information in the None case we can just combine all the patterns that contain at least one None into a single expression that returns None What did we learn ‍By defining an apply function we were able to apply arguments that were wrapped in a Result to a function expecting regular string arguments We saw how doing this allowed us to use partial application as a means of progressively accumulating data and this effectively allowed us to write our code in a very similar style to how we d have written it if we didn t have to deal with invalid inputs 2021-04-09 15:42:57
海外TECH DEV Community You might not need recursion https://dev.to/smeijer/you-might-not-need-recursion-282b You might not need recursionA recursive function repeatedly calls itself until a condition is met that makes it stop Recursive functions are tricky to get right They require a solid exit strategy and will result in an error telling you that the Maximum call stack size exceeded if you mess up Recursion is often used to process tree like structures and sometimes to fetch an unknown number of pages from external paginated APIs In this article I m going to show you an alternative for that recursive function that will improve readability I m going to take the fetch from remote example and will be working with a fetch mock I m won t explain this function in detail but it has the same signature as fetch and returns a result existing of nodes an endCursor and hasMore to tell us if there are more pages available The idea is to fetch more pages as long as hasMore equals true const db Array from length map idx gt id idx async function fetch url body let after JSON parse body after if typeof after undefined after return json async gt const nodes db slice after after const lastNode nodes slice const endCursor lastNode lastNode id null const hasMore lastNode lastNode id lt db length false return nodes endCursor hasMore async function fetchPage after return fetch body JSON stringify after then response gt response json It s okay to directly forget that snippet I m just sharing it so that you have all the code that I m working with and you ll be able to run it in a repl if you want to If you ve worked with APIs before this structure is likely to look familiar Recursive functionHere you ll see the most traditional approach for a recursive function First we fetch a page from the API If there are no more pages indicated by hasMore we return the result and walk back up the tree Otherwise we call fetchAllNodes again Note that this is the same function as we are currently running That s what makes it recursive The function calls itself async function fetchAllNodes after const result await fetchPage after if result hasMore return result nodes recursive call const innerNodes await fetchAllNodes result endCursor return result nodes innerNodes The return statement of this function merges the direct result and the nested result before it returns Note that this is not always directly the final result A function like this walks down the tree before it walks back up the tree Visualized differently the call stack looks something like this fetchAllNodes undefined result nodes id id fetchAllNodes result nodes id id fetchAllNodes result nodes id id fetchAllNodes result nodes id id fetchAllNodes result nodes id id return id id merge results return id id id id merge results return id id id … … id merge results return id id id … … … … id merge results return id id id … … … … … … id You ll see that the fifth call to this function is wrapped by the fourth which is wrapped by the third which is wrapped by the second which is wrapped by the first Now this is a request chain that completes in calls Imagine this when fetching pages from a remote with tens or even hundreds of pages The call stack keeps growing and all variables inside that function stay in memory Not just one page result but all of them Merged as well as individual Garbage collection can only clean up after the final result has been returned and all requests have come to an end Tail call optimizationTail call optimization should be able to reduce the performance hunger of the situation above by optimizing functions that have a function call as a return statement To make use of this optimization we should return the function call instead of the node array To be able to still merge the results we need to adjust the function signature and pass the current result as argument async function fetchAllNodes after nodes const result await fetchPage after const allNodes nodes result nodes if result hasMore return allNodes recursive tail call return fetchAllNodes result endCursor allNodes Even though tail call optimization is part of the ECMAScript specification at the moment of writing Safari is the only browser that has this implemented So which style you prefer is mostly a personal preference at the time being IterativeLike I already mentioned in the title you might not need recursion The functions above can be rewritten to a more simple while loop async function fetchAllNodes const nodes let after while after null const result await fetchPage after nodes push result nodes after result endCursor return nodes It looks so simple and obvious when you see it And yet there are articles that will explain how to fetch recursively Compared to the recursive version the last example has a reduced memory footprint because we don t need to keep track of all frames and in between results This is a single function call in a single frame When you run into more complex scenarios it will be easier to add things like error handling scheduling retries or even to add workers that will do stuff in parallel But maybe even more importantly the loop is way easier to read and understand I m Stephan and I m building rake red If you wish to read more of mine follow me on Twitter or check my work at meijer ws 2021-04-09 15:32:07
海外TECH DEV Community How do you bookmark and take notes? https://dev.to/aahnik/how-do-you-bookmark-and-take-notes-2h45 How do you bookmark and take notes As developers we encounter a huge amount of information every single day GitHub repositories dev to articles Medium articles YouTube videos blog posts on independent websites courses documentation of libraries we are using and the list goes on We need a simple and efficient system to bookmark or save interesting stuff Sometimes we also need to note down things we learned We have all been there Google searching a piece of content that we encountered earlier and not getting that easily as we forgot the specifics Saving everything in a centralized system with proper categorization and tagging can help us find stuff faster There are many ways to do it Like Using the native bookmarking feature of our browsers Platform specific ways like Star on GitHub or Save on dev to or Save to Watch Later on YouTube A GitHub repository can be used to store all the notes as markdown files A bookmark is also a note All notes are organized into topic wise sub folders Using GitHub issues to save the content They are fast to create and also taggable GitHub offers a very efficient search across issues A database in a platform like Notion is a great choice You can use Save to Notion browser extension to save content to it Using a bookmarking software most of which are paid for example raindrop io pocket and so on What system or tools do you use to bookmark and take notes Is it free and open source Did you ever change your technique Are you satisfied with your technique What are the pros and cons of the tool technique you use Please answer these questions in the comments I would love to know how people deal with this thing 2021-04-09 15:31:49
海外TECH DEV Community Debugando Rust no VS Code https://dev.to/rogertorres/debugando-rust-no-vs-code-5ii Debugando Rust no VS CodeVersão em inglês aqui Bem no começo da minha carreira consegui um trampo de desenvolvedor Oracle PL SQL Eu ainda não sei bem o porquê mas a gente não usava qualquer debugger na época Pra corrigir os bugs a guriada adicionava mensagens pelo código tentando isolar o problema Os mais safos fazia algo como uma busca binária criando mensagens a cada linhas ex entre as linhas e descobrindo entre quais linhas estava o problema e então refinavam a busca colocando mensagens a cada linhas ex e assim vai Quando eu deixei de trabalhar com Oracle e passei a trablhar com SAP que tem um debugger fantástico eu descobri um mundo novo Então quando chegou a hora de eu trocar de tecnologia de novo para Rust eu fui imediatamente atormentado pela pergunta eu vou ter debugger lá Essa éa resposta que eu encontrei O que te trouxe aqui debugando Rust no VSCodePrimeiro vocêprecisa de uma extensão Usando Unix Mac Linux Baixe CodeLLDBUsando Windows Baixe C C Por que vocêprecisa disso Resposta curta O compilador do Rust usa LLVM para interagir com a máquina e estas extensões permitem que vocêinteraja com o código que roda nesse nível jáque cêsabe o Rust écompilado Resposta longa Ai vocême complica Dáuma olhada nesse site aqui em inglês Agora no seu VSCode siga esses passos o meu VSCode táem inglês mas acho que étranquilo pra vocêse achar caso o seu esteja em pt brazuca Run gt Start Debugging gt Ok gt YesO resultado esperado éa criação do arquivo vscode launch json que se parece algo com isso Arquivo copiado de um MacOS X version configurations type lldb request launch name Debug unit tests in library yourprogram cargo args test no run lib package yourprogram filter name yourprogram kind lib args cwd workspaceFolder Ou isso se vocêestiver no Windows version configurations name Windows Launch type cppvsdbg request launch program workspaceRoot target debug yourprogram exe args stopAtEntry false cwd workspaceFolder environment console externalTerminal Se por algum motivo os arquivos não forem criados para você podes copiar e colar a pasta vscode fica no mesmo nível da pasta src Além do fato de os exemplos serem de SOs diferentes o primeiro exemplo éde um programa com biblioteca library crate lib jáo segundo écom binário binary crate bin Se vocêtiver os dois no mesmo projeto vocêpoderáter duas ou três entradas em configurations Agora teoricamente vocêserácapaz de adicionar um breakpoint no seu código clicando na coluna da esquerda para criar esse ponto vermelho Se vocênão consegue criar o breakpoint provavelmente éporque vocêestácom essa opção desativada Para resolver isso váem Configurações Settings e selecione Debug no meu caso estádebaixo de Featuresーmas vocêpode digitar breakpoint na barra de busca para encontrá lo rapidamente e habilite a opção Allow Breakpoints Everywhere Permitir Pontos de Parada em Todos os Lugares ou coisa parecida Com os breakpoints acionados aperte F ou Run gt Start Debugging que deve funcionar agora que vocêtem o arquivo O resultado deve ser algo assim Basicamente na esquerda vocêtem os valores carregados na memória As coisas são bem simples enquanto vocêestálidando com tipos como estes inteiros que eu tenho aqui mas podem ficar complicadas se vocêestiver debugando um código com coisas como HashMaps De qualquer forma bem melhor que nada Não funcionou Bom não vai ser a primeira vez que alguém segue um tutorial na internet e não dácerto né Mas comenta aí mesmo se vocêtiver resolvido sozinho porque hágrandes chances de outra pessoa ter um problema similar Ações do DebuggerPra finalizar essas são as ações que o debugger te permite da esquerda pra direita F Continue executa o programa atéele alcançar o próximo breakpoint ou atéo fim se ele não achar nenhum F Step Over Executa o próximo passo sem entrar nele por exemplo se for uma função ele executa toda ela sem entrar nela F Step Into Executa o próximo passo mas ao contrário do F entra no subprocesso Shift F Step out Executa o código atéir para um nível acima por exemplo se estiver numa função ele executa tudo atéchegar no código que chamou a função Shift Cmd Ctrl F Restart Executa tudo do começo Shift F Stop Interrompe a execução E éisso Agora vocêjáémais safo que a guriada do meu primeiro emprego A foto da capa édo Danilo Batista 2021-04-09 15:01:39
Apple AppleInsider - Frontpage News Google cancels Pixel 5a release, according to leaker https://appleinsider.com/articles/21/04/09/google-cancels-pixel-5a-release-according-to-leaker Google cancels Pixel a release according to leakerProlific leaker Jon Prosser claims the Google Pixel a has been axed due to the ongoing chip shortage The Google Pixel a has been canceled by GoogleThe Google Pixel lineup is known for its vanilla Android experience and powerful camera features The Pixel a was going to be a replacement for the Pixel a as a cheaper entry model Read more 2021-04-09 15:51:16
Apple AppleInsider - Frontpage News Apple Music TV launches in UK and Canada https://appleinsider.com/articles/21/04/09/apple-music-tv-launches-in-uk-and-canada Apple Music TV launches in UK and CanadaApple s free hour music video channel has launched in the U K and Canada bringing a curated selection of songs reminiscent of how MTV originally worked Apple Music TV launches in the UK and CanadaFollowing its launch in the U S in October Apple Music TV has now come to both the UK and Canada It s trying to reach both music and video audiences so it pops up across both the Apple Music and Apple TV apps offering the same uninterrupted hour music videos on both Read more 2021-04-09 15:41:37
Apple AppleInsider - Frontpage News P&G worked with Chinese ad agency on bypass of Apple privacy feature https://appleinsider.com/articles/21/04/08/pg-worked-with-chinese-ad-agency-on-bypass-of-apple-privacy-feature P amp G worked with Chinese ad agency on bypass of Apple privacy featureProcter Gamble reportedly worked with the Chinese Advertising Agency to test a new data harvesting tool meant to bypass Apple s imminent App Tracking Transparency privacy feature Credit AppleThe American consumer goods giant was one of several companies testing a data collection tool called CAID The Wall Street Journal reported Thursday Read more 2021-04-09 15:06:54
海外TECH Engadget Amazon seemingly succeeds in blocking Alabama warehouse unionization https://www.engadget.com/amazon-alabama-union-vote-154741754.html bessemer 2021-04-09 15:47:41
海外TECH Engadget Robosen Robotics' Optimus Prime collectible responds to voice commands https://www.engadget.com/robosen-robotics-optimus-prime-collectible-hasbro-153031747.html optimus 2021-04-09 15:30:31
海外TECH Engadget This week's best deals: Over 50 percent off Beats' Solo Pro headphones and more https://www.engadget.com/weekly-tech-deals-beats-solo-pro-headphones-apple-macbook-air-m1-153023771.html This week x s best deals Over percent off Beats x Solo Pro headphones and moreHere s a list of the best tech deals from this week including more than percent off Beats Solo Pro headphones and the lowest price ever on Apple s MacBook Air M 2021-04-09 15:30:23
海外TECH WIRED Despite Union Setback, Amazon Workers Fight for Dignity https://www.wired.com/story/we-are-not-robots-amazon-bessemer-union-result fight 2021-04-09 15:50:59
金融 金融庁ホームページ 審判期日の予定を更新しました。 https://www.fsa.go.jp/policy/kachoukin/06.html 期日 2021-04-09 16:00:00
金融 金融庁ホームページ 株式会社ゆうちょ銀行における新規業務の認可について公表しました。 https://www.fsa.go.jp/news/r2/yuusei/20210409.html 株式会社ゆうちょ銀行 2021-04-09 16:00:00
金融 金融庁ホームページ (株)ディー・エル・イーとの契約締結交渉者従業者による内部者取引等に対する課徴金納付命令の決定について公表しました。 https://www.fsa.go.jp/news/r2/shouken/20210409_1.html 内部者取引 2021-04-09 16:00:00
金融 金融庁ホームページ (株)ディー・エル・イーとの契約締結交渉者従業者からの情報受領者による内部者取引等に対する課徴金納付命令の決定について公表しました。 https://www.fsa.go.jp/news/r2/shouken/20210409_2.html 内部者取引 2021-04-09 16:00:00
金融 金融庁ホームページ ジョルダン(株)株式に係る相場操縦に対する課徴金納付命令の決定について公表しました。 https://www.fsa.go.jp/news/r2/shouken/20210409_5.html 相場操縦 2021-04-09 16:00:00
金融 金融庁ホームページ ユー・エム・シー・エレクトロニクス(株)における有価証券報告書等の虚偽記載に対する課徴金納付命令の決定について公表しました。 https://www.fsa.go.jp/news/r2/shouken/20210409_3.html 有価証券報告書 2021-04-09 16:00:00
金融 金融庁ホームページ 富士ソフトサービスビューロ(株)における有価証券報告書等の虚偽記載に対する課徴金納付命令の決定について公表しました。 https://www.fsa.go.jp/news/r2/shouken/20210409_4.html 富士ソフトサービスビューロ 2021-04-09 16:00:00
金融 金融庁ホームページ ジョルダン(株)株式に係る相場操縦に対する課徴金納付命令の決定について公表しました。 https://www.fsa.go.jp/news/r2/shouken/20210409_6.html 相場操縦 2021-04-09 16:00:00
金融 金融庁ホームページ アイシン精機(株)との契約締結交渉者社員による内部者取引に対する課徴金納付命令の決定について公表しました。 https://www.fsa.go.jp/news/r2/shouken/20210409_7.html 内部者取引 2021-04-09 16:00:00
海外ニュース Japan Times latest articles Anti-disaster prep in Shizuoka lowers megaquake’s projected death toll https://www.japantimes.co.jp/news/2021/04/09/national/anti-disaster-work-sees-shizuoka-cut-projected-nankai-trough-quake-death-toll/ downward 2021-04-10 01:13:25
海外ニュース Japan Times latest articles Long road ahead for Toshiba buyout offer, warns board chairman https://www.japantimes.co.jp/news/2021/04/09/business/corporate-business/toshiba-buyout-osamu-nagayama/ Long road ahead for Toshiba buyout offer warns board chairmanThe statement sent Toshiba shares plunging more than in afternoon trade They had soared as much as when word of the proposal first 2021-04-10 00:47:01
海外ニュース Japan Times latest articles ‘Attack on Titan’ manga series concludes run of almost 12 years https://www.japantimes.co.jp/culture/2021/04/09/entertainment-news/attack-on-titan-manga-ending/ hollywood 2021-04-10 00:31:10
ニュース BBC News - Home Prince Philip has died aged 99, Buckingham Palace announces https://www.bbc.co.uk/news/uk-11437314 british 2021-04-09 15:55:20
ニュース BBC News - Home Prince Philip: World leaders and royals send heartfelt sympathy https://www.bbc.co.uk/news/world-56687736 condolence 2021-04-09 15:51:26
ニュース BBC News - Home Saint Vincent volcano: 'Explosive' Soufrière eruption sparks mass evacuation https://www.bbc.co.uk/news/world-latin-america-56693406 island 2021-04-09 15:52:27
ニュース BBC News - Home Prince Philip: Death of the Duke of Edinburgh announced https://www.bbc.co.uk/news/in-pictures-56692965 floral 2021-04-09 15:05:34
ニュース BBC News - Home Prince Philip: Sporting world pays tribute to Duke of Edinburgh https://www.bbc.co.uk/sport/56692293 philip 2021-04-09 15:24:25
ニュース BBC News - Home Covid vaccine: How many people in the UK have been vaccinated so far? https://www.bbc.co.uk/news/health-55274833 covid 2021-04-09 15:49:57
ニュース BBC News - Home Covid: When can restaurants and pubs reopen and what are the rules? https://www.bbc.co.uk/news/business-52977388 covid 2021-04-09 15:39:04
北海道 北海道新聞 米、国防予算82兆円要求 対中にらみ、1・7%増 https://www.hokkaido-np.co.jp/article/531646/ 米大統領 2021-04-10 00:16:00
北海道 北海道新聞 学術会議の報告書案 見直し消極的と批判 自民PT https://www.hokkaido-np.co.jp/article/531539/ 日本学術会議 2021-04-10 00:05:12
GCP Cloud Blog Creating a SQL Server instance integrated with Active Directory using Google Cloud SQL https://cloud.google.com/blog/topics/developers-practitioners/creating-sql-server-instance-integrated-active-directory-using-google-cloud-sql/ Creating a SQL Server instance integrated with Active Directory using Google Cloud SQLSQL Server instances in Google Cloud SQL now integrate with Microsoft Active Directory AD as a pre GA feature that you can try out for yourself right now This post describes the basic steps required to create a SQL Server instance with this new functionality If you re looking for complete details see the official documentation Create a domain with Managed Service for Microsoft Active DirectoryThe first step is to create a domain with Managed Service for Microsoft AD This can be done easily via the Managed Microsoft Active Directory section in the Google Cloud Console Click the CREATE NEW AD DOMAIN button and enter the following information Specify a Fully Qualified Domain NameExample ad mydomain comSelect a VPC networkExample defaultSpecify a suitable CIDR range for the AD domain Example Select a Region where the AD domain should be locatedExample us centralSpecify an admin name for the AD domain s delegated administratorExample mydomain adminWith all of that information provided it should look something like this Click CREATE DOMAIN to complete the process of creating the AD domain You ll have to be patient for a bit since it can take up minutes for the domain to be available for use Once it is ready it will look like this in the list of domains The final step to configure the AD domain is to set the Delegated admin password Click the domain name in the list of domains to go to its details page On that page click the SET PASSWORD link and make a note of the password which we ll use in a later step of this blog post Create a SQL Server instance with Windows AuthenticationAfter your AD domain is available for use you can start creating SQL Server instances that utilize the AD domain to enable Windows Authentication with AD based identities Go ahead and try out creating a new SQL Server instance by going to the Cloud SQL section of the Google Cloud Console Click the CREATE INSTANCE button Then click Choose SQL Server and enter the following information Specify an Instance IDExample sql server with adEnter a password for the sqlserver user and make a note of this for use in a later step Select a Database version All versions will work with Active Directory I selected  SQL Server Standard Select a Region where the instance should be located It is recommended that you locate the SQL Server instance in the same region as the AD domain for the lowest network latency and the best performance Example us centralSelect whether the instance should be located in a Single zone or Multiple zones For production instances Multiple zones is recommended to achieve high availability which provides automatic failover to another zone within your selected region  Select SHOW CONFIGURATION OPTIONS Click the Connections section to expand it and select both the Private IP and Public IP options  Note if this is the first time creating a Private IP for the Network you select you ll be prompted that a Private service connection is required Click SET UP CONNECTION and select Use an automatically allocated IP range in the Enable Service Networking API dialog that appears  Then click the Continue button to complete the process Back in the instance Configuration Options click the Authentication section to expand it From the dropdown menu for joining a managed Active Directory domain select the domain that you created in the first step of this blog post Cloud SQL will automatically create a Per Product Per Project Service account used for authentication to the instance You will be prompted to grant the service account the managedidentities sqlintegrator IAM role With all of that information provided the create instance form should look something like this Click CREATE INSTANCE to complete the process of creating the instance Once the instance is created you should see the new instance s overview page that should look something like this Well done You now have a SQL Server instance on Google Cloud that you can log into using Windows Authentication with an AD based identity  Connecting to the SQL Server instance using Windows authenticationLet s go ahead and confirm that everything works as expected To do so I ll create a Windows Server VM using Google Compute Engine Using it I can add a new user to the Managed Active Directory give that user access to the SQL Server instance in Cloud SQL and then connect to the SQL Server instance as that user with Windows Authentication Windows Server VM s are easy to create using Google Compute Engine s marketplace Searching for Windows Server in the marketplace returns many options to choose from I ll create a VM using the Secured SQL Server Standard on Windows Server option  After choosing the VM option click the Launch button and you ll be taken to the instance creation page Review the settings of the VM instance to be created especially the Network selection under the Networking section to ensure that the selected Network is a network that is included in your Active Directory domain Then scroll to the bottom of the instance creation page and click the Create button  Once the VM creation process is complete you ll be taken to the instance detail page Click the Set Windows password button to set a password to use for logging into the VM Then use the Remote Desktop Protocol RDP button to login in to the VM Once you are logged into the VM instance you can now join the VM to the Managed Active Directory domain Click the Windows icon on the bottom left of the screen type Control Panel and then press ENTER Navigate to System and Security and then click System Under Computer name domain and workgroup settings click Change settings Then click the Change button in the System Properties dialog box Enter the name of your Managed Active Directory in the Domain input text box and click the OK button A welcome to the domain message should appear that looks something like this Now that we have a Windows Server VM in our Managed Active Directory we can add a User To do so we ll need to install the necessary Remote Server Administration Tools RSAT Open Server Manager and click the Manage menu item and select Add Roles and Features wizard In the wizard advance to the Select features page You can select Features from the sidebar or select Next until you reach it On the Select features page in the Features list expand Remote Server Administration Tools and then expand Role Administration Tools Under Role Administration Tools select AD DS and AD LDS Tools This enables the following features Active Directory module for Windows PowerShellAD LDS Snap Ins and Command Line ToolsActive Directory Administrative CenterAD DS Snap Ins and Command Line ToolsOptional You may also want to enable the following features Group Policy ManagementDNS Server Tools under Role Administration Tools Close the wizard Excellent Now the Windows Server VM is enabled with the tools to add Users to the Managed AD domain Remember the Delegated admin that we specified when we created the AD domain at the beginning of this blog post Well now it s time to use it We ll log out of the Windows Server VM and log back in as the Delegated admin Log out of the Windows VM by clicking the Windows icon at the bottom left of the VM instance screen then clicking the power icon and selecting Disconnect Back on the Google Compute Engine instances page click the RDP button to log back into the Window Server VM but this time do so with the AD domain Delegated admin username and password Once logged in open Server Manager click the Tools menu item and select  Active Directory Users and Computers  In the Active Directory Users and Computers dialog window that appears expand the ad mydomain com item and click the Cloud sub item Then Click the Create a New User in the current container icon to create a new User Enter a First and Last name for the User along with a logon name and click the Next button Enter and confirm a Password for the User then click the Next button again Finally click the Finish button in the confirmation dialog box to create the User Great Now we ve got a new AD domain User But they still need to be granted access to the SQL Server instance on Cloud SQL We can do that with Azure Data Studio Open a browser on the Windows Server VM and go to the Azure Data Studio download page  Click the System Installer link to initiate the download and click the Run button in the download dialog window that appearsAfter the Azure Data Studio installation wizard completes with Launch Azure Data Studio checkbox selected click the Finish button to open the program In the start screen Azure Data Studio click the New Connection link For Server enter the Active Directory FQDN Private value from the Cloud SQL SQL Server instance details page Example  private sql server with ad us central your new project cloudsql ad mydomain comFor Authentication type select SQL Login For the User name enter sqlserver and for Password enter the password for the sqlserver User that you specified when you created the SQL Server instance With all of that information specified the Connection Details should look something like this Click the Connect button to connect to the SQL Server instance Once the connection is made click the New query link and enter the following query CREATE LOGIN ad mydomain com clouduser FROM WINDOWSand click the Run button Wonderful We re completely done with the setup and now it is time for the moment of truth Let s test out connecting to our SQL Server instance as our new AD domain User via Windows Authentication Close the Azure Data Studio Now we ll reopen Azure Data Studio but we ll do so as the new AD domain User Click the Windows icon at the bottom left of the VM instance screen and type Azure Data Studio Right click the Azure Data Studio icon and select Run as a different user Enter the User name and Password for the AD domain User in the dialog box that appears On the Azure Data Studio start page click the New Connection link   For Server enter the Active Directory FQDN Private value from the Cloud SQL SQL Server instance details page Example  private sql server with ad us central your new project cloudsql ad mydomain comFor Authentication type select Windows Authentication Click the Connect button and smile because your SQL Server on Cloud SQL is now integrated with Managed Active Directory Getting startedWindows Authentication for Cloud SQL for SQL Server is available in preview for all customers today   Learn more and get started 2021-04-09 15:57: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件)