Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds

Deep Engineering

45 Articles
Divya Anne Selvaraj
31 Oct 2024
14 min read
Save for later

ProgrammingPro #80: Declarative UI in Flutter, GitHub Copilot’s New AI Models, and PyTorch 2.5 Intel GPU Optimizations

Divya Anne Selvaraj
31 Oct 2024
14 min read
Bite-sized actionable content, practical tutorials, and resources for programmers#80Declarative UI in Flutter, GitHub Copilot’s New AI Models, and PyTorch 2.5 Intel GPU OptimizationsHi ,Welcome to this week’s edition of ProgrammingPro!In today’sExpert Insight, we bring you an excerpt from the recently published book, Flutter Design Patterns and Best Practices, which briefly discusses the declarative UI in Flutter, contrasting it with the traditional imperative approach.News Highlights: NET’s new Central Package Management streamlines dependencies across projects;Flutter is forked as "Flock" due to Google's reduced focus; Microsoft’s Git fix reduces repo bloat; GitHub Copilot expands with new AI models; and PyTorch 2.5 adds Intel GPU support and optimizations for ML.My top 5 picks from today’s learning resources:Concurrent Requests in Python: httpx vs aiohttp🐍How we shrunk our Javascript monorepo git size by 94%📉Clean Code Architecture in Laravel: A Practical Guide🏗️RAG-Powered Copilot Saves Uber 13,000 Engineering Hours🤖Do's and Don'ts of Commenting Code📝But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefPS:Thank you all who participated in this month's survey. With this issue we have fulfilled all resource requests made in October. Keep an eye out for next month's survey.This free 3-hour Training on AI & ChatGPT (worth $399) will help you become a master of 20+ AI tools & prompting techniques and save you 16 hours/week.Get it now for absolutely free (for the first 100 users only)!Sign Up|Advertise🗞️News and Analysis🔎Central Package Management (CPM) Now Available in .NET Upgrade Assistant: Available in Visual Studio and CLI, CPM reduces redundancy by consolidating package versions, simplifying updates with a single directory file.PyTorch 2.5 Release Includes Support for Intel GPUs: Key features include the FlexAttention API for streamlined attention mechanisms, backend optimizations for faster performance, and regional compilation to reduce latency.Java News Roundup: Apache Pulsar 4.0, Jakarta EE 11, Open Liberty, Helidon, JHipster, Apache Camel: Key developments also include JDK 24 progress and Project Loom builds, plus Spring framework releases.Flutter forked as Flock, developer cites “company-wide issues at Google”: Flutter developer Matt Carroll has forked the framework to create “Flock” in response to Google’s deprioritization of Flutter, particularly on desktop platforms.OpenSSF updates its Developing Secure Software course with new interactive labs: The free course covers secure design principles, supply chain security, and threat modeling and offers a certificate valid for two years.OSI officially releases its definition for Open Source AI: The definition includes code, model, and “data information,” requiring detailed descriptions of training data for reproducibility.Microsoft engineer describes a flaw in Git that can hugely bloat repositories – fix is on the way: The fix aimed at large repositories, will soon be available in a Git update, minimizing storage needs.GitHub Copilot now offers access to new Anthropic, Google, and OpenAI models: Updates also include multi-modal support, side-by-side comparisons, Autofix security features, and customization options.🎓Tutorials and Learning Resources💡Python💼Case Study | Concurrent Requests in Python: httpx vs aiohttp:Describes how switching from thehttpx toaiohttp library resolved high-concurrency issues and improved stability in a computer vision application.For more Python resources, go to PythonProSpark and Scala📖Open Access Book | The Internals of Spark Core (Apache Spark 3.5.2): Covers Spark’s structure, job scheduling, execution, and resource management, beneficial for developers looking to understand Spark at a systems level.Optimizing Spark Compute for Medallion Architectures in Microsoft Fabric: Explains how to optimize Spark compute in Microsoft Fabric’s Medallion architecture (Bronze, Silver, Gold) by tailoring configurations for each layer.C# and .NETA comparison of Rust’s borrow checker to the one in C#: Shows that C# achieves similar safety without explicit lifetimes by making trade-offs, such as restricted lifetime management.🎓Tutorial |Integrating Large Language Models in .NET Projects: Demonstrates how to use Microsoft's Semantic Kernel and Extensions.AI, to query custom data and enhance interactions with LLMs.The Power of Function Composition — to Find If an Array Is Special: Explores advanced techniques in function composition to evaluate if an array meets certain criteria, with examples in C# and Haskell.C and C++🎓Tutorial | Square a Number in C++: Methods and Applications: Covers approaches ranging from basic multiplication to complex use cases, such as handling overflow, bitwise operations, and custom number systems.🎓Tutorial | How to Reverse a C++ String: Practical Guide: Covers approaches such as using temporary strings and efficient in-place swaps, STL’s std::reverse, and Unicode handling.🎓Tutorial | Ray-Casting [C]CUB3D Project [42-cursus] (1337 KH): Describes techniques for horizontal and vertical intersections, wall projection, texture mapping, and color handling, including pixel data manipulation.JavaSpring News Roundup: Release Candidates for Spring Boot, Security, Auth Server, Modulith: New release candidates include Spring Boot 3.4.0-RC1, Spring Security 6.4.0-RC1, and updates to Spring Integration.🎥Better Java Builds with the Mill Build Tool, Japan Java User Group Fall Conference 2024: Introduces Mill, a faster, more user-friendly JVM build tool, recently expanded from Scala to Java and Kotlin projects.🎓Tutorial | Applying Clean Architecture in Java with Spring Boot: Provides practical, in-depth examples of architecture decoupling, multiple data sources, and managing external libraries like Lombok, Log4j, and Cacheable.JavaScript and TypeScript🎓Tutorial | Testing In JavaScript With Jest: Guides you through setup, basic testing syntax, matchers, asynchronous testing, and organizing tests for maintainability.💼Case Study | How we shrunk our Javascript monorepo git size by 94%: Described how Microsoft's 1JS team reduced a massive 178GB monorepo's size by addressing several git inefficiencies, particularly with CHANGELOG files.💼Case Study | How We Rebuilt the ChatGPT & YouTube Summary Extensions: Details Glasp's rewrite of their Summary extension, transitioning from VanillaJS to a React and TypeScript setup using Vite.Go🎓Tutorial | Go I/O Closer, Seeker, WriterTo, and ReaderFrom: Explains Closer's role in resource management, Seeker's ability to navigate within streams, and WriterTo and ReaderFrom's streamlining of data transfer.Go does what RxJS couldn't: Compares the simplicity of Go with the complexities of RxJS and imperative JavaScript for state management in an audio player app.RustAsync Rust is not safe with io_uring: Examines the issues of connection leaks and incomplete cancellation in async Rust when using io_uring instead of epoll and proposes partial solutions to address these challenges.Unsafe Rust Is Harder Than C: Explores the complexities of using unsafe Rust to create an optimized batch-processing channel, highlighting the difficulties with intrusive data structures, lifetimes, and Rust’s aliasing model.Swift🎓Tutorial | A Whirlwind Tour of Swift Concurrency: Provides an overview of Swift Concurrency, highlighting its benefits in creating more readable and maintainable code, safer multithreading through actors, and more.🎓Tutorial | Using the #require macro for Swift Testing: IntroducesApple’s new library for testing, which ensures prerequisites are met before tests proceed, enhancing code readability and reducing ambiguity in failure cases.PHP🎓Tutorial | Clean Code Architecture in Laravel: A Practical Guide: Details implementing clean code practices by structuring applications into layers: entities, repositories, interfaces, controllers, and services, with clear examples.SQLSQLite will migrate from GNU Autotools to Autosetup, team warns of ‘some build-level breakage’: While most users won’t notice changes, the shift may cause “build-level breakage,” especially in automated build processes.RubyRuby Caches - Rails Cache Comparisons: Compares various caching options like memory store, file store, Memcached, Redis, and SolidCache, emphasizing their scalability and performance in different deployment contexts.KotlinJetBrains updates Kotlin roadmap: The updated roadmap emphasizes better data handling, abstraction, and performance, with plans for faster code completion and stable analysis in the K2 IntelliJ IDEA plugin.🌟Best Practices and Advice🚀RAG-Powered Copilot Saves Uber 13,000 Engineering Hours: Uber’s Genie streamlines incident response for engineers by quickly retrieving relevant internal data to answer support questions.Securing Cell-Based Architecture in Modern Applications: Details essential strategies including isolation, zero-trust security, role-based and attribute-based access controls, and encrypted communication (TLS, mTLS).Do's and Don'ts of Commenting Code: Covers best practices like using consistent standards, explaining "why" rather than "what," and documenting hacks or tradeoffs for team clarityJump Into the Demoscene; It Is Where Logic, Creativity, and Artistic Expression Merge: Explores the demoscene, a subculture where programmers blend creativity and technical skill to create real-time digital art.🧠Expert Insight📚Here’s an excerpt from “Chapter 1: Best Practices for Building UIs with Flutter" in the book, Flutter Design Patterns and Best Practices by Daria Orlova, Esra Kadah, and Jaime Blasco, published in September 2024.Understanding the difference between declarative and imperative UI designThe beauty of technology is that it evolves with time based on feedback about developer experience. Today, if you’re in mobile development, there is ahigh chance that you have heard about Jetpack Compose, SwiftUI, React Native, and of course Flutter. The thing these technologies have in common is both that they’re used for creating mobile applications and the fact that they do it via a declarative programming approach. You may have heard this term before, but what does it actually mean and why is it important?To take full advantage of a framework, it’s important to understand its paradigm and work with it rather than against it. Understanding the “why” behind the architectural decisions makes it much easier to understand the “how,” and to apply design patterns that complement theoverall system.Native mobile platforms have a long history of development and major transitions. In 2014, Apple announced a new language, Swift, that would replace the current Objective-C. In 2017 the Android team made Kotlin the official language for Android development, which would gradually replace Java. Those introductions had a hugely positive impact on the developer experience, yet they still had to embrace the legacy of existing framework patterns and architecture. In 2019, Google announced Jetpack Compose and Apple announced SwiftUI – completely new toolkits for building UIs. Both SwiftUI and Jetpack Compose take advantage of their respective languages, Swift and Kotlin, leaving legacy approaches behind. Both toolkits also loudly boast their declarative programming paradigm. But language advantages aside, let’s explore why declarative is now the industrial de facto and what is wrongwith imperative.Understanding theimperative paradigmBy definition, the imperative programming paradigm focuses on how to achieve the desired result. You describe the process step by step and have complete control of the process. For example, it could result in code suchas this:fun setErrorState(errorText: String) { val textView = findViewById<TextView>(R.id.error_text_view) textView.text = errorText textView.setTextColor(Color.RED) textView.visibility = View.VISIBLE val button = findViewById<Button>(R.id.submit_button) button.isEnabled = true val progressView = findViewById<ProgressBar>(R.id.progress_view) progressView.visibility = View.GONE}In the preceding snippet, we imperatively described how to update the UI in case of an error. We accessed the UI elements step by step and mutatedtheir fields.This is a real example of code that could’ve been written for a native Android application. Even though this approach may be powerful and gives the developer fine-grained control over the flow of the logic, it comes with the possibility of thefollowing problems:The more elements that can change their presentation based on a state change, the more mutations you need to handle. You can easily imagine how this simplesetErrorStatebecomes cumbersome as more fields need to be hidden or changed. The approach also assumes that there are similar methods for handling a progress and success state. Code such as this may easily become hard to manage, especially as the amount of views in your app grows and the state becomesmore complex.Modifying the global state can produce side effects. On every such change, we mutate the same UI element and possibly call other methods that also mutate the same elements. The resulting myriad of nested conditionals can quickly lead to inconsistency and illegal states in the final view that the user sees. Such bugs tend to manifest only when certain conditions are met, which makes them even harder to reproduceand debug.For many years, the imperative approach was the only way to go. Thankfully, native mobile frameworks have since started adopting declarative toolkits. Although these are great, developers who need to switch between paradigms inside of one project can encounter many challenges. Different tools require different skills and in order to be productive, the developer needs to be experienced with both. More attention needs to be paid to make sure that the application that is created with various approaches is consistent. While the new toolkits are in the process of wider adoption, some time and effort are required until they are able to fully implement what their predecessors already have. Thankfully, Flutter embraced declarative fromthe start.Understanding the declarative paradigmIn an imperative approach, the focus is on the “how.” However, in the declarative approach, the focus is on the “what.” The developer describes the desired outcome, and the framework takes care of the implementation details. Since the details are abstracted by the framework, the developer has less control and has to conform to more rules. Yet the benefit of this is the elimination of the problems imposed by the imperative approach, such as excessive code and possible side effects. Let’s take a look at thefollowing example:Widget build(BuildContext context) { final isError = false; final isProgress = true; return Column( children: [ MyContentView( showError: isError, ), Visibility( visible: isProgress, child: Center( child: CircularProgressIndicator(), ), ), ], );}In the preceding code, we have built a UI as a reaction to state changes (such as theisErrororisProgressfields). In the upcoming chapters, you will learn how to elegantly handle the state, but for now, you only need to understandthe concept.This approach can also be called reactive, since the widget tree updates itself as a reaction to a changeof state.Does Flutter use the declarative or imperative paradigm?It is important to understand that Flutter is a complex framework. Conforming to just one programming paradigm wouldn’t be practical, since it would make a lot of things harder (seehttps://docs.flutter.dev/resources/faq#what-programming-paradigm-does-flutters-framework-use). For example, a purely declarative approach with its natural nesting of code would, make describing aContainerorChipwidget unreadable. It would also make it more complicated to manage all oftheir states....If you are coming from an imperative background, getting used to the declarative approach of building the UI may be mind-bending at first. However, shifting your focus from “how” to “what” you’re trying to build will help. Flutter can help you too, as instead of mutating each part of the UI separately, Flutter rebuilds the entire widget tree as a reaction to state changes. Yet the framework still maintains snappy performance, and developers usually don’t need to think aboutit much.Flutter Design Patterns and Best Practices was published in September 2024. Packt library subscribers can continue reading the entire book for free or you can buy the bookhere!Get the eBook for $31.99$21.99🛠️Useful Tools⚒️trench: An open-source, real-time analytics platform using Kafka and ClickHouse for high-volume event tracking with self-hosted and cloud options.pneumaticworkflow: An open-source, cloud-native workflow manager to automate business processes with a visual designer and API integrations.Codehooks Analytics: An open-source web tool for tracking and analyzing user interactions across websites, giving full data control and real-time insights.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{font-size:75%;line-height:0}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}.reverse{display:table;width: 100%;
Read more
  • 0
  • 0
  • 116

Divya Anne Selvaraj
28 Oct 2024
3 min read
Save for later

Essential 2024 Guides for Cyber Defence and Development

Divya Anne Selvaraj
28 Oct 2024
3 min read
Curated for cybersecurity engineers, DevOps pros, IT administrators, and developersEssential 2024 Guides for Cyber Defence and DevelopmentHi ,This week, we’ve handpicked six essential titles to bolster your skills across every layer of digital defence. From offensive Python techniques and API pentesting to continuous testing for DevOps, these books offer actionable strategies to stay ahead of evolving threats. Learn to build resilient defence programs, ace cybersecurity interviews, and secure Office 365 environments—all at 30% off.Bundle up & save more!Buy 2 eBooks – save an additional 10%Buy 3 eBooks – save an additional 15%Buy 5 eBooks – save an additional 20%Here’s what’s on offer:Continuous Testing, Quality, Security, and Feedback byMarc HornbeekEssential strategies and secure practices for DevOps, DevSecOps, and SRE transformations>Embed continuous testing, security, and feedback in DevOps and SRE practices.>Leverage AI/ML to drive quality improvements, illustrated with real-world cases.>Map digital transformation goals with frameworks for gap assessment and best practices.Get the eBook for $35.99$24.99Get the Print book for $44.99 $30.99Offensive Security Using Python byRejah Rehim, Manindar Mohan, and Grant OngersA hands-on guide to offensive tactics and threat mitigation using practical strategies>Automate offensive security tasks with practical Python scripts and custom tools.>Design security tools with secure coding practices to tackle real-world vulnerabilities.>Defend against advanced cyber threats through Python-powered techniques.Get the eBook for $39.99$27.98Get the Print book for $49.99 $34.98Pentesting APIs byMaurício HarleyA practical guide to discovering, fingerprinting, and exploiting APIs>Identify and exploit API vulnerabilities in RESTful and GraphQL environments.>Set up a dedicated API pentesting lab for comprehensive reconnaissance and testing.>Secure APIs with expert recommendations and practical skills to minimize attack surfaces.Get the eBook for $35.99$24.99Get the Print book for $44.99 $30.99Hack the Cybersecurity Interview - Second Edition by Christophe Foulon, Ken Underhill, and Tia Hopkins Navigate Cybersecurity Interviews with Confidence, from Entry-level to Expert roles>Master techniques to handle technical and behavioural questions across cybersecurity roles.>Discover industry trends, salary expectations, and key certifications to stay competitive.>Showcase your expertise effectively, whether entering the field or advancing your career.Get the eBook for $35.99$24.99Get the Print book for $44.99 $30.99Resilient Cybersecurity byMark DunkerleyReconstruct your defense strategy in an evolving cyber world>Build an adaptable cybersecurity program with zero trust and regulatory compliance.>Integrate governance, risk, and compliance seamlessly into daily operations.>Explore essential strategies for identity management, architecture, and threat resilience.Get the eBook for $39.99$27.98Get the Print book for $49.99 $34.98Mastering Microsoft Defender for Office 365 bySamuel SotoStreamline Office 365 security with expert tips for setup, automation, and advanced threat hunting>Learn step-by-step configuration to combat phishing, malware, and advanced threats.>Automate security tasks to boost efficiency and streamline threat responses.>Build a robust defence strategy tailored for Office 365 environments.Get the eBook for $35.99$24.99Get the Print book for $44.99*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{font-size:75%;line-height:0}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 42

Divya Anne Selvaraj
24 Oct 2024
10 min read
Save for later

ProgrammingPro #79: AI-Driven Product Recommendations, Rust 1.82 Adds Cargo info Subcommand, and 25% JDK Size Reduction Proposal

