投稿時間:2021-11-29 19:45:29 RSSフィード2021-11-29 19:00 分まとめ(50件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT 気になる、記になる… Parallels、「Parallels Desktop for Mac 17」を20%オフで販売するサイバーマンデーセールを開催中 https://taisy0.com/2021/11/29/149120.html parallels 2021-11-29 09:33:54
TECH Engadget Japanese テスラ モデルY、AMD Ryzen搭載を一部中国モデルで確認 https://japanese.engadget.com/tesla-model-y-amd-ryzen-093010284.html amdryzen 2021-11-29 09:30:10
TECH Engadget Japanese カザフスタン、中国から暗号通貨マイナー流入で電力不足に。発電所3か所が緊急停止 https://japanese.engadget.com/crypto-mining-causes-power-shortage-in-kazakhstan-090014352.html 暗号通貨 2021-11-29 09:00:14
IT ITmedia 総合記事一覧 [ITmedia ビジネスオンライン] マルハニチロも値上げ 冷凍食品の価格改定相次ぐ https://www.itmedia.co.jp/business/articles/2111/29/news177.html itmedia 2021-11-29 18:20:00
IT ITmedia 総合記事一覧 [ITmedia ビジネスオンライン] ファミマの「SPAMむすび」、販売累計1000万個を突破 期間限定でツナマヨ増量 https://www.itmedia.co.jp/business/articles/2111/29/news166.html itmedia 2021-11-29 18:16:00
IT ITmedia 総合記事一覧 [ITmedia ビジネスオンライン] 生まれ変わったらやってみたい職業 Z世代は「YouTuber」、バブル世代は? https://www.itmedia.co.jp/business/articles/2111/29/news168.html itmedia 2021-11-29 18:08:00
AWS AWS Japan Blog re:Invent 2021: AWS コンテナトラック https://aws.amazon.com/jp/blogs/news/reinvent-2021-aws-containers-track/ まだreInventへ登録していない場合は、今すぐバーチャル参加者としてプラットフォームに登録し、すべてのアジェンダを確認してお気に入りのセッションをカレンダーに追加してください。 2021-11-29 09:51:47
js JavaScriptタグが付けられた新着投稿 - Qiita 【javascript】Async, Await https://qiita.com/Quest_love33/items/daa64d1f3650429216a8 使用しないとエラーになる。 2021-11-29 18:37:47
js JavaScriptタグが付けられた新着投稿 - Qiita 【javascript】Macrotasks, Microtasks https://qiita.com/Quest_love33/items/e541beb6a6c923ccc179 コールスタックマイクロタスクマクロタスクcontextjobtaskjobtaskマイクロタスクを全て実行コールスタックマイクロタスクマクロタスクcontexttasktaskその後マクロタスクを一つ実行コールスタックマイクロタスクマクロタスクcontexttaskマイクロタスクが追加された場合コールスタックマイクロタスクマクロタスクcontextjobtaskマイクロタスクが実行されコールスタックマイクロタスクマクロタスクcontexttaskまたマクロタスクが一つタスクを実行される。 2021-11-29 18:12:04
js JavaScriptタグが付けられた新着投稿 - Qiita Webの勉強はじめてみた その5 https://qiita.com/mybrother_jake/items/3f0655f91ca7caf117ee 今日やったこと比較演算子論理演算子気付いたこと比較演算子とと曖昧さをとにかく排除するならやを使うのがいい。 2021-11-29 18:08:12
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) GASで文字色を参照した処理を行いたい https://teratail.com/questions/371512?rss=all GASで文字色を参照した処理を行いたい前提・実現したいこと縦書きカレンダー調のスプレッドシートでスケジュール管理をし、例えば赤色の背景色は出張、青色は商談といったカテゴリー分けをしています。 2021-11-29 19:00:04
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) LaravelとStripeで顧客が自由にポイント額を設定して購入する決済機能の実装と運用 https://teratail.com/questions/371511?rss=all LaravelとStripeで顧客が自由にポイント額を設定して購入する決済機能の実装と運用前提・実現したいことLaravelとStripeを使って決済機能を実装したいと考えております。 2021-11-29 18:52:35
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) ExpressからMongoDB Atlasへの接続時にエラー https://teratail.com/questions/371510?rss=all ExpressからMongoDBAtlasへの接続時にエラー【現象】Nodejsexpress使用アプリケーションからMongoDBnbspAtlasに構築したDBとデータのやりとりをしたいのですが、接続する箇所で以下のエラーが発生します。 2021-11-29 18:49:58
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) GQLでCSVを引数にする場合の型定義について https://teratail.com/questions/371509?rss=all 確認 2021-11-29 18:36:25
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) php ボタンが押されたかどうか判定する https://teratail.com/questions/371508?rss=all 2021-11-29 18:14:56
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) unityでファイルが開けない https://teratail.com/questions/371507?rss=all unity 2021-11-29 18:13:30
AWS AWSタグが付けられた新着投稿 - Qiita [AWS] AWS Single Sign-On で Organizations 管理外の AWS アカウントにアクセスする https://qiita.com/wokamoto/items/8f078f14201b772edc15 SSOされる側のAWSアカウントSSOされる側のAWSアカウントでは、IAMでIdentityProvidorを追加し、それに割り当てるIAMロールを作成します。 2021-11-29 18:10:31
技術ブログ Mercari Engineering Blog Kubernetes Casual Talk 〜Ubie、CA、メルペイ各社の開発における工夫〜 を開催しました! #kubernetes_casualtalk https://engineering.mercari.com/blog/entry/20211125-1f0c397b0a/ hellip 2021-11-29 10:00:01
海外TECH DEV Community C# conversions: Implicit VS Explicit https://dev.to/dotnetsafer/c-conversions-implicit-vs-explicit-41g4 C conversions Implicit VS ExplicitAfter many years programming in NET you may have already realized that the framework allows us in a very simple way to make conversions between different types of data Conversions can be of types Implicit ConversionsExplicit ConversionsImplicit conversions are for which it is not necessary to indicate the conversion in parentheses … double variable In the code we assign a variable of type double a value of type int But the compiler doesn t tell us anything and lets us continue working as if nothing had happened This is known as an implicit conversion Instead if we do the following int variable The compiler will give us an error indicating that an implicit conversion from double to int cannot be done and tells us to use an explicit conversionThere is no mystery about it simply this problem can be fixed by putting int in front of int variable int Placing the type of data to which we want to convert it in parentheses is called explicit conversion What this means is that with this syntax we are explicitly indicating to the compiler that we want to convert one type of data into a different one At this point you could perfectly tell me that this would also work double variable double Apparently it does the same as if we don t put double in front of it So…where is the difference The only difference between implicit and explicit conversions has to do with whether or not there is a risk of that information being lost If we go to the first case without parentheses it is an implicit conversion The value of the litetal int does not matter as if we write double since there will be no risk of losing the information as it is a type of greater capacity On the contrary if we go to the second case we are forced to do an explicit conversion This works because a double object can contain values ​​that a smaller capacity int type cannot represent Let s take an example int variable int An integer type cannot contain decimals so it will truncate to thus losing information How we can create our own conversionsUsually the conversions of the Framework are more than enough for the needs that arise However there may be many cases where it would be more useful to define our own implicit and explicit conversions The NET platform provides us with an easy way to do it To create a conversion between two types we simply have to write the corresponding operator either implicit or explicit We are going to create an imaginary scenario in which we have to manage the temperatures so that the degrees can change between Celsius and Fahrenheit Let s create the code class Temperature public float Degrees get set class Celsius Temperature public Celsius float temp Grados temp class Fahrenheit Temperature public Fahrenheit float temp Grados temp Now with this code we have the possibility of writing methods so that we do the conversion between them and which we call each time class Temperature public float Degrees get set public Celsius ToCelsius return new Celsius f f this Degrees public Fahrenheit ToFahrenheit return new Fahrenheit f f this Degrees Celsius cel new Celsius Fahrenheit far cel ToFahrenheit Celsius cel far ToCelsius This works but we will have to call the corresponding method each time and this makes the code very messy If we want to do an implicit conversion we simply have to define a static operator with the static implicit operator We go back to our example class Temperature public float Degrees get set class Celsius Temperature public Celsius float temp Grados temp public static implicit operator Fahrenheit Celsius c return new Fahrenheit f f c Degrees class Fahrenheit Temperature public Fahrenheit float temp Grados temp public static implicit operator Celsius Fahrenheit fahr return new Celsius f f fahr Degrees Celsius cel new Celsius Fahrenheit far cel Celsius cel far We can see that to each class we add an implicit conversion operator for the other related class and after that we just implicitly perform the conversions What we gain from this is a much cleaner code that meets the conditions for implicit conversions If we want to do it differently…Let s imagine that we have an application that has to manage the teachers and students of a school Let s see it better public class Person public string Name get set public class Pupil Person public string Class get set public List lt int gt IdsCourse get set public class Teacher Person public string Class get set public int IdContract get set If at some point a student becomes a teacher or vice versa we will need to use a conversion to reuse the data As in this case we are going to lose information since the different classes do not handle the same information Therefore the conversion will have to be explicit public class Person public string Name get set public class Pupil Person public string Class get set public List lt int gt IdsCourse get set public static explicit operator Teacher Pupil alum return new Teacher Name alum Name Class alum Class IdContract public class Teacher Person public string Class get set public int IdContract get set public static explicit operator Pupil Teacher prof return new Pupil Name prof Name Class prof Class IdsCourse new List lt int gt Teacher teacher new Teacher Name Juan Class Programming IdContract Pupil student Pupil teacher Teacher teacher Teacher student Conclution Marking a conversion as implicit or explicit must strictly meet the criteria of whether there is a risk of information loss It may be the case that today you consider the loss of information that occurs to be negligible but that at some point it is not If you have marked the conversion as implicit anyone who uses it directly assumes that there is no information loss If there is later and the failure is in that conversion it can be a big headache even more so if the code is part of a library and the person who uses it cannot see the code so always think about it before defining the conversion 2021-11-29 09:19:59
海外TECH DEV Community Text Generation with Markov Chains in JavaScript https://dev.to/bespoyasov/text-generation-with-markov-chains-in-javascript-i38 Text Generation with Markov Chains in JavaScriptLet s do something fun today I once came across a discussion on Russian Twitter about how to generate a nice human readable login From university I remember that it s possible to use Markov chains to generate such a text I wasn t working with Markov chains at the time So I was curious to implement them from scratch and see what kind of text they could generate In this post we will implement a text generator using Markov chains and feed it with different sets of texts to see what texts it will generate and whether it will consider “author s style In addition to the text we will try to generate code with this tool This “code generator will be completely useless but I still haven t got access to GitHub Copilot so at least I ll have some generator As a result we will have an app that generates texts like this Hello world Wish me luck It has a post about the codebase This will be my first place we are skyrocketing In our case to guarantee random method existence we can use autosuggestions to select a field to test against business expectations This helps us to avoid unwanted and unnecessary components re renders I ll leave the links to the app and the source code right here Text Generator AppSource on GitHubThese links will also be at the end of this post And now let s start creating the application Markov ChainsWithout going into mathematical details a Markov chain is a sequence of events in which the occurrence of each event depends only on the previous event and doesn t depend on any other events Because of this property the chain has “no memory It “doesn t remember what happened before the current moment which determines what happens next Because of this lack of memory a Markov chain can produce a syntactically correct and yet almost meaningless text Text GenerationA chain is a sequence of events In text generation the event is the next token in a sentenceーa word or punctuation mark For example if we represent this sentence as a chain have an idea have ikea We get a sequence like this START →have →idea →have →ikea → →ENDBesides the words we take punctuation marks into account because they contain information about sentence structure and syntax For example a period most often means the end of one sentence and the beginning of another We ll see how to use this later but for now let s take a closer look at the structure of the chain Chain Structure and Transition Probabilities DistributionIn a sequence START →have →idea →have →ikea → →END There are some events that occur more often than others For example the word “have occurs twice while the others occur only once We can make recurring events more noticeable if we represent the chain as a graph with events as vertices and transitions between them as edges We assume that the transitions from “have to “idea and “ikea are equally likely That is half the time we will see “idea and the other half will see “ikea If the events probabilities are different the chain will behave differently For example when the probability of going from “have to “idea is relatively higher such looped chains will appear more often START →have →idea →have →idea →have →idea →have →ikea → →ENDWhat exactly affects the probability of a next event we ll see a little later Transition MatrixThe transition graph is convenient to read well relatively for people But to use it in a text generation algorithm we need its code representation Such a representation could be a transition matrix It s convenient to think of it as a table with rows listing initial states and columns listing next states In the cells there are probabilities of transitions from the initial state to the next one We can represent the transition graph of our chain as a table STARThaveideaikea ENDSTARThaveideaikea Here with we describe impossible transitions which never happen and with ーones which are guaranteed to happen Such a representation is already more convenient to convert for example into a two dimensional array But we can write this matrix even more compactly Most of the table is zerosーimpossible transitions Since they are impossible we can skip them and reduce the table to columns EventPossible next eventsSTART→havehave→idea →ikeaidea→haveikea→ →ENDNow we store only the original event and a list of possible next events We can turn such a table into an object where the key is the first column the original event and the value is the second column the list of next events We will use this representation of the transition matrix later on when implementing the generator Events From Multiple TokensThe transition matrix from the example above works but it won t be enough to generate syntactically correct text A single token event contains too little information about its environment and location We want to generate sequences that are more likely to appear in the real text In that case events need to know at least roughly their context We don t have to “remember everything it s enough to just “know a bit of the context of each particular token We can do this by using more than one token as a key For example with a key of tokens the chain from will break down into this transition matrix token keyPossible next eventsSTART →have→ideahave →idea→haveidea →have→ikeahave →ikea→ ikea → →END →ENDWith a key of tokens token keyPossible next eventsSTART →have →idea→havehave →idea →have→ikeaidea →have →ikea→ have →ikea → →ENDikea → →END And so on The data structure and generation algorithm will be the same but we will capture more information about the environment of each particular token Long keys have fewer possible next events For example in the last table we basically have no options other than to generate the original sentence But if there are many source tokens this will allow the text to be generated in whole “phrases rather than “words This will make it seem more real Source TextWe have considered the case where a chain is generated from already existing tokens A real generator would need to get those tokens from somewhere We will “get them from the source text the corpus which will be the argument of our generator We will tokenize this source text break it down into words punctuation and spaces These tokens will make a transition matrix and the generator will use this matrix Naive Generator ImplementationTo begin with we will “forget about long keys and focus on working with token keys This will let us understand the principle of how the chain works and learn how to generate simpler texts Then we will generalize the algorithm and be able to generate text similar to real sentences Parsing and Tokenizing TextLet s take the first few paragraphs of Bulgakov s “The Master and Margarita as a corpus Then let s divide this text into tokens that we will work with When tokenizing we need to consider a few things we need to treat line breaks as separate tokens for the generator to break the text into paragraphs we need to keep punctuation marks and spaces to structure sentences more accurately and we won t normalize the text to avoid bothering with capital letters at the beginning of sentences and proper nouns we ll use the words spelling as they occur in the text Whether to count spaces as tokens or not is an implementation issue I ve tried to exclude spaces when tokenizing and haven t seen much quality difference but the code got more complicated In this post I decided not to overcomplicate the example and treat spaces as tokens just like words and punctuation marks With all this in mind let s start writing the tokenizer First let s replace line breaks with something else so we can distinguish them from other whitespace characters I suggest the paragraph sign “§ We can quickly find it in the generated text and replace it with the line break Besides if we find such a character in the source text too we won t lose anything by replacing it with a line break tokenizer jsconst NEWLINE PLACEHOLDER § const newlinesRegex n s g export function tokenize text return text replaceAll newlinesRegex NEWLINE PLACEHOLDER To divide the text into tokens considering the punctuation and spaces we ll use a regular expression Let s use this one as the basis and extend it a bit tokenizer jsconst punctuation amp ー lt gt split join const ellipsis const words a zA Zа яА ЯёЁ const compounds words words const tokenizeRegex new RegExp ellipsis compounds words punctuation First of all we create “internals of the expression Those are responsible for different groups of tokens punctuation compound words simple words etc Then we combine them into a Capturing Group where we list what we want to find in the text The Capturing Group string is used then as a source for the RegExp constructor If you want to know how exactly this regular expression works I suggest you try it in regex It visualizes groups and highlights the found characters in the text I use it wherever I have to use regular expressions To divide the text into tokens let s use the split method tokenizer js export function tokenize text return text replaceAll newlinesRegex NEWLINE PLACEHOLDER split tokenizeRegex Now the tokenize function returns an array of tokens found in the text Among them there may be empty lines because some punctuation marks are typed without a space before them For example notice the period and commas in this sentence § At the sunset hour of one warm spring day two men were to be seen at Patriarch s Ponds We don t need empty strings so we filter them out Let s add a function called exists which will return false if it receives a falsy value as input tokenizer js function exists entity return entity And use it to filter the array of tokens tokenizer js export function tokenize text return text replaceAll newlinesRegex NEWLINE PLACEHOLDER split tokenizeRegex filter exists Slicing Corpus Into SamplesTo make a transition matrix we will divide the whole corpus into an array of samples By a sample we will mean the “eventーtransition combination in the transition matrix For example if we want to use a transition matrix with token keys EventTransitionSTART→havehave→idea →ikeaidea→haveikea→ →END Then the samples will be pairs of “START have “have idea “have ikea “idea have etc In a matrix with longer keys the samples will be larger For example in a matrix with token keys token keyTransitionSTART →have→ideahave →idea→haveidea →have→ikeahave →ikea→ ikea → →END →END Samples will be of size “START have idea “have idea have “idea have ikea etc The sample size is always equal to the sum of the number of tokens in the key and the number of tokens in the transition Since the transition has always token Sample size Number of tokens in the key For a naive implementation the sample size will be Let s write the sliceCorpus function which divides an array of tokens into such samples generator jsfunction sliceCorpus corpus const sampleSize return corpus map index gt corpus slice index index sampleSize filter group gt group length sampleSize This function will take an array of tokens as an argument It will return an array of arrays with sampleSize elements In the sub arrays the first elements will be keys and the last elements will be transitions § At At the the sunset sunset hour hour of of one one warm warm spring spring day day two two men men were were to to be be seen seen at at Patriarch Patriarch s s Ponds Ponds § At length ↑Key ↑Transition ↑Sample SizeNow we will use these samples to create the transition matrix Creating Transition MatrixThe easiest way to represent a transition matrix in the code is in the form of an object where the key is the current event and the value is a list of all possible next events We have already seen such an object before To create such an object we will run through all samples take out keys and transitions and for each key collect a list of all encountered transitions generator jsfunction collectTransitions samples return samples reduce transitions sample gt Split the sample into the current state and the transition state const state next sample If the current state doesn t have a list of possible transitions we create it After we add a new transition into the list transitions state transitions state transitions state push next return transitions There may be repetitions in the list of transitions The more often a token appears in this list the more often it will be selected during generation This way we make transitions not equally likely but make them “consider the source text The more often the word is used the more often it will appear in the generated textーwe re kinda “catching the author s style Predicting WordsNow let s write a function that will select the next token based on the current state of the chain The predictNext function will take a chain and a transition matrix The chain will be an array of previously generated tokens The function will take the last token search for it in the matrix for a list of possible transitions and then randomly choose one of those transitions generator jsfunction predictNext chain transitions const lastState chain at const nextWords transitions lastState return pickRandom nextWords We will write a couple of utilities for random selection The function random will return a random integer within a specified range and pickRandom will return an element from an array with a random index generator jsconst random min max gt Math floor Math random max min min const pickRandom list gt list random list length The easiest way to check the function is to pass it an array with the most frequent character in the textーspace generator jsconst samples sliceCorpus tokenize text const transitions collectTransitions samples predictNext transitions The function will return randomly selected words that came after a space in the source text Now we need to store the chain itself somewhere and make it possible to add a newly generated token to the chain Wrapping Generator in GeneratorTo generate a chain we will use a special type of functionーgenerator Such functions know how to pause their execution until they are called again We ll use them because we may not know the size of the chain we need to generate The generator will endlessly create a new token for each call increasing the chain We will store the chain itself in the closure of the generator function so that we won t need to care about global variables and the state Let s create a generator function named generateChain Note the asterisk after the word function this is how the generator is noted generator jsfunction generateChain startText transitions const chain createChain startText transitions while true const state predictNext chain transitions yield state chain push state In this function we create an infinite loop in which we generate a new token for the chain returning it as the result of the iteration In the end we add that token to the chain so that the next word will be generated based on it Also we create the chain before the loop with the createChain function This function creates a chain from the text passed to it If nothing is passed it selects a random token from the transition matrix and makes it the start of the chain generator jsfunction createChain startText transitions const head startText pickRandom Object keys transitions return tokenize head Now when we call the generateChain function we get an object with the next method that returns a generated word const startText const transitions collectTransitions sliceCorpus tokenize text const generator generateChain startText transitions console log generator next value the done false We can call the next method time after time and the chain will continue growing and each call will result in a new token const generator generateChain startText transitions console log generator next value console log generator next value console log generator next value the myth Next we will write a wrapper function called generate which will generate a text of wordsCount length The function will accept an object with settings and source data Internally it will tokenize the source text split it into samples and create a transition matrix Then it will create a chain generator and call it as many times as specified in the settings We will write the result of generation to an array which we will then glue together using the textify function to get the text generator jsexport function generate source start null wordsCount const corpus tokenize String source const samples sliceCorpus corpus const transitions collectTransitions samples const generator generateChain start transitions const generatedTokens for let i i lt wordsCount i generatedTokens push generator next value return textify generatedTokens The textify function will join the tokens together and replace paragraph marks with line breaks tokenizer jsconst PARAGRAPH CHARACTER n n export function textify tokens return tokens join replaceAll NEWLINE PLACEHOLDER PARAGRAPH CHARACTER We will call the generator like this generate source text wordsCount As a result we will get a text somewhat like the subject he was all the request seemed to a long anti religious poem in a later this poem in front of the chequered figure in May which affected Berlioz alone alone was saying was so powerfulThis of course doesn t sound like a real text at all There are two reasons for this we used so little information about the context of the sentence the original text was probably too short Let s try to fix both problems Making Text More NaturalTo make the generated text look more like the real one we will increase the sample size and select a bigger corpus Implementing Dynamic Sample SizeIn our naive implementation we used the sample size of tokens The first token was a key and the second was a transition event This time we will make the sample size customizable so that users can decide for themselves what size would be best for them We can t predict the optimal sample size because it depends on the size of the corpus The bigger the corpus the more word combinations there are the longer sample we can use for the generation First we ll update the sliceCorpus function It will now start to take sample size as an argument generator jsfunction sliceCorpus corpus sampleSize return corpus map index gt corpus slice index index sampleSize filter group gt group length sampleSize Next we update the collectTransitions function which creates the transition matrix There we will generalize the search for key tokens and a transition token generator jsfunction collectTransitions samples return samples reduce transitions sample gt Split the sample into key tokens and the transition token const lastIndex sample length const lastToken sample lastIndex const restTokens sample slice lastIndex The first tokens constitute the key which we will use to get the list of potential transitions const state fromTokens restTokens const next lastToken And later it s all like we did earlier transitions state transitions state transitions state push next return transitions The fromTokens function “glues several tokens together to get a key generator jsconst escapeString token gt token const fromTokens tokens gt escapeString tokens join The escapeString function is a naive escaping It is needed so that we don t have problems with object properties that already exist For example so that we don t try to get the transitions constructor property We won t use Map and an array keys because Map compares keys using the SameValueZero algorithm In the case of arrays to get the value we have to pass the same array Different arrays are considered different keys even if they have exactly the same content This wouldn t be as convenient as referring to an escaped key Next let s update the predictNext function to be able to handle the new structure of the transition matrix It will also take the sample size as an argument It will use it to extract the right number of tokens to make the key generator jsfunction predictNext chain transitions sampleSize const lastState fromTokens chain slice sampleSize const nextWords transitions lastState return pickRandom nextWords Let s also update the signature of the generator itself so you can specify the sample size in the parameters generator jsfunction generateChain startText transitions sampleSize const chain createChain startText transitions while true const state predictNext chain transitions sampleSize yield state if state chain push state Now we ll add a condition that if no transition is found at some iteration we remove the last token from the chain generator jsfunction generateChain startText transitions sampleSize const chain createChain startText transitions while true const state predictNext chain transitions sampleSize yield state if state chain push state else chain pop This is necessary because when the sample size is big the generator may create combinations that weren t in the text At this point we must either stop the generation or “rollback such a combination We will use the second option Now let s try to generate a text with a sample size of The other a broad shouldered young man with curly reddish hair and a check cap pushed back to the nape of his magazine Ivan Nikolayich had written this poem in record time but unfortunately the editor had commissioned the poet to write a long anti religious poem for one of the strangest appearance On his small head was a jockey cap and he wore a short check bum freezer made of air The man was seven feet tall but narrow in the shoulders incredibly thin andIt got better The chain now starts to generate more “meaningful sentences and it also “learned the rules of punctuation At least now it uses commas and writes the people s names correctly Selecting Source TextIn addition to improving the chain settings we can make the corpus bigger Generating Bulgakov is interesting and all but we can do something funnier I decided to feed the chain all of my tweets and blog posts and see if I can stop blogging on my own what would happen Using New CorpusFor this post I prepared several sets of texts In the first one I collected all my tweets in the second oneーall the blog posts and in the third oneーcode from my projects on GitHub Later I ll show you how you can download the archive with your tweets too and generate a “new tweet I ll also leave the link to the generator right here in case you want to play with it Generating TweetsTo download all my tweets I opened a special page where I could request the data archive I found the data tweet js file in the archive and pulled the text of all my tweets from it I wrote a script to exclude links retweets and automatic messages from IFTTT I got something like const onlyText tweet full text gt full text const onlyAuthored tweet full text gt full text includes RT const removeHandles text gt text replaceAll a zA Z g const removeTwitterLinks text gt text replaceAll https t co a zA Z g const clean tweets filter onlyAuthored map onlyText map removeHandles map removeTwitterLinks map s gt s trim I m not sure if by the time you read this article the format of the archive will still be the same This code might not work sorry I found out that a sample of tokens is the best for generating “my tweets With that settings the chain generates these ahem thoughts Hello world Wish me luck It has a post about the codebase This will be my first place we are skyrocketing I prefer the Game of folder structure Got a cup of Life Generating Blog PostsAfter tweets I decided to feed the generator with the texts from my blog I found out that for the blog the generator needs a sample of tokens to generate something more or less sane For example here is a post about what files are Or here s a note about software design Something about objects and testing It s funny that sometimes chain produces the Markdown text with basic formatting like headings quotes or lists It s not GPT or GPT of course but in general for some random text for a landing page design mockup it s quite good Generating Code After generating text I thought why not try to generate code with this thing I wondered if it could write something at least syntactically correct At first I thought it was hopeless because of this let currentTime falsethis fieldSize isFromRub centralNodes gt createAgent i this data scrollbar button const renderBackBtn useSelector selectCourse onPointerDown e http closest gt el lastPageX gt But it turned out that on larger sample sizes it can handle it Well for example with a token sample it produced import defaultDatetime from sortWith function comparableTagValue tag TagKind FilterFunction lt Metadata gt return lt Link href slug gt lt a className text color gt value lt a gt lt Link gt export default class MyApp extends App lt MyAppInitialProps gt appModel Instance lt typeof ThemeModel gt If we ignore the undeclared variables the code can be compiled Or here with sample size export type Alphabet string export function correctTimeZoneDependentDates state StorableState shift TimeZoneShift StorableState const lastRecalcDateTime getTodayStartTime const callAdapters useStateDependentAdapters const since budget startDate const daysPassed daysBetween getTodayStartTime lastRecalcDateTime return daysPassed gt The rule of hooks is broken Too bad At size it starts declaring complex interfaces and types interface Settings event AnalyticsEventName params AnalyticsEventParameters type Line start Point end Point type ObsoleteHistory List lt ObsoleteRecord gt type ActualHistory HistoryLog function convertRecordKind type ObsoleteRecordKind RecordEntryKind switch type case KeyboardSymbolKind Number case KeyboardSymbolKind Comma return shapeSymbol type For brevity I m omitting piles of imports For what it s worth the generator likes to import unnecessary stuff the most Another example export enum CompareResult AThenB BThenA Equal export type CompareFunction lt TComparable gt a TComparable b TComparable gt CompareResult export function isEmpty lt TCollection extends AnyCollection gt collection TCollection CollectionSize if isCollection collection throw new Error Failed to sort by missing datetime field return Date parse datetime With the size of the result is already too much like the original code I would describe the result as Well have you seen movies where hackers sit around and type some code without thinking This seems to be the right one for these movies ImplementationsI wouldn t write this myself for production of course There are some implementations here are a couple for Python and JavaScript markovifyjs markovBut I wanted to “feel it and build it with my hands to really understand how it worked I wanted to know the problem that those libraries were solving and wanted to know how they did it in principle what obstacles they met Usage of Markov ChainsText generation is not the only application of Markov chains They can be used in various random processes modeling for speech recognition modeling the spread of infections calculations in statistical mechanics and even economics music and games But there of course it s more complicated than I showed in this post References and SourcesAs usual I compiled a list of useful links at the end of the post In addition to mathematics libraries and implementations in other languages I also left links to the application itself the sources on GitHub and a Twitter page where you can request a tweet archive Browser Text GeneratorSource on GitHubRequest a tweet archiveShare your generated “tweets on social networks Markov ChainsMarkov Chains on WikipediaApplications for Markov ChainsStochastic processGraph mathematicsTransition matrix Text Tokenization and GenerationRegExHow do you split a javascript string by spaces and punctuation GPT amp GPT Implementations and LibrariesFrom “What is a Markov Model to “Here is how Markov Models Work markovify Pythonjs markov JavaScript JavaScript StuffGenerators amp Generator functionsClosures 2021-11-29 09:19:20
海外TECH DEV Community Amazon launches AWS RoboRunner to support robotics apps & much more https://dev.to/cloudtech/amazon-launches-aws-roborunner-to-support-robotics-apps-much-more-50li Amazon launches AWS RoboRunner to support robotics apps amp much moreAt a keynote during its Amazon Web Services AWS re Invent conference today Amazon launched AWS IoT RoboRunner a new robotics service designed to make it easier for enterprises to build and deploy apps that enable fleets of robots to work together Alongside IoT RoboRunner Amazon announced the AWS Robotics Startup Accelerator an incubator program in collaboration with nonprofit MassRobotics to tackle challenges in automation robotics and industrial internet of things IoT technologies As pandemics drive digital transformation enterprises are accelerating the adoption of robotics and more broadly automation recently report Automation World companies have found that most of the companies that have adopted robotics over the past year have adopted it to reduce labor costs increase capacity and overcome the shortage of available workers According to the same survey of companies now consider robots in assembly and manufacturing facilities to be an integral part of their day to day operations Amazon ーa large investor in robotics itself ーwasn t shy about its intention to win most of the robotics software market is expected It is worth more than billion by In the company announced AWS RoboMaker A product that assists developers in deploying robot applications with AI and machine learning capabilities And Amazon earlier this year Rolled out SageMaker Reinforcement learning Kubeflow components a toolkit that supports RoboMaker services for tuning robotics workflows IoT RoboRunnerCurrently previewing IoT RoboRunner is built on technology already used in Amazon Warehouse for robotics management This allows AWS customers to connect robots to existing automation software and combine each type of data to coordinate the work of the entire operation Fleet robot Standardize data types such as facilities locations and robot task data in the central repository the goal of IoT RoboRunner is to simplify the process of building a robot group management app As companies become more and more dependent on robotics to automate their operations they are choosing different types of robots making it more difficult to organize robots efficiently Each robot vendor and work management system has its own often incompatible control software data formats and data repositories Also as new robots are added to the fleet they will need to be programmed to connect the control software to the workflow management system and program the logic of the management app Developers can use IoT RoboRunner to access the data needed to build robot management apps and leverage pre built software libraries to create apps for tasks such as work assignments In addition to this you can use IoT RoboRunner to deliver metrics and KPIs to the management dashboard via the API With AWS IoT RoboRunner robot developers no longer have to manage their robots in silos and centralized management can more effectively automate tasks across the facility AWS IoT RoboRunner lets you connect your robots and work management systems thereby enabling you to orchestrate work across your operation through a single system view AWS Robotics Startup Accelerator Amazon also announced the Robotics Startup Accelerator The company says it will foster robotics by providing resources to develop prototype test and commercialize products and services The AWS Robotics Startup Accelerator delivered by MassRobotics aims to help robotics startups adopt and use AWS to boost their robotics development as well as get hands on support from industry and AWS experts to rapidly scale their business As the trend towards automation continues robotics start ups especially industrial robotics are attracting the attention of venture capitalists From March to March venture companies invested billion in robotics companies an increase of about from March to March according to To the data from PitchBook In the long run investment in robotics has more than quintupled over the past five years rising from billion in to billion in The accelerator is a four week technical business and mentorship opportunity open to robotics hardware and software startups from around the globe Startups accepted into the four week program will consult with AWS and MassRobotics industry experts on business models and with AWS robotics experts for help overcoming technological blockers Program benefits for startups include hands on training about AWS solutions for robotics and up to in promotional credits for use of AWS IoT Robotics and ML services to help guide them forward Participants will gain additional knowledge through mentoring from robotics domain experts and technical subject matter experts To get ready for life after the accelerator startups will also get business development and investment guidance from MassRobotics and co marketing opportunities with AWS via blogs and case studies Startups interested in applying to be part of the program can learn more here Applications close on Sunday January Let me know your thoughts in the comment section about the new aws services and accelerator program And if you haven t yet make sure to follow me on below handles connect with me on LinkedInconnect with me on Twitter‍follow me on github️Do Checkout my blogs Like share and follow me for more content ltag user id follow action button background color important color fac important border color important Adit ModiFollow Cloud Engineer AWS Community Builder x AWS Certified x Azure Certified Author of Cloud Tech DailyDevOps amp BigDataJournal DEV moderator ‍Join our Cloud Tech Slack CommunityFollow us on Linkedin Twitter for latest news Take a Look at our Github Repos to know more about our projects ️Our Website 2021-11-29 09:10:48
海外TECH WIRED 74 Best Cyber Monday Video Game and Accessory Deals https://www.wired.com/story/best-cyber-monday-video-game-deals-2021-1 accessory 2021-11-29 09:34:00
金融 RSS FILE - 日本証券業協会 公開価格の設定プロセスのあり方等に関するワーキング・グループ https://www.jsda.or.jp/about/kaigi/jisyukisei/gijigaiyou/20210915170847.html 設定 2021-11-29 10:35:00
海外ニュース Japan Times latest articles Japan to bar all new foreign visitors as omicron fears grow https://www.japantimes.co.jp/news/2021/11/29/national/japan-omicron-entry-restrictions/ Japan to bar all new foreign visitors as omicron fears growThe measures close the border to business travelers foreign students and foreign interns starting Tuesday but it does not affect re entry for Japanese nationals and 2021-11-29 18:13:20
ニュース BBC News - Home Covid in Scotland: Six cases of Omicron variant identified https://www.bbc.co.uk/news/uk-scotland-59457332?at_medium=RSS&at_campaign=KARANGA virus 2021-11-29 09:20:30
ニュース BBC News - Home Covid: JCVI scientists to announce decision on booster rollout https://www.bbc.co.uk/news/uk-59455914?at_medium=RSS&at_campaign=KARANGA groups 2021-11-29 09:42:29
ニュース BBC News - Home Covid: Dutch police arrest quarantine hotel escapees https://www.bbc.co.uk/news/world-europe-59456332?at_medium=RSS&at_campaign=KARANGA spain 2021-11-29 09:36:15
ニュース BBC News - Home Radio 4's Today programme temporarily drops off air https://www.bbc.co.uk/news/entertainment-arts-59457543?at_medium=RSS&at_campaign=KARANGA alarm 2021-11-29 09:05:11
ニュース BBC News - Home Queen of Barbados - but just for one last day https://www.bbc.co.uk/news/uk-59458431?at_medium=RSS&at_campaign=KARANGA barbadian 2021-11-29 09:02:46
ビジネス ダイヤモンド・オンライン - 新着記事 湖池屋(2226)、株主優待を変更! 100株以上で自社 グループ製品のお菓子が2500円相当もらえる点は変わ らず、2022年以降は基準日が従来の12月末⇒9月末に - 株主優待【新設・変更・廃止】最新ニュース https://diamond.jp/articles/-/289034 2021-11-29 18:30:00
ビジネス 不景気.com ACCESSの22年1月期は30億円の最終赤字へ、海外減収で - 不景気.com https://www.fukeiki.com/2021/11/access-2022-loss.html acces 2021-11-29 09:44:22
ビジネス 不景気.com 戸田工業が韓国「戸田フェライトコリア」の工場を閉鎖 - 不景気.com https://www.fukeiki.com/2021/11/toda-kogyo-close-korea-plant.html 戸田工業 2021-11-29 09:23:21
LifeHuck ライフハッカー[日本版] 【Amazonブラックフライデー】モニターアームからデンタルフロスまで! セール対象のAmazonブランド商品まとめ https://www.lifehacker.jp/2021/11/amazon-blackfriday-2021-1129-3.html amazon 2021-11-29 18:15:00
北海道 北海道新聞 日大理事長逮捕は「遺憾」 松野氏、文科省で厳正対応 https://www.hokkaido-np.co.jp/article/616917/ 日本大学 2021-11-29 18:05:17
北海道 北海道新聞 新規上場、15年ぶり高水準 2年連続増加、JPXが見通し https://www.hokkaido-np.co.jp/article/616916/ 株式市場 2021-11-29 18:05:16
北海道 北海道新聞 再発防止の取り組み中に不適切事務 釧路総合振興局の手当未払い https://www.hokkaido-np.co.jp/article/616936/ 再発防止 2021-11-29 18:19:00
北海道 北海道新聞 米の分断、感染拡大招く コロナ対策責任者が懸念 https://www.hokkaido-np.co.jp/article/616933/ 感染拡大 2021-11-29 18:17:00
北海道 北海道新聞 積立金1・3兆円確保の試算 雇用保険、支援制度継続も https://www.hokkaido-np.co.jp/article/616915/ 厚生労働省 2021-11-29 18:18:23
北海道 北海道新聞 冷凍カツオ窃盗で現金授受 20年以上前から、焼津漁協 https://www.hokkaido-np.co.jp/article/616932/ 窃盗事件 2021-11-29 18:16:00
北海道 北海道新聞 小樽の建築物、かすがいが強度の鍵 専門家報告 木材と石壁連動 地震の影響低減 https://www.hokkaido-np.co.jp/article/616931/ 道内 2021-11-29 18:14:00
北海道 北海道新聞 巨大ウミガメ機、一斉披露 全日空、成田空港で https://www.hokkaido-np.co.jp/article/616930/ 成田空港 2021-11-29 18:14:00
北海道 北海道新聞 韓国、「日本は謝罪を」原告訴え 挺身隊判決3年で会見 https://www.hokkaido-np.co.jp/article/616924/ 三菱重工業 2021-11-29 18:13:00
北海道 北海道新聞 転勤拒否で解雇は適法、大阪地裁 NEC関連の元社員が敗訴 https://www.hokkaido-np.co.jp/article/616923/ 大阪地裁 2021-11-29 18:13:00
北海道 北海道新聞 マルハ、冷凍食品値上げへ 来年2月、99品を最大23% https://www.hokkaido-np.co.jp/article/616922/ 冷凍食品 2021-11-29 18:06:00
北海道 北海道新聞 大司教釈明「説明不十分だった」 信徒の性被害訴訟で、長崎 https://www.hokkaido-np.co.jp/article/616921/ 大司教区 2021-11-29 18:02:00
IT 週刊アスキー SNSでも話題の「京ワッフル」を買いに行こう! ルミネ新宿に「kyocafe chacha」のポップアップショップがオープン https://weekly.ascii.jp/elem/000/004/076/4076474/ kyocafechacha 2021-11-29 18:40:00
IT 週刊アスキー 『ウマ娘 プリティーダービー』で新ストーリーイベント「聖なる夜に重なるキセキ」が開催 https://weekly.ascii.jp/elem/000/004/076/4076497/ 開催 2021-11-29 18:35:00
IT 週刊アスキー DATAFLUCT、AIアシスタントと対話をしながらデータを深堀りできるBIツール「Thryving」提供開始 https://weekly.ascii.jp/elem/000/004/076/4076469/ datafluct 2021-11-29 18:30:00
IT 週刊アスキー クリスマスの伝統菓子! ル ビアン新宿小田急店、本格「パネトーネ」を販売 https://weekly.ascii.jp/elem/000/004/076/4076470/ 販売 2021-11-29 18:30:00
IT 週刊アスキー 『地球防衛軍5』などがお買い得!D3PがPS Store「歳末感謝セール!」に提供するラインナップを公開 https://weekly.ascii.jp/elem/000/004/076/4076471/ playstationstore 2021-11-29 18:15: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件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)