IT |
InfoQ |
JEP 441: Transforming Java with Pattern Matching for switch |
https://www.infoq.com/news/2023/07/tranforming-java-pattern/?utm_campaign=infoq_content&utm_source=infoq&utm_medium=feed&utm_term=global
|
JEP Transforming Java with Pattern Matching for switchJEP Pattern Matching for the switch is completed in JDK following four previews in JDKs JEPs It finalizes the feature addressing feedback from previews and enhances the language with pattern matching for switch expressions and statements By A N M Bazlur Rahman |
2023-07-03 18:40:00 |
AWS |
AWS News Blog |
AWS Week in Review – Generative AI with LLM Hands-on Course, Amazon SageMaker Data Wrangler Updates, and More – July 3, 2023 |
https://aws.amazon.com/blogs/aws/aws-week-in-review-generative-ai-with-llm-hands-on-course-amazon-sagemaker-data-wrangler-updates-and-more-july-3-2023/
|
AWS Week in Review Generative AI with LLM Hands on Course Amazon SageMaker Data Wrangler Updates and More July In last week s AWS Week in Review post Danilo mentioned that it s summer in London Well I m based in Singapore and it s mostly summer here But June is a special month here as it marks the start of durian season Starting next week I ll be travelling to Thailand Malaysia and the Philippines But before I … |
2023-07-03 18:20:12 |
AWS |
AWS Big Data Blog |
Backtesting index rebalancing arbitrage with Amazon EMR and Apache Iceberg |
https://aws.amazon.com/blogs/big-data/backtesting-index-rebalancing-arbitrage-with-amazon-emr-and-apache-iceberg/
|
Backtesting index rebalancing arbitrage with Amazon EMR and Apache IcebergBacktesting is a process used in quantitative finance to evaluate trading strategies using historical data This helps traders determine the potential profitability of a strategy and identify any risks associated with it enabling them to optimize it for better performance Index rebalancing arbitrage takes advantage of short term price discrepancies resulting from ETF managers efforts to … |
2023-07-03 18:14:39 |
AWS |
AWS Desktop and Application Streaming Blog |
Secure workloads with Amazon WorkSpaces Core |
https://aws.amazon.com/blogs/desktop-and-application-streaming/secure-workloads-with-amazon-workspaces-core/
|
Secure workloads with Amazon WorkSpaces CoreSince launching Amazon WorkSpaces Core customers have asked us numerous questions related to maximizing workload security with this new service In this blog we ll dive deep into the most frequently asked security related questions As a refresher WorkSpaces Core provides cloud based fully managed virtual desktop infrastructure VDI designed to work with third party VDI management solutions … |
2023-07-03 18:00:36 |
海外TECH |
MakeUseOf |
How to Track All Your Manga and Anime With My Anime List |
https://www.makeuseof.com/how-to-track-manga-anime-my-anime-list/
|
How to Track All Your Manga and Anime With My Anime ListWhether you want to track anime or manga discover hidden gems or find people with the same interests as you MyAnimeList has everything you need |
2023-07-03 18:45:18 |
海外TECH |
MakeUseOf |
How to Install Elasticsearch on Ubuntu |
https://www.makeuseof.com/how-to-install-elasticsearch-on-ubuntu/
|
ubuntu |
2023-07-03 18:30:18 |
海外TECH |
DEV Community |
The Significance of Binary Trees (Part 1) |
https://dev.to/livshits_ivan/the-significance-of-binary-trees-part-1-506c
|
The Significance of Binary Trees Part In my recent article I delved into the topic of Binary Trees exploring their various types and highlighting their significance as fundamental data structures in computer science With their wide ranging applications Binary Trees offer a vast spectrum of use cases In this article my aim is to illuminate this lesser known realm and showcase the scenarios where Binary Trees prove to be exceptionally useful Introduction to the Use Cases of Binary Trees Hierarchical data structure Binary trees are versatile data structures widely used for representing hierarchical relationships They excel at tasks such as organizing file systems parsing trees in compilers and capturing connections in semantic networks Their branching structure allows for efficient storage and retrieval of data making them valuable tools in various applications In the picture below you ll find a simple example of a hierarchical data structure Items are linked together in parent child relationships forming an overall tree structure Search and Sorting Data StructuresBinary search trees efficiently organize and retrieve sorted data They facilitate easy insertion deletion and searching of elements in a precisely ordered collection These trees maintain balance to ensure smooth data management Leveraging their streamlined operations leads to optimal performance in information management Traversal and Search AlgorithmsTraversing and searching algorithms such as depth first traversal DFS and breadth first traversal BFS are utilized in the world of trees These algorithms extend beyond trees and find applications in graph exploration network analysis code optimization and other important tasks They enable efficient data exploration and manipulation facilitating the discovery of insights and enhancing overall efficiency Below is the image to illustrate the Depth First Search algorithm Cryptography and security data structuresTrees serve as the foundation for constructing various data structures including the Merkle Tree The Merkle Tree plays a crucial role in cryptographic protocols key management systems and blockchains by ensuring data integrity and authentication It accomplishes this by organizing data into a hierarchical structure where each node represents a hash value derived from its child nodes This allows for efficient verification of data integrity as changes in any part of the tree can be detected through the hash values The Merkle Tree s utilization in cryptographic systems and blockchains strengthens security measures and enables robust data validation mechanisms Algorithm OptimizationTrees provide a valuable framework for implementing efficient algorithms like dynamic programming and optimal binary search These algorithms leverage tree structures to organize data resulting in faster calculations and improved performance Dynamic programming breaks down complex problems into smaller subproblems using trees enabling efficient memoization and avoiding redundant computations Optimal binary search algorithms benefit from trees by organizing data in a sorted manner allowing for quick search operations with minimal comparisons Trees simplify data organization and enhance computational efficiency for these algorithms Below is the image to illustrate the Binary Search Algorithm Trees are highly valuable in the field of computer science due to their remarkable versatility and efficiency They serve as indispensable tools across various domains encompassing fundamental data structures intricate algorithms and robust systems The inherent flexibility of trees enables them to adapt seamlessly to diverse scenarios and problem areas facilitating the efficient organization and management of data In the subsequent sections we will delve into each of these application areas In the first part of this article we will explore the significance of trees in hierarchical data structures search and sorting data structures as well as traversal and search algorithms Cryptography and optimization algorithms will be covered in the second part Hierarchical data structureHierarchical data is a data structure when items are linked to each other in parent child relationships in an overall tree structure Think of data like a family tree with grandparents parents children and grandchildren forming a hierarchy of connected data Typically this is used to show an organizational chart a project with tasks or a taxonomy of language item In hierarchical data each of these children nodes has only one parent but each parent can have multiple children The first node at the top of the hierarchy is called the root node When information needs to be retrieved it makes for an inflexible slow system Modern databases have evolved to include the usage of multiple hierarchical over the same data for faster easier searching However hierarchical data is still very widely used today A common use of a hierarchical data structure is staffing information Under an organizational chart structure you have the CEO root node at the top with a staffing structure below Developed by IDM in the s the hierarchical data model is one of the earliest types of models However it quickly was replaced with a relational data model to overcome some of the significant structural problems inherent with this model Hierarchical data structures are commonly used in various domains to organize and represent information in a hierarchical manner Here are a few examples of where hierarchical data structures are used in real life File systemsA file system is a crucial component of an operating system that provides a way to store retrieve and manage files on a storage medium such as a hard disk or solid state drive Hierarchical data structures play a fundamental role in organizing the files and directories within a file system In most file systems including popular ones like NTFS used by Windows and ext used by Linux the hierarchical structure starts with a root directory The root directory serves as the starting point or the top level of the hierarchy From the root directory subdirectories and files can be created Here s an example to illustrate the hierarchical structure in a file system ├ー home│ ├ー user│ │ ├ー Documents│ │ ├ー Pictures│ │ └ー Music│ └ー user│ ├ー Documents│ ├ー Pictures│ └ー Music└ー var ├ー log └ー www ├ー html └ー imagesIn this example the root directory is the starting point of the hierarchy It contains two main directories home and var The home directory represents the home directories of individual users and the var directory represents system related files Under the home directory there are two subdirectories user and user Each user s directory can contain additional subdirectories like Documents Pictures and Music This hierarchical structure allows users to organize their files and folders in a logical and intuitive manner Similarly under the var directory there are subdirectories like log and www The www directory in turn contains subdirectories like html and images to organize website related files The hierarchical structure of a file system provides several advantages It allows for efficient organization easy navigation and logical grouping of files and directories Users can easily locate files within the file system by following the directory hierarchy starting from the root directory Moreover hierarchical data structures enable the implementation of various file operations such as creating deleting renaming and moving files and directories These operations are typically performed by traversing and manipulating the hierarchical structure of the file system Here s an example of code that represents the hierarchical file system structure which I mentioned earlier interface Directory name string directories Directory files string const fileSystem Directory name directories name home directories name user directories name Documents directories files name Pictures directories files name Music directories files files name user directories name Documents directories files name Pictures directories files name Music directories files files files name var directories name log directories files name www directories name html directories files name images directories files files files files Example usage console log fileSystem name Output console log fileSystem directories name Output home console log fileSystem directories directories name Output user console log fileSystem directories directories directories name Output Documents In the example each Directory object contains properties for the name of the directory an array of subdirectories directories and an array of files files By nesting these Directory objects within each other we create a hierarchical structure that mirrors the organization of directories within a file system For instance the fileSystem object represents the root directory which contains two main directories home and var Each of these directories in turn can contain subdirectories forming a hierarchical structure By traversing the nested directories arrays you can navigate through the hierarchy and access specific directories or files This representation allows you to mimic the hierarchical relationships present in a file system enabling you to perform operations like accessing adding or manipulating directories and files in a hierarchical manner Programming AbstractionsMany programming languages and frameworks use hierarchical data structures to represent and manipulate data efficiently For instance the Document Object Model DOM in web development represents the structure of an HTML document as a hierarchical tree enabling easy manipulation and traversal of elements The Document Object Model DOM is a programming interface for HTML and XML documents It represents the structure of an HTML or XML document as a hierarchical tree like structure called the DOM tree This tree like structure allows developers to programmatically access manipulate and modify the elements attributes and content of a web page Here are some key aspects and features of the DOM Tree Structure The DOM represents an HTML document as a hierarchical tree structure The root of the tree is the document object which represents the entire HTML document Elements such as lt html gt lt head gt and lt body gt are nodes in the tree with child elements as their descendants The structure reflects the nesting of HTML elements in the document Node Types Each node in the DOM tree represents a different type of HTML element or content Some common node types include elements e g lt div gt lt p gt lt span gt text nodes representing text content comment nodes and document nodes Each node type has specific properties and methods for accessing and manipulating its content and attributes Accessing Elements Developers can access elements in the DOM tree using methods like getElementById querySelector and getElementsByClassName These methods allow you to retrieve specific elements based on their IDs CSS selectors or class names respectively Manipulating Elements Once an element is accessed developers can modify its attributes content and structure using DOM manipulation methods Common methods include setAttribute textContent innerHTML appendChild removeChild and more These methods enable adding or removing elements changing text content updating attribute values and altering the structure of the DOM tree Event Handling The DOM provides mechanisms to handle user interactions and events such as clicks keypresses and form submissions Event listeners can be added to elements using methods like addEventListener allowing developers to respond to user actions and trigger appropriate functions or behavior in their applications Traversing the DOM The hierarchical structure of the DOM tree enables traversal from one element to another Developers can navigate the tree using properties like parentNode childNodes nextSibling and previousSibling This allows for iterating over elements finding related elements or moving through the DOM tree based on specific conditions The DOM is a fundamental concept in web development and is supported by various programming languages like JavaScript It provides a powerful way to interact with and manipulate HTML documents dynamically Frameworks like React Angular and Vue js build on top of the DOM to provide efficient ways of updating and rendering UI components based on changes in data or state By utilizing the hierarchical nature of the DOM tree developers can easily access manipulate and update elements and their properties enabling dynamic web page creation and interactivity To represent the hierarchical structure of the Document Object Model DOM we can define a class called DOMNode that represents a node in the DOM tree Each DOMNode object can have child nodes attributes and other properties Here s an example of how you can create a hierarchical data structure to represent the DOM class DOMNode tagName string attributes key string string children DOMNode constructor tagName string this tagName tagName this attributes this children setAttribute name string value string this attributes name value addChild child DOMNode this children push child removeChild child DOMNode const index this children indexOf child if index this children splice index toString indentation string let str indentation lt this tagName for const attr value of Object entries this attributes str attr value if this children length gt str gt n for const child of this children str child toString indentation n str indentation lt this tagName gt else str gt return str Example usage const root new DOMNode html const head new DOMNode head root addChild head const title new DOMNode title title addChild new DOMNode text setAttribute value Document Title head addChild title const body new DOMNode body root addChild body const heading new DOMNode h heading addChild new DOMNode text setAttribute value Hello world body addChild heading const paragraph new DOMNode p paragraph addChild new DOMNode text setAttribute value This is a paragraph body addChild paragraph console log root toString In this example the DOMNode class represents a node in the DOM hierarchy Each node has a tagName property representing the HTML tag name an attributes object to store attributes and a children array to hold child nodes The setAttribute method allows setting attributes for a node and the addChild and removeChild methods are used to add or remove child nodes The toString method recursively converts the DOMNode and its children into a string representation preserving the hierarchical structure with proper indentation In the example usage section we create a sample DOM structure by creating instances of DOMNode and adding child nodes as necessary Finally we output the string representation of the root node using toString Search and Sorting Data StructuresSearch and sorting alrorithms are fundamental operations in computer science and data processing There are various data structures and algorithms designed to efficiently perform and sorting tasks Here are some commonly used data strutures for search and sorting Arrays are the most basic and straightforward data structure They store elements in contiguous memory locations making random access and search operations efficient However sorting an array can be time consuming typically requiring O nlogn time complexity for comparison based sorting algorithms like Quicksort or Merge sort Linked Lists Linked lists consist of nodes where each node contains data and a reference to the next node Searching in a singly linked list has a linear time complexity of O n However sorting a linked list can be challenging due to the lack of random access and efficient sorting algorithms often use other data structures in combination Binary Search Trees BST BSTs are binary trees where each node has a key and the left subtree contains keys smaller than the node while the right subtree contains larger keys Searching in a BST has an average time complexity of O logn making it an efficient search structure However the worst case scenario can degrade to O n if the tree is highly unbalanced Hash Tables Hash tables use an array combined with a hash function to store and retrieve elements based on their keys Search operations in a hash table have an average case time complexity of O but worst case scenarios can occur degrading search performance Hash tables do not inherently provide sorting functionality but they can be used in combination with other sorting algorithms Heaps Heaps are complete binary trees where each node satisfies the heap property either the maximum or minimum value at the root Heaps are commonly used in priority queues but can also be used for efficient sorting using heap sort which has a time complexity of O nlogn Balanced Search Trees Balanced search trees such as AVL trees Red Black trees or B trees provide efficient searching and sorting operations These trees ensure that the height remains balanced leading to logarithmic time complexity for search and insert delete operations Sorting in these trees can be achieved through in order traversals Graphs Graphs are not primarily designed for search and sorting but they can be used for specialized cases Sorting in graphs often involves topological sorting which arranges the vertices based on their dependencies Here s an example implementation of a balanced search tree specifically an AVL tree class Node value number left Node null right Node null height number constructor value number this value value this left null this right null this height class AVLTree root Node null constructor this root null getHeight node Node null number if node null return return node height getBalanceFactor node Node null number if node null return return this getHeight node left this getHeight node right updateHeight node Node node height Math max this getHeight node left this getHeight node right rotateRight z Node Node const y z left as Node const T y right as Node Perform rotation y right z z left T Update heights this updateHeight z this updateHeight y return y rotateLeft z Node Node const y z right as Node const T y left as Node Perform rotation y left z z right T Update heights this updateHeight z this updateHeight y return y insert value number void this root this insertNode this root value insertNode node Node null value number Node if node null return new Node value if value lt node value node left this insertNode node left value else if value gt node value node right this insertNode node right value else Duplicate values not allowed in AVL tree return node Update the height of the current node this updateHeight node Perform rotation if needed const balanceFactor this getBalanceFactor node if balanceFactor gt Left subtree is heavier if value lt node left value Left Left case return this rotateRight node else Left Right case node left this rotateLeft node left return this rotateRight node if balanceFactor lt Right subtree is heavier if value gt node right value Right Right case return this rotateLeft node else Right Left case node right this rotateRight node right return this rotateLeft node return node In order traversal of the AVL tree inOrderTraversal node Node null void if node null this inOrderTraversal node left console log node value this inOrderTraversal node right Example usage const tree new AVLTree tree insert tree insert tree insert tree insert tree insert tree insert tree inOrderTraversal tree root This is a basic implementation of an AVL tree It includes methods for inserting nodes into the tree performing rotations to maintain balance calculating height and balance factor and performing an in order traversal You can create an instance of AVLTree insert values into it and then use the inOrderTraversal method to print the sorted values in ascending order Here s an example implementation of a binary search tree BST class Node value number left Node null right Node null constructor value number this value value this left null this right null class BinarySearchTree root Node null constructor this root null insert value number void const newNode new Node value if this root null this root newNode else this insertNode this root newNode insertNode node Node newNode Node void if newNode value lt node value if node left null node left newNode else this insertNode node left newNode else if node right null node right newNode else this insertNode node right newNode search value number boolean return this searchNode this root value searchNode node Node null value number boolean if node null return false if value lt node value return this searchNode node left value else if value gt node value return this searchNode node right value else return true inOrderTraversal node Node null callback value number gt void void if node null this inOrderTraversal node left callback callback node value this inOrderTraversal node right callback Example usage const tree new BinarySearchTree tree insert tree insert tree insert tree insert tree insert tree insert tree insert const valueToSearch const isPresent tree search valueToSearch console log Value valueToSearch is present in the tree isPresent tree inOrderTraversal tree root value number gt console log value In this implementation the BinarySearchTree class represents a binary search tree It includes methods for inserting nodes searching for a value and performing an in order traversal Each node in the tree is represented by the Node class which contains the value and references to the left and right child nodes You can create an instance of BinarySearchTree insert values into it using the insert method search for a specific value using the search method and perform an in order traversal of the tree using the inOrderTraversal method Currently we have two implementations one for a binary search tree BST and another for a balanced search tree specifically an AVL tree The BST implementation provides basic functionality for inserting nodes searching for values and performing an in order traversal It follows the standard binary search tree properties where values smaller than the current node are placed in the left subtree and values larger are placed in the right subtree However it does not have any additional mechanisms to enforce or maintain balance within the tree On the other hand the AVL tree implementation includes methods for inserting nodes while ensuring the tree remains balanced It utilizes rotations and balance factor checks to maintain a balance between the left and right subtrees This balancing mechanism helps prevent the tree from becoming highly skewed or degenerate ensuring efficient operations with logarithmic time complexities Therefore the AVL tree implementation provides better performance guarantees for search insertion and deletion operations compared to the basic BST implementation which does not enforce balance Traversal and Search AlgorithmsTraversal algorithms are crucial for efficiently working with trees and accessing specific values within them and provide systematic ways to explore the elements of a tree Depth first traversal options such as pre order in order and post order allow for recursive exploration of the tree s nodes These traversals visit nodes in specific orders either before or after traversing child nodes Another popular traversal algorithm is breadth first traversal which explores the tree level by level using a queue to manage the order of node visits Search algorithms on the other hand are designed to efficiently find specific values within a tree Linear search is a simple algorithm applicable to any data structure sequentially checking each element until a match is found For sorted structures binary search offers an optimized approach by dividing the search space in half repeatedly efficiently narrowing down the range until the target value is located Understanding these traversal and search algorithms is essential for effectively working with trees and accessing their elements Traversal algorithms enable systematic exploration while search algorithms efficiently locate desired values Depending on the problem at hand and the characteristics of the tree choosing the appropriate algorithm can greatly impact performance and the outcome of operations performed on the tree In the context of binary trees traversal and search algorithms play a vital role Traversal algorithms like in order pre order and post order allow for systematic exploration of nodes while search algorithms such as depth first search DFS and breadth first search BFS efficiently find specific values These algorithms provide powerful tools for traversing binary trees searching for values and performing various operations By selecting the most suitable algorithm for a given task optimal performance can be achieved contributing to effective data manipulation and analysis in binary tree structures Here s an example implementation of in order pre order and post order traversal algorithms class Node value number left Node null right Node null constructor value number this value value this left null this right null class BinaryTree root Node null constructor this root null inOrderTraversal node Node null callback value number gt void void if node null this inOrderTraversal node left callback callback node value this inOrderTraversal node right callback preOrderTraversal node Node null callback value number gt void void if node null callback node value this preOrderTraversal node left callback this preOrderTraversal node right callback postOrderTraversal node Node null callback value number gt void void if node null this postOrderTraversal node left callback this postOrderTraversal node right callback callback node value Example usage const tree new BinaryTree tree root new Node tree root left new Node tree root right new Node tree root left left new Node tree root left right new Node console log In Order Traversal tree inOrderTraversal tree root value number gt console log value console log Pre Order Traversal tree preOrderTraversal tree root value number gt console log value console log Post Order Traversal tree postOrderTraversal tree root value number gt console log value The in order traversal visits the nodes in ascending order giving the output The pre order traversal visits the nodes in a pre order fashion giving the output The post order traversal visits the nodes in a post order fashion giving the output In this implementation the BinaryTree class represents a binary tree and the Node class represents a node within the tree The inOrderTraversal preOrderTraversal and postOrderTraversal methods perform in order pre order and post order traversals respectively To use the traversals you can create a binary tree by assigning nodes and their child relationships to the root and subsequent nodes Then you can call the appropriate traversal method and provide a callback function to perform the desired action on each visited node The example usage demonstrates traversing a binary tree and printing the values in the specified traversal order Traversal algorithms such as in order pre order and post order traversals play a fundamental role in various domains of computer science and software development These algorithms find practical applications in several real life scenarios In the realm of data structures traversal algorithms are essential when working with binary search trees BSTs allowing for the retrieval of elements in sorted order and facilitating operations like range queries Additionally traversal algorithms are commonly used in expression parsing and evaluation enabling the construction of abstract syntax trees and the evaluation of mathematical expressions Traversal algorithms also prove invaluable in file system navigation aiding in the systematic exploration of hierarchical directory structures They are further employed in graph traversal for tasks such as finding paths detecting cycles and solving connectivity problems In the context of compiler and interpreter design traversal algorithms support various stages of source code analysis including abstract syntax tree construction symbol table generation and code optimization Moreover traversal algorithms serve as key components in the efficient manipulation of other tree based data structures like AVL trees B trees and trie structures Overall traversal algorithms find versatile applications across domains contributing to the analysis and manipulation of data structures in real life scenarios ConclusionIn conclusion hierarchical data structures search and sorting algorithms and traversal algorithms are fundamental elements in computer science They hold significant importance in various domains ranging from organizing file systems to developing efficient search systems The advantages of trees include their flexibility high efficiency and scalability making them an ideal choice for processing and managing structured data In the next article we will delve into the world of cryptography and optimization Cryptography is an essential field that ensures information security and trees can be used in various cryptographic algorithms such as Merkle trees or search trees for key storage Optimization algorithms enable finding optimal solutions in complex problems and trees can be effective tools for optimizing processes and improving system performance By exploring cryptography and optimization we will expand our understanding of the capabilities of trees in computer science and see how they find their application in modern systems and solving complex problems Get ready for an exciting dive into these captivating areas in the next part of our article |
2023-07-03 18:56:20 |
海外TECH |
DEV Community |
Alice in Borderland Games |
https://dev.to/vulcanwm/alice-in-borderland-games-26il
|
Alice in Borderland GamesTo all you Alice in Borderland fans out there What was your favourite Alice in Borderland game and which one would you most likely want to play as an actual game |
2023-07-03 18:15:14 |
海外TECH |
DEV Community |
Deploy Rails with Yugabyte |
https://dev.to/yet_anotherdev/deploy-rails-with-yugabyte-4jah
|
Deploy Rails with YugabyteSo recently I ve discussed this with Franck Pachot about databases And he told me about YugabyteDB and the advantages of distributed SQL This article will show how to deploy a Yugabyte database locally And then connect a Rails app to it Let s see how smoothly this is Let s deploy this locallyThe documentation is well explained to deploy your Yugabyte database locally I created a docker compose yml to avoid rerunning the same command over and over services yuga image yugabytedb yugabyte b ports command bin yugabyted start daemon false Here you go Now you can try to connect to the database In the documentation they said that you could connect to the YugabyteDB with this command By runningdocker exec it yugabyte yuga home yugabyte bin ysqlsh echo queriesBut it turns out that I get this error ysqlsh could not connect to server Connection refused Is the server running on host localhost and accepting TCP IP connections on port could not connect to server Cannot assign requested address Is the server running on host localhost and accepting TCP IP connections on port After researching a solution I found this solution from Frank Pachot docker exec it yugabyte yuga bash c ysqlsh echo queries h hostname p Let s connect with a Rails appTo test this Yugabyte database I wanted to create a Rails app rails new yugapp d postgres Yugabyte is a PostgreSQL compatible database Using the adapter for Postgres with our rails app should work This is why I put the d postgres option Now we will need to tweak a bit the database yml file Indeed as we have seen above unlike Postgres Yugabyte is not accepting a connection on port but on I have managed to connect to the database locally with the configuration default amp default adapter postgresql encoding unicode host localhost port added by myself username postgres password Run your database rake task to create migrate and seed your database rails db create db migrate db seed RemarksThe rake task is slower with Yugabyte than with Postgres But this is normal Indeed the distributed engine needs to ensure everything is synced So the writing operations are necessarily slower And that s it Now you can run your server and it works nicely ConclusionDeploying a Yugabyte database is straightforward with your Rails app There is more to come from Yugabyte in the future for sure This is a really cool technology and distributed SQL is a passionate subject I hope to write about the RAFT algorithm soon |
2023-07-03 18:12:02 |
海外TECH |
DEV Community |
Who Writes Helm Charts? |
https://dev.to/thorstenhirsch/who-writes-helm-charts-27lc
|
Who Writes Helm Charts It seems like for Helm charts and their values files the whole IT department needs to provide input What are the dependencies of the application What settings are available to customize the application Server names URL of DB storage settings maybe also message broker and all other infrastructure platform requirementsInitial resource allocation scaling settings deployment strategy HA settings if on application level Internal network settings like ports to be opened between your pods service mesh settings amp mTLS certificates amp their renewalUsernames and passwords in the different stages path to secrets additional certificates that need to be importedBackup settings agents storage path interval settingsMonitoring amp logging agents forwarding settingsIf you work at a small company you might only have or people filling all these roles But imagine working at a big company where you really have different people Is it even possible under these circumstances to write Helm charts and their values files for an application in a single sprint So what s the solution Who writes Helm charts and their values files at your workplace Is splitting responsibility between charts and values files a good start Where do you draw the line between things that belong into Terraform scripts and things that go into Helm charts |
2023-07-03 18:03:03 |
海外TECH |
Engadget |
The best mobile microphones for 2023 |
https://www.engadget.com/best-mobile-microphones-for-recording-with-a-phone-154536629.html?src=rss
|
The best mobile microphones for If you consider yourself a mobile creator and you re not using some sort of dedicated microphone you might be holding yourself back We re not judging but your audience likely is Audio especially dialog is often overlooked but if you want true high quality content you need good sound There are many many options for the home or office studio but there are a surprising amount of mobile specific or at least mobile friendly solutions out there to elevate your on the go recordings be that for social a jam session live streaming making movies podcasting and beyond What “the best mic for your iPhone or Android is will vary depending on the task you need it for If you want to record a TikTok or a podcast or even a jam session all have slightly different needs but the selection below covers most bases and maybe even a few you didn t think of yet for recording high quality sound with little more than a mobile phone The gearThis guide is all about recording on the go free from the constraints of a studio or office but also far away from luxuries like power outlets acoustically friendly rooms and a full size PC As such there are two styles of microphone that really shine here Lavalier lapel and shotgun We ll be covering a few other types too but between those most tasks are covered We ll also show you how you can use the USB mics you may already have with your phone and even ways to connect heavy duty studio classics XLR to your humble handset but all that will be through accessories For now let s start with the classic clip mics James Trew EngadgetLavalier micsThe obvious benefit of a lapel mic is size Their small profile makes them perfect for presenting to the camera with the flexibility to move around while maintaining consistent audio quality If you re a budding TikTok or YouTube creator it s definitely worth having one of these in your bag The main trade off however is that they re only good for recording the person they re attached to If you have two people talking and only one is wearing the mic you ll only get good audio for one half of the conversation so for multi person recordings you ll need a mic for each guest and a way to record them at the same time so costs can go up quickly Fortunately lapel mics have become a very competitive market with good viable options costing as little as For an absolute bargain with a long cord and some connectivity accessories the Boya BY M is hard to argue with But while these budget choices are great value if you want something that should either last longer is more versatile or just sounds better it s worth paying a little bit more Best mm mic Rode Lavalier IIRode s Lavalier II is a slick looking low profile lavalier that sounds great At it s somewhere in the sweet spot between budget and higher end clip on options It s easy to recommend the Lavalier II just on its sound alone but it comes with a rugged case and a good selection of accessories For even more flexibility you can pair this with Rode s AI Micro interface which provides easy connection to an iPhone or Android or even PCs and adds support for a second mic perfect for recording podcasts or interviews Best USB C mic Sennheiser XSAt Sennheiser s XS USB C lav mic is fairly affordable sounds great and plugs right into your phone or laptop without needing an adapter This not only makes it convenient but reduces the overall cost as you don t need a headphone adapter for your phone What s more the XS has a meter long cable which gives you plenty of scope for movement or framing A word on wireless systemsJames Trew EngadgetRecently there has been an explosion in mobile friendly wireless systems but there are two we really like The first is Rode s Wireless GO II Arguably the original defined this category but the second generation improves on it with two wireless transmitters making this podcast and interview friendly This wireless microphone is also incredibly versatile as it doubles as a standalone recorder can be mounted in a camera cold shoe and even has its own “reporter mic adapter Oh and you can make any mm mic including the lavaliers above wireless by plugging it into one of the receivers The second is the Mikme Pocket This Austrian designed pack is a high end wireless lavalier microphone system designed to be particularly mobile friendly There s a comprehensive app for both video and audio recording and internal storage so you won t ever experience dropouts It also means you can enjoy a practically infinite range At it s a higher spend but if high quality audio and near infinite range are what you need then this is the one AdaptersSo we ve already touched on this with the AI Micro which is an adapter of sorts One of the first things you might bump up against when dealing with mobile audio accessories is TRRS vs TRS connectors Simply put mm TRS is what you might know as the age old classic headphone connector while TRRS became common for its support for headsets and inline mics You can easily tell them apart as TRS connectors have two black bands on them while a TRRS has three For you the budding creator it can be a bit of an annoyance as many mm lavaliers are going to be TRS and won t work when plugged into your phone s headphone adapter Sometimes your lavalier might include what you need in the box but otherwise you ll want to pick up a TRS to TRRS adapter like this Of course some smartphone specific mics have TRRS connectors already for those you ll want a cable that goes the other way should you want to use it with other devices like a DSLR Shotgun micsJames Trew EngadgetYou may be more familiar with shotgun mics when it comes to video recording It s the style of microphone most often found atop a DSLR or mirrorless camera but they make great companions for other portable devices too your cell phone included The benefit of a shotgun is that they tend to be highly directional which makes them perfect for podcasts recording instruments foley sounds and much much more For us mobile recordists another benefit is that they tend to be light and portable perfect for slipping into a backpack or even a laptop bag Even better there are some great mobile specific options Best shotgun mic for video music Sennheiser MKE nd gen You shouldn t buy a mic just because of how it looks but the MKE from Sennheiser definitely makes its rivals look wimpy More important than aesthetics though is how it sounds and the MKE records very cleanly without obvious coloration to the audio What s more the battery powered mic won t steal power from your phone or camera and with three gain levels to choose from you can boost things when needed or avoid clipping on louder subjects The MKE also comes with both TRS and TRRS cables for compatibility with a variety of devices The MKE s physical gain controls and high pass filter unlike the other two below that are updated via an app take the stress out of worrying if your audio source moves or changes volume as you can adjust that on the fly If you re a musician looking to record loud drums and then softer vocals on the move for example these tactile gain settings are a massive plus Best budget shotgun mic Rode VideoMic GO IIWhen we tested the VideoMic GO II we were surprised at just how good it sounded right out of the box At it rivals many desktop microphones that cost three times the price You ll need a companion app to change settings otherwise this performs well across the board Best shotgun mic for portability Shure MV Not to be confused with the older MV that plugged directly into a Lightning port the MV is a mini shotgun mic made with the smartphone in mind Often sold as a vlogging kit with a tripod and phone grip the MV has modular cables for connecting directly to Androids and iPhones Desktop and USB mics go mobileJames Trew EngadgetMobile specific mics are great but there s nothing stopping you from using your phone mic or another you might already have if it s somewhat portable You ll definitely need to do a little dance with some adapters but that s half the fun Below are a couple of recommendations for “regular microphones that pair well with a phone and then the cables and adapters that you ll need to get setup Apogee HypeMicArguably there are few microphones that are could be described as quot mobile friendly quot than the HypeMic from Apogee While it looks like a regular handheld mic it s actually deceivingly small making it very light and portable It also comes with cables to directly connect it to iPhones and Android handsets ーno adapters needed Don t let the small size deceive you though the HypeMic has a big trick up its sleeve a built in analog compressor for professional sounding vocals Whether you record podcasts vocals or instruments there s a setting on the HypeMic just for you At it s a little on the spendy side but you get a very versatile device that s just as useful for the desktop too Samson QUThis dynamic mic is a favorite with podcasters with many production companies using it as their standard mic to send out to remote guests thanks to its excellent quality to value performance The QU features both USB and XLR connectivity making it versatile for both desktop and mobile applications but it s the former we re interested in here as that s what allows you to connect it to your phone with nothing more than a USB cable and an adapter see below What s more the QU is solid enough to endure a little bit of rough and tumble so will happily live in the bottom of your backpack ready for when you need it Meanwhile the handheld design is versatile enough it can turn its hand to singing instruments podcasts interviews and more TulaYou may not be familiar with the name but Tula snuck into our hearts with its versatile vintage inspired debut microphone From a mobile perspective the Tula connects to Androids directly over USB C or iPhones with the right USB C to Lightning cable more on this below or a USB “camera kit adapter What makes the Tula special is that it s also a desktop mic and portable recorder with lavalier input and GB of storage and even features noise cancellation perfect for cutting down on outside background sounds With the Tula you could theoretically have one mic for home mobile and standalone recording IK Multimedia iRig Pre If you already have a stash of XLR mics or really do need a studio condenser mic with phantom power then the iRig Pre is a portable interface that will feed any XLR mic into your phone It runs off two AA batteries which it uses to supply phantom power when needed and won t drain your phone There s also a headphone port for monitoring gain controls and LEDs to help prevent clipping A word on cablesJames Trew EngadgetConnecting USB microphones directly to phones is rarely as simple as just one cable although that s starting to become more common In general Android makes this simpler but also thanks to the wide range of manufacturers and software versions you can t always guarantee things will work smoothly The iPhone is a whole other situation USB microphones have a good chance of working via the USB camera kit we mentioned earlier but that s still inelegant sometimes Frustratingly some USB C to Lightning cables will play nice with microphones but sadly most will not including Apple s own One confirmed option is this cable from Fiio or this generic alternative These are inexpensive enough that it s worth having a couple around if you work with audio a lot they of course can also be used to charge your phone as a bonus This article originally appeared on Engadget at |
2023-07-03 18:50:07 |
海外TECH |
Engadget |
Tidal is increasing its HiFi plan to $11 per month |
https://www.engadget.com/tidal-is-increasing-its-hifi-plan-to-11-per-month-183139113.html?src=rss
|
Tidal is increasing its HiFi plan to per monthTidal has followed Apple Music Deezer and Amazon Music by increasing the price of its base HiFi subscription Starting on August st the cost of an individual membership is going up by to per month in the US while the family plan will run you per month an increase of According to Billboard prices are going up in other markets too Tidal confirmed to Engadget that the Tidal HiFi Plus tier is not affected This per month plan includes Dolby Atmos Music Sony Audio and Master Quality Authenticated MQA tracks There appear to be no changes to the free tier student plan and discounted military membership for now nbsp Several of Tidal s rivals have increased their prices in recent months Deezer and Apple Music both bumped up the prices of their individual plans to per month in late Amazon Music followed suit in February Spotify meanwhile hasn t changed the price of its per month individual plan in the US since The company is expected to do so in the near future following recent remarks by CEO Daniel Ek Rumors also suggest that Spotify s long awaited high fidelity plan which is said to include audiobooks could arrive this year Update PM ET Added clarification from Tidal This article originally appeared on Engadget at |
2023-07-03 18:31:39 |
海外TECH |
WIRED |
20 Best Early Amazon Prime Day 2023 Deals: Pixel Phones, Apple Watches, and Dyson Gear |
https://www.wired.com/story/early-prime-day-deals-2023/
|
Best Early Amazon Prime Day Deals Pixel Phones Apple Watches and Dyson GearAmazon s big sale event arrives in July but the discounts have already startedーincluding on office chairs and the Apple Watch Series |
2023-07-03 18:21:00 |
ニュース |
BBC News - Home |
Watch: Explosions and gunfire as BBC reports from Jenin |
https://www.bbc.co.uk/news/world-middle-east-66093147?at_medium=RSS&at_campaign=KARANGA
|
palestinian |
2023-07-03 18:28:04 |
ニュース |
BBC News - Home |
Buck Moon: July supermoon to appear brighter than usual in the sky this week |
https://www.bbc.co.uk/news/world-66091619?at_medium=RSS&at_campaign=KARANGA
|
uk |
2023-07-03 18:16:29 |
ニュース |
BBC News - Home |
Parole Board asked to reconsider Colin Pitchfork release |
https://www.bbc.co.uk/news/uk-england-leicestershire-66090922?at_medium=RSS&at_campaign=KARANGA
|
dangerous |
2023-07-03 18:16:44 |
ニュース |
BBC News - Home |
Steven Gerrard: Ex-Liverpool midfielder named manager of Saudi Pro League Al-Ettifaq |
https://www.bbc.co.uk/sport/football/65889461?at_medium=RSS&at_campaign=KARANGA
|
ettifaq |
2023-07-03 18:21:17 |
ニュース |
BBC News - Home |
Wimbledon 2023 results: Britons Jodie Burrage & Liam Broady through, Dart & Swan out |
https://www.bbc.co.uk/sport/tennis/66086408?at_medium=RSS&at_campaign=KARANGA
|
wimbledon |
2023-07-03 18:41:10 |
コメント
コメントを投稿