Divya Anne Selvaraj
24 Oct 2024
10 min read
Bite-sized actionable content, practical tutorials, and resources for programmers#79AI-Driven Product Recommendations, Rust 1.82 Adds Cargo info Subcommand, and 25% JDK Size Reduction ProposalHi ,Welcome to this week’s edition of ProgrammingPro!In today’sExpert Insight, we bring you an excerpt from the recently published book, AI Strategies for Web Development, which demonstrates how to create an AI-driven product recommendation system for e-commerce using TensorFlow and Keras.News Highlights: Rust 1.82 adds cargo info and lifetime improvements; Java proposal targets 25% JDK size reduction; OpenAI releases Swarm for multi-agent AI; and Microsoft previews .NET AI integration libraries.My top 5 picks from today’s learning resources:Comprehensive Python Cheatsheet📜How fast can you parse a CSV file in C#?🚀Async Rust in Three Parts⚙️Optimizing Wellhub Autocomplete Service Latency: a Multi-Region Architecture🌍Navigating unexpected license changes in open source software🛡️But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefPS:The October survey is still live. Do take the opportunity to leave us your feedback, request a learning resource, and earn your one Packt credit for this month.Sign Up|Advertise🗞️News and Analysis🔎Rust 1.82 brings Cargo info subcommand:The long-requested cargo info subcommand provides detailed information about packages in the Cargo registry. Additional updates include improvements in lifetime parameter handling.Java proposal would shrink JDK by 25%: The proposal aims to enable the jlink tool to create custom runtime images without using JMOD files to improve efficiency in cloud environments.OpenAI Releases Swarm, an Experimental Open-Source Framework for Multi-Agent Orchestration: The framework allows for more scalable, customizable, and complex AI systems by breaking tasks into subtasks.Microsoft Releases Preview of AI Integration Libraries for .NET: Microsoft.Extensions.AI.Abstractions and Microsoft.Extensions.AI provide unified API abstractions for integrating AI services and middleware.Noxia: Emerging Dark Web Hosting Provider Targets Python, Node.js, Go, and Rust Ecosystems: Noxia facilitates malicious campaigns by hosting malware and providing infrastructure for activities like phishing.Java News Roundup: WildFly 34, Stream Gatherers, Oracle CPU, Quarkiverse Release Process: Also includes updates on Spring Framework, Micrometer, Project Reactor, Apache TomEE, JobRunr, and Gradle.Microsoft 365 Copilot allows users to create their own autonomous agents: The agents can automate tasks and business processes, with new agents being introduced for Dynamics 365 across sales, finance, and more.🎓Tutorials and Learning Resources💡PythonComprehensive Python Cheatsheet:An extensive resource covering a wide array of Python topics, including syntax, data structures, and advanced concepts.For more Python resources, go to PythonProC# and .NETHow fast can you parse a CSV file in C#?: Explores different methods and libraries for parsing CSV files in C#, comparing their performance and showing how a low-level approach can significantly improve processing speed.🎓Tutorial | Build native WebAssembly components with .NET and C#—and deploy on wasmCloud: Explains the current tooling landscape with tools like componentize-dotnet and the process of utilizing WIT interfaces.🎓Tutorial | .NET gRPC: Developing High-Performance and Scalable Services (Sample Project): A guide for building a sample client-server application, including setting up the project and configuring Protocol Buffers.C and C++🎓Tutorial | Triaging clang C++ frontend bugs: Covers best practices and how to identify bug types, use tools for bug reduction, and handle undefined behavior, diagnostics, and implementation differences.💼Case Study | Developing a Beautiful and Performant Block Editor in Qt C++ and QML: Details the process explaining its architecture, performance optimizations, and challenges in creating advanced features.🎓Tutorial | How the ls *.c Command Can Save Your Life as a Developer: Explains how ls *.c can significantly boost your productivity by quickly listing only the C source files in a directory, making file management easier.Java🎥A Sneak Peek at StableValue and SegmentMapper in Java: Introduces two Java features, Stable Value and Segment Mapper, both designed to improve performance and flexibility.WasmGC and the future of front-end Java development: Covers how WasmGC, enables languages like Java to run efficiently on the front end, potentially transforming web development.Navigate Early Development | Simplify Data Storage: Discusses the importance of delaying the selection of a database solution and introduces Filelize, a simple file-based data storage library for Java, Android, and KotlinJavaScript and TypeScriptShould JavaScript be split into two languages? New Google-driven proposal divides opinion: The proposal aims to improve security, performance, and stability by limiting complexity in JavaScript engines.🎓Tutorial | Using Protocol Buffers in JavaScript: Efficient Binary Format: Explains how to use Protobuf for efficient binary data serialization, covering its benefits like compactness, speed, and schema-based data integrity.💼Case Study | How to Build a Query Engine with Automata, TypeScript and Apache Arrow: Describes the development of Sequence Operations Language (SOL), created to address the limitations of SQL.GoGo Exceptions for the Unconvinced: Explains how Go's panic/recover mechanism functions similarly to exceptions in other languages and ignoring this can lead to practical issues, such as leaving data in a corrupted state.What's in an (Alias) Name?": Introduces generic alias types in Go and explains their importance for incremental refactoring of large codebases.Rust🎓Tutorial | Async Rust in Three Parts: Guides you through the process of working with futures, tasks, and async I/O along with practical code examples.🎓Tutorial | When should I use String vs &str?: Offers four levels of advice, starting with using String everywhere, gradually refining to using &str for function parameters and when returning substrings, and avoiding &str in structs.SwiftNative Cross-Platform Apps: Introduces Aparoksha, a cross-platform UI framework for Swift that leverages native frameworks like GNOME's libadwaita and WinUI 3.Vapor and Swift Testing: Running tests in parallel: Explores running parallel tests in Swift for Vapor-based applications and handling the challenge of database reliance.PHPMonitoring PHP Performance and Diagnosing Bottlenecks: Covers performance monitoring tools like Datadog, New Relic, and profiling tools such as Xdebug and Blackfire and key performance metrics such as CPU usage.SQL🎓Tutorial | Introducing the prompt() Function: Use the Power of LLMs with SQL!: Discusses common patterns that cause poor SQL query performance and offers solutions to issues including undersorting.RubyClass methods are Ruby’s useEffect: Draws a parallel between React’s useEffect and Ruby’s class methods, referring to both as "escape hatches" from their respective paradigms that should be used sparingly.Kotlin🎓Tutorial | How To Create a Parallax Movie Pager In Jetpack Compose: Shows you how to utilize offset calculations, image scaling, translation, and Bitmap implementation for enhanced UI effects.🌟Best Practices and Advice🚀Adaptive Responses to Resiliently Handle Hard Problems in Software Operations: Highlights five key traits of adaptive expertise: recognizing changes, revising mental models, replanning, reconfiguring resources, and reviewing performance for learning.Taking Advantage of Cell-Based Architectures to Build Resilient and Fault-Tolerant Systems: Focuses on monitoring, tracing, and logging to identify bottlenecks, detect issues early, and optimize performance.Optimizing Wellhub Autocomplete Service Latency: a Multi-Region Architecture: Outlines how Wellhub optimized its Go-based service by leveraging AWS Global Accelerator and S3 Cross-Region Replication.Navigating unexpected license changes in open source software: Recommends that organizations maintain a software bill of materials (SBOM) and dedicated teams to manage OSS compliance and security.🧠Expert Insight📚Here’s an excerpt from “Chapter 6: Design Intelligence – Creating User-Centric Experiences with AI" in the book, AI Strategies for Web Development, by Anderson Soares Furtado Oliveira, published in September 2024.Example of AI Movie Recommendation ChatbotIn this example, we will create an AI-driven dynamic content personalization system for an e-commerce website. The system will use TensorFlow and Keras to analyze user behavior and personalize product recommendations based ontheir shopping history. We will use the Retailrocket recommender system dataset to store user data and product information.The workflow of the example isas follows:Collect user data from the Retailrocket recommendersystem dataset.Train a TensorFlow model to analyze user behavior and predictproduct preferences.Use Keras to create a personalized product recommendation system based on theTensorFlow model.Implement the recommendation system on thee-commerce website.However, it also hassome disadvantages:Speed limitations: UART is generally slower compared to SPI and I2C, making it less suitable for high-speeddata transferLimited distance: Susceptibility to noise over long distances can limit the range ofreliable communicationPoint-to-point only: UART is designed for direct, point-to-point communication, which can be a limitation if multiple devices needto communicateData DescriptionRetailrocket recommender system dataset is a dataset of user behavior from an e-commerce website, including clicks, purchases, and views. The dataset contains 1,407,580 users and 2,756,101 behavior events, including 2,664,312 views, 69,332 cart additions, and 22,457 purchases. You can access the datasetat:https://www.kaggle.com/datasets/retailrocket/ecommerce-datasetNext, we will learn how to manipulate and analyze this datausing Python.Python Code Step by StepIn this section, we will outline a series of coding steps essential for manipulating and understanding the dataset effectively. Each step will build upon the last, guiding you through the use of various Python libraries to harness the power of this data for building an intelligentrecommender system.We import the necessary libraries for the example, including TensorFlow, Keras,and Pandas.import tensorflow as tffrom tensorflow import kerasimport pandas as pdWe load the Retailrocket recommender system dataset into aPandas DataFrame.events_df = pd.read_csv( "/kaggle/input/ecommerce-dataset/events.csv")We group the data by visitor ID and aggregate the item IDs into a list foreach visitor.user_data = events_df.groupby('visitorid').agg( {'itemid': lambda x: list(x)})We create a sequential model with two hidden layers and an output layer. We compile the model with the Adam optimizer and sparse categorical cross-entropy loss function. We then fit the model to theuser data.model = keras.Sequential([ keras.layers.Dense(64, activation='relu'), keras.layers.Dense(64, activation='relu'), keras.layers.Dense(len(user_data), activation='softmax')])model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])model.fit(user_data, user_data, epochs=10)We define a function that takes a user ID as input and returns a list of recommended products based on the user’sshopping history.def recommend_products(user_id): user_data = user_data[user_id] predictions = model.predict(user_data) recommended_products = [] for i in range(len(predictions)): if predictions[i] > 0.5: recommended_products.append(products[i]) return recommended_productsNow, we implement the recommendation system on thee-commerce website.The result of this example is an AI-driven dynamic content personalization system for an e-commerce website that provides personalized product recommendations based onuser behavior.In this example, we discussed techniques for implementing AI-driven dynamic content personalization in e-commerce applications. We also introduced tools like TensorFlow and Keras for incorporating AI into e-commerce environments. By following the above project, you can create a personalized product recommendation system for your e-commerce website and provide a unique shopping experience foreach user.NoteThis is a simplified example and may not work directly without some modifications depending on your development environment. Adjust itas needed.AI Strategies for Web Development was published in September 2024. Packt library subscribers can continue reading the entire book for free or you can buy the bookhere!Get the eBook for $30.99$20.99🛠️Useful Tools⚒️finch:an open-source AWS tool for simplifying container development using containerd and nerdctl across platforms.superhtml: An open-source language server offering real-time HTML5 syntax validation, autocorrect, and reformatting for LSP-compatible editors.Srcbook: An open-source TypeScript platform that uses AI to create, edit, and run web apps and backends with interactive notebooks and live previews.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{line-height:0;font-size:75%}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 47

Divya Anne Selvaraj
17 Oct 2024
11 min read
Save for later

ProgrammingPro #78: API-First Development Trends, Google’s New LLM Algorithm, and AI-Powered PHP

Divya Anne Selvaraj
17 Oct 2024
11 min read
Bite-sized actionable content, practical tutorials, and resources for programmers#78Notion for StartupsThousands of startups use Notion as a connected workspace to create and share docs, take notes, manage projects, and organize knowledge—all in one place.We’re offering 6 months of new Plus plans, including unlimited Notion AI, so you can try it all for free!To redeem the Notion for Startups offer:1. Submit an application using our custom link: https://ntn.so/packtand selectPackton the partner list.2. Include our partner key:STARTUP4110P19151Get your Free 6-month Notion Plus Access!Hi ,Welcome to this week’s edition of ProgrammingPro!In today’sExpert Insight, we bring you an excerpt from the recently published book, Bare-Metal Embedded C Programming, which briefly compares UART, SPI, and I2C communication protocols in embedded systems.News Highlights: Postman's 2024 survey shows 74% of developers adopting an API-first approach; Google unveils an LLM self-correction algorithm; StackBlitz's Bolt.new allows Node.js projects in the browser via AI prompts; and Google’s Code Assist Enterprise now trains on internal code with GitHub and GitLab.My top 5 picks from today’s learning resources:Python 3.12 vs Python 3.13 – performance testing🐍How to use Java generics to avoid ClassCastExceptions🔄Unlocking AI Magic: 10 Ways to Supercharge Your PHP Apps with OpenAI✨The imperative of artifact management in modern software development📦Building a Global Caching System at Netflix: a Deep Dive into Global Replication🌍But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefPS:The October survey is still live. Do take the opportunity to leave us your feedback, request a learning resource, and earn your one Packt credit for this month.Sign Up|Advertise🗞️News and Analysis🔎Report: Developers are increasingly adopting an API-first approach: Postman’s 2024 survey reveals 74% of respondents adopted this method, citing faster production and recovery times.Ephemeral IDs: Cloudflare's Latest Tool for Fraud Detection: Cloudflare's new fraud detection feature tracks client behavior instead of IP addresses to detect fraudulent activities.Google Publishes LLM Self-Correction Algorithm Self-Correction via Reinforcement Learning (SCoRe): Google's new algorithm is designed to improve LLMs' ability to self-correct math and coding problems.Ktor 3.0 switches to kotlinx.io library: The Kotlin-based framework for building asynchronous applications, now uses the multiplatform kotlinx.io library for handling data sources, improving byte transformation efficiency.TypeScript 5.7 improves error reporting: The version, now in beta, improves error reporting by detecting never-initialized variables, addressing gaps in the type system's checks.StackBlitz Bolt.new blurs boundaries between web development and skilled use of AI prompts: Bolt.new allows developers to create projects using Node.js directly in the browser, guided by precise AI prompts.Google’s Code Assist Enterprise can be trained on internal source code, is focused on Google services: Announced at the Google Cloud Summit, Gemini Code Assist Enterprise, supports integrations with GitHub and GitLab.🎓Tutorials and Learning Resources💡PythonPython 3.12 vs Python 3.13 – performance testing:Tests on AMD Ryzen 7000 and Intel 13th-gen processors show Python 3.13 generally performs faster, especially in asynchronous tasks, but there are slowdowns in certain areas.🎓Tutorial | Get started with the free-threaded build of Python 3.13: Introduces Python 3.13’s new "no-GIL" or free-threaded build, allowing true parallelism by removing the GIL for better concurrency.For more Python resources, go to PythonProC# and .NETEngineering the Scalable Vector Extension in .NET: Covers the new SVE APIs, code generation techniques, and challenges like register handling and context switches.The Role of the Checked Keyword in Managing Overflow in C#: Covers how the checked keyword in C# helps manage arithmetic overflow and ensures reliable type conversions by throwing exceptions when overflow occurs.Func vs. Predicate vs. Expression in C# .Net: Helps you choose the correct delegate type for efficient method encapsulation, condition checking, and expression handling in C# programming.C and C++C++ String Conversion: Exploring std::from_chars in C++17 to C++26: Highlights how std::from_chars provides high-performance, low-level text-to-number conversions with features like non-throwing behavior, and more.Opaque Pointer Pattern in C++: Discusses the the pattern in C++ (also known as the Pimpl Idiom or Bridge Pattern), which helps hide implementation details from clients while maintaining a stable interface.Self-referential variable initialization in C: Highlights that in C, variables are in scope as soon as they are declared, allowing code like int x = x + 1; despite the variable being uninitialized at that point, which leads to undefined behavior.Java🎓Tutorial | How to use Java generics to avoid ClassCastExceptions: Covers upper bounds, wildcard usage, generic methods, type inference, and type erasure, highlighting how generics prevent runtime exceptions.🎥Continuations: The magic behind virtual threads in Java by Balkrishna Rawool: Explains how virtual threads differ from platform threads, and ithe continuation mechanism that pauses and resumes thread execution.🎥Practical LLM Inference in Modern Java by Alfonso² Peterssen, Alina Yurenko: Discusses implementing a fast LLM inference engine in pure Java using GraalVM.JavaScript and TypeScript🎓Tutorial | Time duration in JS: Explains how JavaScript's Temporal API, specifically Temporal.Duration, handles time durations, offering a modern solution to complexities like leap years, time zones, and Daylight Saving Time.The greatness and limitations of the js-framework-benchmark: Covers the benchmark's strengths in measuring JavaScript framework performance, and its limitations in areas like server-side rendering, hydration, and more.🎓Tutorial | TypeScript for Functional Programmers: Introduces TypeScript's type system to functional programmers familiar with Haskell or ML, highlighting its unique features and differences.Go🎓Tutorial | Practical guide for building a blockchain from scratch in Go: Covers the foundational concepts and practical steps to build a blockchain from scratch in Go using gRPC.Go's New Iterators Smell (A Little) Funny, but It's Probably OK: Discusses Go's new iterators, introduced in Go 1.23, and how they work, including potential issues with early loop exits causing panics.Rust💼Case Study | Challenges and Lessons Porting Code from C to Rust: Describes how engineers used c2rust to convert code step-by-step, addressing threading, memory safety, and performance optimizations.🎓Tutorial | Improve an algorithm's performance step by step: Covers profiling techniques, memory optimization, SIMD use, and iterating over different performance-enhancing approaches, including Rust-specific features and tools.SwiftSecurity-scoped bookmarks for URL access: Discusses how security-scoped bookmarks allow macOS apps to store and regain access to user-selected directories across sessions.🎓Tutorial | Write Swift Like Apple: Emphasizes using clear, descriptive naming for variables, methods, and protocols, favoring Apple's own style over other coding standards.PHP🎓Tutorial | Unlocking AI Magic: 10 Ways to Supercharge Your PHP Apps with OpenAI: Provides a step-by-step guide to integrating OpenAI's API with PHP applications, explaining how to leverage AI-powered features.SQL💼Case Study | Uber Completes Major MySQL Fleet Upgrade, Boosting Performance and Security: Details Uber's successful MySQL upgrade from version 5.7 to 8.0, involving over 2,100 clusters and a side-by-side process.RubyThe Hidden Power of Symbols in Ruby: When to Use Symbols Instead of Strings: Highlights their efficiency as immutable identifiers, particularly for hash keys and method references.Kotlin🎓Tutorial | Testing Coroutines — Simplified: Details the setup for testing coroutine functions, including the use of StandardTestDispatcher to manage coroutine execution and ensure proper assertions.🌟Best Practices and Advice🚀The imperative of artifact management in modern software development: Highlights how artifact management platforms streamline development, enhance security, and automate dependency management.Scaling Uber’s Batch Data Platform: a Journey to the Cloud with Data Mesh Principles: Details the migration which aims to enhance scalability, security, and operational efficiency while decentralizing data ownership.How Cell-Based Architecture Enhances Modern Distributed Systems: Explores how cell-based architectures improve scalability, fault isolation, and resiliency in modern distributed systems.Building a Global Caching System at Netflix: a Deep Dive into Global Replication: Explains how Netflix built a global caching system using EVCache to ensure data availability across multiple regions.🧠Expert Insight📚Here’s an excerpt from “Chapter 4: Crossing the Language Barrier with the Arrow C Data API” in the book, Bare-Metal Embedded C Programming, byIsrael Gbati, published in September 2024.Comparing UART, SPI, and I2CLet’s startwith UART.UARTHere are some key featuresof UART:Asynchronous communication: UART doesn’t require a clock signal. Instead, it uses start and stop bits to synchronizedata transmission.Full-duplex: UART can send and receive data simultaneously, which is ideal for many applications requiringreal-time communication.Simple and cost-effective: With minimal hardware requirements, UART is easy to implementand cost-effective.The following are some ofits advantages:Ease of use: Setting up UART communication is straightforward, making it a popular choice for beginners andsimple applicationsWide support: UART is universally supported by most microcontrollers andperipheral devicesLow overhead: The lack of a clock signal means fewer pins are used,reducing complexityHowever, it also hassome disadvantages:Speed limitations: UART is generally slower compared to SPI and I2C, making it less suitable for high-speeddata transferLimited distance: Susceptibility to noise over long distances can limit the range ofreliable communicationPoint-to-point only: UART is designed for direct, point-to-point communication, which can be a limitation if multiple devices needto communicateNext, wehave SPI.SPIHere are some key featuresof SPI:Synchronous communication: SPI uses a clock signal along with data lines, ensuring synchronizeddata transferFull-duplex: It allows data to be sent andreceived simultaneouslyMaster-slave architecture: One master device controls multiple slave devices, with dedicated linesfor eachThe following are some ofits advantages:High speed: SPI supports high-speed data transfer, making it ideal for applications requiringfast communicationVersatility: SPI can connect multiple devices with different configurations, providing flexibilityin designHowever, it also hassome disadvantages:More pins required: Each slave device needs a separate select line, which can increase the pincount significantlyNo standardized acknowledgment: Unlike I2C, SPI does not have a built-in acknowledgment mechanism, which can make error detectionmore challengingLimited multi-master capability: SPI is not designed for multi-master systems, which can be a limitation insome scenariosThe final common communication protocol we’ll coveris I2C.I2CHere are some key featuresof I2C:Synchronous communication: I2C uses a clock signal for synchronizeddata transferMulti-master capability: Multiple master devices can share the same bus, which is useful in morecomplex systemsTwo-wire interface: I2C requires only two lines (SDA and SCL) for communication, minimizing thepin countThe following are some ofits advantages:Simplicity in wiring: The two-wire interface reduces the complexity and number ofpins requiredMulti-device support: I2C easily connects multiple devices on the same bus, each with aunique addressBuilt-in addressing: I2C has a built-in addressing mechanism, making communication with multipledevices straightforwardHowever, it does havesome disadvantages:Slower speed: I2C is generally slower than SPI, which can be a limitation forhigh-speed applicationsComplex protocol: The protocol is more complex than UART and SPI, requiring more sophisticated handling of data transfersand addressingSusceptible to noise: Like UART, I2C can be susceptible to noise over longer distances, potentially affectingcommunication reliabilityChoosing the right communication protocol depends on your specific application needs. If you need simple, straightforward communication and can tolerate slower speeds,UARTis a great choice. For high-speed applications with a need for full-duplex communication,SPIis ideal, especially if you can manage the higher pin count. When you need to connect multiple devices with minimal wiring and have a complex communication setup,I2Cis your go-to protocol. To help you better understand when to choose which protocol, let’s explore some commonuse cases.Bare-Metal Embedded C Programmingwas published in September 2024. Packt library subscribers can continue reading the entire book for free or you can buy the bookhere!Get the eBook for $33.99$22.99🛠️Useful Tools⚒️pan: A privacy-focused PHP analytics library for tracking events like impressions, hovers, and clicks in Laravel without collecting personal data.Parsek: A modular back-end platform that boosts development efficiency with reusable plugins while optimizing speed and performance.arch: A Layer 7 gateway for LLM applications that optimizes prompt handling, API interactions, and security.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{line-height:0;font-size:75%}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 26

