AWS |
AWS Mobile Blog |
Share code between Next.js apps with Nx on AWS Amplify Hosting |
https://aws.amazon.com/blogs/mobile/share-code-between-next-js-apps-with-nx-on-aws-amplify-hosting/
|
Share code between Next js apps with Nx on AWS Amplify HostingIn this post we will explore the capabilities of Amplify Hosting to interface with monorepos specifically Nx and deploy the frontend applications that reside in them nbsp We ll learn the benefits of using a monorepo through an example of multiple banking websites that use the same mortgage calculator made up of libraries and components that can … |
2023-06-29 14:01:56 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
venvで手軽にPythonの仮想環境を構築しよう |
https://qiita.com/shun_sakamoto/items/7944d0ac4d30edf91fde
|
開発 |
2023-06-29 23:51:59 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
【make it easy】POIから卒業しましょう |
https://qiita.com/changkejun/items/dea128563b608b7dcb43
|
httpsja |
2023-06-29 23:14:07 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
Next.jsについて |
https://qiita.com/hukuryo/items/2c07c52ff3386d5d75b9
|
nextjs |
2023-06-29 23:14:03 |
技術ブログ |
Developers.IO |
[GitHub] Audit log の展開可能なペイロードビューが GA となり、UI から詳細なログが確認できるようになりました |
https://dev.classmethod.jp/articles/new-expandable-event-payload-view-is-fully-available-in-all-audit-logs/
|
auditlog |
2023-06-29 14:21:19 |
海外TECH |
MakeUseOf |
An Introduction to Routing in Svelte |
https://www.makeuseof.com/svelte-routing-introduction/
|
discover |
2023-06-29 14:45:18 |
海外TECH |
MakeUseOf |
Can ChatGPT Control Your Smart Home? |
https://www.makeuseof.com/can-chatgpt-control-your-smart-home/
|
smart |
2023-06-29 14:30:17 |
海外TECH |
MakeUseOf |
The 6 Best Free Apps to Turn Photos Into Art and Paintings |
https://www.makeuseof.com/tag/5-free-apps-turn-photos-art-android-ios-web/
|
ordinary |
2023-06-29 14:16:44 |
海外TECH |
MakeUseOf |
How to Fix the Microsoft Office Error 0x80041015 on Windows |
https://www.makeuseof.com/microsoft-office-error-0x80041015-windows/
|
error |
2023-06-29 14:16:19 |
海外TECH |
DEV Community |
Terrible tips for a C++ developer |
https://dev.to/anogneva/terrible-tips-for-a-c-developer-3kp0
|
Terrible tips for a C developerLet s talk about bugs and bad coding practices There are many guides on this topic I would like to recommend an interesting and non standard compilation of terrible tips Andrey Karpov the author of fascinating articles about C has published a mini book terrible tips for a C developer This is a case when reading about programming is both useful and entertaining The book can come in handy not only for C developers it has some general tips for all programmers It is especially useful for beginners who want to know what is right and what is wrong Each terrible tip is brief and easy to understand And the main thing is that everything is based on some real life cases It s not just a list of terrible tips but a practical guide that helps developers avoid typical coding mistakesHere are some fragments from the book that made me smile me Terrible tip N Invisible characters The author has a point that using them in your code makes things magical and it s cool That sounds like fun But seriously such character sequences can cause the developer and the compiler to interpret the code differently Terrible tip N Professionals do not make mistakesThe point here is that there are experts who understand better than anyone else how to code and how to test But in fact they are subjected to a cognitive bias ー illusory superiority ーjust like all of us honestly In general all developers need to check their code Terrible tip N For as long as possible resist using the new C standardIt is better and more efficient to switch to a new version of the language but some developers may say that they stick to the old standard just in case They say this is because someday their project may be in demand on platforms with outdated compilers However this may never happen The tip may seem obvious but it would be a good idea for developers to think about it again In addition to such tips there are some points that show how to avoid typical bugs and create a clean and reliable code To summarize I would describe this mini book as informative entertaining and easy to understand You can find the full version of the book here |
2023-06-29 14:39:48 |
海外TECH |
DEV Community |
7 Secret JavaScript Web-APIs That You Don't Know ✨🔥 |
https://dev.to/akashpattnaik/7-secret-javascript-web-apis-that-you-dont-know-4p57
|
Secret JavaScript Web APIs That You Don x t Know JavaScript is a versatile programming language that powers the interactive elements of websites and web applications While many developers are familiar with the common JavaScript APIs there are several lesser known Web APIs that can greatly enhance the functionality and user experience of your web projects In this article we will explore seven secret JavaScript Web APIs that you may not be aware of By leveraging these APIs you can unlock new possibilities and take your web development skills to the next level Table of Contents 🪜The Notifications APIThe Speech Recognition APIThe Geolocation APIThe Web Bluetooth APIThe Battery Status APIThe Vibration APIThe Payment Request APIConclusion The Notifications API The Notifications API allows web developers to send notifications to users directly from their websites This API enables you to display system notifications even when the user is not actively browsing your site By utilizing this API you can provide timely updates reminders or alerts to your users enhancing their engagement and user experience Example usage of the Notifications APIif Notification in window Notification requestPermission then function permission if permission granted new Notification Hello world The Speech Recognition APIThe Speech Recognition API enables speech recognition capabilities in web applications With this API you can capture spoken words and convert them into text opening up possibilities for voice controlled interfaces voice commands and speech to text functionalities By integrating speech recognition into your web projects you can create more accessible and user friendly applications Example usage of the Speech Recognition APIif SpeechRecognition in window const recognition new SpeechRecognition recognition onresult function event const transcript event results transcript console log You said transcript recognition start The Geolocation API The Geolocation API provides information about the user s current geographical location By using this API you can retrieve latitude longitude and other location related data This information can be utilized to offer location based services such as finding nearby restaurants displaying local weather information or providing customized content based on the user s location Example usage of the Geolocation APIif geolocation in navigator navigator geolocation getCurrentPosition function position const latitude position coords latitude const longitude position coords longitude console log Latitude latitude console log Longitude longitude The Web Bluetooth API The Web Bluetooth API allows web applications to communicate with Bluetooth devices With this API you can connect to and interact with Bluetooth enabled devices such as fitness trackers smartwatches or IoT devices By leveraging the Web Bluetooth API you can create web applications that seamlessly integrate with the physical world Example usage of the Web Bluetooth APIif bluetooth in navigator navigator bluetooth requestDevice filters services heart rate then function device console log Device device name catch function error console error Error error The Battery Status API The Battery Status API provides information about the device s battery status This API enables you to access battery related information such as the battery level charging status and time remaining until the battery is fully discharged By using this API you can optimize your web applications based on the device s battery life offering energy efficient experiences to your users Example usage of the Battery Status APIif getBattery in navigator navigator getBattery then function battery console log Battery level battery level console log Charging battery charging console log Time remaining battery dischargingTime The Vibration API The Vibration API allows web applications to control the device s vibration capabilities With this API you can trigger vibrations of different patterns and durations providing haptic feedback to your users The Vibration API can be utilized to enhance game experiences create immersive interactions or provide tactile notifications Example usage of the Vibration APIif vibrate in navigator navigator vibrate Vibrate for second The Payment Request API The Payment Request API simplifies the payment process in web applications This API enables you to integrate secure and seamless payment functionality allowing users to make payments using stored payment methods or digital wallets By implementing the Payment Request API you can streamline the checkout process and improve conversion rates Example usage of the Payment Request APIif PaymentRequest in window const paymentRequest new PaymentRequest supportedMethods basic card total label Total amount currency USD value paymentRequest show then function paymentResponse console log Payment response paymentResponse Conclusion In this article we have uncovered seven secret JavaScript Web APIs that can add powerful features to your web projects From sending notifications and enabling speech recognition to accessing geolocation data and controlling device vibrations these APIs offer exciting possibilities for web developers By incorporating these lesser known APIs into your work you can create more engaging interactive and user friendly web experiences Feel free to explore these secret JavaScript Web APIs and elevate your web development skills Connect with me Mail akashpattnaik github gamil comGithub iAkashPattnaikTwitter akash am |
2023-06-29 14:37:50 |
海外TECH |
DEV Community |
Ruby Method of the Day: String#=~ |
https://dev.to/burdettelamar/ruby-method-of-the-day-string-30f2
|
Ruby Method of the Day String Method String searches string self looking for the given argument Regexp or other object When the argument is a regexp the method returns the integer index of the first substring that matches the regexp or nil if no match But that s only the beginning The method also sets a number of global variables that give more details Returns a MatchData object or nil amp Returns the matched part of the string or nil Returns the part of the string to the left of the match or nil Returns the part of the string to the right of the match or nil Returns the last group matched or nil etc Returns the first second etc matched group or nil Note that is quite different it returns the name of the currently executing program See examples at Regexp Global Variables Yes I ve copied shamelessly from the official documentation for regexp global variables But I don t feel bad I wrote that documentation as well as the documentation for String |
2023-06-29 14:32:25 |
海外TECH |
DEV Community |
AWS Speakers Directory: Adding AI Functionality |
https://dev.to/aws-builders/community-speakers-directory-adding-ai-functionality-3427
|
AWS Speakers Directory Adding AI Functionality BackgroundIn June Johannes Koch Matt Morgan Julian Michel and myself participated in the AI themed hackathon for the AWS Community Builders The hackathon challenge was to create a tool using the Transformer Tools framework The ProjectJohannes had the idea that we agreed to implement We ended up building an AWS community focused speaker directory website Think an awesome AWS focused version of sessionize where event organizers can create an event Speakers can create a speaker profile and use the site to submit talks to the various events For more details on the project take a look at Matt s overview post This post focuses on how we utilized the Hugging Face transformers agent to add functionality to our speaker directory Here s links to posts by my teammates on other topics related to the projectOverviewHow we used Amplify FlutterHow we used CodeCatalystHow we used AppSync merged APIs AI FunctionalityThe AI functionality that we added to enhance the speaker directory was Generate an image whenever a speaker adds a new talkGenerate appropriate tags and add tags to newly added talksAllow event organizers to get recommendations of talks that fit their event based off of a set of tags Implementation Overview ArchitectureFeatures and were set this up in a similar way We have a DynamoDB DDB event source that triggers both Functions via a DDB stream whenever a new talk is added via an AppSync GraphQL GQL mutation The two Functions then do the work of generating images and dynamically adding tags to the talk The final step of the tag generation Function feature is to insert the generated tags into our DDB table We then have another DDB stream that triggers when a tag is inserted that then triggers a Function that does some aggregation for us to support feature For feature we set up a GQL mutation that accepts an array of tags and queries our DDB table to retrieve a list of talks recommendations that also contain those tags More on the FunctionsEveryone on the team was new to the world of AI ML one thing we quickly realized was that these Functions were very heavy in terms of the size number of dependencies needed and in terms of the compute power needed to complete these complex AI processing tasks Inspired by this blog post we decided to utilize an EFS file system to cache some artifacts to lessen cold start on subsequent requests to these AI processor Functions Due to the number of dependencies needed we decided to take advantage of packing our Function code using Docker containers instead of zip files to take advantage of the higher size limit Matt also learned that sometimes maintainers are not great at updating the dependencies in their Docker images and he ended up creating a custom Docker image based off of the image used in that linked blog post with updated Python and gradio tools we needed it for image generation Function code Generate ImageThis Function responds to the DDB insert event when a new talk is added calls the Hugging Face agent to generate an image based off of the description of the talk and puts the generated image into an S bucket The new part for us was working with the Hugging Face agent We first needed to login using credentials stored in Secrets Manager and generate the image using stable diffusion gradio tools from gradio tools import StableDiffusionPromptGeneratorToolfrom huggingface hub import loginimport botofrom transformers import HfAgent Toolgradio tool StableDiffusionPromptGeneratorTool tool Tool from gradio gradio tool ssm boto client ssm agent token ssm get parameter Name community speakers agent token WithDecryption True login agent token Parameter Value agent HfAgent additional tools tool The entire Function code looked like thisimport botoimport osfrom gradio tools import StableDiffusionPromptGeneratorToolfrom huggingface hub import loginfrom io import BytesIOfrom transformers import HfAgent Toolimport jsonBUCKET NAME os getenv BUCKET NAME gradio tool StableDiffusionPromptGeneratorTool s boto resource s ssm boto client ssm tool Tool from gradio gradio tool agent token ssm get parameter Name community speakers agent token WithDecryption True login agent token Parameter Value agent HfAgent additional tools tool def handler event context print json dumps event image event Records dynamodb NewImage image agent run Generate an image of the prompt after improving it remote True prompt f image description S image title S buffer BytesIO image to raw save buffer png buffer seek prefix ai generated newId event Records dynamodb Keys pk S replace replace s Bucket BUCKET NAME put object Body buffer Key f prefix str newId png response statusCode body ok return response Function Code Generate TagsThis function utilized a similar pattern in terms of connecting to Hugging Face however we utilized a different tools for this the Bart model import botoimport osfrom datetime import datetimefrom transformers import pipelineoracle pipeline model facebook bart large mnli tableName os getenv TABLE NAME client boto client dynamodb def handler event context tags get tags candidate labels t tagName S lower for t in tags image event Records dynamodb NewImage Use both the title and the description of the talk to identify tags identifiedTags oracle f image title S lower image description S lower candidate labels candidate labels labels identifiedTags labels scores identifiedTags scores selectedTags t for index t in enumerate labels if scores index gt save tags image selectedTags response statusCode body identifiedTags return response Query all tags to get a list of label candidates def get tags response client query ExpressionAttributeNames pk pk ExpressionAttributeValues tag S tag KeyConditionExpression pk tag TableName tableName tags response Items Need the loop to get all tags while LastEvaluatedKey in response response client query ExclusiveStartKey response LastEvaluatedKey ExpressionAttributeNames pk pk ExpressionAttributeValues tag S tag KeyConditionExpression pk tag TableName tableName tags update response Items return tags We re going to save any tags that the creator may have neglected to apply def save tags image tags tagList list set t S for t in image tags L tags print tagList Update the original talk with any new tags client update item ExpressionAttributeNames tags tags md md ExpressionAttributeValues tags L S t for t in tagList md S datetime now isoformat Key pk S image pk S sk S image sk S UpdateExpression SET tags tags md md TableName tableName Save any new tags for tag in tags try client put item ConditionExpression attribute not exists pk and attribute not exists sk Item pk S image pk S sk S f tag tag gsipk S f tag tag gsisk S image pk S tagName S tag title S image title S et S TAG ct S datetime now isoformat md S datetime now isoformat TableName tableName except client exceptions ConditionalCheckFailedException print Tag already existed Function Code Aggregate TagsThis is triggered whenever a new tag is inserted into our table As you ll see in the recommend talks Function these aggregations support that feature Because we don t need to utilize the Hugging Face transformers in this Function we decided to do this one in Typescript rather than Python import UpdateCommand from aws sdk lib dynamodb import type DynamoDBStreamEvent from aws lambda import docClient tableName from util docClient export const handler async event DynamoDBStreamEvent Promise lt void gt gt for const record of event Records const image record dynamodb NewImage if image tagName S continue const tagName image tagName S const command new UpdateCommand ExpressionAttributeNames quantity quantity tagName tagName et et ct ct md md ExpressionAttributeValues one tagName tagName timestamp new Date toISOString zero et TAG COUNT Key pk tag sk tag tagName TableName tableName UpdateExpression SET quantity one if not exists quantity zero tagName tagName et et ct if not exists ct timestamp md timestamp await docClient send command Function Code Recommend TalksThis Function is set up as a GQL resolver that is called from our Flutter frontend We decided to set this one up as a Lambda resolver rather than a JS pipeline resolver because this feature is making multiple queries to our table This Function also does not utilize the Hugging Face transformers so we decided to write it using Typescript rather than Python import QueryCommand from aws sdk lib dynamodb import type AppSyncResolverEvent from aws lambda import type Event type Talk from API import docClient tableName from util docClient export const handler async event AppSyncResolverEvent lt event Event gt Promise lt Talk gt gt const eventTags event arguments event tags const talks Array lt Talk amp matches number gt for const eventTag of eventTags const queryTagsCommand new QueryCommand ExpressionAttributeNames gsipk gsipk ExpressionAttributeValues gsipk tag eventTag KeyConditionExpression gsipk gsipk IndexName gsi TableName tableName const tagsResult await docClient send queryTagsCommand if tagsResult Items continue for const tagResult of tagsResult Items const queryTalksCommand new QueryCommand ExpressionAttributeNames pk pk sk sk ExpressionAttributeValues pk tagResult gsisk talk talk KeyConditionExpression pk pk and begins with sk talk TableName tableName const talksResult await docClient send queryTalksCommand if talksResult Items talksResult Items forEach talk gt if talks find t gt t pk talk pk talks push talk as Talk talks forEach talk gt const matchCount talk tags filter t gt eventTags includes t length talk matches matchCount return talks filter t gt t matches sort a b gt a matches amp amp b matches amp amp a matches lt b matches slice Trade offsWe noticed that generative AI takes a lot longer to process than your typical CRUD like API against a database For this reason a lot of our processing was conducted in an async manner Not necessarily a trade off but we did need to change our mental model in how we approached this as it was not going to be a good user experience if we stuck with the more traditional request response model An issue that we ran into was that the shared AWS account we were using for the hackathon was considered new and had some additional usage limits on it In our case the Lambda Functions had an upper limit of mb Most of the time this is more than enough memory for a request response API endpoint that interfaces with a database however with AI ML having more memory would ve helped with our slow responses during the processing We wrote a ticket to AWS support and were told that these limits are in place on newer accounts to prevent surprise bills Then they told us they couldn t raise the limit until they saw more activity in the account I can t speak for my teammates but it is my personal hope that AWS can improve this process and live up to the customer obsession leadership principle We ran into other issues with the new account limits but that is the only one I ll mention here since it is directly related to our AI integrations Post Hackathon PlansGiven the timeline for this hackathon days and the fact that no one on this team had extensive experience with AI ML we took some shortcuts when it came to the talk recommendations feature Overall I m happy with how it came out Post hackathon we plan to explore creating and training our own custom data model based off of what was entered into our DDB table in order to see if we can further lean on AI ML and get more specific beyond tags recommendations I would ve liked to go beyond the Hugging Face transformers and see if some of this could be implemented using SageMaker endpoints or another AI platform Potential benefits that I saw with SageMaker endpoints over our implementation was that this is in the AWS ecosystem for a hopefully tighter integration and being able to speed up processing I learned from this hackathon that Hugging Face is great but there might also be other tools out there that better suit our needs We won t know for sure until we try ClosingOverall this was a fun collaboration It feels good to contribute to building something that the community will use and to learn from my peers within the community while doing so On a personal level life got in the way and I did not have as much time as I would ve liked to have to dedicate to this project I thank my team mates for their hard work via ideas and implementation Major props to Matt for doing a lot of the AI implementation If you would like to participate with us building out the AWS Speaker Directory to help AWS User Group leaders find speakers please reach out of any of us |
2023-06-29 14:17:00 |
海外TECH |
DEV Community |
Top 8 Tools to Build Your Own PaaS |
https://dev.to/morganperry_/top-8-tools-to-build-your-own-paas-p1c
|
Top Tools to Build Your Own PaaSImagine you can build your own Heroku Exciting right Building your own PaaS Platform as a Service can revolutionize the way you deploy and manage applications One of the key advantages of a custom PaaS solution is its ability to streamline the complete application life cycle With a well designed PaaS environment developers can easily package their applications define dependencies and deploy them seamlessly across various cloud environments This simplifies the deployment process reduces time to market and ensures consistent application delivery By leveraging PaaS tools developers can focus their efforts on writing code and innovating rather than being burdened by infrastructure setup and maintenance tasks Disclaimer I m the co founder of Qovery and we ve built our own PaaS designed to integrate with multiple cloud providers including AWS Here is a list of the most popular tools to create your own PaaS and unlock the full potential of your application infrastructure Note The order doesn t matter since all the following tools have their own unique twist DokkuDokku is a lightweight and open source PaaS platform that simplifies application deployment by leveraging Docker With Dokku developers can easily push their applications using Git allowing Dokku to build and run them in isolated containers Its CLI only approach and plugin architecture make it highly extensible Dokku s modular plugins enable features like database integration Let s Encrypt SSL certificates and automated Slack notifications giving developers flexibility and control over their PaaS environment Dokku Key FeaturesLightweight and Easy to Set UpLanguage and Framework AgnosticHeroku CompatibilityCLI client for integrating into existing build toolsGit Based DeploymentBuilt in Docker support for advanced usagePlugin System and Extensibility Cloud FoundryCloud Foundry is a mature and widely adopted PaaS solution that uses the scalability of Kubernetes to build a simple yet performant PaaS option It offers robust features such as built in scaling logging and automation capabilities With Cloud Foundry you can easily deploy applications across multiple clouds enabling portability and flexibility Its extensive ecosystem and support for various programming languages make it an attractive option for enterprises seeking a powerful PaaS solution Cloud Foundry Key FeaturesBuilt in Scaling and High AvailabilityApplication lifecycleLogging and MetricsAutomation and DevOps EnablementMultiple Language and Framework SupportBuilt in service marketplace for enhancing deployment functionalityMulti Cloud DeploymentFlexible infrastructure support through BOSH stemcellsCommunity and Support CapRoverCapRover a popular open source PaaS solution emerged in Developed using TypeScript CapRover boasts a user friendly interface that demands just a few commands to kickstart your journey Leveraging the power of Docker CapRover supports the deployment of a wide range of applications with minimal overhead While CapRover s ease of use sets it apart its standout feature lies in the built in marketplace offering one click deployment of popular applications like WordPress and MySQL This marketplace simplifies the deployment process significantly reducing the complexity associated with launching applications on CapRover CapRover Key featuresWeb GUI for ease of useCLI for scripting and automationLoad balancing with the help of NginxFree SSL certificates using Let s EncryptContainerization and clustering using Docker SwarmAutomatic SSL certificate provisioning from Let s EncryptSupports all Docker based applicationsBuilt in marketplace for one click deploys of other popular open source applications QoveryQovery is a comprehensive PaaS tool that offers a range of features to simplify the deployment and management of applications With Qovery you can easily deploy your applications in various cloud environments eliminating the complexities of infrastructure setup Its intuitive and developer friendly interface Git integration and automatic scaling capabilities make it a powerful choice for building a custom PaaS Qovery s seamless integration with popular frameworks and databases further enhances its appeal Qovery Key FeaturesAutomatically installed on your cloud account in minutes User friendly Interface amp Modern UIEasy application deployment using GitZero maintenance no infrastructure upgrades everything is handled by Qovery Built in support for AWSCronjob Workers Custom Domain TLS auto scaling Environment Variables Secrets Management Rollback…Preview Environments amp Cloning Environments in one clickAdvanced Security features RBAC Audit Logs SOC HIPAA Compliance Extensibility amp IntegrationsBusiness and community supportQovery is a powerful choice for building your own PaaS on AWS or other cloud providers allowing you to focus on your applications and accelerate your development processes CoherenceEmerged in Coherence is a cloud native PaaS tool focused on providing seamless deployment experiences It offers intelligent auto scaling logging and monitoring capabilities ensuring performance and reliability for your applications Coherence s emphasis on automation and ease of use enables developers to quickly deploy and manage their applications without compromising on quality Coherence is a relatively young platform that is still evolving but the product looks promising Coherence Key FeaturesUser friendly interfaceAutomated infra as codeManaged CI CDPreview EnvironmentsAuto ScalingSeamlessly integrates with popular DevOps tools and workflowsBuilt in support for AWS VirtuozzoVirtuozzo is a powerful PaaS tool designed specifically for containers and virtualization It provides container orchestration capabilities and supports high density workloads allowing you to build scalable and efficient PaaS environments Virtuozzo offers a lite edition that shares most features with its Business and Enterprise counterparts albeit with certain limitations But it s very effective for small applications and saves a lot of costs Virtuozzo is best suited for e commerce websites and applications Virtuozzo Key FeaturesHigh Density WorkloadsAutomatic vertical and horizontal scalingBuilt in monitoring and troubleshooting toolsAPI CLI and SSH access for container managementEasy integration with popular container ecosystem tools and servicesContainer and Kubernetes supportSupport and Expertise PortainerPortainer is a container management tool that can be leveraged to build a PaaS environment Its intuitive interface multi cloud support and container orchestration features simplify the management of containers and services Portainer allows you to monitor resource usage manage container networks and deploy applications with ease Portainer Key FeaturesIntuitive interfaceMulti cloud supportPowerful container orchestration tool supports Kubernetes and Docker Swarm Application templates and stacksAutomatic stack updatesMonitoring and logging tools integrationExtensibilityCommunity support RancherRancher is a comprehensive container management platform that offers extensive capabilities for building a custom PaaS environment It provides advanced container orchestration networking and infrastructure management features With Rancher you can easily deploy scale and manage containerized applications across diverse environments Its flexibility and scalability make it an excellent choice for organizations looking to create their own PaaS platforms Rancher Key FeaturesContainer Orchestration amp Scheduling Kubernetes Docker Swarm and Apache Mesos support Advanced networking capabilitiesMulti Cluster ManagementApplication CatalogResource allocation amp Scaling capabilitiesExtensibility and Ecosystem Integration supports a wide range of third party integrations Observability amp AlertsCommunity and Support ConclusionBuilding your own PaaS using the right tools can revolutionize your application deployment and management processes From comprehensive solutions like Cloud Foundry and Qovery to lightweight options like Dokku and CapRover these tools offer a range of features and functionalities to suit different needs So what s next Go ahead and try the above tools to build your own PaaS Most of them are open source or offer a free plan Are there any other solutions that you believe are worth mentioning and might have been overlooked |
2023-06-29 14:15:11 |
海外TECH |
DEV Community |
How to kickstart automated test suite when there are 0 tests written and the codebase is already huge |
https://dev.to/zvone187/how-to-kickstart-automated-test-suite-when-there-are-0-tests-written-and-the-codebase-is-already-huge-164p
|
How to kickstart automated test suite when there are tests written and the codebase is already hugeYou know there s a certain anxiety that creeps in when you take a look at a codebase you re just starting to work on only to realize it s a vast uncharted wilderness Not a single test has been written to guard against the unexpected It s like walking on a tightrope over a chasm knowing a single misstep could send your entire project plummeting into chaos If you worked on a codebase with tests you know that it can be a daunting task to think about covering the entire codebase with tests from scratch where none currently exist The process demands an almost Herculean effort you d have to pour over every function method and component brainstorm all potential edge cases structure the test suite code and get it all running smoothly And that s not even touching on the time it takes to reach meaningful coverage We re talking weeks perhaps months before you can sit back and say “Yes we ve hit or coverage This is why I m excited to share what I ve been working on for the past couple of months This journey takes us to a place where the realm of automated testing meets the magical world of AI Meet Pythagora an open source dev tool that s about to become your new best friend Throughout this blog post I m going to show you how to kickstart automated testing with Pythagora which harnesses the power of AI to generate tests for your entire codebase all with a single CLI command and hopefully get your codebase to code coverage in a single day Creating a test suite from scratchWe all know the saying “Rome wasn t built in a day The same could be said for a comprehensive effective test suite It s a meticulous demanding process but once you ve traversed this rocky road the sense of accomplishment is profound Let s journey together through the necessary steps involved in creating a test suite from scratch and reaching that coveted code coverage Laying the groundworkIn the first stage you re like a painter in front of a blank canvas The world is full of possibilities and you re free to create a masterpiece Your masterpiece in this case involves choosing the types of tests you want to write finding the right testing framework to use and adopting the best practices suited for your specific environment Are you considering unit tests integration tests EE tests or a blend of all three While this initial setup is often viewed as the “easy part it is by no means a walk in the park Time research and perhaps a few cups of coffee are required to make informed decisions Diving into the detailsOnce you ve got your basic structure in place it s time to roll up your sleeves and delve deep into the nitty gritty Now you ll need to go through your entire codebase one function at a time and write tests for each Your task here is to ensure that your tests touch all lines of code within each function method or component This task is akin to exploring an intricate labyrinth You need to traverse every path turn every corner and ensure no stone is left unturned Writing these tests is a detailed time intensive step It s not just about writing a few lines of code it s about understanding the function s purpose its expected output and how it interacts within your application Exploring the edge casesAfter the initial round of testing you might breathe a sigh of relief Hold on though there s still an important piece of the puzzle left It s time to dive into the wild unpredictable world of edge cases This part might not increase your code coverage percentage but it s crucial in testing the robustness and resilience of your code These so called negative tests help evaluate how your code reacts to various inputs particularly those on the fringes of expected behavior From empty inputs to values that push the limits of your data types these tests are designed to mimic user behavior in the real world where users often have a knack for pushing your code in directions you never thought possible Creating a test suite from scratch is a Herculean task But rest assured every effort you put in is a step towards creating a more robust reliable and resilient application And remember you re not alone We ve all been there and with a tool like Pythagora the journey is not as daunting as it may seem Generating Tests with one CLI commandOn the other hand with Pythagora what you can do is enter npx pythagora unit tests path path to repoPythagora will navigate through all files in all folders conjuring up unit tests for each function it encounters Now you can sit back and relax or go grab lunch and let it run for a while until it finishes writing tests Ok but wait what the hell is Pythagora What is PythagoraI ve always dreamed of a world where automated tests could be created for me But the reality isn t that simple No one knows your code quite like you do making it challenging for another to draft effective automated tests for it The results often fall short of what you d achieve yourself However everything changed when ChatGPT entered the scene As I tinkered with this technology I found myself wondering “Could we harness the power of ChatGPT for writing automated tests Curiosity piqued I delved deeper experimenting with its capabilities and what I discovered blew me away ChatGPT demonstrated an incredible ability to comprehend code offering a glimpse of a promising new avenue in automated testing And thus an idea for Pythagora was born Pythagora is an open source dev tool crafted with one mission in mind making automated testing autonomous I envision a world where developers such as you and me can focus on creating features without getting bogged down in the mire of test writing and maintenance To achieve this vision it s using GPT Currently Pythagora has the prowess to write both unit and integration tests However for the purposes of this blog post we ll concentrate on its ability to generate unit tests InstallationTo install Pythagora you just need to do npm i pythagora That s it Pythagora is now at your service ConfigurationOnce Pythagora is installed you ll need to configure it with an API key This can either be an OpenAI API key or a Pythagora API key To use an OpenAI API key you should run the following command npx pythagora config openai api key lt OPENAI API KEY gt It s important to note that if you choose to use your own OpenAI API key you must have access to GPT Alternatively you can obtain a Pythagora API key from this link Once you have it set it up with the following command npx pythagora config pythagora api key lt PYTHAGORA API KEY gt CommandsIf you prefer to generate tests for a specific file use npx pythagora unit tests path path to file jsAnd if you have a particular function in mind use npx pythagora unit tests func lt FUNCTION NAME gt How does Pythagora workLet s peel back the curtain and take a peek into the engine room What makes Pythagora tick At its core Pythagora functions as an intrepid explorer delving into the intricate labyrinth of your codebase First it maps all functions that are exported from your files so that it can call them from within the tests Obviously if a function is not exported it cannot be called from the outside of its file Btw after generating tests a couple of times it will make you think about your codebase and how can you structure it better so that more tests can be generated Once it identifies the exported functions Pythagora takes another step into the rabbit hole it investigates each function in turn hunting down any additional functions called within Picture it as the archaeologist of your codebase gently brushing away layers of dust to expose the hidden connections and dependencies In other words it looks for all functions that are called from within the function being tested so that GPT can get a better understanding of what does a function for which the tests are being written for do Armed with this information Pythagora prepares to utilize the power of AI It packages the collected code and dispatches it to the Pythagora API Here the actual magic happens a prompt is meticulously crafted and handed over to the GPT model This interaction between the code the API and the AI model results in generating a comprehensive set of unit tests ready to be deployed and put to work Both the API server and the prompts used are open source They re available for you to delve into scrutinize and even contribute to if you so desire You can find the Pythagora API server here while the prompts key ingredients in the creation of unit tests are housed in this folder Reviewing TestsOnce Pythagora writes all requested tests it s time for you to jump in and start reviewing them This is a vital step in the process it s important to know what has been created and ensure everything aligns with your expectations Remember Pythagora creates Jest based tests So to run all the generated tests you can just run npx jest pythagora tests Now a word of caution Pythagora is still in its early stages As with all young projects it s bound to have some hiccups along the way So you might encounter failing tests in your initial runs Don t be disheartened consider this a part of the journey With your review and the continuous improvements to Pythagora these failed tests will soon be a thing of the past And let s not forget the bright side Even with these early stage teething problems Pythagora can get you to a place where your codebase has a substantial potentially up to test coverage Committing TestsThe review process especially for larger codebases may take a few hours Remember you re not only looking at the tests that passed but also at those that failed It s crucial to understand every test you re committing to your repository Knowledge is power after all After a thorough review and potential tweaks you re ready to make your final move committing the generated tests to your repository With this last step you would have successfully integrated a robust unit test suite into your project And all of this is achieved with the power of Pythagora and a few lines of command in your terminal Example Tests on Lodash RepoAlright now that I ve got your interest piqued let s delve into the real stuff tangible examples of Pythagora in action For the purpose of our demonstration we selected a well known open source project Lodash Running just one Pythagora command was enough to generate a whopping tests achieving an impressive code coverage of the entire Lodash repository But it s not just the quantity of tests that s impressive Out of these tests unearthed actual bugs within the Lodash master branch If you re curious to check these out yourself we ve forked the Lodash repository and added the tests generated by Pythagora Feel free to explore them here Now let s take a closer look at one of the tests that caught a sneaky bug test size a b length gt expect size a b length toBe test returns In this test the size function of Lodash is supposed to return the size of a JSON object But GPT added a key named length a little trick to see if Lodash might return the value of that key instead of the true size of the object It appears that Lodash fell for this ruse as the test failed by returning instead of the expected This is a fantastic example of how Pythagora powered by GPT excels at uncovering tricky edge cases that could easily slip under the radar By generating a large number of such intricate test cases automatically Pythagora can be your trusty sidekick helping you discover and fix bugs you might never have anticipated ConclusionWell there we have it fellow developers We ve embarked on quite a journey today traversing through the uncharted territories of a substantial codebase devoid of tests and returning with an automated suite of tests crafted by our trusty AI powered tool Pythagora You ve learned that even in the face of a daunting test less codebase there s no need for despair The task of creating a substantial suite of tests need not be an uphill slog anymore We ve witnessed the magic of Pythagora as it examined a well known open source library Lodash and generated tests that covered a jaw dropping of the codebase We saw how Pythagora isn t just about quantity but also the quality of tests It isn t just creating tests for the sake of it but intelligently finding edge cases and bugs that may have otherwise slipped through unnoticed Pythagora unmasked real bugs in the Lodash master branch a testament to the power of AI in software testing Now you should have a clearer understanding of why AI powered testing tools like Pythagora are not just a luxury but a necessity in today s fast paced development landscape So whether you re dealing with an existing project with zero tests or starting a new one and looking to establish a solid testing framework from the outset remember that you re not alone Pythagora is here to take the reins helping you generate meaningful tests with ease and saving you valuable time that can be better spent on developing great features Thank you for joining me on this journey and I can t wait to see how you utilize Pythagora in your projects Happy coding P S If you found this post helpful it would mean a lot to me if you starred the Pythagora Github repo and if you try Pythagora out please let us know how it went on hi pythagora ai |
2023-06-29 14:07:09 |
海外TECH |
Engadget |
Polestar will join Volvo in switching to Tesla's EV charging standard |
https://www.engadget.com/polestar-will-join-volvo-in-switching-to-teslas-ev-charging-standard-144653065.html?src=rss
|
Polestar will join Volvo in switching to Tesla x s EV charging standardYou knew it was just a matter of time before Polestar echoed Volvo s adoption of Tesla s charging technology The EV oriented brand has confirmed that it will use Tesla s NACS connector in North America You ll see quot convenient quot CCS to NACS adapters for existing cars in mid and cars released in onward will have the standard built in An adapter will help those future models charge at CCS stations The news complicates the expansion of Polestar s lineup The Polestar SUV and Polestar SUV coupe are expected in while the Polestar grand tourer and Polestar roadster are coming later In other words some models will have as little as one year of CCS native charging before moving to Tesla s port while others will ship with NACS from the outset You may have to decide if it s worth dealing with an adapter just to get an EV as soon as it s available The reasoning behind the switch is the same as for Volvo using NACS gives Polestar drivers access to Tesla s much larger not to mention more reliable Supercharger network in North America with over charge points available so far This could quot greatly increase quot EV uptake in the area Polestar chief Thomas Ingenlath argues You could buy a Polestar knowing you d have enough charging stations to complete a long distance trip Volvo and Polestar aren t alone Ford GM and Rivian have also committed to using Tesla s tech in North America while Hyundai and Stellantis have said they re evaluating that move For Polestar however the decision may be more symbolically significant than for other marques It s considered one of the closest competitors to Tesla ーthe Polestar is an obvious Model alternative This isn t an outright capitulation to Tesla but it is an acknowledgment that access to the Supercharger network is a major advantage that sways customers This article originally appeared on Engadget at |
2023-06-29 14:46:53 |
海外TECH |
Engadget |
Watch the launch of Virgin Galactic's first commercial spaceflight |
https://www.engadget.com/watch-the-launch-of-virgin-galactics-first-commercial-spaceflight-143027267.html?src=rss
|
Watch the launch of Virgin Galactic x s first commercial spaceflightAfter years of testing and delays Virgin Galactic s first commercial spaceflight is finally taking off ーtoday if the company s plan goes as intended Galactic is scheduled to launch from the company s Spaceport America facility in New Mexico past AM Eastern time and you can stream the event live on Virgin Galactic s website or through the video below The mission will carry a three person crew from the Italian Air Force and the National Research Council of Italy to suborbital space aboard the VSS Unity That s Virgin Galactic s second SpaceShipTwo space plane which first reached space back in The flight will last for minutes during which the crew will conduct scientific experiments A particular experiment requires one of the passengers Col Walter Villadei to wear a state of the art smart suit to measure his physiological responses and biometric data in space nbsp Virgin Galactic posted a net loss of million for the quarter ending in March st this year almost twice the loss it posted for the same period a year ago Galactic s success will lead to more and frequent launches in the future and that could eventually lead to profitability If this mission goes off without a hitch the company plans to launch Galactic with a private crew in early August After that the company plans to launch suborbital flights on a monthly basis charging passengers a seat nbsp This article originally appeared on Engadget at |
2023-06-29 14:30:27 |
海外科学 |
NYT > Science |
Can Indoor Air Quality Sensors Keep Offices Safe? |
https://www.nytimes.com/2023/06/29/health/air-quality-pandemic-wildfires.html
|
indoor |
2023-06-29 14:51:51 |
金融 |
金融庁ホームページ |
NISA・ジュニアNISA口座の利用状況に関する調査結果(2022年12月末(確報値))を公表します。 |
https://www.fsa.go.jp/policy/nisa/20230629.html
|
調査結果 |
2023-06-29 15:00:00 |
金融 |
金融庁ホームページ |
NISA・ジュニアNISA口座の 利用状況に関する調査結果(2023年3月末)を公表しました。 |
https://www.fsa.go.jp/policy/nisa/20230629-2.html
|
調査結果 |
2023-06-29 15:00:00 |
ニュース |
BBC News - Home |
Government to appeal asylum ruling in Supreme Court |
https://www.bbc.co.uk/news/uk-66051292?at_medium=RSS&at_campaign=KARANGA
|
seekers |
2023-06-29 14:47:04 |
ニュース |
BBC News - Home |
Customers withdraw record amount of savings in May |
https://www.bbc.co.uk/news/business-66051711?at_medium=RSS&at_campaign=KARANGA
|
shows |
2023-06-29 14:12:22 |
ニュース |
BBC News - Home |
Sweden Quran burning: Protesters storm embassy in Baghdad |
https://www.bbc.co.uk/news/world-europe-66052670?at_medium=RSS&at_campaign=KARANGA
|
stockholm |
2023-06-29 14:33:15 |
ニュース |
BBC News - Home |
Benjamin Mendy said he slept with 10,000 women, court hears |
https://www.bbc.co.uk/news/uk-england-manchester-66041881?at_medium=RSS&at_campaign=KARANGA
|
cheshire |
2023-06-29 14:08:02 |
ニュース |
BBC News - Home |
Why is Thames Water in so much trouble? |
https://www.bbc.co.uk/news/business-66051555?at_medium=RSS&at_campaign=KARANGA
|
water |
2023-06-29 14:34:18 |
ニュース |
BBC News - Home |
What is the UK's plan to send asylum seekers to Rwanda? |
https://www.bbc.co.uk/news/explainers-61782866?at_medium=RSS&at_campaign=KARANGA
|
rwanda |
2023-06-29 14:21:00 |
ニュース |
BBC News - Home |
Tory MPs tried to interfere with Johnson probe - report |
https://www.bbc.co.uk/news/uk-66051280?at_medium=RSS&at_campaign=KARANGA
|
dorries |
2023-06-29 14:22:08 |
ニュース |
BBC News - Home |
Caroline Wozniacki: Former WTA number one reveals tennis comeback and eyes US Open title |
https://www.bbc.co.uk/sport/tennis/66054292?at_medium=RSS&at_campaign=KARANGA
|
Caroline Wozniacki Former WTA number one reveals tennis comeback and eyes US Open titleFormer world number one Caroline Wozniacki announces she will return to professional tennis after retiring in January |
2023-06-29 14:49:51 |
ニュース |
BBC News - Home |
The Ashes: England lose first wicket as Zak Crawley stumped on 48 |
https://www.bbc.co.uk/sport/av/cricket/66055052?at_medium=RSS&at_campaign=KARANGA
|
ashes |
2023-06-29 14:03:25 |
ニュース |
BBC News - Home |
Just Stop Oil: Three charged after activists disrupt Ashes Test at Lords |
https://www.bbc.co.uk/news/uk-england-london-66050912?at_medium=RSS&at_campaign=KARANGA
|
activists |
2023-06-29 14:33:07 |
コメント
コメントを投稿