投稿時間:2022-07-18 20:38:58 RSSフィード2022-07-18 20:00 分まとめ(42件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
AWS lambdaタグが付けられた新着投稿 - Qiita AWS LambdaのLayerを利用する3つの種類 https://qiita.com/poruruba/items/73c09832fec6664fa5c3 layer 2022-07-18 19:57:33
Ruby Rubyタグが付けられた新着投稿 - Qiita Railsのproduction.rbはどういう事が設定できるの?全ての設定を調べてみた! https://qiita.com/zakino123/items/86f0351d0a501758ab02 productionr 2022-07-18 19:52:53
AWS AWSタグが付けられた新着投稿 - Qiita AWS LambdaのLayerを利用する3つの種類 https://qiita.com/poruruba/items/73c09832fec6664fa5c3 layer 2022-07-18 19:57:33
golang Goタグが付けられた新着投稿 - Qiita go の知らなかった仕様 https://qiita.com/Nabetani/items/bfeb49c66cc569f45bc4 newnameofstring 2022-07-18 19:05:55
Ruby Railsタグが付けられた新着投稿 - Qiita Railsのproduction.rbはどういう事が設定できるの?全ての設定を調べてみた! https://qiita.com/zakino123/items/86f0351d0a501758ab02 productionr 2022-07-18 19:52:53
海外TECH MakeUseOf WhatsApp vs. Signal: Which App Provides Better Security and Privacy? https://www.makeuseof.com/whatsapp-vs-signal-security/ privacy 2022-07-18 10:45:13
海外TECH MakeUseOf What Is HTTP/3? How Does It Compare to HTTP/2? https://www.makeuseof.com/what-is-http3-how-compare-http2/ does 2022-07-18 10:15:14
海外TECH DEV Community Why your password is to weak https://dev.to/eelcoverbrugge/why-your-password-is-to-weak-1dp9 Why your password is to weakDoes your password requires at least the following Must be a minimum of charactersMust contain at least numberMust contain at least one uppercase characterMust contain at least one lowercase characterMust contain at least one special character amp Research recently showed this password is cracked in minutes Yes you took a risk for brain damage in order to come up with a password like this or let your password manager did the job en still it can be cracked so so fast In this password was cracked in hours That s just times slower then what it is now imagine how fast it will be within the next years from now Password on steroidsBest possible way to come up with a password is according to the Diceware method Experts use this to add randomness to the words your password contains Every numbers you throw in a row belongs to a word Repeat this process until you have at least words and create a passphrase CannonVirtuousMovableUnnerveRectifiedCreasing Safety vs userfriendlyOne problem is this won t be acceptable by our minimal requirements like we said in the beginning Of course we can add a number and exclamation mark or whatever but this isn t the best solution Also this is pretty harshe to ask everyone to do for just a password This also depends on what the value is of what you are trying to secure But since people are lazy lets come up with a solution that works for everyone What we can do is higher the least minimal of characters used If you go from to this means it can be cracked in years in Still in this was years so what will it be within the next years But it is at least takes waaayyyy more time to crack and hopefully a hackers decides to target an easier victim Source 2022-07-18 10:34:39
海外TECH DEV Community SUGGESTED FUTURE PLAN FOR STUDENTS AND NEWBIES. https://dev.to/areedev/suggested-future-plan-for-students-and-newbies-435i SUGGESTED FUTURE PLAN FOR STUDENTS AND NEWBIES MONTHS For months learn Online on YOUTUBE HTML CSS PHP AND JAVASCRIPT OR FLUTTER DART FIREBASE SQL AND PYTHON INTERNSHIP Apply for an internship in any Software House for NEXT MONTHS And complete your MONTHS IN DEVELOPMENT AFTER MONTHS After months apply for a job in any Software House to Complete ONE YEAR OF DEVELOPMENT NOW SINCE YOU HAVE COMPLETED ONE YEAR IN DEVELOPMENT Since you have completed One year in Developement you have got a lot of Infromation based on that apply for highly professional and good paying Job or find ONLINE FREELANCING to earn for the next year to complete YEARS OF YOUR EXPERIENCE IN DEVELOPMENT AFTER YEARS OF PERFECT PROGRAMMING Start searching about building a Digital Software Build your own Brand Identity and find any problem to resolver for next years to complete YEARS OF EXPERTISE FIND STARTUPS Find startups and Ideas and Invest in them Collaborate with them and start MAKING MONEY AS A INVESTOR 2022-07-18 10:27:52
海外TECH DEV Community Applying AI for Early Dementia Diagnosis and Prediction https://dev.to/mobidev/applying-ai-for-early-dementia-diagnosis-and-prediction-5en7 Applying AI for Early Dementia Diagnosis and PredictionMobiDev would like to acknowledge and give its warmest thanks to the DementiaBank which made this work possible by providing the data set Mental illnesses and diseases that cause mental symptoms are somewhat difficult to diagnose due to the uneven nature of such symptoms One such condition is dementia While it s impossible to cure dementia caused by degenerative diseases early diagnostics help reduce symptom severity with the proper treatment or slow down illness progression Moreover about of dementia causes are believed to be reversible when diagnosed early Communicative and reasoning problems are some of the earliest indicators used to identify patients at risk of developing dementia Applying AI for audio and speech processing significantly improves diagnostic opportunity for dementia and helps to spot early signs years before significant symptoms develop In this study we ll describe our experience creating a speech processing model that predicts dementia risk including the pitfalls and challenges in speech classification tasks AI Speech Processing TechniquesArtificial intelligence offers a range of techniques to classify raw audio information which often passes through pre processing and annotation In audio classification tasks we generally strive to improve the sound quality and clean up any present anomalies before training the model If we speak about classification tasks involving human speech generally there are two major types of audio processing techniques used for extracting meaningful information Automatic speech recognition or ASR is used to recognize or transcribe spoken words into a written form for further processing feature extraction and analysis Natural language processing or NLP is a technique for understanding human speech in context by a computer NLP models generally apply complex linguistic rules to derive meaningful information from sentences determining syntactic and grammatical relations between words Pauses in speech can also be meaningful to the results of a task and audio processing models can also distinguish between different sound classes like human voicesanimal soundsmachine noisesambient soundsAll of the different sounds above may be removed from the target audio files because they can worsen overall audio quality or impact model prediction HOW DOES AI SPEECH PROCESSING APPLY TO DEMENTIA DIAGNOSIS People with Alzheimer s disease and dementia specifically have a certain number of communication conditions such as reasoning struggles focusing problems and memory loss Impairment in cognition can be spotted during the neuropsychological testing performed on individuals If recorded on audio these defects can be used as features for training a classification model that will find a difference between a healthy person and an ill one Since an AI model can process enormous amounts of data and maintain accuracy of its classification the integration of this method into dementia screening can improve overall diagnostic accuracy Dementia detection systems based on neural networks have two potential applications in healthcare Early dementia diagnostics Using recordings of neuropsychological tests patients can learn about the early signs of dementia long before brain cell damage occurs Applying even phone recordings with test results appears to be an accessible and fast way to screen population compared to conventional appointments Tracking dementia progression Dementia is a progressive condition which means its symptoms tend to progress and manifest differently over time Classification models for dementia detection can also be used to track changes in a patient s mental condition and learn how the symptoms develop or how treatment affects manifestation So now let s discuss how we can train the actual model and what approaches appear most effective in classifying dementia How do you train AI to analyze dementia patterns The goal of this experiment was to detect as many sick people as possible out of the available data For this we needed a classification model that was able to extract features and find the differences between healthy and ill people The method used for dementia detection applies neural networks both for feature extraction and classification Since audio data has a complex and continuous nature with multiple sonic layers neural networks appear superior to traditional machine learning for feature extraction In this research types of models were used Speech representation neural network which accounts for extracting speech features embeddings andClassification model which learns patterns from feature extractor outputIn terms of data recordings of Cookie Theft neuropsychological examination are used to train the model Image source researchgate netIn a nutshell Cookie Theft is a graphic task that requires patients to describe the events happening in the picture Since people suffering from early symptoms of dementia experience cognitive problems they often fail to explain the scene in words repeat thoughts or lose the narrative chain All of the mentioned symptoms can be spotted in recorded audio and used as features for training classification models ANALYZING DATAFor the model training and evaluation we used a DementiaBank dataset consisting of Cookie Theft recordings The data represents people of different ages split into two groups healthy and those diagnosed with Alzheimer diseases ーthe most common cause of dementia The DementiaBank dataset shows a balanced distribution of healthy and ill people which means neural networks will consider both classes during the training procedure without skewing to only one class The dataset contains samples with different length loudness and noise level The total length of the whole dataset equals hours min with an average audio length of seconds In the preparation phase it was noted that the duration of the recordings of healthy people is overall shorter which is logicall since ill people struggle with completing the task However relying just on the speech length doesn t guarantee meaningful classification results Since there can be people suffering from mild symptoms or we can become biased for quick descriptors DATA PREPROCESSINGBefore actual training the obtained data has to go through a number of preparation procedures Audio processing models are sensitive to the quality of recording as well as omission of words in sentences Poor quality data may worsen the prediction result since a model may struggle to find a relationship between the information where a part of recording is corrupted Preprocessing sound entails cleaning any unnecessary noises improving general audio quality and annotating the required parts of an audio recording The Dementia dataset initially has approximately poor quality data included in it We have tested both AI and non AI approaches to normalize loudness level and reduce noises in recordings Huggingface MetricGan model was used to automatically improve audio quality although the majority of the samples weren t improved enough Additionally Python audio processing libraries and Audacity were used to further improve data quality For very poor quality audio additional cycles of preprocessing may be required using different Python libraries or audio mastering tools like Izotope RX But in our case the aforementioned preprocessing steps dramatically increased data quality During the preprocessing samples with the poorest quality were deleted accounting for samples min sec length which is only of total dataset length APPROACHES TO SPEECH CLASSIFICATIONAs you might remember neural network models are used in conjunction to extract features and classify recordings In speech classification tasks there are generally two approaches Converting speech to text and using text as an input for the classification model training Extracting high level speech representations to conduct classification on them This approach is an end to end solution since audio data doesn t require conversion into other formats In our research we use both approaches to see how they differ in terms of classification accuracy Another important point is that all feature extractors were trained in two steps On the first iteration the model is pre trained in a self supervised way on pretext tasks such as language modeling auxiliary task In the second step the model is fine tuned on downstream tasks in a standard supervised way using human labeled data The pretext task should force the model to encode the data to a meaningful representation that can be reused for fine tuning later For example a speech model trained in a self supervised way needs to learn about sound structure and characteristics to effectively predict the next audio unit This speech knowledge can be re used in a downstream task like converting speech into text ModelingTo evaluate the results of model classification we ll use a set of metrics that will help us determine the accuracy of the model output Recall evaluates the fraction of correctly classified audio records of all audio records in the dataset In other words recall shows the number of records our model classified as dementia Precision metric indicates how many of those records classified with dementia are actually true F Score was used as a metric to calculate harmonic mean out of recall and precision The formula of metric calculation looks like this F Recall Precision Recall Precision Additionally as in the first approach when we converted audio to text Word Error Rate is also used to calculate the number of substitutions deletions and insertions between the extracted text and the target one APPROACH TEXT TO SPEECH IN DEMENTIA CLASSIFICATIONFor the first approach two models were used as feature extractors wavvec base and NEMO QuartzNet While these models convert speech into text and extract features from it the HuggingFace BERT model performs the role of a classifier Extracted by wavvec text appeared to be more accurate compared to QuartzNet output But on the flipside it took significantly longer for wavvec to process audio which makes it less preferable for real time tasks In contrast QuartzNet shows faster performance due to a lower number of parameters The next step was feeding the extracted text of both models into the BERT classifier for training Eventually the training logs showed that BERT wasn t trained at all This could possibly happen due to the following factors Converting audio speech into text basically means losing information about the pitch pauses and loudness Once we extract the text there is no way feature extractors can convey this information while it s meaningful to consider pauses during the dementia classification The second reason is that the BERT model uses predefined vocabulary to convert word sequences into tokens Depending on the quality of recording the model can lose the information it s unable to recognize This leads to omission of for example incorrect words that still make sense to the prediction results As long as this approach doesn t seem to bring meaningful results let s proceed to the end to end processing approach and discuss the training results APPROACH END TO END PROCESSINGNeural networks represent a stack of layers where each of the layers is responsible for catching some information In the early layers models learn the information about raw sound units also called low level audio features These have no human interpretable meaning Deep layers represent more human understandable features like words and phonemes End to end approach entails the use of speech features from intermediate layers In this case speech representation models ALBERT or HuBERT were used as feature extractors Both feature extractors were used as a Transfer learning while classification models were fine tuned For these classification tasks we used two custom sprl downstream models an attention based classifier that was trained on SNIPS dataset and a linear classifier that is trained on Fluent commands dataset but eventually both models were fine tuned using Dementia dataset Looking at inference results of the end to end solution it s claimed that using speech features instead of text with fine tuned downsample models led to more meaningful results Namely the combination of HuBERT and an attention based model shows the most concise result among all approaches In this case classifiers learned to catch relevant information that could help differentiate between healthy people and those with Dementia For the explicit description of what models and methods for fine tuning were used you can download the PDF of this article How to improve the results Given the two different approaches to dementia classification with AI we can derive a couple of recommendations to improve the model output Use more data Dementia can have different manifestations depending on the cause and patient age as symptoms will basically vary from person to person Obtaining more data samples with dementia speech representations allows us to train models on more diverse data which can possibly result in more accurate classifications Improve preprocessing procedure Besides the number of samples data quality also matters While we can t correct the initial defects in speech or actual recording using preprocessing can significantly improve audio quality This will result in less meaningful information lost during the feature extraction and have a positive impact on the training Alter models As an example of end to end processing different upstream and downstream models show different accuracy Trying different models in speech classification may result in improvement of classification accuracy As the test results show applying neural networks to analyzing dementia audio recordings can generate accurate suggestions Training neural networks for speech classification tasks is a complex exercise that requires data science expertise as well as audio processing knowledge 2022-07-18 10:22:48
海外TECH DEV Community Java Interface and abstract class related interview questions https://dev.to/prashantrmishra/java-inteface-and-abstract-class-related-interview-questions-l59 Java Interface and abstract class related interview questions Abstract classCan Abstract class have contructor Yes abstarct classses can have constructors Even if you don t define JVM will create one default constructor for the abstract class What is the need of constructor in abstract class The main purpose of the constructor is to initialize the newly created object In abstract class we have an instance variable abstract methods and non abstract methods We need to initialize the non abstract methods and instance variables therefore abstract classes have a constructorHow costructors will be called in an abstract method as we can t create object of abstract class It s called with the help of costructor chaining i e when we create the object of sub class constructor of abstract class will also be called What will happen if abstract class implements an inteface Abstract class can miss the implementation of one or more methods defined in the interface and it won t through any errors This is because abstract class by definition is required to be extended by sub classes and when a subclass is extending the abstract class then we can probvide the implementation of all the abstract methodsclass Main public static void main String args System out println This is main class abstract class Bird implements Ifly interface Ifly public void fly Output No errorsThis is main classNote as soon as the abstract method Bird is getting extended then it is required to implement all the abstract methods including the methods of the interface Ifly class Main extends Bird public static void main String args System out println This is main class abstract class Bird implements Ifly interface Ifly public void fly Output with error as we are not implementing the abstract method fly Main java error Main is not abstract and does not override abstract method fly in Iflyclass Main extends Bird error InterfaceIf there are two intefaces having same method what will happen if both of them are implemented by a class If the methods are abstract and method signatures are same including return type then the implementing class will have to override only one method and there won t be any issuesclass HelloWorld implements Face Anatomy public static void main String args System out println Hello World HelloWorld w new HelloWorld w getName Override public void getName interface Face void getName interface Anatomy void getName Output Hello World Note But if return types is different in both the methods then implementing class will have to override both the methods Note If there are default method with same name in both the interfaces then it will give you compile time errorWhen return types are same class Main implements Face Anatomy public static void main String args Override public void getName interface Face void getName default void getFaceOrientation System out println the default face shape fo Face interface interface Anatomy void getName default void getFaceOrientation System out println the default face shape of Anatomy inteface Output Main java error types Face and Anatomy are incompatible class Main implements Face Anatomy class Main inherits unrelated defaults for getFaceOrientation from types Face and Anatomy errorWhen return types are different class Main implements Face Anatomy public static void main String args Override public void getName interface Face void getName default void getFaceOrientation System out println the default face shape fo Face interface interface Anatomy void getName default String getFaceOrientation return the default face shape of Anatomy inteface OutputMain java error types Anatomy and Face are incompatible class Main implements Face Anatomy both define getFaceOrientation but with unrelated return types error 2022-07-18 10:18:45
海外TECH DEV Community How to store and update arrays in React useState hook https://dev.to/collegewap/how-to-store-and-update-arrays-in-react-usestate-hook-5d4j How to store and update arrays in React useState hookYou might have come across different use cases where you would want to store an array in the React state and later modify them In this article we will see different ways of doing it Project setupCreate a react project by running the following command npx create react app react usestate arrayUpdate the index css file with the following code for styling the app body display flex justify content center App display flex flex direction column justify content center align items center ul padding button margin rem cursor pointer ul li display flex align items center list style type disc justify content space between Update App js with the following code import useState from react function getRandomNumber max return Math floor Math random max const INITIAL LIST Array from length gt getRandomNumber function App const list setList useState INITIAL LIST return lt div className App gt lt div gt lt button gt Add Item to Start lt button gt lt button gt Add Item to End lt button gt lt button gt Add Item in between lt button gt lt div gt lt div gt lt button gt Delete Item from Start lt button gt lt button gt Delete Item from End lt button gt lt button onClick gt Delete Item from between lt button gt lt div gt lt ul gt list map item i gt return lt li key i gt lt span gt item lt span gt lt button title increment gt lt button gt lt li gt lt ul gt lt div gt export default AppHere we are creating a list of random numbers initializing a local state with the list of random numbers and displaying them Against each number in the list we have a button to increment it Also we have buttons to modify the list Modifying an item in the arrayFirst let s make the increment buttons working import useState from react function getRandomNumber max return Math floor Math random max const INITIAL LIST Array from length gt getRandomNumber function App const list setList useState INITIAL LIST const incrementNumber index gt setList existingItems gt return existingItems slice index existingItems index existingItems slice index return lt div className App gt lt div gt lt button gt Add Item to Start lt button gt lt button gt Add Item to End lt button gt lt button gt Add Item in between lt button gt lt div gt lt div gt lt button gt Delete Item from Start lt button gt lt button gt Delete Item from End lt button gt lt button onClick gt Delete Item from between lt button gt lt div gt lt ul gt list map item i gt return lt li key i gt lt span gt item lt span gt lt button title increment onClick gt incrementNumber i gt lt button gt lt li gt lt ul gt lt div gt export default AppAs you may be aware we should not directly modify the state Hence we use the callback which is the second argument to setList function The callback receives an argument which is the existing state and we make use of the slicemethod and spread operators to return the updated array An alternative way is to get the updated array using map function const incrementNumber index gt setList existingItems gt return existingItems map item j gt return j index item item Here inside the map function we check if the passed index is the same as the current index then we increment the number by one otherwise we return the same number Adding Items to the arrayWe will see how to add an item to the beginning end and somewhere in between the array Adding item to the start of the array We can add item by using spread operator as shown below const addItemToStart gt setList existingItems gt return getRandomNumber existingItems return getRandomNumber concat existingItems As you can see in the commented code you can use concat method as well Don t forget to bind addItemToStart function to the onClick handler import useState from react function getRandomNumber max return Math floor Math random max const INITIAL LIST Array from length gt getRandomNumber function App const list setList useState INITIAL LIST const incrementNumber index gt setList existingItems gt return existingItems slice index existingItems index existingItems slice index return existingItems map item j gt return j index item item const addItemToStart gt setList existingItems gt return getRandomNumber existingItems return getRandomNumber concat existingItems return lt div className App gt lt div gt lt button onClick addItemToStart gt Add Item to Start lt button gt lt button gt Add Item to End lt button gt lt button gt Add Item in between lt button gt lt div gt lt div gt lt button gt Delete Item from Start lt button gt lt button gt Delete Item from End lt button gt lt button onClick gt Delete Item from between lt button gt lt div gt lt ul gt list map item i gt return lt li key i gt lt span gt item lt span gt lt button title increment onClick gt incrementNumber i gt lt button gt lt li gt lt ul gt lt div gt export default App Adding item to the end of the arraySimilar to adding item to the start of the array we can make use of spread operator by modifying the order const addItemToEnd gt setList existingItems gt return existingItems getRandomNumber return existingItems concat getRandomNumber An alternative approach with the concat method can also be used as shown in the commented code above Adding Item in between of the arraySay if you have to add an item in a particular index and then shift the rest of the items to the right by index you can do that by using slice and spread operator as shown below const addItemInBetween gt setList existingItems gt const randomIndex getRandomNumber existingItems length const randomNumber getRandomNumber return existingItems slice randomIndex randomNumber existingItems slice randomIndex Here we have randomly generated an index you can hard code it to some value and see if it is updating correctly We can use reduce method as well as shown below for adding an item in between const addItemInBetween gt setList existingItems gt const randomIndex getRandomNumber existingItems length const randomNumber getRandomNumber return existingItems reduce prev x i gt prev concat i randomIndex randomNumber x x Here inside the reduce method callback if the index is the same as that of the index to be updated then we concatenate the previous array with an array of the number to be inserted and the current item Otherwise we just concatenate the current item to the previous array Deleting items from the arrayWhile deleting as well we will see how to delete from the start end and in between the array Deleting an item from the start of the arrayHere as well we can use the slice method When we pass as the first argument to the slice method it returns all the items starting from the first index all items except the first one since the array index starts from const deleteItemFromStart gt setList existingItems gt return existingItems slice return existingItems filter item i gt i As you can see we can use the filter method as well where we check if the index is and if so then we filter it out Deleting an item from the end of the arrayThe last index of the array can be found using Array length so in order to remove the last item we can do Array slice Array length const deleteItemFromEnd gt setList existingItems gt return existingItems slice existingItems length return existingItems filter item i gt i existingItems length Even the filter function can also be used as shown in the commented code Deleting an item in between of the arrayWhile deleting from a particular position we can use the combination of slice method and spread operator const removeItemInBetween gt setList existingItems gt const randomIndex getRandomNumber existingItems length return existingItems slice randomIndex existingItems slice randomIndex return existingItems reduce prev x i gt prev concat i randomIndex x As you can see we have spread items before the index and after the index and added them to a brand new array This can also be achieved using reduce method similar to adding an item at a specified index except that we are concatenating an empty array when the index is matched thus skipping it Final codeHere is the final code with all the operations together import useState from react function getRandomNumber max return Math floor Math random max const INITIAL LIST Array from length gt getRandomNumber function App const list setList useState INITIAL LIST const incrementNumber index gt setList existingItems gt return existingItems slice index existingItems index existingItems slice index return existingItems map item j gt return j index item item const addItemToStart gt setList existingItems gt return getRandomNumber existingItems return getRandomNumber concat existingItems const addItemToEnd gt setList existingItems gt return existingItems getRandomNumber return existingItems concat getRandomNumber const deleteItemFromStart gt setList existingItems gt return existingItems slice return existingItems filter item i gt i const deleteItemFromEnd gt setList existingItems gt return existingItems slice existingItems length return existingItems filter item i gt i existingItems length const addItemInBetween gt setList existingItems gt const randomIndex getRandomNumber existingItems length const randomNumber getRandomNumber return existingItems slice randomIndex randomNumber existingItems slice randomIndex return existingItems reduce prev x i gt prev concat i randomIndex randomNumber x x const removeItemInBetween gt setList existingItems gt const randomIndex getRandomNumber existingItems length return existingItems slice randomIndex existingItems slice randomIndex return existingItems reduce prev x i gt prev concat i randomIndex x return lt div className App gt lt div gt lt button onClick addItemToStart gt Add Item to Start lt button gt lt button onClick addItemToEnd gt Add Item to End lt button gt lt button onClick addItemInBetween gt Add Item in between lt button gt lt div gt lt div gt lt button onClick deleteItemFromStart gt Delete Item from Start lt button gt lt button onClick deleteItemFromEnd gt Delete Item from End lt button gt lt button onClick removeItemInBetween gt Delete Item from between lt button gt lt div gt lt ul gt list map item i gt return lt li key i gt lt span gt item lt span gt lt button title increment onClick gt incrementNumber i gt lt button gt lt li gt lt ul gt lt div gt export default App Updating an array of objectsConsider the below array id score id score id score If you have an array of objects with unique ids assigned to each object and you want to modify the array based on the id then you can achieve it by the following function const incrementScore currentId gt setScore existingItems gt const itemIndex existingItems findIndex item gt item id currentId return existingItems slice itemIndex spread all the other items in the object and update only the score existingItems itemIndex score existingItems itemIndex score existingItems slice itemIndex Same functionality can be achieved using map function as shown below const incrementScore currentId gt setScore existingItems gt return existingItems map item gt return item id currentId item score item score item Here is the complete code using the above functions import useState from react const INITIAL SCORES id score id score id score function Scores const score setScore useState INITIAL SCORES const incrementScore currentId gt setScore existingItems gt const itemIndex existingItems findIndex item gt item id currentId return existingItems slice itemIndex spread all the other items in the object and update only the score existingItems itemIndex score existingItems itemIndex score existingItems slice itemIndex return existingItems map item gt return item id currentId item score item score item return lt div className App gt lt ul gt score map item gt return lt li key item id gt lt span gt item score lt span gt lt button title increment onClick gt incrementScore item id gt lt button gt lt li gt lt ul gt lt div gt export default Scores 2022-07-18 10:17:00
海外TECH DEV Community Object Mapping and my journey to minimal boiler-plate code https://dev.to/avivm/object-mapping-and-my-journey-to-minimal-boiler-plate-code-2ajh Object Mapping and my journey to minimal boiler plate codeA long time ago when I was about to finish university and just above junior level programmer I joined a new company and received their organized fresh out of the oven MVP code The code was written by an Ukrainian developer I have never met but loved in my heart It wasn t the first time I saw a layered application but it was the best of times She put everything there clean controllers layer for the API service layer to handle process logic handlers layer to tackle fine grained actions and of course DAO layer to handle all the DB stuff From then on all my future projects followed her beautiful layering and everything was better Fast forward a couple of years my partner and I are now managing the R amp D team somewhere not interesting amp not important Like most teams we are being swamped with feature requests and other bullshit the management finds CRITICAL Our code base is still quite organized with the layering we know and love but we start noticing some issues Add dramatic sound Every time we need to add a new CRUD entity to the system even the most basic entity for some kind of configuration we need to add A LOT of boiler plate code We start by copying an existing entity code then Update the controller with the new entity Clean not relevant code Update the service with the new entity again Clean not relevant code Update the handler with the new entity again Clean not relevant code Update the DAO with the new entity again Clean not relevant code Just writing it and remembering the old times made me tired And more important adding the new entity is the easy part now we have more code we need to maintain Our code base is growing and doing system wide changes becomes impossible Then one day we are on a flight to some conference disconnected from the world and connected to our inner thoughts no wifi My partner comes to me and say What if we develop a generic CRUD framework without boiler plate just add an entity and everything else is available in seconds At first I was skeptical he is the smart one between us so I give it another thought and decides to roll with it Fast forward again my partner and his sidekick have kept their promise and delivered their boiler plate free CRUD framework after countless of fights and iterations to this day I don t want to bore you with too much code but I just have to show a simple example to honor everything we lost on the way Entity Table name example DefaultMappingTarget ExampleDisplay class class Example MappedField Column var exampleString String MappedField Column var exampleBoolean Boolean AbstractJpaEntity DefaultMappingTarget Example class data class ExampleDisplay MappedField var exampleString String null MappedField var exampleBoolean Boolean null AbstractJpaDisplay RestController RequestMapping example class ExampleController BaseCRUDController lt Example ExampleDisplay gt That s it Now I know what you are going to tell me Where are your layers that you couldn t shut up about The beautiful thing is they are all here Behind the scenes the framework has all the layers and it allows you to use hooks and other mechanisms to add additional logic frameworks Since then the smart guys have added permissions security and more on top of the CRUD framework according to the requirements of each project So your next thought is probably Where do I sign Hold your horses for a moment I know your honest current thought is that I m stupid and I know nothing fare Also I would be happy to give you the CRUD framework but it s not truly open source ready If you want to look anyway it s available here Because it s a large framework and it will take time to bring it to the level that we want for an open source release we decided to start small and separate our object mapping capabilities into a separate library Of course the hardest part was to find a name for this library but in the end we settled for ShapeShift If you are not sure what is object mapping or why you need it you can read more about it here If you have any thoughts comments disses you would like to throw at me I would be more than happy to connect 2022-07-18 10:16:42
海外TECH DEV Community Sending real-time notifications with Socket.io in Node.js https://dev.to/novu/sending-real-time-notifications-with-socketio-in-nodejs-1l5j Sending real time notifications with Socket io in Node js How do websites work A user provides a URL to the web browser The browser sends a request to the web server asking for resources related to the URL The server receives the request and sends an HTTP response containing the related files to the web browser The browser displays the response as web pages to the user This type of communication is an HTTP connection suitable for applications where data doesn t change frequently Have you ever used a forex trading app or visited a sports betting website You will notice that the data changes almost every minute these changes are possible with the help of WebSockets WebSockets create a connection between a client and a server allowing them to send data both ways client server and server client Compared to HTTP WebSockets provide a lasting bi directional client server connection making it possible for data to change in real time without refreshing the page NovuIf you are looking to implement in app notifications kind of like Facebook Instagram Upwork etc Check out Novu we bring you the whole solution without dealing with websockets scaling databases servers Come and star us ️And we are back Node js has a built in WebSocket module but this module doesn t provide the functionalities required to build complex real time applications this is why Socket io exists Socket io is a popular JavaScript library that allows us to create real time bi directional communication between clients and a Node js server It is a highly performant and reliable library optimized to process a large volume of data messages with minimal delay It follows the WebSocket protocol and provides better functionalities such as fallback to HTTP long polling or automatic reconnection which enables us to build efficient chat and real time web applications In this article you ll learn how to send notifications between web clients and a Node js server using Socket io Before we start coding this project let s see how Socket io works This tutorial assumes that you have a basic knowledge of building web applications with Express js and Node js How does the Socket io library work Real time Node js applications such as forex trading sports betting websites chat applications and many others use Socket io In this section you ll learn how Socket io transfer messages between the client and the server in a web application The Socket io library has two parts the client and the server API The client API enables users to connect to the server via WebSocket and the server API initiates a Socket io connection on the backend server To connect Socket io to the web client you ll need to download the client JavaScript bundle via CDN or NPM For HTML clients add this code within the head tag lt script src integrity sha EyYLQZgWBifBtVxw OWlkjsfrPFcaUppnAh iFDQogUvgEwyk crossorigin anonymous gt lt script gt The code snippet above downloads Socket io via CDN and exposes a client bundle at socket io socket io js to the client We can then access Socket io by adding the code below to the bottom of our HTML body tag lt script src socket io socket io js gt lt script gt lt script gt const socket io lt script gt For React js Next js and other JavaScript libraries or frameworks you can download the Socket io client API via NPM npm install socket io clientFor the backend server installation you need to have at least Node js v installed on your computer before you can install the Server API via NPM npm install socket ioWith this library you can create a Socket io connection connect web clients to the backend server and start sending messages between the client and the server However this is just a simple explanation of how Socket io works In this article I will walk you through adding the Socket io library to the client and the server by building a notification system Setting up Express js on a Node js serverHere I will guide you through setting up Express js on a Node js server Express js is a fast minimalist framework that provides several features for building Node js web applications It enables us to create the web client for Node js applications Create a folder that will contain our app Then create a package json file by running the code below mkdir lt folder name gt cd lt folder name gt npm init yCreate an index js file the entry point to the web application touch index jsInstall Express js Nodemon and Socket io Nodemon is a Node js tool that automatically restarts the server after detecting file changes npm install express nodemon socket ioConfigure Nodemon by adding the start command to the list of the scripts in the package json file The code snippet below starts the server using Nodemon name server version description main index js scripts test echo Error no test specified amp amp exit start nodemon index js npm start starts the server with Nodemon author license ISC dependencies express nodemon socket io Update the index js file to render an HTML page Copy the code below into the index js file const express require express const app express const path require path const PORT process env PORT enables us to host static CSS amp JS files The public folder contains the CSS amp JS files app use express static public Route to the homepage of the applicationapp get req res gt res sendFile path join dirname index html Listens for changes in the web applicationapp listen PORT gt console log App listening at PORT Create an index html file that displays a message bar and button lt DOCTYPE html gt lt html lang en gt lt head gt lt meta charset UTF gt lt meta http equiv X UA Compatible content IE edge gt lt meta name viewport content width device width initial scale gt lt title gt Socket IO Chat App lt title gt lt Link to CSS file gt lt link rel stylesheet href index css gt lt head gt lt body gt lt div id message bar gt lt p id notification gt lt p gt lt div gt lt form class container gt lt h gt Send Messages with Socket io lt h gt lt textarea rows width name message id message placeholder Enter your message gt lt textarea gt lt button gt SEND MESSAGE lt button gt lt form gt lt body gt lt html gt Create a folder named public This folder will contain the CSS file for the HTML page mkdir publiccd publictouch index cssCopy the code below into the index css file box sizing border box margin padding font family Poppins sans serif message bar width display flex align items center justify content center notification color fff container height vh width padding px display flex flex direction column justify content center h text align center margin bottom px textarea font size px margin bottom px padding px outline none button width px padding px cursor pointer background color c outline none border none color dcdc font size px button hover background color fef Run the Node js server You can view the index html file at https localhost in your web browser npm start Configuring Socket io on the clientIn this section I will walk you through connecting the web client to Socket io Update the index html file to connect Socket io JavaScript bundles via CDN Add the first snippet within the head tag and the other at the bottom of the body tag lt head gt lt This links to Socket io client JavaScript bundle via CDN gt lt script src integrity sha EyYLQZgWBifBtVxw OWlkjsfrPFcaUppnAh iFDQogUvgEwyk crossorigin anonymous gt lt script gt lt head gt lt body gt The page content lt Link to the JavaScript file gt lt script src script js type module gt lt script gt lt This access the client JavaScript bundle provided via its CDN gt lt script src socket io socket io js gt lt script gt lt body gt Create a JavaScript file script js that enables us to access the user s inputs and the HTML elements on the webpage via JavaScript DOM cd publictouch script jsAccess the HTML elements via the Document Object Model provided by JavaScript In script jsconst notify document querySelector notification const message document querySelector message const button document querySelector button const messageBar document querySelector message bar Create an event listener that logs the message provided by the user to the console whenever the form is submitted function printMessage e e preventDefault console log message value button addEventListener click printMessage Next add Socket io to the client JavaScript file script js const socket io socket on response data gt notify textContent data messageBar style backgroundColor FEF messageBar style height vh The code snippet above listens for messages labeled response from the server If there is a message it displays the message on the webpage Edit the printMessage function to send messages from the client to the Node js server The code snippet below sends messages to the server when a user clicks the submit button function printMessage e e preventDefault socket emit message message value Adding Socket io to the Node js serverIn this section you will learn how to configure Socket io on a Node js server and you can receive and send messages from the client via Socket io Update the index js by importing Socket io and the HTTP module from Node js The HTTP module creates an HTTP server that allows Node js to transfer data via the network const express require express const app express const path require path const PORT process env PORT New importsconst http require http Server app Pass the Express app into the HTTP module const socketIO require socket io http app use express static public app get req res gt res sendFile path join dirname index html Listen for changes on the HTTP server not the Express serverhttp listen PORT gt console log App listening at PORT From the code snippet above the HTTP server accepts the Express app as a parameter and we listen for changes on the HTTP server instead of Express Before the app get block create a connection to the web client with Socket io socketIO on connection socket gt console log socket id user just connected socket on disconnect gt console log A user disconnected The socket io connection function above creates a connection with the web client Socket io creates a unique ID for each client and logs the ID to the console whenever a user visits the web page When you refresh or close the web page the socket fires the disconnect event showing that a user has disconnected from the socket Next update the function to send and receive data from the client socketIO on connection socket gt console log socket id user just connected socket on disconnect gt console log A user disconnected socket on message data gt sends the data to everyone except you socket broadcast emit response data sends the data to everyone connected to the server socket emit response data socket broadcast emit sends the data to everyone except you and the socket emit sends the data to everyone connected to the server including you Congratulations You ve just completed the project for this tutorial ConclusionIn this tutorial you ve learnedWhat WebSockets areWhy and when do we need Socket io How to connect Socket io to a web client and a Node js server andhow to send messages between an HTML client and a Node js server Socket io supports private messaging and group chats identifying users by nicknames showing whether a user is online and knowing if a user is typing With these features provided by Socket io you can build complex real time applications useful in various industries such as aviation gaming media and finance Socket io is an excellent choice for real time communication between a client and a Node js server Some other libraries like Twilio Firebase Supabase and many others support real time communication Feel free to check them out Thank you for reading You can find the full source code here 2022-07-18 10:14:13
海外TECH DEV Community Funny Hat Day! 👒🎩 How to do face detection with your webcam and JavaScript 📸🧠 https://dev.to/thormeier/funny-hat-day-how-to-do-face-detection-with-your-webcam-and-javascript-4gkf Funny Hat Day How to do face detection with your webcam and JavaScript Cover image created with Dall E mini and the caption an AI wearing a funny top hat you know because we re doing machine learning stuff today It s been a while since my last post I m working on something rather large you can expect some news soon But today we ll have a look at you Yes you Specifically your beautiful faces We ll make you wear hats We ll use face api js and the Media Stream API for that Don t worry though Nothing will be processed in the cloud or anywhere outside your machine you ll keep your images and everything happens in your browser Let s get started BoilerplateFirst we ll need some HTML A lt video gt element a hat two buttons for starting and stopping the video and two lt select gt for selecting a hat and the device You know you might have two webcams lt div class container gt lt div id hat gt lt div gt lt autoplay is important here otherwise it doesn t immediately show the camera input gt lt video id video width height autoplay gt lt video gt lt div gt lt div gt lt label for deviceSelector gt Select device lt label gt lt select id deviceSelector gt lt select gt lt div gt lt div gt lt label for hatSelector gt Select hat lt label gt lt select id hatSelector gt lt select gt lt div gt lt button id start gt Start video lt button gt lt button id stop gt Stop video lt button gt Next some CSS for the positioning of the hat hat position absolute display none text align center hat visible display block container position relative Awesome Next we install face api js with npm and create an index js file for us to work in npm i face api js amp amp touch index jsAnd lastly for the boilerplate we select all elements we need from the HTML All of the necessary HTML elements const videoEl document querySelector video const startButtonEl document querySelector start const stopButtonEl document querySelector stop const deviceDropdownEl document querySelector deviceSelector const hatSelectorEl document querySelector hatSelector const hatEl document querySelector hat Awesome Let s get to the fun part Accessing the webcamTo access a webcam we will use the Media Stream API This API allows us to access video and audio devices but we re only interested in video devices Also we ll cache those devices in a global variable to not have to fetch them again So let s have a look const listDevices async gt if devices length gt return devices await navigator mediaDevices enumerateDevices The mediaDevices object lets us access all devices both video and audio Each device is an object of either the class InputDeviceInfo or MediaDeviceInfo These objects both roughly look like this deviceId someHash groupId someOtherHash kind videoinput or audioinput label Some human readable name some identifier The kind is what s interesting to us We can use that to filter for all videoinput devices giving us a list of available webcams We will also add these devices to the lt select gt we ve added in the boilerplate and mark the first device we encounter as the selected one List all available camera devices in the select let selectedDevice nulllet devices const listDevices async gt if devices length gt return devices await navigator mediaDevices enumerateDevices filter d gt d kind videoinput if devices length gt deviceDropdownEl innerHTML devices map d gt lt option value d deviceId gt d label lt option gt join Select first device selectedDevice devices deviceId Now we ll actually show the webcam input to the user For that the Media Stream API offers the getUserMedia method It receives a config object as an argument that defines what exactly we want to access how We don t need any audio but we need a video stream from the selectedDevice We can also tell the API our preferred video size Finally we assign the output of this method to the lt video gt namely its srcObject const startVideo async gt Some more face detection stuff later videoEl srcObject await navigator mediaDevices getUserMedia video width ideal height ideal deviceId selectedDevice audio false More face detection stuff later That should do the trick Since the lt video gt has an autoplay attribute it should immediately show what the cam sees Unless we didn t allow the browser to access the cam of course But why wouldn t we right After all we want to wear hats If the hat wearing is getting a bit too spooky we would also like to stop the video We can do that by first stopping each source object s track individually and then clearing the srcObject itself const stopVideo gt Some face detection stuff later on if videoEl srcObject videoEl srcObject getTracks forEach t gt t stop videoEl srcObject null Now we can start and stop the video Next up Doing the face recognitionLet s get the machine learning in During the boiler plating we installed face api js which is a pretty fantastic lib to do all kinds of ML tasks regarding face recognition detection and interpretation It can also detect moods tell us where different parts of the face such as the jawline or the eyes are and is capable of using different model weights And the best part It doesn t need any remote service we only need to provide the correct model weights Given these can be rather large but we only need to load them once and can do face recognition for the rest of the session First we need the models though The face api js repo has all the pre trained models we need face landmark model shardface landmark model weights manifest jsonssd mobilenetv model shardssd mobilenetv model shardssd mobilenetv model weights manifest jsontiny face detector model shardtiny face detector model weights manifest jsonWe put those in a folder called model and make face api load these let faceApiInitialized falseconst initFaceApi async gt if faceApiInitialized await faceapi loadFaceLandmarkModel models await faceapi nets tinyFaceDetector loadFromUri models faceApiInitialized true The face landmarks are what we need They represent a box with x and y coordinates a width and a height value We could use the facial features to have more precision but for the sake of simplicity we ll use the landmarks instead With face api js we can create an async function to detect a face in the stream of the video element face api js does all the magic for us and we only need to tell it in which element we want to look for faces and what model to use We need to initialize the API first though const detectFace async gt await initFaceApi return await faceapi detectSingleFace videoEl new faceapi TinyFaceDetectorOptions This will return us an object called dd with an attribute called box This box contains all kinds of information namely sets of coordinates for every corner x and y coordinates of the top left corner width and height To position the box that contains the hat we need the top left width and height attributes Since every hat emoji is slightly different we cannot simply put them right over the face they wouldn t fit So let s add the hats and some way to customize the hats positioning All of the available hats const hats tophat hat positioning box gt top box top box height left box left fontSize box height bowhat hat positioning box gt top box top box height left box left box width width box width fontSize box height cap hat positioning box gt top box top box height left box left box width fontSize box height graduationcap hat positioning box gt top box top box height left box left fontSize box height rescuehelmet hat ️ positioning box gt top box top box height left box left fontSize box height The main reason for Since we haven t used the lt select gt for the hats just yet let s add this next let selectedHat tophat const listHats gt hatSelectorEl innerHTML Object keys hats map hatKey gt const hat hats hatKey return lt option value hatKey gt hat hat lt option gt join How to wear hatsNow we can start glueing things together With the selectedHat variable and the box we can now position the selected hat on the detected face Positions the hat by a given box const positionHat box gt const hatConfig hats selectedHat const positioning hatConfig positioning box hatEl classList add visible hatEl innerHTML hatConfig hat hatEl setAttribute style top positioning top px left positioning left px width box width px height box height px font size positioning fontSize px As you can see we re using CSS for that Of course we could paint it with a canvas and whatnot but CSS makes things more straightforward and less laggy Now we need to integrate the face detection into the startVideo and the stopVideo functions I ll show the entire code of these functions here for completeness Start and stop the video let faceDetectionInterval nullconst startVideo async gt listHats await listDevices stopVideo try videoEl srcObject await navigator mediaDevices getUserMedia video width ideal height ideal deviceId selectedDevice audio false faceDetectionInterval setInterval async gt const positioning await detectFace if positioning positionHat positioning box catch e console error e const stopVideo gt clearInterval faceDetectionInterval hatEl classList remove visible if videoEl srcObject videoEl srcObject getTracks forEach t gt t stop videoEl srcObject null As you can see we re using an interval here to position everything Due to the nature of face detection it would be way too jiggly if we did it any more frequent It already is quite jiggly but around ms makes it at least bearable Last we add some event listeners and we re good to go Event listeners startButtonEl addEventListener click startVideo stopButtonEl addEventListener click stopVideo deviceDropdownEl addEventListener change e gt selectedDevice e target value startVideo hatSelectorEl addEventListener change e gt selectedHat e target value The resultAnd here s the result Depending on your system the hats may very well be off because every system renders emojis differently Also give it a second to actually load the model weights they take a few seconds For best results view on a large screen and open the sandbox in a new tab Obviously the tab needs camera access Nice I hope you enjoyed reading this article as much as I enjoyed writing it If so leave a ️or a I write tech articles in my free time and like to drink coffee every once in a while If you want to support my efforts you can offer me a coffee or follow me on Twitter You can also support me directly via Paypal 2022-07-18 10:05:21
海外TECH DEV Community 8 things about Records in C# you probably didn't know https://dev.to/bellonedavide/8-things-about-records-in-c-you-probably-didnt-know-jeg things about Records in C you probably didn x t knowRecords are the new data type introduced in with C and NET Core public record Person string Name int Id Records are the third way of defining data types in C the other two are class and struct Since they re a quite new idea in NET we should spend some time experimenting with it and trying to understand its possibilities and functionalities In this article we will see properties of Records that you should know before using it to get the best out of this new data type Records are immutableBy default Records are immutable This means that once you ve created one instance you cannot modify any of its fields var me new Person Davide me Name AnotherMe won t compile This operation is not legit Even the compiler complains Init only property or indexer Person Name can only be assigned in an object initializer or on this or base in an instance constructor or an init accessor Records implement equalityThe other main property of Records is that they implement equality out of the box Test public void EquivalentInstances AreEqual var me new Person Davide var anotherMe new Person Davide Assert That anotherMe Is EqualTo me Assert That me Is Not SameAs anotherMe As you can see I ve created two instances of Person with the same fields They are considered equal but they are not the same instance Records can be cloned or updated using with Ok so if we need to update the field of a Record what can we do We can use the with keyword Test public void WithProperty CreatesNewInstance var me new Person Davide var anotherMe me with Id Assert That anotherMe Is Not EqualTo me Assert That me Is Not SameAs anotherMe Take a look at me with Id that operation creates a clone of me and updates the Id field Of course you can use with to create a new instance identical to the original one Test public void With CreatesNewInstance var me new Person Davide var anotherMe me with Assert That anotherMe Is EqualTo me Assert That me Is Not SameAs anotherMe Records can be structs and classesBasically Records act as Classes public record Person string Name int Id Sometimes that s not what you want Since C you can declare Records as Structs public record struct Point int X int Y Clearly everything we ve seen before is still valid Test public void EquivalentStructsInstances AreEqual var a new Point var b new Point Assert That b Is EqualTo a Assert That a Is Not SameAs b does not compile Well almost everything you cannot use Is SameAs because since structs are value types two values will always be distinct values You ll get notified about it by the compiler with an error that says The SameAs constraint always fails on value types as the actual and the expected value cannot be the same reference Records are actually not immutableWe ve seen that you cannot update existing Records Well that s not totally correct That assertion is true in the case of simple Records like Person public record Person string Name int Id But things change when we use another way of defining Records public record Pair public Pair string Key string Value this Key Key this Value Value public string Key get set public string Value get set We can explicitly declare the properties of the Record to make it look more like plain classes Using this approach we still can use the auto equality functionality of Records Test public void ComplexRecordsAreEquatable var a new Pair Capital Roma var b new Pair Capital Roma Assert That b Is EqualTo a But we can update a single field without creating a brand new instance Test public void ComplexRecordsAreNotImmutable var b new Pair Capital Roma b Value Torino Assert That b Value Is EqualTo Torino Also only simple types are immutable even with the basic Record definition The ComplexPair type is a Record that accepts in the definition a list of strings public record ComplexPair string Key string Value List lt string gt Metadata That list of strings is not immutable you can add and remove items as you wish Test public void ComplexRecordsAreNotImmutable var b new ComplexPair Capital Roma new List lt string gt City b Metadata Add Another Value Assert That b Metadata Count Is EqualTo In the example below you can see that I added a new item to the Metadata list without creating a new object Records can have subtypesA neat feature is that we can create a hierarchy of Records in a very simple manner Do you remember the Person definition public record Person string Name int Id Well you can define a subtype just as you would do with plain classes public record Employee string Name int Id string Role Person Name Id Of course all the rules of Boxing and Unboxing are still valid Test public void Records CanHaveSubtypes Person meEmp new Employee Davide Chief Assert That meEmp Is AssignableTo lt Employee gt Assert That meEmp Is AssignableTo lt Person gt Records can be abstract and yes we can have Abstract Records public abstract record Box int Volume string Material This means that we cannot instantiate new Records whose type is marked ad Abstract var box new Box Glass cannot create it it s abstractOn the contrary we need to create concrete types to instantiate new objects public record PlasticBox int Volume Box Volume Plastic Again all the rules we already know are still valid Test public void Records CanBeAbstract var plasticBox new PlasticBox Assert That plasticBox Is AssignableTo lt Box gt Assert That plasticBox Is AssignableTo lt PlasticBox gt Record can be sealedFinally Records can be marked as Sealed public sealed record PointD int X int Y int Z Marking a Record as Sealed means that we cannot declare subtypes public record ColoredPointD int X int Y int Z string RgbColor PointD X Y X Will not compile This can be useful when exposing your types to external systems Additional resourcesAs usual a few links you might want to read to learn more about Records in C The first one is a tutorial from the Microsoft website that teaches you the basics of Records Create record types Microsoft DocsThe second one is a splendid article by Gary Woodfine where he explores the internals of C Records and more C Records The good bad amp ugly Gary Woodfine Finally if you re interested in trivia about C stuff we use but we rarely explore here s an article I wrote a while ago about GUIDs in C you ll find some neat stuff in there things you didn t know about Guid in C CodeITThis article first appeared on CodeIT Wrapping upIn this article we ve seen things you probably didn t know about Records in C Records are quite new in the NET ecosystem so we can expect more updates and functionalities Is there anything else we should add Or maybe something you did not expect Happy coding 2022-07-18 10:01:57
Apple AppleInsider - Frontpage News Armed thieves perform daytime raid of Covent Garden Apple Store https://appleinsider.com/articles/22/07/18/armed-thieves-perform-daytime-raid-of-covent-garden-apple-store?utm_medium=rss Armed thieves perform daytime raid of Covent Garden Apple StoreArmed thieves stormed the Apple Store in Covent Garden London on Sunday stealing goods as well as the possessions of customers visiting the outlet Occurring during the day at PM on Sunday police were summoned to the Covent Garden Apple Store following reports of theft Witnesses say a group of thieves pushed into the store grabbing whatever they could before quickly exiting The thieves took goods including iPhones and iPads but also stole from customers visiting the store reports the Daily Mail I m not sure if people were hurt but customers had their phones and belongings snatched from them so I m sure there was a scuffle during that a witness explained Read more 2022-07-18 10:40:05
海外TECH Engadget Google's Nest WiFi router 3-pack falls to a new all-time low https://www.engadget.com/googles-nest-wi-fi-3-pack-falls-to-a-new-all-time-low-104056934.html?src=rss Google x s Nest WiFi router pack falls to a new all time lowGoogle is having a sale on Nest products at Amazon right now with strong discounts on the Nest Doorbell battery Nest Security Cam wired and Nest Cam Outdoor or Indoor battery However the standout deal is on the Nest WiFi Router nd generation available in a pack for just percent off ーthe lowest price we ve seen yet nbsp Buy Google Nest products at Amazon The pack setup will let you cover up to square feet enough for even large homes We gave the Google Nest WiFi router a score of in our review for its installation simplicity and ease of use Setup is easy to do and its wireless radios are twice as powerful as the ones inside the old Google WiFi router We also praised both the router and the access points for having unobtrusive designs that will fit nicely into most homes nbsp The access points also work as speakers with built in Google Assistant that you can use to issue voice commands They can t quite replace a proper speaker but sound quality is the same as a standalone Google Home Mini The biggest drawback is a lack of support for WiFi but these are otherwise some of the best mesh routers available nbsp GoogleMeanwhile the Nest Video Doorbell battery is on sale for or off the regular price The battery makes installation easy and possible to use with any door and it offers features like visitor alerts along with a built in speaker and microphone nbsp And finally both the wired and battery Nest Security Camera s are also marked down The wired model nd generation is on sale for or percent off the regular price while the Nest Cam Outdoor or Indoor nd gen with battery is marked down percent to Both record at p and they ll send alerts to your phone when motion is detected in their line of site They also have built in speakers and microphones so you can hear what s going on and speak to people on the other end of the camera Follow EngadgetDeals on Twitter and subscribe to the Engadget Deals newsletter for the latest tech deals and buying advice 2022-07-18 10:40:56
海外ニュース Japan Times latest articles It’s time to rescue Mike Trout and Shohei Ohtani https://www.japantimes.co.jp/sports/2022/07/18/baseball/mlb/trout-ohtani-angels/ ohtani 2022-07-18 19:22:31
海外ニュース Japan Times latest articles Lions beat Fighters to stay in hunt for first place https://www.japantimes.co.jp/sports/2022/07/18/baseball/japanese-baseball/lions-beat-fighters/ league 2022-07-18 19:18:46
海外ニュース Japan Times latest articles Terunofuji too much for Endo on Day 9 in Nagoya https://www.japantimes.co.jp/sports/2022/07/18/sumo/basho-reports/terunofuji-win-endo-nagoya/ kotonowaka 2022-07-18 19:12:49
ニュース BBC News - Home UK heatwave: Country may have hottest day on record with 41C forecast https://www.bbc.co.uk/news/uk-62201793?at_medium=RSS&at_campaign=KARANGA country 2022-07-18 10:19:08
ニュース BBC News - Home Tory leadership TV debate shelved amid infighting concerns https://www.bbc.co.uk/news/uk-politics-62206727?at_medium=RSS&at_campaign=KARANGA truss 2022-07-18 10:49:21
ニュース BBC News - Home Heatwave: Warnings of 'heat apocalypse' in France https://www.bbc.co.uk/news/world-europe-62206006?at_medium=RSS&at_campaign=KARANGA europe 2022-07-18 10:48:27
ニュース BBC News - Home Tories have abandoned levelling up, says Labour's Lisa Nandy https://www.bbc.co.uk/news/uk-politics-62204475?at_medium=RSS&at_campaign=KARANGA groups 2022-07-18 10:36:49
ニュース BBC News - Home Caroline Henry: Driving ban for police boss caught speeding five times https://www.bbc.co.uk/news/uk-england-nottinghamshire-62207530?at_medium=RSS&at_campaign=KARANGA caroline 2022-07-18 10:39:51
ニュース BBC News - Home In pictures: Hot weather sweeps across UK https://www.bbc.co.uk/news/in-pictures-62205653?at_medium=RSS&at_campaign=KARANGA levels 2022-07-18 10:10:52
ニュース BBC News - Home European bison arrive near Canterbury to manage woodland https://www.bbc.co.uk/news/uk-england-kent-62164223?at_medium=RSS&at_campaign=KARANGA blean 2022-07-18 10:19:06
ニュース BBC News - Home Heatwave: Radio 1 Newsbeat meets BBC Weather https://www.bbc.co.uk/news/newsbeat-62189779?at_medium=RSS&at_campaign=KARANGA taylor 2022-07-18 10:18:08
ニュース BBC News - Home UK weather: How to keep cool and carry on in a heatwave https://www.bbc.co.uk/news/uk-49073972?at_medium=RSS&at_campaign=KARANGA heatwavewith 2022-07-18 10:40:49
ビジネス 不景気.com 大庄が32店舗を閉店へ、50店舗はボランタリーチェーン移行 - 不景気com https://www.fukeiki.com/2022/07/dasyo-close-32-restaurants.html 居酒屋チェーン 2022-07-18 10:47:35
北海道 北海道新聞 地元食材使いチーズやカレー 静内農高生、食品3社と共同開発 地元スーパーで販売へ https://www.hokkaido-np.co.jp/article/707153/ 共同開発 2022-07-18 19:34:46
北海道 北海道新聞 勝負の分かれ目 日本ハム清宮の打球失速(18日) https://www.hokkaido-np.co.jp/article/707155/ 分かれ目 2022-07-18 19:28:59
北海道 北海道新聞 サッカーE1選手権、19日開幕 男子は香港戦、女子は韓国戦 https://www.hokkaido-np.co.jp/article/707151/ 東アジア 2022-07-18 19:13:08
北海道 北海道新聞 全道将棋選手権、苫小牧地区の斉藤さん初優勝 https://www.hokkaido-np.co.jp/article/707115/ 斉藤さん 2022-07-18 19:26:17
北海道 北海道新聞 照ノ富士、7勝目で首位並走 2敗に6人 大相撲名古屋場所 https://www.hokkaido-np.co.jp/article/707157/ 大相撲名古屋場所 2022-07-18 19:25:07
北海道 北海道新聞 女子柔道、阿部詩「内容が良かった」 東京五輪以来の国際大会V https://www.hokkaido-np.co.jp/article/707126/ 国際大会 2022-07-18 19:21:52
北海道 北海道新聞 れいわ、初の代表質問へ 統一選へ向け「政治塾」設立 https://www.hokkaido-np.co.jp/article/707127/ 代表質問 2022-07-18 19:22:04
北海道 北海道新聞 上川管内32人感染 旭川は23人 新型コロナ https://www.hokkaido-np.co.jp/article/707098/ 上川管内 2022-07-18 19:17:04
北海道 北海道新聞 道産建築材の安定供給へ補助金 北海道、原木生産者対象に https://www.hokkaido-np.co.jp/article/707145/ 道産 2022-07-18 19:13:21
北海道 北海道新聞 タリバン副首相「政権承認済み」 指導者会議の後ろ盾をアピール https://www.hokkaido-np.co.jp/article/707154/ 済み 2022-07-18 19:11:00
北海道 北海道新聞 神戸市長がコロナ感染 軽症、自宅で療養 https://www.hokkaido-np.co.jp/article/707152/ 久元喜造 2022-07-18 19:01: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件)