Divya Anne Selvaraj
14 Oct 2024
4 min read
Save for later

Your 2024 Guide to Mastering IoT and AI Development

Divya Anne Selvaraj
14 Oct 2024
4 min read
Curated for IoT developers, AI engineers, and embedded systems specialistsYour 2024 Guide to Mastering IoT and AI DevelopmentHi ,This week, we’ve curated six exceptional books that offer practical, real-world guidance to mastering IoT, AI, and embedded systems, all published in 2024.Whether you're building intelligent robots with AI-driven decision-making, crafting custom IoT solutions from scratch, accelerating development with ChatGPT, or even creating secure automotive IoT applications, this collection equips you to design, build, and deploy cutting-edge systems with ESP32, Arduino, cloud computing, and AWS.Each of these 6 eBooks and Print books is available -- for a limited time -- at 30% or more off!Bundle up & save more!Buy 2 – save an additional 10%Buy 3 – save an additional 15%Buy 5 – save an additional 20%Print discounts end October 18th.Here’s what’s on offer:Internet of Things from Scratch byRenaldi GondosubrotoBuild IoT solutions for Industry 4.0 with ESP32, Raspberry Pi, and AWS>Build industry-grade IoT solutions.>Master wireless sensor networks, cloud integration, and security best practices.>Explore generative AI for IoT to future-proof your projects.Get the eBook for $31.99$21.99Get the Print book for $39.99 $27.98Artificial Intelligence for Robotics - Second Edition byFrancis X. Govers IIIBuild intelligent robots using ROS 2, Python, OpenCV, and AI/ML techniques for real-world tasks>Build intelligent robots using AI/ML techniques with Python and ROS 2.>Implement object recognition, reinforcement learning, and natural language processing.>Design robots that navigate autonomously and interact with real-world environments.Get the eBook for $35.99$24.99Get the Print book for $44.99 $30.99Accelerating IoT Development with ChatGPT byJun WenA practical guide to building your first IoT project using AI-assisted coding and cloud integration>Use ChatGPT to generate code for IoT projects on ESP32 and AWS.>Build 10 practical projects, from flame detection to air quality monitoring.>Master the integration of AI-assisted coding with cloud infrastructure.Get the eBook for $31.99$21.99Get the Print book for $39.99 $27.98Internet of Things Programming Projects - Second Edition byColin DowBuild exciting IoT projects using Raspberry Pi 5, Raspberry Pi Pico, and Python>Develop advanced IoT applications using Raspberry Pi 5, Pico, and Python.>Implement MQTT, LoRa, and ROS for long-range and autonomous systems.>Build projects like smart robot cars, weather indicators, and security systems.Get the eBook for $35.99$24.99Get the Print book for $44.99 $30.99Hands-on ESP32 with Arduino IDE by AsimZulfiqarUnleash the power of IoT with ESP32 and build exciting projects with this practical guide>Interface ESP32 with sensors, cameras, and displays for IoT projects.>Master Arduino IDE 2.0 for simplified IoT development.>Build automation projects, data loggers, and smart connected devices.Get the eBook for $23.99$15.99Get the Print book for $29.99 $20.98Building Secure Automotive IoT Applications byDr. Dennis Kengo Oka, Sharanukumar Nadahalli, Jeff Yost, and Ram Prasad BojankiDevelop robust IoT solutions for next-gen automotive software>Explore modern vehicle architectures and IoT use cases in automotive software.>Learn cybersecurity practices for developing secure automotive applications.>Master cloud integration, diagnostics, and functional safety processes.Get the eBook for $35.99$24.99Get the Print book for $44.99 $30.99All books are minimum 30% off, and print discounts end in 5 days on October 18th.*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{line-height:0;font-size:75%}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 39

Divya Anne Selvaraj
10 Oct 2024
10 min read
Save for later

ProgrammingPro #77: Python 3.13 Finally Debuts, Rspack 1.0, and Importing Arrow Data with Python

Divya Anne Selvaraj
10 Oct 2024
10 min read
Bite-sized actionable content, practical tutorials, and resources for programmers#77Secure and Simplify: Salesforce Data Protection with RubrikWhat if your Salesforce data was suddenly lost or corrupted? Human errors, accidental deletions, misconfigurations can all contribute to data loss.1 of 2 SaaS users who did not implement SaaS data protection, experienced data loss or corruption in the last 12 months.Check out this exclusive webinar where we reveal Rubrik's new integration with Salesforce, designed to tackle this exact issue.Watch On-DemandHi ,Welcome to this week’s edition of ProgrammingPro!In today’sExpert Insight, we bring you an excerpt from the recently published book, In-Memory Analytics with Apache Arrow - Second Edition, which shows you how to import Arrow data with Python using the C Data API via the pyarrow and cffi modules.News Highlights: Python 3.13 finally debuts with GIL disabling and JIT compiler; Rust firm at 13th in Tiobe, Mojo enters top 50; Rspack 1.0 is 23x faster than Webpack; and Julia 1.11 introduces a faster, lower-overhead Memory type.My top 5 picks from today’s learning resources:10 Jupyter Notebook Features You Didn’t Know Exist📓Reflection in C++26: Metafunctions for Enums and Classes💻The #1 Mistake Developers Make with Redux and How to Fix It🚧Confusing or misunderstood topics in systems programming: Part 0🧩Brutalist Programming Manifesto🛠️But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefPS:The October survey is still live. Do take the opportunity to leave us your feedback, request a learning resource, and earn your one Packt credit for this month.Sign Up|Advertise🗞️News and Analysis🔎Breaking Down Python 3.13’s Latest Features:Released finally on the 7th of October, the version includes a revamped interactive interpreter with multi-line editing, experimental disabling of the GIL, and a JIT compiler.Rust resumes rise in popularity: Rust has returned to 13th place in the October 2024 Tiobe index and maintained 10th in the Pypl index. Mojo has also entered Tiobe's top 50. Read to learn more about current rankings.Rspack 1.0 Released, 23x Faster than Webpack, Compatible with Top 50 Webpack Plugins: Rspack 1.0, a JavaScript bundler written in Rust from ByteDance, is compatible with over 80% of the top 50 Webpack plugins.Julia language adds lower-overhead Memory type: Julia 1.11 introduces a new Memory type as a lower-overhead alternative to Array, offering significant speed improvements and more maintainable code.Apollo Connectors enables developers to turn REST APIs into GraphQL endpoints: Apollo Connectors simplifies API integration, reduces complexity, and enables a unified API strategy.UNO Platform 5.4 Improves App Performance: The version introduces over 290 new features and enhancements focused on improving app performance, including a 15% reduction in memory allocations.ChatGPT Canvas offers a new visual interface for working with ChatGPT in a more collaborative way: The new offering, currently rolling out to select users, enhances collaboration on writing and coding projects.🎓Tutorials and Learning Resources💡Python10 Jupyter Notebook Features You Didn’t Know Exist:Discusses features including magic commands, interactive widgets, auto-reload for modules, in-notebook documentation, and collapsible headings.For more Python resources, go to PythonProSeptember Python Releases from Packt at 30% offon both eBook and Print BooksGet for $39.99 $27.98!Get for $35.99 $24.99!Get for $27.99 $18.99!Get for $35.99 $17.98!Print discounts end tomorrow on the 11th of October!C# and .NETMicrosoft previews unified .NET API for AI, and delivers .NET 9 Release Candidate with go-live license: The AI extension library aims to standardize interactions with AI services, allowing developers to work with a common API.🎓Tutorial | How to Use StateContainers in .NET MAUI to Manage State in Applications: Explains how to implement StateContainers with code examples and a demo for handling user authentication.🎓Tutorial | Dispose or Finalize in C#? Discover which to use: Provides real-world examples, such as file handling, database connections, and graphics processing, to demonstrate when to use each method.C and C++🎓Tutorial | Reflection in C++26: Metafunctions for Enums and Classes: Demonstrates how developers can use reflection to iterate through enum members and retrieve class members by index or name.Iterating through matched characters in modern C++: Explores using approaches like find_first_of, std::ranges from C++20, and coroutines from C++23.Privileges relinquishing order in C: Explains the correct order for relinquishing privileges in C programs, specifically for setUID and setGID operations, to prevent security vulnerabilities.JavaOracle touts ‘tip and tail’ release model for Java library development: The model, aimed at improving the developer experience allows faster innovation for new development while maintaining stability for long-term projects.🎓Tutorial | Event-driven architecture (EDA) on the modern stack of Java technologies: Explores the implementation of an EDA focusing on Transactional outbox, Inbox, and Saga patterns in microservices.Java 23 New Features With Examples: Covers improvements like primitive type support in patterns, instanceof, and switch statements, the introduction of Markdown documentation comments, and enhancements to concurrency.JavaScript and TypeScript🎓Tutorial | The #1 Mistake Developers Make with Redux and How to Fix It: Discusses the common mistake of overusing Redux, explains the difference between client and server state, and shows you the benefits of React Query.Behind the Scenes at the JavaScript Registry (JSR): Discusses JSR, a modern open-source package repository for JavaScript and TypeScript that offers features like type declaration files, secure publishing, and more.Announcing TypeScript 5.7 Beta: New features include checks for never-initialized variables, path rewriting for relative paths, support for ES2024, faster project ownership checks, JSON import validation, and improved performance.Go🎓Tutorial | Securing gRPC Services with JWT Authentication in Go: Explains how to secure gRPC services using JSON Web Tokens (JWT) authentication in Go, focusing on interceptors, metadata, and JWT handling.The Go libraries that never failed us: 22 libraries you need to know: Lists libraries for routing, middleware, database management, OpenAPI, gRPC, testing, and more, while offering anti-pattern warnings and practical tips.Rust💼Case Study | Rust is rolling off the Volvo assembly line: Discusses how Volvo successfully integrated Rust into the development of their low-power processor ECU, improving code quality and reliability in their vehicles.🎓Tutorial | Understanding Rust's Trait Objects: Vtables, Dynamic Dispatch, and Memory Deallocation: Explains how vtables store method pointers for trait objects, how TCO optimizes performance, and more.Swift🎥Swift & Interoperability - Tony Parker & Ben Cohen: Introduces the new direction for Swift's Foundation, including a major refactor of Foundation for Swift 6, enabling open-source contributions, and transitioning from C to Swift.🎓Tutorial | Writing Cleaner Swift Code: Early Returns & Aligning the Happy Path Left: Explains how handling edge cases upfront and reducing nesting, results in cleaner, more maintainable code with reduced cognitive load.PHP👨‍🏫Open Access Course | Laravel API Course: Covers topics like optimizing a Laravel project for API-first development, data modeling, API design, authentication, rate limiting, versioning, pagination, error handling, and more.SQL🎓Tutorial | Advanced SQL for 10x Data Analysts - Part 1: Explores advanced SQL techniques, focusing on joins, nested data, analytical functions, and efficient query writing.RubyRuby on Rails 8.0 first beta release: A big bet on SQLite in production: The release promotes using SQLite in production environments for various features, including caching, queuing, and as the primary database.Ruby 3.4.0 preview2 Released: The version introduces features like switching to the Prism parser, language changes, core class updates, and C API improvements.Kotlin🎓Tutorial | How Functional Programming Can Help You Write Efficient, Elegant Web Applications: Includes code examples and practical guidance on topics like pure functions, function composition, and functional DI.🌟Best Practices and Advice🚀Proactive Approaches to Securing Linux Systems and Engineering Applications: Key approaches discussed include dynamic vulnerability confirmation, regular security audits, and comprehensive patch management.Brutalist Programming Manifesto: Advocates for simplicity, self-reliance, solving real problems, avoiding unnecessary complexity, and encouraging independent, practical thinking in software development.Confusing or misunderstood topics in systems programming: Part 0: Explains complex systems programming concepts like processes, context switching, and the kernel in a clear, beginner-friendly way.🎥Tacit Talk Episode 5: Combinatory Programming with Zach Smith: Explores how functional programming concepts such as combinatory and tacit programming, can simplify code and improve readability.🧠Expert Insight📚Here’s an excerpt from “Chapter 4: Crossing the Language Barrier with the Arrow C Data API” in the book, In-Memory Analytics with Apache Arrow - Second Edition by Matthew Topol, published in September 2024.Importing Arrow data with PythonThe common terminology for runtimes providing an interface for calling an API of another runtime or language is an FFI. In Python, we’re going to use a library called cffi , which is used by the pyarrow module to implement the Cdata API. Make sure that you’re running the script we’re about to write in the same directory as the libsample.solibrary file that we created in theprevious exercise:First, the imports – the following highlighted line represents the essential case that we’re importing the already compiledffilibrary that is part of thepyarrow module:import pyarrow as pafrom pyarrow.cffi import ffiThere are a few different ways to integrate the FFI module, but for the purposes of this exercise, we’re going to use dynamic loading of the library with the defined interface through thecdeffunction. Then, we’ll load our shared object librarywithdlopen:ffi.cdef("void export_int32_data( struct ArrowArray*);")lib = ffi.dlopen("./libsample.so")Note that this matches ourextern "C"declarationfrom before.Now, we can create anArrowArraystruct and call the function we exported topopulate it:c_arr = ffi.new("struct ArrowArray*")c_ptr = int(ffi.cast("uintptr_t", c_arr))lib.export_int32_data(c_arr)Then, we use thepyarrowmodule to import data. Remember that since we’re passing around pointers, there’s no copying of the data buffers. So, it doesn’t matter whether this array has 1,000 elements or 1 million elements; we’re not copying the data here. Importing the data is just hooking everything up to point to the right areasin memory:arrnew = pa.Array._import_from_c(c_ptr, pa.int32())# do stuff with the arraydel arrnew # will call the release callback # once it is garbage collectedYou can add aprintstatement in there if you like, to confirm that it is actually working as intended. That’s it. The library we created could create that array of data in any way we want, but as long as it properly populates the C struct, we’re able to pass the data around in the Arrow format without having tocopy it.What if we wanted to work in the other direction? We can read in our data with Python and then hand it off to something faster for processing, similar to how Spark used JPype to communicate the data from Python to Java without copying. How would we go aboutdoing that?Memory Analytics with Apache Arrow - Second Editionwas published in September 2024. Packt library subscribers can continue reading the entire book for free or you can buy the bookhere!Get the eBook for $39.99$27.98Get the Print book for $49.99 $34.98🛠️Useful Tools⚒️Drasi: Microsoft's open-source system for real-time change detection and automated reactions in dynamic systems.One:a React framework on Vite, streamlining web and native app development with universal routing and seamless data management.agents: a real-time AI framework for processing text, audio, images, and video, with OpenAI Realtime API support and plugins for popular LLMs.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{line-height:0;font-size:75%}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 244
Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at €14.99/month. Cancel anytime
Divya Anne Selvaraj
07 Oct 2024
3 min read
Save for later

Python Must-Reads from September 2024

Divya Anne Selvaraj
07 Oct 2024
3 min read
Curated for cybersecurity experts, data scientists, web developers, and NLP enthusiasts.Python Must-Reads from September 2024Hi ,This week, we’ve handpicked five standout Python titles for you, all published in September 2024.Whether you're securing networks with Python automation, cleaning and preparing data for analysis, streamlining workflows with Apache Arrow, building web apps, or diving into the power of natural language processing, these new releases offer the guidance you need.Each of these 5 eBook's and Print books is available -- for a limited time -- at 30% or more off!Bundle up & save more!Buy 2 – save an additional 10%Buy 3 – save an additional 15%Buy 5 – save an additional 20%Print discounts end October 11th.Here’s what’s on offer:Offensive Security Using Python by Rejah Rehim and Manindar MohanA hands-on guide to offensive tactics and threat mitigation using practical strategies>Defend. Attack. Automate.>Dive deep into cybersecurity tactics with Python, exploit vulnerabilities, and code securely.>A go-to guide for staying ahead in digital defence.Get the eBook for $39.99$27.98Get the Print book for $49.99 $34.98Python Natural Language Processing Cookbook - Second Edition byZhenya Antić and Saurabh ChakravartyOver 60 recipes for building powerful NLP solutions using Python and LLM libraries>Unlock NLP’s full power.>Recipes packed with practical insights, from text analysis to working with the latest LLMs like GPT-4 and OpenAI.>Real-world NLP mastery awaits.Get the eBook for $35.99$17.99Get the Print book for $44.99 $30.99Python Data Cleaning and Preparation Best Practices byMaria ZervouA practical guide to organizing and handling data from various sources and formats using Python>Turn raw data into gold.Learn to clean, validate, and prepare both structured and unstructured data.>Transform your pipelines and make your data truly actionable.Get the eBook for $35.99$24.99Get the Print book for $44.99 $30.99In-Memory Analytics with Apache Arrow - Second Edition byMatthew TopolAccelerate data analytics for efficient processing of flat and hierarchical data structures>Boost your analytics.>Discover how Apache Arrow makes data processing lightning-fast.>Perfect for data engineers and analysts seeking seamless integration and peak performance.Get the eBook for $39.99$27.98Get the Print book for $49.99 $34.98Django 5 for the Impatient - Second Edition byDaniel Correa and Greg LimLearn the core concepts of Django to develop Python web applications>Build fast. Launch faster.>Create responsive web apps with Django 5 and deploy them effortlessly.>The fast lane to full-stack web development starts here.Get the eBook for $27.99$18.99Get the Print book for $34.99 $23.99All books are minimum 30% off, and print discounts end in 5 days on October 11th.*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{line-height:0;font-size:75%}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 89

Divya Anne Selvaraj
03 Oct 2024
12 min read
Save for later

ProgrammingPro #76: Python 3.13 RC 3, Django’s MVT Architecture, and PostgreSQL 17 Performance Enhancements

Divya Anne Selvaraj
03 Oct 2024
12 min read
Bite-sized actionable content, practical tutorials, and resources for programmers#76:Python 3.13 RC 3, Django’s MVT Architecture, and PostgreSQL 17 Performance EnhancementsIntroducing A Market-Changing Approach to Mobile App Protection by GuardsquareMobile applications face constant, evolving threats; to address these challenges, Guardsquare is proud to announce the launch of our innovative guided configuration approach to mobile app protection.By combining the highest level of protection with unparalleled ease of use, we empower developers and security professionals to secure their applications against even the most sophisticated threats.Guardsquare is setting a new standard for mobile app protection and we invite you to join us on this journey to experience the peace of mind that comes with knowing your mobile applications are protected by the most advanced and user-friendly product on the market.Learn MoreHi ,Welcome to this week’s edition of ProgrammingPro!In today’sExpert Insight, we bring you an excerpt from the recently published book, Django 5 for the Impatient - Second Edition, which introduces Django's MVT architecture, briefly outlining how Models, Views, and Templates work together to build a scalable web application.News Highlights:Python 3.13.0 RC 3 introduces features like free-threaded mode and JIT; PostgreSQL 17 enhances performance, storage, and JSON support; OpenAI reveals Realtime API, prompt caching, and AI updates; and MongoDB 8.0 boosts read throughput, time series handling, and sharding efficiency.My top 5 picks from today’s learning resources:Python 3.13: Cool New Features for You to Try✨Lesser known tricks, quirks, and features of C🕵️‍♂️Comparative Study of Java Native, Platform, and Virtual Threads🧵Planning, Automation and Monorepo: How Monzo Does Code Migrations across 2800 Microservices🚀021 - the tortoise and the hare - building faster with low level programming🐢🐇But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefPS:The October survey is now live. Do take the opportunity to leave us your feedback, request a learning resource, and earn your one Packt credit for this month.BOOK NOW AT $399.99 $239.99Use code LASTCHANCE40 at checkoutSign Up|Advertise🗞️News and Analysis🔎Python 3.13.0 release candidate 3 released: It includes new features like a free-threaded build mode, an improved interpreter, experimental JIT, and typing enhancements. The final release is now scheduled for October 7, 2024.JRuby 10 due to arrive in early-2025: The Ruby implementation for the JVM, is set to release in early 2025 and will support Ruby 3.4.0, Rails 7.1+, and require Java 17 or 21 to leverage modern JVM features.Java News Roundup: Proposed Schedule for JDK 24, SecurityManager Disabled, Commonhaus Foundation: Also covers JEP 475 (G1 garbage collector changes), updates in Spring Framework, and more.PostgreSQL 17 adds performance gains, storage optimizations and more: The version also introduces expanded JSON support, including SQL/JSON standards for data manipulation.OpenAI announces Realtime API, prompt caching, and more at DevDay: Vision fine-tuning, model distillation, and the company's recent $6.6 billion funding round were also discussed.MongoDB 8.0 offers significant performance improvements to read throughput, bulk writes, and more: It also offers improved handling of time series data, more efficient sharding, and control over query performance.The SQLite team is preparing an efficient remote replication tool: The tool uses ssh for secure data transfer, optimizes bandwidth by only transmitting changed data pages, and targets scenarios needing read-heavy access.🎓Tutorials and Learning Resources💡PythonPython 3.13: Cool New Features for You to Try: Releasing finally on October 7th, Python 3.13 introduces several improvements, including an enhanced REPL, clearer error messages, and progress on removing the GIL.For more Python resources, go to PythonProC# and .NETWhich .NET ORM - Dapper or Entity Framework?: Helps you decidewhen to choose Dapper or EF based on project size, database requirements, and adaptability.🎓Tutorial | Embracing DRY Principle to Streamline Test Automation: Contrasts tests with and without DRY, demonstrating how reusable utility functions and base classes enhance code efficiency and readability.🎓Tutorial | Dotnet Source Generators in 2024 Part 1 - Getting Started: Introduces .NET source generators, focusing on their purpose, types, and usage, particularly for code generation and reducing boilerplate in C# projects.C and C++Lesser known tricks, quirks and features of C: Covers topics ranging from advanced array manipulation and memory usage to uncommon syntactic constructs and obscure type qualifiers.It is never too late to write your own C/C++ command-line utilities: Discusses how a custom C++ command-line utility greatly outperformed a Python script in querying JSON files, improving performance tenfold.std::initializer_list in C++ 2/2 - Caveats and Improvements: Explores the issues and limitations of std::initializer_list in C++, and suggests alternatives like variadic factory functions to reduce copies and improve efficiency.Java🎓Tutorial | How to use generics in your Java programs: Demonstrates generics with collections, type safety benefits, examples of generic classes, and discusses raw types versus generics.Class File API - Not Your Everyday Java API: Introduces the Class-File API, a modern Java library for bytecode manipulation, aimed primarily at framework, tooling, and advanced Java developers.Comparative Study of Java Native, Platform and Virtual Threads: Highlights how virtual threads introduced by Project Loom improve performance and resource management.JavaScript and TypeScriptA guide to destructuring in JavaScript: covers binding patterns, default values, rest properties, and the spread operator for working with complex data structures.Strict mode: Outlines how to invoke strict mode, its restrictions on syntax and behavior, and the advantages over "sloppy mode."📖Open Access Book | The Concise TypeScript Book: Provides a clear and comprehensive overview of TypeScript, covering its type system, advanced features, and latest language updates.GoSome Go web dev notes: Discusses recent learnings from developing a website in Go, covering improved routing in Go 1.22, SQL query handling using sqlc , performance tips for SQLite, and memory management enhancements.CPU Throttling for containerized Go applications explained: Covers Kubernetes CPU limits, Go's concurrency model, how CPU quotas are enforced, and strategies to mitigate throttling, including configuring GOMAXPROCS.RustCode Generation in Rust vs C++26: Explores Rust’s derive procedural macro for code generation and how the upcoming C++26 reflection feature, with introspection and annotation capabilities, offers an equally powerful approach.Should you use Rust in LLM based tools for performance?: Discusses why Rust was chosen for building Swiftide, a text-processing toolchain, and its performance compared to Python's Langchain.SwiftURLSession in Swift: The Essential Guide [with Examples]: Explains the use of URLSession for network requests, handling protocols like HTTP and FTP, and parsing JSON data.Using the #expect macro for Swift Testing: Discusses the #expect macro in Swift Testing, Apple's new framework for writing tests which replaces various XCTest assertions, simplifying debugging.PHPLaravel 11.26 Released: The version introduces features like graceful stopping of process pools, using Enums for rate limiting, an Artisan command to create job middleware, and enhanced factory annotations for model factories.SQLTroubleshooting SQL queries with omni_id: Discusses how by creating new types for primary keys (e.g., user_id, product_id), omni_id helps identify issues, such as incorrect column comparisons, and enhances query accuracy.RubyBuilding a Vector Database in Ruby Using Hash and PStore: Shows how to build a vector database for semantic search and provides an overview of generating embeddings with OpenAI's API, and calculating cosine similarity.KotlinPushing the Boundaries of Compose Multiplatform with AGSL Shaders: Covers the anatomy of shaders, their use in Kotlin Multiplatform, and demonstrates applying effects like vignetting in the Photo-FX app.🌟Best Practices and Advice🚀How to Minimize Latency and Cost in Distributed Systems: Discusses optimizing distributed systems to reduce data transfer costs and latency through zone-aware routing.Planning, Automation and Monorepo: How Monzo Does Code Migrations across 2800 Microservices: Discusses how Monzo efficiently migrates services without downtime, enabling gradual rollouts and quick rollbacks.021 - the tortoise and the hare - building faster with low level programming: Argues that while initially slower, low-level programming offers full control and fewer trade-offs, potentially leading to more optimal results.Five Common Misconceptions About Event-Driven Architecture (EDA): Debunks 5 common misconceptions about EDA, highlighting its distinct characteristics, differences from related concepts, and benefits.🧠Expert Insight📚Here’s an excerpt from “Chapter 1: Installing Python and Django, and Introducing the Movies Store Application” in the book, Django 5 for the Impatient - Second Edition by Daniel Correa and Greg Lim, published in September 2024.Introducing the Django MVT architectureThere are various methodologies and approaches to design and code web applications. One approach involves consolidating all code into a single file toconstruct the entire web application.However, finding errors within such a file, often comprising thousands of lines of code, can be incredibly challenging. Alternatively, other strategies distribute code across different files and directories. Additionally, some approaches segment an application into multiple smaller applications dispersed across several servers, although managing the distribution of these servers presents its own set of challenges.Organizing your code effectively presents challenges. This is why developers and computer scientists have created software architectural patterns.Software architectural patternsoffer structural frameworks or layouts to address common software design issues. By leveraging these patterns, start-ups and inexperienced developers can avoid reinventing solutions for every new project. Various architectural patterns exist, includingModel-View-Controller(MVC),Model-View-Template(MVT), layers, service-oriented, and microservices. Each pattern comes with its own set of pros and cons. Many frameworks, such as Django, adhere to specific patterns in constructingtheir applications.In the case of Django, Django is based on the MVT pattern. This pattern is similar to MVC but with some differences in the responsibilities ofeach component:Models: The model represents the data structure. In Django, models are Python classes that define the structure of the data and how it interacts with the database. Models handle tasks such as querying a database, performingCRUD(Create, Read, Update, Delete) operations, and enforcing data validation. In the case of theMovies Storeapp,Movie,Review,Orderand the other classes from our class diagram will be coded asDjango models.Views: Views in Django are responsible for processing user requests and returning appropriate responses. Views typically receive HTTP requests from clients, fetch data from the database using models, and render templates to generate HTML responses. In Django, views are Python functions or classes that accept HTTP requests and return HTTP responses. In the case of theMovies Storeapp, we will create views and functions to handle the movies, accounts, and cart,among others.Templates: Templates are used to generate HTML dynamically. They contain the application’s user interface and define how data from the views should be displayed to the users. In the case of theMovies Storeapp, we will create a template to allow users to log in, a template to list movies, and a template to display the shopping cart,among others.The MVT pattern offers several benefits such as enhanced code separation, facilitated collaboration among multiple team members, simplified error identification, increased code reusability, and improved maintainability.Figure 1.11illustrates the software architecture of theMovies Store, which we will develop throughout this book. While it may seem overwhelming now, you will understand the intricacies of this architecture by the book’s conclusion. We will delve deeper into the architecture in thefinal chapters.Figure 1.11 – The Movies Store software architecture diagramLet’s briefly analyzethisarchitecture:Positioned on the left are the clients, which are the users of our application, who use browsers on mobile or desktop devices. These clients establish connections with the application via theHypertext Transfer Protocol(HTTP), providing users with a means to interact with ourweb application.On the right side, we have the server, which hosts ourapplication code.All client interactions first pass for a project-level URL file calledurls.py. This file is located in the main project folder calledmoviesstore/. URLs will be explored inChapter 2. This project folder also contains atemplates/folder in which we will design a reusable base template. Base templates will be explored inChapter 3.The project-level URL file passes the interaction to an app-level URL file. For this project, we will design and implement four Django apps –home,movies,cart, andaccounts. Django apps will be explored inChapter 2.Each app-level URL file passes the interaction to aviews.pyfile. Views will be explored inChapter 2.Views communicate with models, if required, and pass information to the templates, which are finally delivered to the clients as HTML, CSS, and JS code. Templates will be explored inChapter 2, and models will be explored inChapter 5.Django 5 for the Impatient - Second Edition was published in September 2024. Packt library subscribers can continue reading the entire book for free or you can buy the bookhere!Get the eBook for $27.99$18.99Get the Print book for $34.99 $23.99🛠️Useful Tools⚒️iceoryx2 v0.4.0: An IPC library for fast inter-process communication with decentralized architecture, modularity, and advanced QoS.dust-core: An Apache-licensed Java library for creating efficient, scalable actor-based systems using lightweight threading.Quadratic: A modern spreadsheet merging JavaScript, Python, SQL, and formulas for dynamic data analysis, API integration, and visualizations.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{line-height:0;font-size:75%}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 57

Divya Anne Selvaraj
30 Sep 2024
4 min read
Save for later

Master Swift & iOS with 7 Essential Books

Divya Anne Selvaraj
30 Sep 2024
4 min read
Curated for iOS developers, SwiftUI designers, and aspiring app creators.Master Swift & iOS with 7 Essential BooksHi ,Master Swift, build incredible apps, and save up to 50%.Swift and iOS are evolving—so should you. Swift 6 and iOS 18 are shaping the future, but the foundations haven't changed. We’ve handpicked 7 books to cover practical recipes, project-based learning, animations, app architecture, SwiftUI essentials, and interview preparation—providing you with a strong foundation in Swift and iOS development, built on core concepts, proven techniques, and best practices that transcend version changes.To support your learning journey, we're offering a 30% discount on print and eBook formats of our top Swift books—for a limited time. Buy eBooks in bundles and save even more:Buy 2 – save an additional 10%Buy 3 – save an additional 15%Buy 5 – save an additional 20%Print discounts end October 4th.Here’s what’s on offer:Swift Cookbook - Third Edition by Keith Moon, Chris Barker, Daniel Bolella, and Nathan LawlorProven recipes for developing robust iOS applications with Swift 5.9>Master Swift 5.9’s capabilities with practical recipes to build robust iOS applications.>Dive into Swift’s core features, from UIKit and SwiftUI to machine learning with CoreML.>Empower your skills with step-by-step solutions for real-world challenges.Get the eBook for $35.99$24.99Get the Print book for $44.99 $30.99An iOS Developer's Guide to SwiftUI byMichele FaddaDesign and build beautiful apps quickly and easily with minimum code>Transform your app development with SwiftUI.>Learn to build clean, responsive architectures and asynchronous programming for modern apps.>Discover SwiftUI’s declarative power which lets you create stunning interfaces across all Apple platforms—efficiently and elegantly.Get the eBook for $35.99$24.99Get the Print book for $44.99 $30.99The Ultimate iOS Interview Playbook byAvi TsadokConquer Swift, frameworks, design patterns, and app architecture for your dream job>Secure your dream job.>Tackle the toughest interview questions with confidence, from Swift fundamentals to app architecture.>Stand out in a competitive market, mastering every aspect of the iOS interview process to become the candidate every company wants.Get the eBook for $27.99$18.99Get the Print book for $34.99 $23.99SwiftUI Cookbook - Third Edition byJuan C. CatalanA guide for building beautiful and interactive SwiftUI apps>Go beyond the basics.>Unlock SwiftUI 5’s power to build multi-platform apps with advanced controls, data visualisations, and animations.>Create seamless, interactive user interfaces that captivate—while mastering Swift’s most up-to-date features.Get the eBook for $35.99$24.99Get the Print book for $44.99 $30.99iOS 17 Programming for Beginners - Eighth Edition byAhmad SaharUnlock the world of iOS development with Swift 5.9, Xcode 15, and iOS 17 – your path to App Store success>Jumpstart your journey into iOS development.>Start from scratch and quickly build up to publishing your app, with step-by-step projects covering Swift 5.9, Xcode 15, and iOS 17.>Build strong foundations to adapt effortlessly to iOS 18.Get the eBook for $35.99$24.99Get the Print book for $44.99 $30.99Animating SwiftUI Applications byStephen DeStefanoCreate visually stunning and engaging animations for iOS with SwiftUI>Bring apps to life with stunning animations.>From simple transitions to complex visual effects, master techniques to create engaging user experiences.>Learn declarative programming to combine physics, motion, and creativity with minimal code.Get the eBook for $36.99$24.99Get the Print book for $45.99 $31.99Elevate SwiftUI Skills by Building Projects byFrahaan HussainBuild four modern applications using Swift, Xcode 14, and SwiftUI for iPhone, iPad, Mac, and Apple Watch>Learn by doing.>Build real-world apps for iPhone, iPad, Mac, and Apple Watch using SwiftUI.>Develop hands-on expertise through four diverse projects, from tax calculators to fitness companions, making you a well-rounded SwiftUI developer.Get the eBook for $27.99$18.99Get the Print book for $34.99 $23.99All books are 30% off, and print discounts end in 5 days on October 4th.*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{line-height:0;font-size:75%}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 16

Divya Anne Selvaraj
26 Sep 2024
10 min read
Save for later

ProgrammingPro #75: Python 3.13 JIT & Free Threading, C# Native AOT Performance, and AI Tools for DevOps & Productivity

Divya Anne Selvaraj
26 Sep 2024
10 min read
Bite-sized actionable content, practical tutorials, and resources for programmers#75What changed in the way you code for 2024? What has happened in the tech world in the last few months?Take this shorter version of the Developer Nation survey, learn about new tools, influence the future of development and share your insights with the world!What’s in it for you?A virtual goody bag packed with cool resourcesThe more questions you answer the more chances you have to win amazing prizes including aSamsung Galaxy Watch 7!Take the Survey now!Hi ,Welcome to this week’s edition of ProgrammingPro!In today’sExpert Insight, we bring you an excerpt from the recently published book, System Design Guide for Software Professionals, which discusses distributed tracing—tracking requests across distributed systems.News Highlights: JavaScript community petitions to cancel Oracle’s trademark; Microsoft unveils Azure AI Inference SDK for .NET; Harness debuts AI assistants for DevOps, QA, and code; YugabyteDB update enhances distributed PostgreSQL performance.My top 5 picks from today’s learning resources:Python 3.13 Preview: Free Threading and a JIT Compiler🐍C# Native AOT performance⚙️this in JavaScript🧩How Canva Scaled Real-Time Collaboration with WebRTC - From WebSockets to Seamless P2P Communication🔄Study Shows AI Coding Assistant Improves Developer Productivity🤖But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefPS:With this issue, we have finished covering all resource requests made through the September survey. Keep your eye out for next month's survey.Experience the easiest File API on the internet!Add file uploads and retrieval in minutes so you can focus on building your app— because you’ve got better things to code than infrastructure.Try now!Sign Up|Advertise🗞️News and Analysis🔎JavaScript community challenges Oracle’s JavaScript trademark:With over 10,000 signatures, the community plans to petition the USPTO to cancel the trademark, aiming to protect the language's widespread use from legal issues.Java 23 highlights crypto performance and security: Key changes include increased buffer sizes for crypto operations, additional root certificates, and adjustments for case-sensitive Kerberos principal name lookups.Microsoft Launches Azure AI Inference SDK for .NET:The SDK is designed to simplify access to genAI models from the Azure AI Studio model catalog, which includes models from Azure OpenAI Service, Mistral, Meta, and more.Harness launches new AI assistants for DevOps, QA, and Code Generation offerings: Harness’s new AI solutions include tools for pipeline creation, code completion, testing automation, and productivity insights.Latest YugabyteDB update enables distributed PostgreSQL: Key improvements include an adaptive cost-based optimizer and smart data distribution to optimise performance and support multi-region applications.Eclipse Foundation forms new working group to help open source community comply with global regulations: The group will focus on the European Cyber Resilience Act, develop best practices, and provide resources.Gleam language reaches 1.5 release: Gleam is a statically typed language for the Erlang VM and JavaScript runtimes. The update brings productivity improvements like better compile-time error messages.🎓Tutorials and Learning Resources💡PythonPython 3.13 Preview: Free Threading and a JIT Compiler:Demonstrates the key new features in Python 3.13, including free threading, which makes the GIL optional, and a JIT compiler that compiles Python code into machine code.For more Python resources, go to PythonProC# and .NET🎓Tutorial | Curve Fitting in C# using Particle Swarm Optimization: Covers setup, theory, and implementation details, guiding users on how to fit custom equations to data points.C# Native AOT performance: Compares the performance of .NET Native AOT applications to regular managed .NET code, focusing on startup time, memory usage, and request processing speed.4 Genius .NET Libraries I Love: Covers Refit for streamlined HTTP requests, Coravel for scheduling, queuing, and background jobs, FluentValidation for cleanly defining data validation rules, and Polly for robust resilience.Recent C#, .NET, and Unity Books from PacktBuy 5 eBooks for 30% + 20% off!Discount automatically calculated when you add items to cartGet the eBook for $39.99$27.98Get the eBook for$43.99$29.99Get the eBook for$38.99$26.99 C and C++🎓Tutorial | Logging all C++ destructors, poor mans run-time tracing: Shows you how to trace destructor calls, set up logging, and filter out unnecessary library output.C++ programmer's guide to undefined behavior: part 6 of 11: Discusses undefined behavior in C++ with a focus on broken syntax and standard library pitfalls, covering topics like variadic functions and iostreams quirks.Hardening C Against ROP: Getting CET Shadow Stacks Working: Provides instructions for compiling a C program with shadow stack support and demonstrates how to enable CET in recent Linux distributions.Java🎓Tutorial | Demystifying Java Reflection: A Guide to Dynamic Code Capabilities (Part 1): Covers accessing class info, creating instances dynamically, modifying fields, and invoking methods at runtime.Java JDBC Best Practices for Developers: Outlines 10 essential best practices including using prepared statements for security, closing resources properly, and handling exceptions.🎓Tutorial | Building an Orders Processing Service with ChatGPT (contribute 70–80% efforts) and Finished in 2 Days: Covers defining API endpoints, designing entities like User and Order, and more.JavaScript and TypeScript🎓Tutorial | this in JavaScript: Provides examples to explain the usage and behavior of the this keyword in different contexts such as objects, functions, constructors, and callback functions, with practical demonstrations.Variable Naming Best Practices in JavaScript: Outlines 12 best practices for variable naming in JavaScript to improve code clarity and maintainability. Key guidelines include using let and const instead of var , and proper naming.Try, catch, but don't throw: Discusses how the standard try-catch-throw approach to error handling in TypeScript lacks type safety, leading to challenges in handling recoverable vs. unrecoverable errors.GoDeveloping a go bot embedding ichiban Prolog: Introduces the new PrologTrigger struct to execute Prolog scripts and discusses implementation steps and improvements.Go sync.Cond, the Most Overlooked Sync Mechanism: Covers its usage for goroutine synchronization, demonstrating patterns for Wait(), Signal(), and Broadcast() with examples, benefits, and internal workings.RustHow to Learn Rust in 2024: A Complete Beginner’s Guide to Mastering Rust Programming: Explains how to effectively approach Rust, understand its unique features like memory safety, and access curated learning resources.“Truly Hygienic” Let Statements in Rust: Explores solutions like using IDENT @ _ patterns, dummy functions, and ultimately choosing pragmatic trade-offs for maintainability and simplicity.SwiftMastering Data Binning with Swift Charts: Explores data binning using Swift Charts' NumberBins and DateBins APIs and demonstrates how these tools enable precise data intervals for numerical and temporal data.Insetting Scrollable Views’ Content With contentMargins In SwiftUI: Discusses using the contentMargins view modifier in SwiftUI (iOS 17), which adds spacing around content within scrollable views like ScrollView , and List .PHPHigh frequency metrics in PHP using TCP sockets: Covers practical examples of logging API and database calls, handling TCP socket connections non-blockingly, and provides a PHP class, MetricObserver .SQLSQL-tips-and-tricks:A repository containing a curated list of SQL tips and tricks for improving query readability, avoiding pitfalls, and leveraging advanced features.Ruby“Gilded Rose” refactoring kata in Ruby — as if it is 2024:Discusses a "stories-first" approach to refactor the "Gilded Rose" kata in Ruby, focusing on readable, concise code rather than small, overly abstracted classes.KotlinLoading Initial Data on Android Part 2: Clear All Your Doubts: Addresses common challenges in loading initial data in Android apps, focusing on using the right triggers to avoid side effects.🌟Best Practices and Advice🚀How Canva Scaled Real-Time Collaboration with WebRTC - From WebSockets to Seamless P2P Communication: Discusses how the adoption of WebRTC for direct data transmission enhanced user experience and more.Dirty code still runs, and that’s not a good thing: Discusses the hidden risks of allowing "dirty code" to persist in software production, highlighting that it functions but causes technical debt and long-term issues.How software teams should prepare for the digital twin and AI revolution: Discusses how these technologies can enable real-time monitoring, enhance analytics, and streamline development.Study Shows AI Coding Assistant Improves Developer Productivity: A study shows that GitHub Copilot increased developer productivity by 26%, based on three randomized controlled trials involving over 4,000 developers.🧠Expert Insight📚Here’s an excerpt from “Chapter 8: Design and Implementation of System Components: API, Security, and Metrics” in the book, System Design Guide for Software Professionals by Dhirendra Sinha and Tejas Chopra, published in August 2024.Distributed tracingDistributed tracing extends the concept of tracing to a distributed system. It involves tracking a request as it travels across multiple services and machines. Each step in the request’s journey isrecorded as a span. Each step in the request’s journey is recorded as a span. A collection of spans forms a trace, which represents the entire journey of the request.Distributed tracing providesseveral benefits:Performance optimization: By visualizing the flow of requests, you can identify performance bottlenecks andoptimize themError diagnosis: If a request fails, you can use the trace to identify where the error occurred and whatcaused itSystem understanding: Tracing helps you understand the flow of requests in your system, which can be useful when onboarding new team members or when planningsystem changesOpen-source tools for distributed tracingSeveral open-source tools are available for implementing distributed tracing, each offering distinct featuresand capabilities:Jaeger: Jaeger is a distributed tracing system that was developed by Uber Technologies and subsequently released as open-source software. It is designed to monitor and troubleshoot microservices-based distributed systems, drawing inspiration from Google’s Dapper and OpenZipkin. Jaeger provides a comprehensive set of features, including distributed context propagation, transaction monitoring, root cause analysis, and performance optimization. It supports various storage backends, including Elasticsearch, Cassandra, and Kafka, for scalabletrace storage.Zipkin: Zipkin is another distributed tracing system that focuses on collecting and managing timing data for troubleshooting latency issues in microservice architectures. It provides a simple and intuitive interface for visualizing trace data, enabling developers to quickly identify and address performance bottlenecks. Zipkin supports multiple data storage options, such as in-memory, MySQL, Cassandra, and Elasticsearch, and can be integrated with various programming languagesand frameworks.OpenTelemetry: OpenTelemetry is a unified observability framework that provides APIs, libraries, agents, and collector services for capturing distributed traces and metrics from applications. It aims to standardize the collection and analysis of telemetry data across different platforms and tools. OpenTelemetry supports a wide range of programming languages and integrates seamlessly with popular observability tools such as Prometheus and Jaeger. It offers advanced features such as context propagation, distributed tracing, and metric collection, making it a versatile choice for moderncloud-native applications.System Design Guide for Software Professionalswas published in August 2024. Packt library subscribers can continue reading the entire book for free or you can buy the bookhere!Get the eBook for $33.99$22.99🛠️Useful Tools⚒️Stride Community Toolkit:A collection of extensions and helpers to simplify and enhance game development in the Stride engine using C# and .NET.Panora: An open-source API that streamlines data integration for LLMs, connecting data sources and managing embeddings and chunking efficiently.Viewport Tester: Enables testing websites on 180+ device viewports simultaneously, with multi-device mode, deep-linking, and favorites for tracking.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{line-height:0;font-size:75%}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 64
Divya Anne Selvaraj
23 Sep 2024
6 min read
Save for later

2024 guides for C#, .NET, and Unity developers

Divya Anne Selvaraj
23 Sep 2024
6 min read
Curated for software architects, game developers, and .NET engineers2024 guides for C#, .NET, and Unity developersHi ,Great programmers never stop learning. Whether you’re perfecting C#, mastering .NET, or building the next big game with Unity, the right resources make all the difference.That's why we’ve curated 16 essential titles—all published in 2024—covering everything from data structures to advanced game mechanics. This collection is designed to help you build faster, scale bigger, and code smarter.For a limited time, you can get these select expert-led resources at 30% off in both Print and eBook formats. And for those looking to save more:Buy 5 eBooksat Extra 20% offBuy 3 eBooks atExtra 15% offBuy 2 eBooks atExtra 10% offPrint discounts end September 29th.Here’s what’s on offer:C# Programming💡SpotlightC# Data Structures and Algorithms - Second Edition by Marcin JamroHarness the power of C# to build a diverse range of efficient applications>Master lists, stacks, queues, dictionaries, sets, and trees, among other data structures>Delve into effective design and implementation techniques to meet your software requirements>Visualize data structures and algorithms through illustrations for a clearer understanding of their analysisGet the eBook for $39.99$27.98Get the Print book for $49.99 $34.98C# Interview Guide by Konstantin SemenenkoBoost your confidence with answers to hundreds of secret interview questions>Acquire a strong foundation in syntax, data types, and object-oriented programming to code confidently>Develop strategies for addressing behavioral questions, tackle technical challenges, and showcase your coding skills>Augment your C# programming skills with valuable insights from industry expertsGet the eBook for$33.99 $22.99Get the Print Book for $41.99$28.99Also SeeFunctional Programming with C#by Alex Yagur: Unlock coding brilliance with the power of functional magic. eBook $38.99 $26.99 | Print $47.99 $32.99.NET DevelopmentSoftware Architecture & Microservices💡SpotlightSoftware Architecture with C# 12 and .NET 8 - Fourth Edition by Gabriel Baptista and Francesco AbbruzzeseBuild enterprise applications using microservices, DevOps, EF Core, and design patterns for Azure>Get introduced to software architecture fundamentals and begin applying them in .NET>Explore the main technologies used by software architects and choose the best ones for your needs>Master new developments in .NET with the help of a practical case study that looks at software architecture for a travel agencyGet the eBook for $39.99$27.98Get the Print book for $49.99 $34.98Pragmatic Microservices with C# and Azure by Christian NagelBuild, deploy, and scale microservices efficiently to meet modern software demands>Benefit from step-by-step project-based guidance on how to develop a full-fledged microservices application>Gain extensive knowledge of microservices by covering essential concepts, tools, and methodologies>Use essential Microsoft Azure cloud-native services and as alternatives for on-premises environmentsGet the eBook for $39.99$27.98Get the Print Book for $49.99 $34.98Also SeeEnterprise Architecture with .NET by Jean-Philippe Gouigoux: Expert-backed advice for information system design, down to .NET and C# implementation. eBook $41.99 $28.99 | Print $51.99 $35.99Web API DevelopmentArchitecting ASP.NET Core Applications - Third Edition by Carl-Hugo Marcotte: An atypical design patterns guide for .NET 8, C# 12, and beyond.eBook $37.99 $25.99 | Print $46.99 $31.99Cross-Platform Development💡Spotlight.NET MAUI Cross-Platform Application Development - Second Edition by Roger YeBuild high-performance apps for Android, iOS, macOS, and Windows using XAML and Blazor with .NET 8>Handle data effectively with expanded coverage on the MVVM model and data binding>Integrate platform-specific code using plugins and custom controls>Migrate from Xamarin.Forms to .NET MAUI for the latest hybrid app development capabilitiesGet the eBook for $32.99 $22.99Get the Print Book for $40.00 $27.99Also See.NET MAUI Projects - Third Edition by Michael Cummings, Daniel Hindrikes, and Johan Karlsson: Build multi-platform desktop and mobile apps from scratch using C# and Visual Studio 2022. eBook $41.99 $28.99 | Print $51.99 $35.99Systems ProgrammingSystems Programming with C# and .NET by Dennis Vroegop: Building robust system solutions with C# 12 and .NET 8. eBook $38.99 $26.99 | Print $47.99 $32.99Unity Game Development💡SpotlightLearning Design Patterns with Unity by Harrison FerroneLearn the secret of popular design patterns while building fun, efficient games in Unity 2023 and C#>Craft engaging Unity 2023 games while mastering design patterns like Singleton, Object Pool, and more>Write clean, reusable C# code using creational, behavioral, and structural patterns, tailored for the game development environment>Go beyond basic design pattern usage and learn to customize and extend them for your unique game design needsGet the eBook for $35.99$24.99Get the Print Book for $41.99 $28.99Hands-On Unity Game Development - Fourth Edition by Nicolas Alejandro Borromeo and Juan Gabriel Gomila SalasUnlock the power of Unity 2023 and build your dream game>Learn the fundamentals of Unity 2023 and create your dream game>Explore the world of augmented reality (AR) to create captivating mobile games>Propel game performance and player experience to new heights with Data-Oriented Technology Stack (DOTS) insightsGet the eBook for $38.99$26.99Get the Print Book for $47.99 $32.99Also SeeMastering Unity Game Development with C# by Mohamed Essam: Harness the full potential of Unity 2022 game development using C#. eBook $33.99 $22.99 | Print $41.99 $28.99Unity 2022 by Example by Scott H. Cameron: A project-based guide to building 2D and 3D games, enhanced for AR, VR, and MR experiences. eBook $39.99 $27.98 | Print $49.99 $34.98Mastering UI Development with Unity - Second Edition by Dr. Ashley Godbold: Develop engaging and immersive user interfaces with Unity. eBook $39.99 $27.98 | Print $49.99 $34.98AI Development💡SpotlightBuilding AI Applications with Microsoft Semantic Kernel by Lucas A. MeyerEasily integrate generative AI capabilities and copilot experiences into your applications>Link your C# and Python applications with the latest AI models from OpenAI>Combine and orchestrate different AI services such as text and image generators>Create your own AI apps with real-world use case examples that show you how to use basic generative AI, create images, process documents, use a vector databaseGet the eBook for $35.99$24.99Get the Print Book for $44.99 $30.99All books are 30% off, and print discounts end 29th September. Discounts are automatic—no codes needed.Start learning today.*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{line-height:0;font-size:75%}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 59

Divya Anne Selvaraj
19 Sep 2024
10 min read
Save for later

ProgrammingPro #74: Swift 6 Concurrency, C++ Memory Safety, Python Concurrency Best Practices, and Rust for Linux

Divya Anne Selvaraj
19 Sep 2024
10 min read
Bite-sized actionable content, practical tutorials, and resources for programmers#74Join Roman Lavrik from Deloitte at Snyk hosted DevSecCon 2024Snyk is thrilled to announce DevSecCon 2024, Developing AI Trust Oct 8-9, a FREE virtual summit designed for DevOps, developer and security pros of all levels. Join Roman Lavrik from Deloitte, among many others, and learn some presciptive DevSecOps methods for AI-powered development.Save your spotHi ,Welcome to this week’s edition of ProgrammingPro!In today’sExpert Insight, we bring you an excerpt from the recently published book, Generative AI-Powered Assistant for Developers, which demonstrates how Amazon Q Developer assists in generating C++ code (The book also covers Python, Java, SQL, and more) for complex tasks like developing an operating system kernel.News Highlights: Swift 6 adds strict concurrency checking, C++ interoperability, and Embedded Swift; 60% of open source maintainers are unpaid, says 2024 report; C++ Alliance proposes a Safe Standard Library for memory safety; and RustConf reaffirms Rust's role in the Linux kernel.My top 5 picks from today’s learning resources:Why Learn Python Concurrency⚙️An Overview of C++26: Concurrency🔄Let’s build and optimize a Rust extension for Python🦀Leveraging eBPF for Improved Infrastructure Observability📊Llama 3 in Action - Deployment Strategies and Advanced Functionality for Real-World Applications🦙But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefPS: Thismonth’ssurvey is still live. Do take the opportunity to tell us what you think of ProgrammingPro, request learning resources, and earn your one Packt Credit for this month.Use AI to 10X your productivity & efficiency at workStill struggling to achieve work-life balance and manage your time efficiently?Join this 3 hour Intensive Workshop on AI & ChatGPT tools (usually $399) but FREE for the first 100 people.Save your free spot here (seats are filling fast!) ⏰Sign Up|Advertise🗞️News and Analysis🔎Swift 6 now available with strict concurrency checking: The version expands platform support, adds C++ interoperability, offers Embedded Swift, and improves build performance on Windows.Java 23 is now available: The version introduces preview features such as primitive types in patterns, flexible constructor bodies, and module import declarations. Library updates include structured concurrency and more.The state of open source maintainers: The 2024 State of Open Maintainer report has revealed that 60% of open source maintainers are unpaid despite their critical role in software security and paid maintainers face stress.Can Java rival Python in AI development?: Experts argue that Java's performance, enterprise adoption, and evolving syntax position it for growth in AI.C++ Alliance takes aim at C++ memory safety: The Safe C++ Extensions proposal introduces a Safe Standard Library with memory-safe implementations and features to prevent common memory-related errors.ASP.NET Core 9 RC 1 - Keep-Alive Timeouts for Websockets, Improved SignalR Tracing, and MoreLike: Other updates include Linux support for HTTPS certificates and type overriding for InputNumber components.RustConf speakers affirm Rust for Linux project despite challenges of unstable Rust, maintainer resignation: The Rust for Linux project, aims to make Rust a second programming language for the Linux kernel.🎓Tutorials and Learning Resources💡PythonWhy Learn Python Concurrency:Explains how concurrent, parallel, and asynchronous execution allow programs to fully utilize modern hardware, improve performance, and scale more effectively.For more Python resources, go to PythonProRecent Python Books from PacktBuy 5 eBooks for 30% + 20% off!Discount automatically calculated when you add items to cartGet the eBook for$31.99$21.99 Get the Print Book for$39.99$29.98Get the eBook for$43.99$29.99 Get the Print Book for$54.99$40.99Get the eBook for$31.99$18.99 Get the Print Book for$39.99 $25.99Print book discounts end on the 22nd of September 2024.C# and .NET🎓Tutorial | Using the Pinecone vector database in .NET: Explains how to build retrieval-augmented generation (RAG) AI applications.You have 10 seconds to nixify your .Net project: Guides you through building, packaging, and containerizing .NET applications using Nix and provides a detailed example.🎓Tutorial | Logistic Regression with Batch SGD Training and Weight Decay Using C#: Teaches you to use logistic regression for binary classification tasks and interpret the significance of model weights and bias.C and C++An Overview of C++26: Concurrency: Focuses on the new std::execution framework for managing asynchronous execution with schedulers, senders, and receivers.Going Super Sonic with Asio: Covers core usage, thread management, concurrency, IO optimization, and advanced strategies like custom allocators, disabling Nagle's algorithm, and efficient buffering.🎓Tutorial | LS implementation: Explains the implementation of the ls command in Unix-like operating systems, detailing how to replicate its various functionalities in C, such as listing all files (including hidden ones), and more.Java🎓Tutorial | Exception handling in Java - The basics: Covers how to throw, try, catch, and clean up exceptions and introduces concepts such as checked and unchecked exceptions, error handling, and the use of finally blocks.Embracing Reactive Applications on JVM - A Deep Dive Into Modern I/O Models and Vert.x: Discusses the evolution of I/O models and how reactive architectures, particularly Vert.x, can be leveraged for modern software development.The Arrival of Java 23: Announces the release of Java 23, detailing its new features, performance improvements, and contributions from the Java community while highlighting its significance for modern development.JavaScript and TypeScriptCompile and run C in JavaScript: Introduces Bun's new feature in version 1.1.28, enabling developers to compile and run C code directly from JavaScript for efficient use of native libraries without relying on N-API or WebAssembly.🎓Tutorial | How To Detect Proxies: Outlines how to detect and block proxy-based signups in web applications by examining IP spoofing techniques, using the X-Forwarded-For header, WebRTC, and third-party APIs like IPQuery.The Strange Behavior of the void Type in TypeScript: Explores the peculiar behavior of the void type in TypeScript, explaining its primary use for function return types, its restrictions on variable assignments, and more.GoHow Go Tests "go test": Explains how the Go team tests the go test command, outlining the evolution of testing methodologies for command-line tools, from shell scripts to Go-based testing frameworks.Notes on running Go in the browser with WebAssembly: Covers topics such as calling Go functions from JavaScript, manipulating the DOM with Go, and using TinyGo for smaller binaries.RustUnderstanding Memory Ordering in Rust: Explores the concept of memory ordering in Rust in multi-threaded programs to ensure data consistency when compiler and processor optimizations could disrupt execution order.🎓Tutorial | Let’s build and optimize a Rust extension for Python: Covers creating a Rust extension using PyO3 and Maturin, and optimizing it through various techniques like link-time optimization, and faster random number generation.SwiftSwift Build Times and Module Verification: Discusses optimizing Swift build times for the app Secrets 4 by refactoring its codebase into 36 smaller modules for better compiler performance and clearer access control.🎓Tutorial | Using Traits to annotate and customize test behavior: explains how to use traits in Swift Testing to annotate, customize, and control test behavior, including conditional enabling/disabling, bug tracking, and time limits.PHP🎓Why I Avoid Using empty() in PHP? A Closer Look: Highlights how the function's broad handling of values like 0, "0", and false can lead to unexpected behavior in production code, and advocates for strict comparisons (===).SQL🎓Tutorial | SQL from a Programming Language Perspective — Part I: Explains SQL's core operations—filtering, projecting, grouping, sorting, and merging tables—and how queries are built, focusing on SQL’s syntax evolution.Ruby🎓Tutorial | Ruby 3.0 - Optimizing Applications with GC.compact: Discusses the GC.compact method, which reduces memory fragmentation in long-running applications by compacting the heap.Kotlin🎓Advanced Kotlin Flow Cheat sheet (for Android Engineer):Covers key concepts such as cold vs. hot streams, channels, flow operators (merge, combine, zip), and buffer handling, with practical examples for optimizing flow.🌟Best Practices and Advice🚀Leveraging eBPF for Improved Infrastructure Observability: Discusses how Netflix uses eBPF to enhance infrastructure observability by monitoring system performance and detecting "noisy neighbors."Llama 3 in Action - Deployment Strategies and Advanced Functionality for Real-World Applications: Provides insights into deploying Llama 3, optimizing performance on platforms like AWS, and fine-tuning models for specific cases.Safeloop Architecture: Introduces a coding style focused on reducing cognitive load and improving predictability between design-time and runtime behavior by using explicit, predictable code patterns.A Comprehensive Introduction to Git & GitHub — Part 1/4 - Core git features: Covers essential concepts like Git architecture (working directory, staging area, repository), installation, configuring user identity, and more.🧠Expert Insight📚Here’s an excerpt from “Chapter 5: Boost Coding Efficiency for C and C++ with Auto-Code Generation” in the book, Generative AI-Powered Assistant for Developers by Behram Irani and Rahul Sonawane, published in August 2024.End-to-end C++ language use case developmentNow let’s move to the sample use case to show the power of Amazon Q Developer’s ability to recommend code. To illustrate, I am going to use the VS Code script editor window with singleandmulti-line prompts.Let’s say that we want to write a C++ program to develop a new operating system kernel, which can control system resources and has the ability to handle complex memory management tasks. The kernel must interact with hardware, manage processes, and ensure stability across differenthardware architectures.Let’s use the multi-line prompt technique to achieve the precedinguse case.Prompt:/* Write an end to end executable C++ scriptto develop a new operating system kernel, that can control over system resources and ability to handle complex memory management tasks. The kernel must interact with hardware, manage processes, and ensure stability across different hardware architectures.*/Figure 5.11 – Writing a C++ program with Amazon Q DeveloperThe preceding screenshot shows partial code suggested by Amazon Q Developer. You can observe that end-to-end code demonstrates several fundamental and advanced concepts in C++ programming, including OOP, classes, vectors, functions, error handling,and more.Now let’s use an interactive inline prompt with the chain-of-thought technique to enhance the code. As you can see, theloadProcess()function does not have exception handling, so let’s instruct it to add an exception handle for the null process with the single-lineprompt technique:Prompt :/* add exception handling for loadProcess */Figure 5.12 – Prompt – C++ program sample snapshotAs shown in the screenshot, based on our prompt, Amazon Q Developer added anullptrcondition to check the process load exception. If it encounters a null pointer, then the code gracefully exits with aError: process isnullmessage.Generative AI-Powered Assistant for Developerswas published in August 2024. Packt library subscribers can continue reading the entire book for free or you can buy the bookhere!Get the eBook for $31.99$21.99🛠️Useful Tools⚒️GraalVM: a high-performance JDK that compiles Java applications into native executables for instant startup and efficient performance.void: an open-source Cursor alternative, forked from vscode, allowing users to build, contribute, and develop independently with support via Discord and email.Neosync: an open-source tool for anonymizing PII, generating synthetic data, and syncing environments to improve testing, debugging, and compliance.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{line-height:0;font-size:75%}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 19

Divya Anne Selvaraj
12 Sep 2024
13 min read
Save for later

ProgrammingPro #73: Java Microservices, C Falls in Tiobe Index, Rust Firmware Deployment, and Protocol Buffer Design

Divya Anne Selvaraj
12 Sep 2024
13 min read
Bite-sized actionable content, practical tutorials, and resources for programmers#73:Java Microservices, C Falls in Tiobe Index, Rust Firmware Deployment, and Protocol Buffer DesignHi ,Welcome to this week’s edition of ProgrammingPro!In today’sExpert Insight, we bring you an excerpt from the recently published book, Java Concurrency and Parallelism, which demonstrates building a data processing pipeline using a microservices architecture with Java.News Highlights: C language falls to its lowest position in the Tiobe index; TypeScript 5.6 adds new compiler options and diagnostics; Vapor 5 leverages Swift 6 concurrency; and Rust 1.81 stabilizes the Error trait.My top 5 picks from today’s learning resources:Python QuickStart for People Learning AI🤖Modernize your UWP app with preview UWP support for .NET 9 and Native AOT🚀Deploying Rust in Existing Firmware Codebases🦀Protocol Buffer Design - Principles and Practices for Collaborative Development🤝Mastering Impact Analysis and Optimizing Change Release Processes🛠️But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefPS: Thismonth’ssurvey is still live. Do take the opportunity to tell us what you think of ProgrammingPro, request learning resources, and earn your one Packt Credit for this month.Sign Up|Advertise🗞️News and Analysis🔎C language slumps in Tiobe popularity index:C has dropped to fourth place, its lowest position since the index began. Read to learn about the reasons for C's reduced popularity compared to alternatives like C++ and Rust..NET 9 Release Candidate 1 is now available!: Key updates include enhanced WebSocket APIs, new compression options (ZLib and Brotli), advanced SignalR tracing, and improvements to .NET MAUI.Vapor 5 Materializes the Future of Server-Side Development in Swift: The release will leverage Swift 6's structured concurrency, introduce modern packages, and rewrite WebSocket and MultipartKit APIs for better async.Rust 1.81 stabilizes Error trait:The update allows its use in #![no_std] libraries, and introduces improved sort algorithms for better performance.TypeScript 5.6 now generally available:The update includes features such as disallowing nullish and truthy checks on non-variable syntax, new compiler options, and improved diagnostics.JFrog helps developers improve DevSecOps with new solutions and integrations: JFrog announced new solutions and integrations with GitHub and NVIDIA at its swampUp conference, enhancing security capabilities.Express.js 5.0 released after long delay, though not yet default as project appeals for contributors: New features include improved path route matching, better error handling for rejected promises, and the return of the app.router.🎓Tutorials and Learning Resources💡Sponsored Mini Course on AI worth $399 for free: 200+ hours of research on AI-led career growth strategies & hacks packed in 3 hours. Register Now.PythonPython QuickStart for People Learning AI:Covers Python fundamentals, including data types, loops, and functions, and provides a concrete AI project example using the OpenAI API for summarizing research papers.For more Python resources, go to PythonProC# and .NET🎓Tutorial | Modernize your UWP app with preview UWP support for .NET 9 and Native AOT: Explains how to upgrade UWP apps incrementally to .NET 9, adopt Native AOT, and discusses tools for future migration to WinUI 3.WebAssembly and Containers: Orchestrating Distributed Architectures with .NET AspireLike: Explains how .NET Aspire simplifies orchestration using C#, enabling developers to manage components using the Dashboard.🎓Tutorial | C# Testing set up: Provides a step-by-step guide on setting up testing in C# using xUnit, with a focus on creating a basic test structure for a C# class.C and C++What’s new in C++26 (part 1):Focuses on specifying reasons for deleted functions, unnamed placeholder variables, structured binding declarations in conditions, and user-generated static_assert messages.🎓Tutorial | Giving C++ std::regex a C makeover: Discusses how to wrap C++'s std::regex into a C interface, providing a way to use C++ regular expressions in C projects without dealing with C++ directly.🎥💼Case Study | Zero-Cost Abstractions in C++ - High Performance Message Dispatch - Luke Valenty - C++Now 2024: Provides a detailed breakdown of how Intel optimizes message handling and uses C++ techniques to manage power in embedded systems.Java🎓Tutorial | Packages and static imports in Java:Explains how Java developers can use packages and static imports to organize top-level types, prevent naming conflicts, and simplify access to static members.🎓Tutorial | Using oneAPI Construction Kit and TornadoVM to accelerate Java Programs on x86, ARM and RISC-V CPUs: Covers setup, performance comparisons, and configurations for OCK as an OpenCL and SPIR-V driver.🎓Tutorial | Writing a Linux scheduler in Java with eBPF (15): Explains how to implement two Linux schedulers using eBPF in Java: a FIFO scheduler and a weighted scheduler.Recent Java Resources from PacktDiscover strategies and best practices to develop high performance Java applicationsGet the eBook for $33.99$22.99Proven recipes for building modern and robust Java web applications with Spring BootGet the eBook for $31.99$21.99Master Continuous Integration with Jenkins: Automate, Test, and Deploy Like a ProGet the 3 hour course for $49.99JavaScript and TypeScriptUnderstanding Concurrency, Parallelism and JS: Explores the differences between concurrency and parallelism, explains how JavaScript achieves concurrency through Node.js’s single-threaded event-driven model, and more.Javascript/Python Array Quick Reference: Offers side-by-side comparisons of syntax for tasks like accessing, iterating, mapping, adding/removing elements, filtering, and sorting.What Good Looks Like - A Real-World Typescript Refactor: Demonstrates a real-world TypeScript refactor of an entity-manager library, focusing on improving efficiency and reducing complexity.Go🎓Tutorial | An HTTP Server in Go From scratch: Walks through key steps, including binding to a port, responding with status codes, extracting URL paths, handling request headers, and implementing concurrent connections.Using Go instead of bash for scripts: Explains how to automate programming tasks and simplify development by replacing Bash scripts with a more efficient, cross-platform Go program.RustDeploying Rust in Existing Firmware Codebases: Discusses how to incrementally deploy Rust into existing firmware codebases, focusing on enhancing memory safety, especially for critical components.Porting C to Rust for a Fast and Safe AV1 Media Decoder: Takes you through the challenges and methods of preserving C API compatibility, managing threading models, and achieving memory safety while maintaining performance.SwiftSwift Type placeholder - What is it and when to use it: Discusses Swift's type placeholders, introduced in Swift 5.6, allowing the compiler to infer complex types using underscores (_) in place of specific types.Swift Testing - Validate your code using expressive APIs: Discusses Apple's new Swift Testing framework, which includes the @Test macro for defining tests, the #expect macro for assertions, and enhanced feedback in Xcode for test results.PHP🎓Look out, kids - PHP is the new JavaScript: Shows how Laravel has revitalized PHP, offering developers an easy and efficient way to build dynamic web applications, making PHP fun and relevant again.SQLDissecting a Hybrid Search query in SQL: Explains how to use Common Table Expressions (CTEs) in SQL to build hybrid search queries, focusing on combining vector and full-text search results.KotlinLoading Initial Data in LaunchedEffect vs. ViewModel: Compares two approaches for loading initial data in Jetpack Compose: using LaunchedEffect within a composable and ViewModel.init().🌟Best Practices and Advice🚀💼Case Study | Protocol Buffer Design - Principles and Practices for Collaborative Development: Highlights the benefits of Protobuf for scalability, backward compatibility, and consistency in multi-language environments.How to Make Technical Debt Your Friend: Argues that not all TD needs to be repaid, and using a Minimum Viable Architecture (MVA) approach allows teams to focus on delivering Minimum Viable Products that meet immediate needs.Mastering Impact Analysis and Optimizing Change Release Processes: Emphasizes focusing on "why" rather than "who" when analyzing failures, improving pre-production testing, and minimizing the blast radius of bugs.Do we need enterprise software marketplaces?: Explores the evolution of marketplaces, from gadget collections to API-driven models, and the importance of maintaining strong vendor relationships for future success.🧠Expert Insight📚Here’s an excerpt from “Chapter 8: Microservices in the Cloud and Java’s Concurrency” in the book, Java Concurrency and Parallelism, by Jay Wang, published in August 2024.Use case 2 – building a data processing pipeline with microservicesThis case study delves into designing and implementing a data processing pipeline using amicroservices architecture:The first step is to design the microservices. We’ll construct the pipeline with threedistinct microservices:Data ingestion service: This service acts as the entry point, which is responsible for receiving and validating incoming data from external sources. Once validated, it publishes the data to an Amazon SQS queue for further processing. The service depends on the Amazon SQSclient library.Data processing service: This service subscribes to the Amazon SQS queue used by the data ingestion service. It consumes the data, applies business logic for transformation, and publishes the processed data to another SQS queue for persistence. This service relies on both the Amazon SQS client library and the AWSGlue SDK.Data persistence service: The final service consumes the processed data from the second SQS queue. Its primary function is to store the data persistently in Amazon RDS for long-term accessibility. This service utilizes both the Amazon SQS client library and the Amazon RDS client library...The next step is to set upthe AWSs:Two AWS Simple Queue Service(SQS)queueswill beset up:Initial data queue: Create a queue intended for receiving initialunprocessed dataProcessed data queue: Set up another queue for holding processed data ready for further actionsor storageAWS RDS instance: Set up an RDS instance to provide persistent storage for your application. You can choose MySQL, PostgreSQL, or any other available RDS database engine depending on your application requirements. This database will be used to store and manage the data processed byyour application.AWS Simple Notification Service(SNS): Create an SNS topic to facilitate the notification process. This topic will be used to publish messages notifying subscribers of successful data processing events and other important notifications. Determine the subscribers to this topic, which could include email addresses, SMS, HTTP endpoints, or even other AWS services such as Lambda or SQS, depending on yournotification requirements.The third step is to set up a Maven project. Create a new Maven project for each microservice (DataIngestionService, DataProcessingLambda, and DataPersistenceService) in your preferredIntegrated Development Environment(IDE) or using the command line. Open thepom.xmlfile in each project’s root directory and add therelated dependencies.The fourth step is to implement the dataingestion service:@Servicepublic class DataIngestionService { private final AmazonSQS sqsClient; public DataIngestionService(AmazonSQS sqsClient) { this.sqsClient = sqsClient; } public void ingestData(Data dat{ // Validate the incoming data if (isValid(data)) { // Publish the data to Amazon SQS SendMessageRequest sendMessageRequest = new SendMessageRequest() .withQueueUrl("data-ingestion-queue-url") .withMessageBody(data.toString()); sqsClient.sendMessage(sendMessageRequest); } } private boolean isValid(Data dat{ boolean isValid = true; // Implement data validation logic // ... return isValid; }The code represents the implementation of the data ingestion service, which is responsible for receiving incoming data, validating it, and publishing it to Amazon SQS forfurther processing.TheDataIngestionServiceclass is annotated with@Service, indicating that it is a Spring service component. It has a dependency on theAmazonSQS client, which is injected throughthe constructor.TheingestData()method takes adata objectas input and performs data validation by calling theisValid()method. If the data is valid, it creates aSendMessageRequestobject with the specified SQS queue URL and the data payload as the message body. The message is then sent to the SQS queue using thesqsClient.sendMessage()method.The fifth step is to implement the data processing service usingAWS Lambda:public class DataProcessingLambda implements RequestHandler<SQSEvent, Void> { private final AmazonSQS sqsClient; public DataProcessingLambda() { this.sqsClient = AmazonSQSClientBuilder.defaultClient(); } @Override public Void handleRequest(SQSEvent event, Context context) { for (SQSEvent.SQSMessage message : event.getRecords()) { String data = message.getBody(); // Transform the data within the Lambda function String transformedData= transformData( data); // Publish the transformed data to another Amazon SQS for persistence or further // processing sqsClient.sendMessage( new SendMessageRequest() .withQueueUrl( "processed-data-queue-url") .withMessageBody(transformedData)); } return null; } /** * Simulate data transformation. * In a real scenario, this method would contain logic to transform data based * on specific rules or operations. * * @param data the original data from the SQS message * @return transformed data as a String */ private String transformData(String dat{ // Example transformation: append a timestamp or modify the string in some way return "Transformed: " + data + " at " + System. currentTimeMillis(); }}This Lambda function,DataProcessingLambda, processes data from an Amazon SQS queue by implementing theRequestHandlerinterface to handleSQSEventevents. It initializes an Amazon SQS client in the constructor and uses it to send transformed data to another SQS queue for further processingor storage.ThehandleRequest()method, serving as the function’s entry point, processes eachSQSMessagefrom theSQSEvent, extracting the data and transforming it directly within the function through thetransformData()method. Here, the transformation appends a timestamp to the data as a simple example, but typically this would involve more complex operations tailored to specific dataprocessing requirements.Following the data transformation, the function sends the processed data to a specified SQS queue by invoking thesendMessage()method on theSQS client.The next step is to create a Spring-managed service that handles storing processed data in a database and notifies subscribers via AWS SNS uponsuccessful persistence:@Servicepublic class DataPersistenceService { private final AmazonSNS snsClient; private final DataRepository dataRepository; public DataPersistenceService(DataRepository dataRepository) { // Initialize the AmazonSNS client this.snsClient = AmazonSNSClientBuilder.standard(). build(); this.dataRepository = dataRepository; } public void persistData(String data{ // Assume 'data' is the processed data received // Store the processed data in a database Data dataEntity = new Data(); dataEntity.setProcessedData(data); dataRepository.save(dataEntity); // Send notification via SNS after successful persistence sendNotification("Data has been successfully persisted with the following content: " + data); } private void sendNotification(String message) { // Define the ARN of the SNS topic to send notification to String topicArn = "arn:aws:sns:region:account-id:your- topic-name"; // Create the publish request PublishRequest publishRequest = new PublishRequest() .withTopicArn(topicArn) .withMessage(message); // Publish the message to the SNS topic snsClient.publish(publishRequest); }}DataPersistenceService is a Spring-managed bean responsible for handling data persistence and notifying other components or services via Amazon SNS....Java Concurrency and Parallelismwas published in August 2024. Packt library subscribers can continue readingthe entire book for free or you can buy the bookhere!Get the eBook for $33.99$22.99🛠️Useful Tools⚒️dokku: an open-source PaaS using Docker, allowing developers to deploy Heroku-compatible apps via git and run them in isolated containers.R3: a modern, high-performance reimplementation of Reactive Extensions for .NET, optimized for game engines and aligned with new C# features.nomadic: An enterprise-grade toolkit by NomadicML for optimizing compound AI systems, allowing teams to refine hyperparameters and prompts.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere. Complete ProgrammingPro archives can be foundhere. Complete PythonPro archives arehere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{line-height:0;font-size:75%}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 52
Divya Anne Selvaraj
05 Sep 2024
13 min read
Save for later

ProgrammingPro #72: Optimizing Builds with CMake & ccache, Android 15 Developer Tools, PyPi Security Risks, and JDK 23 Updates

Divya Anne Selvaraj
05 Sep 2024
13 min read
Bite-sized actionable content, practical tutorials, and resources for programmers#72:Optimizing Builds with CMake & ccache, Android 15 Developer Tools, PyPi Security Risks, and JDK 23 UpdatesHi ,Welcome to this week’s edition of ProgrammingPro!In today’sExpert Insight, we bring you an excerpt from the recently published book, CMake Best Practices -Second Edition, which discusses how to optimize and maintain CMake projects using a compiler cache, specifically ccache, to speed up C and C++ builds.Related Titles from PacktGet to grips with CMake and take your C++ development skills to enterprise standardsUse hands-on exercises and self-assessment questions to lock-in your learningUnderstand how to build in an array of quality checks and tests for robust codeGet the eBook for $39.99 $27.98Get the Print Book for $49.99 $39.98Comprehensive introduction to C++ programming and detailed explanations of algorithmic concepts.Step-by-step setup of development environments, with practical exercises and real-world examples.In-depth coverage of control structures, and visual aids such as trace tables and flowcharts.Get the eBook for $9.99News Highlights: Android 15 launches with enhanced developer tools; PyPi faces security risks in package management; .NET 9 introduces crucial security updates, .NET Framework remains vulnerable; and Elasticsearch reverts to open source amid tech shifts.My top 5 picks from today’s learning resources:Web Scraping With Scrapy and MongoDB🕸️.NET and C# are in trouble. Here is what I'd do🚨JDK 23 and JDK 24 - What We Know So Far🔍Efficient DevSecOps Workflows With a Little Help From AI🤖Gemma explained - RecurrentGemma architecture🧠But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefPS: Thismonth’ssurvey is now live. Do take the opportunity to tell us what you think of ProgrammingPro, request learning resources, and earn your one Packt Credit for this month.Developing for iOS? Setapp's 2024 report on the state of the iOS market in the EU is a must-seeHow do users in the EU find apps? What's the main source of information about new apps? Would users install your app from a third-party app marketplace?Set yourself up for success with these and more valuable marketing insights in Setapp Mobile's report, "iOS Market Insights for EU."Get Insights FreeSign Up|Advertise🗞️News and Analysis🔎Android 15 is now officially available: The version introduces a range of developer tools in Android Studio and Jetpack including new PdfRenderer API capabilities, new OpenJDK APIs, new SQLite APIs, and new Canvas drawing capabilities.TypeScript 5.6 enters release candidate stage: Changes include renamed types, reverted search behavior for tsconfig.json files, and improvements from the prior beta phase.PyPi repository vulnerable to deleted package hijack, say researchers: Researchers at JFrog have identified a vulnerability in the PyPi package repository where attackers can hijack deleted package names and upload malicious versions.Microsoft makes breaking change in .NET 9 for security, leaves .NET Framework insecure: Microsoft is removing the BinaryFormatter class from .NET 9 due to its unfixable security risks, although it will remain in the .NET Framework.Elasticsearch will be open source again as CTO declares changed landscape: This move comes after the projects shifted from the Apache 2.0 license to more restrictive terms in 2021, aimed at preventing companies like AWS from offering these products as managed services without collaboration.Uno Platform 5.3 Released: The version Introduces official support for JetBrains Rider, enhances the Hot Reload experience across all supported IDEs, and includes new UI controls..NET Aspire 8.2: Components Renamed to Integrations, Enhanced Testing, and More Improvements: The version also introduces a Hosting package to simplify resource management in local development and enhanced setup.🎓Tutorials and Learning Resources💡Sponsored Mini Course on AI worth $399 for free: 200+ hours of research on AI-led career growth strategies & hacks packed in 3 hours. This course on AI has been taken by 1 Million people across the globe. Register Now.Sponsored Live Webinar - The Power of Data Storytelling in Driving Business Decisions: Join to learn about Data Storytelling and turn complex information into actionable insights for faster decision-making. Register for free.PythonWeb Scraping With Scrapy and MongoDB:Guides you through setting up a Scrapy project, building a web scraper, extracting data, and storing it in MongoDB.Readto also learn about testing and debugging techniques.For more Python resources, go to PythonProC# and .NETLesser-known operators in C#: Details unique logical and null operators alongside functional ones, which enhance code expressiveness and error handling.🎥.NET and C# are in trouble. Here is what I'd do: Delves into the debate surrounding the rapid evolution of .NET and C#, featuring community reactions and proposals for enhancing adoption and support.🎥🎓Tutorial | Let's Build Our Own ArrayPool - Deep .NET with Stephen & Scott: Explores the intricacies of object pooling, optimizing array length, and managing memory pressure, alongside concurrent queue operations and thread management.C and C++Qt/.NET — Using QML in a .NET WPF application: Discusses the integration of QML into .NET WPF applications through the proposed Qt/.NET toolkit, allowing seamless interoperability between C++ and .NET.Honey, I shrunk {fmt}: bringing binary size to 14k and ditching the C++ runtime: Covers strategies including using type erasure to minimize template bloat and applying the Dragonbox algorithm for efficient numeric formatting.HashMap in 25 lines of C: Demonstrates how to construct a simple hash table in C, accommodating any value that C understands.Java🎓Tutorial | Static classes and inner classes in Java: Shows how nested classes can organize code and explains static member classes. Read to gain insights into using nested classes in Java to maintain cleaner code structure.JDK 23 and JDK 24 - What We Know So Far: Provides a breakdown of new Java Enhancement Proposals (JEPs) across different categories and updates on major Java projects like Amber, Loom, Panama, and Valhalla.Hide and Seek with Collections in Java: Delves into the Collection Accessor Method pattern using Eclipse Collections, analyzing various strategies to manage relationships within object-oriented domains in Java.JavaScript and TypeScriptPoor man's signals: Explains how signals can be implemented using JavaScript's EventTarget class, providing a simplified, event-driven approach to track changes to data.Compilation of JavaScript to Wasm, Part 3 - Partial Evaluation: Explores the use of the first Futamura projection to transform interpreter code into compiled WebAssembly code, highlighting the practical challenges and solutions.Advanced React Component Design with TypeScript: Focuses on creating reusable, flexible, and type-safe components while enhancing developer experience (DX).GoExploring Goja - A Golang JavaScript Runtime: Explores how Goja, a JavaScript runtime for Golang, effectively simplifies embedding JavaScript in Go applications, particularly for tasks involving complex data manipulation.Telemetry in Go 1.23 and beyond: Discusses the introduction of telemetry in Go 1.23, allowing developers to opt-in to sharing toolchain usage data to improve bug fixes, prevent regressions, and enhance decision-making.RustUnmaking the Makefiles - exorcising the Rust compiler test suite one file at a time: Narrates the journey of rewriting 352 Makefiles into Rust using the run-make-support crate, which was part of a Google Summer of Code project.Async Rust can be a pleasure to work with (without `Send + Sync + 'static`): Explains how to simplify async Rust development by avoiding Send + Sync + 'static bounds through Structured Concurrency and thread-per-core.SwiftCross-Platform Swift - Building a Swift app for the browser: Discusses the development of Swift applications for non-Apple platforms, specifically focusing on creating a simple Swift app that runs in a browser using WebAssembly.Swift Enums 🤝 Design Systems: Elaborates on the advantages of using enums to define UI components, providing a clean and maintainable way to encapsulate branding elements like colors and icons into reusable components.PHP🎓Tutorial | PHP and Web Dev Phobia: Guides you through setting up a virtual machine using Vagrant and VirtualBox, installing PHP and Lighttpd on Debian, and creating a simple PHP page.SQLBest practices for prompt engineering with Meta Llama 3 for Text-to-SQL use cases: Outlines the process of setting up the model with Amazon SageMaker JumpStart, using structured prompts, and leveraging model versions for optimized dialogue and SQL parsing.RubyWrite a Ruby C Extension to Use CLIPS from Ruby - Part 3: Focuses on enabling Ruby methods to be called from CLIPS rules, showcasing how to manipulate and interact with Ruby objects and data types within the CLIPS environment.Transpiling Go & Java to Ruby using GPT-4o & Claude 3.5 Sonnet: Discusses the extension of the DevQualityEval LLM code generation benchmark to include Ruby and utilizing LLMs like Claude 3.5 Sonnet.Kotlin🎓Tutorial | Data Analytics With Kotlin Notebooks, DataFrame, and Kandy: Guides beginners on how to set up and use Kotlin Notebook to analyze and visualize data, specifically using a weather data CSV file as an example.🌟Best Practices and Advice🚀Efficient DevSecOps Workflows With a Little Help From AI: Explores how AI aids in identifying security vulnerabilities, offering explanations and fixes, and streamlining operations with features like root cause analysis.Glue and coprocessor architectures: Highlights how systems can efficiently handle complex computations by separating them into highly specialized tasks performed by coprocessors and more general, flexible operations.Gemma explained - RecurrentGemma architecture: Discusses how the architecture employs a hybrid model called Griffin that combines gated linear recurrences with local sliding window attention for efficient long context processing.Lean Architecture: Proposes a 'Lean Architecture,' focusing on efficiency, minimal design waste, and maintaining software with an adaptable, problem-solving approach rather than following strict architectural guidelines.🧠Expert Insight📚Here’s an excerpt from “Chapter 14: Optimizing and Maintaining CMake Projects” in the book, CMake Best Practices -Second Edition, by Dominik Berner and Mustafa Kemal Gilor, published in August 2024.Using a compiler cache (ccache) to speed up rebuildsCcaches work by caching compilations and detecting when the same compilation is done again. At the time of writing this book, the most popularprogram for caching compile results isccache, which is open source and distributed under the Lesser General Public License 3(LGPL 3). The ccache program not only affects incremental builds but also fresh builds, as long as the cache is not deleted between the two runs. The cache created is portable between systems running the same compilers and can be stored in remote databases so that multiple developers may access the same cache. Officially, ccachesupports GCC, Clang, andNvidia CUDA Compiler(NVCC), but people claim to have run it for MSVC and Intel compilers. When usingccachewith CMake, it works best with Makefile and Ninja generators. At the time of writing this book, Visual Studio wasnot supported.To useccache with CMake, the CMAKE_<LANG>_COMPILER_LAUNCHER cache variable is used, where <LANG>is replaced with the respective programming language. The recommended way is to pass this in using a preset, but to enableccachefor C and C++ inside aCMakeLists.txt file, the following code canbe used:find_program(CCACHE_PROGRAM ccache)if(CCACHE_PROGRAM) set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_PROGRAM}) set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_PROGRAM})endif()Passing the variable from a preset or from the command line or a preset is also a good alternative, especially because the configuration ofccacheis done easiest by usingenvironment variables.Usingccachewith the default configuration might already bring a considerable improvement regarding build times, but if the build is a bit more complex, further configuration might be necessary. To configureccache, certain environment variables starting withCCACHE_can be used; for full documentation of all configuration options, refer to theccachedocumentation. Common scenarios that need special attention are combiningccache with precompiled headers, managing dependencies that are included usingFetchContent, and combiningccache with other compiler wrappers, such asdistcc or icecc for distributed builds. For these scenarios, the following environment variables are used:To work efficiently with precompiled headers, set CCACHE_SLOPPINESS to pch_defines,time_macros. The reason for this is that ccachecannot detect changes in#definesin the precompiled header, and it cannot tell if__TIME__,__DATE__, or__TIMESTAMP__ are used when creating precompiled headers. Optionally, setting include_file_mtime to CCACHE_SLOPPINESS might further increase the cache hit performance, but it carries a very small risk of arace condition.When including big dependencies that are built from source (for instance, by usingFetchContent), setting CCACHE_BASEDIR to CMAKE_BINARY_DIR might increase the cache hit rate; this might bring a performance boost especially if there are many (sub)projects fetching the same dependency. On the other hand, if the sources in the project itself are the ones that take more time to compile, setting this toCMAKE_SOURCE_DIRmight bring better results. It needs to be tried out to learn which one brings thebetter result.To work with other compiler wrappers, theCCACHE_PREFIX environment variable is used to add commands for these wrappers. It is recommended to useccache first when chaining multiple wrappers so that the results of other wrappers may alsobe cached.Passing environment variables to CMake using a configure preset, as described in "Chapter 9,Creating Reproducible Build Environments", is the recommended way; this can either be combined with detectingccache inside the CMakeLists.txt file or the ccache command may also be passed using the following preset:{"name" : "ccache-env",... "environment": { "CCACHE_BASEDIR" : "${sourceDir}", "CCACHE_SLOPPINESS" : "pch_defines,time_macros" }},With these configurations, usingccachecan yield very large benefits to the compile time, but caching compiler results is a complicated matter, so to get the full benefit, theccachedocumentation should be consulted. In most cases, usingccachewill probably bring the most performance benefit with a relatively trivial setup. Other tools, such asdistccfor distributed builds, work very similarly from the CMake perspective, but require a bit moresetup work.CMake Best Practices -Second Edition was published in August 2024. Packt library subscribers can continue readingthe entire book for free or you can buy the bookhere!Get the eBook for $33.99$22.99Get the Print Book for $41.99🛠️Useful Tools⚒️Daytona: An open-source tool that simplifies the setup of development environments, allowing developers to configure and launch their workspaces with a single command across various platforms and architectures.Sparo: Anopen-source tool developed by TikTok engineers to enhance the performance of large monorepos by utilizing sparse checkout and partial clone features of Git for more efficient operations.lmnr: an open-source observability and analytics platform tailored for complex LLM applications, integrating automatic telemetry, analytics, and prompt chain management with a focus on performance, transparency, and scalability.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere. Complete ProgrammingPro archives can be foundhere. Complete PythonPro archives arehere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.If you have any suggestions or feedback, or would like us to find you a Programming learning resource on a particular subject, take the surveyor just respond to this email!*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{line-height:0;font-size:75%}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 21

Divya Anne Selvaraj
29 Aug 2024
14 min read
Save for later

ProgrammingPro #71: Nullable Reference Types in C#, Prompty for VS Code, Python Packaging Tools

Divya Anne Selvaraj
29 Aug 2024
14 min read
Bite-sized actionable content, practical tutorials, and resources for programmers#71:Nullable Reference Types in C#, Prompty for VS Code, Python Packaging Tools, and Rust Error HandlingHi ,Welcome to this week’s edition of ProgrammingPro!In today’sExpert Insight, we bring you an excerpt from the recently published book, Functional Programming with C#, which discusses the implementation of Nullable Reference Types (NRTs) in C#, as a tool for developers to handle null references more safely and transparentlyNews Highlights: OSI releases latest draft of Open Source AI Definition; Microsoft releases Prompty, a new VS Code extension for integrating LLMs into .NET development; JetBrains Workspaces offers monorepo benefits exclusively in IntelliJ IDEA; and Survey shows game engines like Godot gaining traction in non-game projects.My top 5 picks from today’s learning resources:What's the deal with setuptools, setup.py, pyproject.toml, and wheels?🛠️Supercharge your testing experience with MSTest.Analyzers⚡The definitive guide to error handling in Rust🛡️Simplicity, Speed, and Re-Use. Shipping Threads in 5 Months🚀Best practices for event logging and threat detection🛑But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefPS:We have finished covering all requests made by you so far through the August survey. We did receive some specific and comprehensive requests around Java and are therefore planning to take out a Collector's Edition on Java sometime next month. If you have any more Java specific requests you would like covered in the special issue, reply to this email and let me know.Sign Up|Advertise🗞️News and Analysis🔎OSI releases latest draft of Open Source AI Definition: The draft clarifies that all components of an AI system must meet open source standards, excludes training data from classification, and updates key terminologies.Kotlin update shines on garbage collector:The update also includes bug fixes, support for newer Gradle versions, and improvements in Kotlin Multiplatform development.The slow evolution of enterprise tech: argues that despite the rapid hype cycles around technologies like cloud computing and gen AI, enterprise tech evolves slowly, with core programming languages and databases remaining largely unchanged over the past decade.JDK 24 preps for restrictions on JNI use: This feature will introduce warnings to prepare for future restrictions, aligning JNI usage with the Foreign Function and Memory (FFM) API.Microsoft Releases Prompty - New VS Code Extension for Integrating LLMs into .NET DevelopmentLike: This free tool simplifies adding AI-driven capabilities to applications, such as generating content or creating chatbots, directly within the development environment.JetBrains Workspaces aims for benefits of monorepos without the downside – but only in IntelliJ IDEA: The plugin addresses issues like monorepo fragility and performance problems by keeping projects independent.Survey finds game engines used equally by non-game projects, rise of interest in open source Godot: The survey also noted the increasing use of JetBrains Rider and VS Code, and challenges in collaboration due to the handling of large files in game development.🎓Tutorials and Learning Resources💡PythonWhat's the deal with setuptools, setup.py, pyproject.toml, and wheels?:Provides a detailed explanation of Python packaging tools and practices, offering insights and recommendations for how to approach packaging in modern projects.Debugging and Profiling in Python: Discusses debugging and profiling tools for Python, highlighting key libraries like pdb, faulthandler, cProfile, and tracemalloc.For more Python resources, go to PythonProC# and .NET🎓Tutorial | Introducing the Pinecone .NET SDK: Provides a step-by-step guide on setting up the SDK, creating an index, adding records, and querying data.Supercharge your testing experience with MSTest.Analyzers: Showcases specific examples of how MSTest.Analyzers help catch common mistakes, and provides recommendations for best practices in test writing.The C# type system: Explains built-in and custom types, the common type system (CTS), and how types influence memory allocation, type safety, and program behavior.C and C++C++ unwind exception metadata - A hidden reverse engineering bonanza: Discusses how C++ unwind exception metadata can aid reverse engineering by revealing hidden details about data structures in C++ programs, particularly those using MSVC/x64 targets.An Overview of C++26 - Core Language: Highlights key features such as reflection, which enhances compile-time programming, and contracts, which allow precise and checkable interface specifications.How to run valgrind on a CGI program in C: Explains how to use Valgrind to debug a memory corruption issue in a CGI program that only manifests during a POST request.Java🎓Tutorial | Better than reflection: Using method handles and variable handles in Java: Discusses replacing Java reflection with MethodHandle and VarHandle for accessing methods and fields programmatically.🎓Tutorial | Method overloading in the JVM: Focuses on techniques like widening, boxing, and varargs. Read to learn about the advantages of method overloading for cleaner code and common pitfalls to avoid.WebAssembly, the Safer Alternative to Integrating Native Code in Java: Highlights the use of Chicory, a pure JVM Wasm runtime, to integrate Wasm-compiled code, such as SQLite, into Java applications, providing strong security guarantees.JavaScript and TypeScriptCompilation of JavaScript to Wasm, Part 2 - Ahead-of-Time vs. JIT: Discusses the challenges of compiling JavaScript due to its dynamic typing and the limitations of traditional JIT (just-in-time) compilation in Wasm-first platforms.Frontend Strategies - Frameworks or Pure JavaScript?: Clarifies when to use frameworks versus pure JavaScript, along with the advantages of modular code, reusable components, and integration with modern development tools.Announcing TypeScript 5.6 RC: Details new features like disallowed nullish and truthy checks, iterator helper methods, and improved built-in iterator checks.GoC# (.NET) vs. Go (Golang): Performance Benchmark in Kubernetes: Focuses on metrics like CPU and memory usage, request handling capacity, and end-user latency. Read to learn how Golang generally performed better.The 4-chan Go programmer: Humorously explores the complexities of using channels in Go by demonstrating a convoluted example of sending channels over channels, inspired by the concept of "4-star programmers" from C.Rust💼Case Study | MiniJinja - Learnings from Building a Template Engine in Rust: Discusses the author's experience and technical challenges in creating MiniJinja, a Jinja2-compatible template engine in Rust.🎓Tutorial | The definitive guide to error handling in Rust: Covers the use of Result, dynamic errors like Box<dyn Error>, and structured errors. Read to also learn about downcasting errors, using the anyhowcrate.SwiftSwift Macros at scale: Introduces Tuist, a tool for managing Xcode projects, which supports caching for Swift Macros, improving build times for developers.Designing Apps: 5 Methods to improve your workflow: Highlights techniques such as using the Golden Ratio, proper spacing for visual hierarchy, designing directly with SwiftUI, gradually enhancing app visuals from basic to vibrant, and more.PHP🎓Tutorial | How to build a game engine in a CMS, in PHP:While acknowledging that it's not an ideal approach, the author details creating a rendering system, implementing game logic, handling collisions, adding animations, and more.SQLEfficient Data Cleanup in Partitioned PostgreSQL Tables using Common Table Expressions: Demonstrates using CTEs to identify deletable data, optimizing the deletion process through batch processing, and maintaining database consistency.Scala and Spark"Domain Modeling" in the Scala 3 - Book: Covers the tools available in Scala, such as classes, traits, and enums, to build models. Read to learn how to effectively represent attributes and behaviors within each paradigm.Spark — debugging a slow Application: Outlines common reasons why Apache Spark applications may run slowly, highlighting issues such as input/source inefficiencies, uneven or excessive partitioning, and slow transformations.[Solution] Spark — debugging a slow Application: Covers techniques such as partitioning, bucketing, and file compaction, and advises on managing partition sizes, leveraging adaptive query execution, avoiding slow transformations, and more.KotlinKotlin's Type System is (Also) Unsound: Presents a proof that Kotlin's type system can allow operations that should not be permissible at runtime. Read to learn about the specific language features involved, and potential solutions.🌟Best Practices and Advice🚀Podcast: Misconceptions around Agile in an AI world: Featuring insights from David Ross, Agile evangelist for Miro, highlights how Agile practices have evolved, moving away from rigid frameworks towards more adaptive and pragmatic approaches.Simplicity, Speed, and Re-Use. Shipping Threads in 5 Months: Describes how despite technical debt and challenges, such as scaling issues on launch day, the team prioritized simplicity and leveraged a battle-tested codebase to meet tight deadlines.Best practices for event logging and threat detection: Developed by the Australian Cyber Security Centre in collaboration with international cybersecurity agencies, this document emphasizes creating an enterprise-approved logging policy, ensuring log quality, centralizing log collection, and implementing secure storage.The Terralith: Monolithic Architecture of Terraform & Infrastructure as Code: Argues for breaking down monolithic structures into smaller, more manageable modules to enhance scalability, maintainability, and reduce risk.🧠Expert Insight📚Here’s an excerpt from “Chapter 4: Honest Functions, Null, and Option” in the book, Functional Programming with C# by Alex Yagur, published in July 2024.Embracing honesty with nullable reference typesHandling null in C# has alwaysbeen quite a challenge. Many software developers (me included) advocate doing a check for NullReferenceExceptions as a mandatory task in a code review checklist. In most cases, it is really easy to check for possible null values just by looking at the pull request, even without an IDE. Recently, we received help when Microsoft introduced nullable reference types. So, now, the compiler will join us in the search of possible disasters causedby null.What are nullable reference types?In the simplest terms,Nullable Reference Types(orNRTsfor short) are a feature in C# that allows developers to clearly indicate whether a reference type can be null or not. With this, C# gives us a tool to make our intentions clear right from the start. Think of it as a signpost, guiding other developers (and even our future selves) about what to expect fromour code.Without NRTs, every reference type in C# could potentially benull. This would create a guessing game. Is this variable going to have a value or is it going to benull? Now, with NRTs, we don’t have to guess anymore. The code itself tellsthe story.Let’s look at a basic example to graspthe concept:string notNullable = "Hello, World!";string? nullable = null;In the preceding snippet, thenotNullablevariable is a regular string that can’t be assignednull(if you try, the compiler will warn you). On the other hand, since C# 8.0, nullable is explicitly marked with?, indicating that it canbenull.In some cases, you might want to assignnullto a variable that is not marked as nullable. In this case, to suppress warnings, you can use the! sign to let the compiler know that you are aware of what you are doing and everything is going according to plan:string notNullable = "Hello, World!";notNullable = null!;One of the biggest advantages of NRTs is that the C# compiler will warn you if you’re potentially doing something risky with null values. It’s like having a friendly guide always looking over your shoulder, ensuring you don’t fall into the common traps ofnull misuse.For instance, if you try to access properties or methods on a nullable reference without checking fornull, the compiler will give you a heads-up.Transitioning to NRTsFor those with existing C# projects, you might be wondering:Will my project be littered with warnings if I enable NRTs?The answer is no. By default, NRTs are turned off. You can opt into this feature, file by file, allowing for asmooth transition.NRTs are a good answer to the long-standing challenge posed by null references. By making the potential presence of null explicit in our code, we take a giant leap toward clarity, safety, and functional honesty. In the end, embracing NRTs not only makes ourcode more resilient but also ensures that our intentions, as developers,are transparent.Enabling nullable reference typesTo enable NRTs, we need to tell the C# compiler that we’re ready for its guidance. This is done using a simple directive:#nullable enable.Place this at the start of your.csfile:#nullable enableFrom this point onward in the file, the compiler creates a specific nullable context and assumes that all reference types are non-nullable by default. If you want a type to be nullable, you’ll have to mark it explicitlywith?.With NRTs enabled, the C# compiler becomes your safety net, pointing out potential issues with nulls in your code. Whenever you try to assign null to a reference type without the?marker or when you attempt to access a potentially null variable without checking it, the compiler willwarn you.Here’san example:string name = null; // This will trigger a warningstring? maybeName = null; // This is okayDisabling nullable reference typesWhile transitioning a project to use NRTs, there may be sections of your code where you’d prefer to delay the transition. You can turn off NRTs for those specific sections using the #nullable disabledirective:#nullable disableThis tells the compiler to revert to the old behavior, treating all reference types aspotentially nullable.You might wonder why C# chose to use directives for this feature. The reason is flexibility. By using directives, developers can gradually introduce NRTs into their projects, one file or even one section of code at a time. This phased approach makes it easier to adaptexisting projects.Warnings and annotations optionsSpeaking of a phased approach, there are two more options to set our nullable contexts:warningsandannotations. You can use them by writingthe following:#nullable enable warningsOr, you canwrite this:#nullable enable annotationsThe main purpose of these options is to ease the migration of your existing code from a fully disabled null context to a fully enabled one. In short, we want to start with thewarningsoption in order to get dereference warnings. When all warnings are fixed, we can switch toannotations. This option will not give us any warnings, but it will start to treat our variables as non-nullable unless declared with the?mark.To get more information about these options and nullable context in generated files, and to find out more about three nullabilities – oblivious, nullable, and non-nullable, I recommend you read the article "Nullable reference types". You might also want to read the article “Update a codebase with nullable reference types to improve null diagnostic warnings”.Functional Programming with C# was published in July 2024. Packt library subscribers can continue readingthe entire book for free or you can buy the bookhere!Get the eBook for $38.99$26.99🛠️Useful Tools⚒️teable: a no-code database platform that combines the ease of a spreadsheet interface with the performance of a database, enabling users to create and manage applications without coding.RealtimeSanitizer (a.k.a. RTSan): a real-time safety testing tool for C and C++ projects that detects and raises errors when non-deterministic functions are called within real-time contexts.Rspack 1.0: a Rust-based JavaScript bundler, fully compatible with the webpack API, offering much faster performance than webpack while supporting modern web standards and improving build efficiency.awesome-decentralized-autonomous-organizations: a curated list of resources and projects for decentralized autonomous organizations (DAOs) to help users start and participate in their own DAOs.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere. Complete ProgrammingPro archives can be foundhere. Complete PythonPro archives arehere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.If you have any comments or feedback, just respond to this email.*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{line-height:0;font-size:75%}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}.reverse{display:table;width: 100%;
Read more
  • 0
  • 1
  • 1184