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
Explore 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

57 Articles
Divya Anne Selvaraj
13 Feb 2025
14 min read
Save for later

ProgrammingPro #89: Python 3.14’s 30% Speed Boost, VS Code’s AI Upgrades, Go 1.24 Released, and Building a Rust Driver

Divya Anne Selvaraj
13 Feb 2025
14 min read
Bite-sized actionable content, practical tutorials, and resources for programmers#89Python 3.14’s 30% Speed Boost, VS Code’s AI Upgrades, Go 1.24 Released, and Building a Rust DriverHi ,Welcome to a brand new issue of ProgrammingPro.In today’sExpert Insight, we bring you an excerpt from the recently published book, Minimal CMake, which explains how to simplify project onboarding using ExternalProject_Add to automate dependency management, reducing manual setup and improving build efficiency by consolidating multiple steps into a single command.News Highlights: Python 3.14’s interpreter boosts performance by 30%; VS Code 1.97 makes Copilot an “out-of-the-box” feature with predictive edits; JetBrains AI Assistant adds local LLM support; Go 1.24 introduces generic type aliases and runtime improvements.My top 5 picks from today’s learning resources:How I Built a Deep Learning Library from Scratch Using Only Python, NumPy & Math🧠We Replaced Our React Frontend with Go and WebAssembly🔄Writing a Simple Driver inRust⚙️Surviving Google’s JavaScript rendering shift: one month later🌍How to Prevent Bugs From Reaching Production🛡️But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefPS:We're conducting market research to better understand the evolving landscape of software engineering and architecture – including how professionals like you learn, grow and adapt to the impact of AI.We think your insights would be incredibly valuable, and would love to hear what you have to say in aquick 1:1 conversationwith our team.What's in it for you?✅ Abrief 20–30 minute conversationat a time that’s convenient for you✅ An opportunity toshare your experiences and shape the future of learning✅A free credit to redeem any eBook of your choicefrom our library as a thank-youHow to Participate:Schedule a quick call at your convenience using the link provided after the form:https://forms.office.com/e/Bqc7gaDCKqLooking forward to speaking with you soon!Thank you,Team Packt.Sign Up|Advertise🗞️News and Analysis🔎What you need to know about Python 3.14’s faster interpreter: Theinterpreter aims to improve performance by up to 30% without requiring code changes and is based on tail call improvements at the C level.Go 1.24 is released!: The versionintroduces full support for generic type aliases, runtime performance improvements, a new map implementation, enhanced tool tracking, a test analyzer in go vet , and more.JetBrains AI Assistant can now use local LLMs: The update allows developers with strict privacy requirements to run models locally and adds support for Claude 3.5 Sonnet, Claude 3.5 Haiku, and OpenAI’s o1, o1-mini, and o3-mini models.Microsoft Visual Studio and C# DevKit updates bring long-awaited fixes: Microsoft Visual Studio 2022 17.13 introduces setting UTF-8 without a BOM as the default text file encoding, resolving a 2017 issue.VS Code update treats Copilot as “out-of-the-box” feature: VS Code 1.97 now has a free Copilot plan, and introduces predictive edit suggestions, auto-accept for AI edits, and experimental agent mode for end-to-end tasks.JDK 24 and JDK 25: What We Know So Far: JDK 24, set for release on March 18, includes 24 new features spanning core libraries, security, and HotSpot; JDK 25, expected September 2025, may finalize structured concurrency and HTTP/3 support.AWS CodeBuild Now Supports Fastlane to Simplify iOS Deployments: The CI service now includes Fastlane by default, simplifying iOS, iPadOS, watchOS, tvOS, and macOS app deployments. MacOS CodeBuild images also support Xcode and various programming languages.🎓Tutorials and Learning Resources💡Python💼How I Built a Deep Learning Library from Scratch Using Only Python, NumPy & Math:Explains the motivation, abstraction layers, and technical design, and delves into comparisons with PyTorch, covering key components like tensors, autograd, neural network modules, and optimizers.For more Python resources, go to PythonProC# and .NET🗞️VisualStudio.Extensibility: Managing .NET runtime versions: Explains how the SDK manages .NET runtime version updates, ensuring extensions remain compatible as Visual Studio transitions to newer .NET versions.💡Integrating AI into Your Existing Applications Using Semantic Kernel and C#: Explores how Microsoft's Semantic Kernel enables AI integration in C# applications, covering its capabilities, use cases, challenges, and strategies.🎓Integrating Azure Service Bus Emulator in .NET Aspire: Covers setting up the emulator, configuring SQL Server, integrating with .NET Aspire, and managing service connections for local development.C and C++🎓Fun with C++26 reflection - Keyword Arguments: Provides a guide on implementing order-independent keyword arguments in C++26 using reflection features, along with alternative approaches, code examples, and explanations.🎓Creating a Code Obfuscation Program For C: Outlines techniques such as renaming variables and functions, adding junk macros, altering code structure, and formatting manipulations while maintaining functionality.🎓Write your own C++ unit testing library: Explains how to write a testing library without using existing frameworks like Google Test or Catch2 andcovers designing a simple test interface, handling failures with exceptions, and more.Java💡Evolution of Java Ecosystem for Integrating AI: Explores how the Java ecosystem is evolving to support AI integration, highlighting frameworks like LangChain4j, Spring AI, and Jlama, alongside Oracle Generative AI for enterprise solutions.🎓Making Java enums forwards compatible: Explains how to make Java enums forward-compatible in SDKs by using a wrapper class that stores both the raw API value and a safe enum representation, preventing crashes.🎓Streamline UUID v7 Generation in Spring Boot Entities with Custom Annotations(Hibernate 6.5+ & Spring Boot 3.3+): Explains how to improve database performance with time-ordered unique identifiers by creating a custom annotation and UUID generator.JavaScript and TypeScript🎓Clean room tests with JavaScript's `using` keyword: Explains how JavaScript's new using keyword can simplify test isolation by automatically managing resources like test databases and mock servers.🎓JavaScript Decorators & Annotations: A Practical Guide to Metaprogramming: Covers use cases, implementation in TypeScript, integration with the Reflect API for metadata handling, and real-world applications.🎓TypeScript: thesatisfies operator: Explains how the operator enforces type constraints without altering inferred types, its syntax, and practical use cases for validating object properties.Go💼We Replaced Our React Frontend with Go and WebAssembly: Explains why Dagger switched to a Go-based WASM UI, detailing the benefits of code unification, performance improvements, memory optimizations, and more.🎓Fast Listing of Files from Large S3 and GCS Buckets Using Go Concurrency: Covers, optimizing file traversal through parallelization, strategic range-based queries, and the rill concurrency toolkit to improve performance.Rust🎓Writing a Simple Driver inRust: Walks you through the process of writing a simple Windows kernel-mode driver in Rust, covering setup, dependencies, device creation, handling requests, and testing the driver with a C++ client.💡How Does Ada's Memory Safety Compare Against Rust?: Concludes that while Rust enforces strict compile-time guarantees to prevent common memory errors, Ada relies on safer design patterns, runtime checks, and formal verification, making it less prone to such issues.Swift🎓How to develop an app for iOS: Covers essential tools like macOS, Xcode, and optional enhancements, along with learning resources, joining Apple's Developer Program, and strategies for releasing and promoting an app.💡Protocol Extensions in Swift 6.0: New Tricks: Explores enhanced generic constraints that enable more flexible, reusable, and maintainable code in protocol-oriented programming.PHP🎓Exploring Concurrent Access Handling: Examines strategies for handling concurrent access in PHP and MySQL, covering issues like race conditions, observability, parallelization, locking mechanisms, and transactions.🎓Lazy objects in PHP 8.4: Demonstrates how to use lazy objects in PHP 8.4, explaining their benefits, implementation, and practical applications such as deserialization and I/O-bound entity fetching.SQL🎓Measuring Cross-Product Adoption Using dbt_set_similarity: Explains how to measure cross-product adoption using the Jaccard Index within dbt workflows, leveraging the dbt_set_similarity package to quantify user overlap.Ruby🎓Essential Rails 7 & 8 Commands Guide: Covers project setup, database management, component generation, testing, debugging, and asset management, production deployment, and modern frontend tools.🎓Rails Soft Delete & Audit Logging Guide: Explains how to implement soft deletion and audit logging in Rails financial applications using acts_as_paranoid for data retention and a structured audit log system.Kotlin💡Designing Effective UI Components in Jetpack Compose: Covers best practices for modifier usage, theming for consistency, customizability via slots and style classes, and preview compatibility to enhance developer experience.💡Kotlin Constants in Android: Top-level vs. Companion-enclosed: Examines the constants' differences by analyzing their impact on APK size, performance, and memory usage by decompiling bytecode and testing R8 optimizations.🌟Best Practices and Advice🚀🧟‍♂️Cell-based Architecture Explained, with Zombies: Explains cell-based architecture using a zombie-resistant city analogy, where isolated neighborhoods (cells) prevent failures from spreading.Automated Accessibility Testing at Slack: Discusses how Slack integrated automated accessibility testing using Axe within their Playwright framework to enhance compliance with WCAG standards.How to Prevent Bugs From Reaching Production: Outlines six practices used at Outbrain, including CI/CD pipelines, simulator environments, duplicate traffic testing, gradual deployments, A/B testing, and structured postmortems.Surviving Google’s JavaScript rendering shift: one month later: Reflects on the impact of Google’s new requirement on web scraping, the challenges it created for SEO tools and data collection, and how the industry is adapting with headless browsers, proxy solutions, and advanced scraping techniques.My DOs and DON’Ts of Software Architecture: Recommends developing clarity, questioning assumptions, and avoiding over-architecture, while warning against ineffective collaboration, poor decision-making, and hybrid Agile-Waterfall approaches.🧠Expert Insight📚Here’s an excerpt from “Chapter 8: Using Super Builds to Simplify Onboarding" in the book, Minimal CMake, by Tom Hulton-Harrop, published in January 2025.Using ExternalProject_Add with your own librariesIn the previous chapter, we stuck largely to manual CMake build and install commands (along with a bit of help from CMake presets) to increase our familiarity with CMake, and to work at a slightly lower level of abstraction to understand what CMake is doing behindthe scenes. Now that we’re a bit morecomfortable with these concepts, it’s time to remove the tedium of navigating to each individual library folder and running the familiar CMake commandsthat follow:cmake --preset <preset-name>cmake --build <build-folder> --target installWe can start updating our project to take advantage of the more useful features that CMake provides. To start with, we’re going to update our existing third-partyCMakeLists.txtfile to bring in not only SDL 2 and bgfx but also the libraries we created and depend on. This will remove the need for us to manually install them and allow us to run a single pair of CMake commands (configure and build/install) to retrieve all the dependencies we need for ourGame ofLifeapplication.Let’s start by looking atch8/part-1/third-party/CMakeLists.txt. The file is largely the same as before, only underneath our existingExternalProject_Addcommands, we’ve added references to our libraries foundinch8/part-1/lib.Here is an example of themc-arraylibrary:ExternalProject_Add( mc-array SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../lib/array BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/mc-array-build/${build_type_dir} INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/install CMAKE_ARGS ${build_type_arg} -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> CMAKE_CACHE_ARGS -DCMAKE_DEBUG_POSTFIX:STRING=d)The command should look remarkably similar to those we covered inChapter 6,Installing Dependencies and ExternalProject_Add. The only real difference is the reference toSOURCE_DIR. Given the slightly unconventional layout of this book’s repository, we can reference the source folder directly, as the library source code is stored in thesame repository:SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../lib/arrayIt would normally be the case that we’d refer to an external library using aURLorGIT_REPOSITORYlink. If we did, for some reason, want to refer to an older version of one of the libraries at a specific moment in the Git history of our project, we could usethis approach:ExternalProject_Add( mc-array GIT_REPOSITORY https://github.com/PacktPublishing/Minimal-CMake.git GIT_TAG 18535c9d140e828895c57dbb39b97a3307f846ab SOURCE_SUBDIR ch8/part-1/lib/array ...We did the same thing inChapter 3,Using FetchContent with External Dependencies, when usingFetchContent. The preceding command will clone the entire repository into the build folder of our third-partyCMakeList.txtfile, and then treat thech8/part-1/lib/arraydirectory as the root of the repository (at least as far asExternalProject_Addis concerned). It’s not often needed but can be useful if a repository holds more than oneCMake project.While we’re making changes tothird-party/CMakeLists.txt, we’ll also make one small improvement to how we handle our bgfx dependency. When bgfx was first introduced inChapter 6,Installing Dependencies and ExternalProject_Add(seech6/part-4), we wound up needing to clone the repository twice, once for the static version of the library (needed to build the tools), and again for the shared version of the library that our application linked against. The good news is there’s a handy technique we can apply to download the library once. The following is an extract of the changes with thedifferences highlighted:ExternalProject_Add( bgfxt GIT_REPOSITORY https://github.com/bkaradzic/bgfx.cmake.git GIT_TAG v1.127.8710-464 ...ExternalProject_Get_Property(bgfxt SOURCE_DIR)ExternalProject_Add( bgfx URL "file://${SOURCE_DIR}" DEPENDS bgfxt ...The firstExternalProject_Addcall is the same as before; we let it know the repository and specificGIT_TAGto download. However, in the second version, instead of repeating those lines, we first callExternalProject_Get_Property, passing thebgfxttarget and theSOURCE_DIRproperty.SOURCE_DIRwill be populated with the location of thebgfxtsource code once it’s downloaded, and in the second command, we point thebgfxtarget to reference that source code location. As the code is identical and it’s just how we’re building it that’s different, this saves a bit of time and network bandwidth downloading the same files allover again.You might have noticed that we’re usingURL "file://${SOURCE_DIR}"as opposed toSOURCE_DIR ${SOURCE_DIR}. This is because if we tried to useSOURCE_DIR, theExternalProject_Addcommand would fail at configure time becauseSOURCE_DIRis expected to already be present when we configure. As this isn’t the case with our dependency (the source forbgfxtwill only be downloaded and made available at build time), we can use theURLoption with a local file path shown byfile://, which will cause the file path to instead be resolved atbuild time.With the addition of the three newExternalProject_Addcalls referencing our libraries, when building our project, we only need to visit two directories, as opposed to the earlier five. We can navigate toch8/part-1/third-partyand run the followingCMake commands:cmake -B build -G "Ninja Multi-Config"cmake --build build --config ReleaseThis will download, build, and install all our dependencies at once. We then only need to navigate toch8/part-1/appand runthe following:cmake --preset multi-ninjacmake --build build/multi-ninja --config ReleaseThis will build and link our application. We’ve also tidied up ourCMakePresets.jsonfile to haveCMAKE_PREFIX_PATHonly refer to${sourceDir}/../third-party/install, as opposed to the numerous install folders we had for each of our internal dependencies in thelast chapter.Finally, to launch the application, we first need to compile our shaders and then launch the application from our application rootdirectory (ch8/part-1/app):./compile-shader-<platform>.sh/bat./build/multi-ninja/Release/minimal-cmake_game-of-life_windowThis is a substantial improvement from before, but we can do better. The main build is still split across two stages (dependencies and application), and we still have the annoying issue of needing to remember to compile the shaders (an easy step to overlook). We want to achieve the holy grail of one command to bootstrap everything. Let’s start by seeing how we can solve the first problem by reducing our build steps from two to one...Minimal CMakewas published in January 2025. Packt library subscribers can continue reading the entire book for free or you can buy the book here!Get the eBook for $33.99$22.99🛠️Useful Tools⚒️OLake: An open-source tool designed for fast, scalable database replication to Apache Iceberg or data lakehouses, starting with MongoDB.Hanko: An open-source, passwordless authentication and user management solution with passkeys, SSO, and API-first design.data-formulator: An open-source AI-powered tool from microsoft for transforming data into rich visualizations using UI and natural language inputs.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.If you have any suggestions or feedback, or would like us to find you a learning resource on a particular subject, 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{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
  • 490

Divya Anne Selvaraj
06 Feb 2025
11 min read
Save for later

ProgrammingPro #88: Go Shared Memory Fixes, 100 Common Python Errors, 10 AI-Powered Dev Tools, and a Malicious Go Package

Divya Anne Selvaraj
06 Feb 2025
11 min read
Bite-sized actionable content, practical tutorials, and resources for programmers#88Go Shared Memory Fixes, 100 Common Python Errors, 10 AI-Powered Dev Tools, and a Malicious Go PackageHi ,Welcome to a brand new issue of ProgrammingPro.In today’sExpert Insight, we bring you an excerpt from the recently published book, Go Recipes for Developers, which demonstrates how to manage shared memory in Go by avoiding memory races and using mutexes to synchronize access to shared variables, instead of relying solely on channels.News Highlights: 10 AI tools gain new features, including Amazon Q’s code validation; a malicious Go package evades detection for years; Stack Exchange tests AI answers despite a past ban; and Java updates JDK, frameworks, and tooling.My top 5 picks from today’s learning resources:100 Common Python Mistakes⚠️Build Intelligent Apps with .NET and DeepSeek R1🤖How Databases Work Under the Hood: Building a Key-Value Store in Go🗄️Do Code LLMs Understand Design Patterns?🧠Building a Serverless Fan-Out-Fan-In Mechanism🪭But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefSign Up|Advertise🗞️News and Analysis🔎10 development tools that have recently added new AI capabilities: Covers Amazon Q’s real-time code validation, DeepSeek R1’s availability on Azure AI, JetBrains' Junie coding agent, Sourcegraph’s AI code reviewers, and more.Java News Roundup: Java Operator SDK 5.0, Open Liberty, Quarkus MCP, Vert.x, JBang, TornadoVM: Also covers updates to JDK 24 and 25, Spring Cloud, Infinispan, and JHipster Lite.Malicious package found in the Go ecosystem: The typosquat package mimicking BoltDB contains a backdoor for remote code execution and exploited the Go Module Mirror’s indefinite caching, evading detection for over three years!Rust update fixes ‘forever’ compilation: Rust 1.84.1 fixes regressions from Rust 1.84, including a severe slowdown caused by the next-gen trait solver, errors in overlapping impls, duplicate-crate diagnostics, and missing debug info.TypeScript checks returns for conditional and indexed access types: TypeScript 5.8, now in beta, introduces limited type checking for conditional and indexed access types in return statements, reducing reliance on type assertions.Apple open sources Swift Build: The engine used by Xcode, to unify build systems across Xcode and Swift Package Manager (Swift PM), is now available on GitHub under the Apache 2.0 license and supports multiple platforms.Stack Exchange dabbles with AI answers – despite Stack Overflow banning them in 2022: The experiment, limited to select sites, requires human verification before AI answers become public and aims to boost engagement.🎓Tutorials and Learning Resources💡Python💡100 Common Python Mistakes:Covers logic bugs, inefficient code, non-Pythonic practices, and best practices for readability and performance, using clear examples for each mistake.For more Python resources, go to PythonProC# and .NET💡Top 10 .NET Performance Anti-Patterns You Should Fix Today: Covers excessive object allocation, blocking async calls, inefficient database queries, and overusing reflection, and provides fixes such as using object pooling.🎓Tutorial | Build Intelligent Apps with .NET and DeepSeek R1: Using the Microsoft.Extensions.AI (MEAI) library, it provides a step-by-step guide for connecting to GitHub Models, Azure AI Foundry, or running locally with Ollama.🎓Tutorial | Writing a .NET Garbage Collector in C# - Part 2: Covers defining key interfaces (IGCHeap, IGCHandleManager, IGCHandleStore), handling GC handles, implementing memory allocation, and more.C and C++💡21st Century C++: In this article, Bjarne Stroustrup recommends modern C++ practices for performance, type safety, and maintainability, covering resource management, modularity, generic programming, and more.💡Starflate: Deflate decompression in C++23: Discusses lessons learned from the development of Starflate, a Deflate decompression implementation in C++23, covering the Deflate algorithm, project design, and more.💡I Wrote a Wasm Interpreter in C: Covers the author's experience writing Semblance, a WebAssembly interpreter in C, detailing the WebAssembly specification, interpreter design, and implementation of function calls and host imports.Java🎓Tutorial | How to Compile Java into Native Binaries with Mill and Graal: Explains the setup, build process, benefits like faster startup and lower memory usage, and limitations such as longer build times and restricted reflection support.💡The Java Streams Parallel: Provides an in-depth analysis of Java Streams' parallel execution, including its implementation, concurrency behavior, stream operation characteristics, and internal design in JDK 24.💡Java's synchronized explained: Explains how Java’s synchronized keyword works at the bytecode level, detailing monitorenter and monitorexit instructions, object monitors, and how synchronized methods differ from synchronized blocks.JavaScript and TypeScript💡Is npm Enough? Why Startups are Coming after this JavaScript Package Registry: Examines emerging competition in the JavaScript package management space, focusing on how Deno’s JSR and vlt’s vsr challenge npm’s dominance.🤯Someone got Linux running inside a PDF file, because its users are something else: The project exploits the PDF format’s JavaScript support to enable computation, with user input via a virtual keyboard and text box translating to on-screen actions.🎓Tutorial | Slots: Make your Angular API flexible: Explores how content projection in Angular can make UI components more flexible and reusable, comparing ng-content and ng-template.Go🎓Tutorial |How Databases Work Under the Hood: Building a Key-Value Store in Go: Explains how databases store and retrieve data efficiently by managing query layers and storage engines.🎓Tutorial | Dealing with Golang Data Types: Explains Golang’s data types' memory considerations, practical applications, and syntax, with examples, and concludes with coding exercises.Rust💡No-Panic Rust: A Nice Technique for Systems Programming: Discusses how, by carefully designing APIs and leveraging Rust’s optimizer, developers can write efficient, panic-free Rust code.🎓Tutorial | Making System Calls in Rust: Requesting Services from the Kernel: Explains how to use the libc crate to access low-level kernel services, with examples on file I/O, handling processes via fork() , and more.Swift💡Rethinking Our Color System: A Type-Safe Approach in Swift: Discusses rethinking a color system in Swift using type safety, generics, and property wrappers instead of subclassing UIColor .🎓Tutorial |Parameterized tests in Swift: Reducing boilerplate code: Explains how to improve test clarity, and make debugging easier by running a single test with multiple input values.PHP💡The State of PHP 2024: Reveals that PHP remains a dominant force in web development, with Laravel as the leading framework, PhpStorm as the preferred IDE, increasing AI adoption, and ongoing efforts to enhance PHP’s features.SQL🎓Tutorial | Query Tuning in DBSQL with the new V2 Query Profile: Introduces a streamlined tool for query tuning in DBSQL, helping users quickly identify bottlenecks through execution summaries, detailed scan insights, and the new "Top Operators" feature.Ruby🎓Tutorial | Setting Up a Rails 8 with Vite and Tailwind CSS 4: Covers installation, configuration, and integration of Turbo, Stimulus, and Tailwind with Vite for modern frontend development in Rails.🎓Tutorial | Ruby on Rails on WebAssembly, the full-stack in-browser journey: Details the process of "wasmifying" a Rails app, adapting database storage, leveraging service workers, and the future potential of Rails.Kotlin🎓Tutorial | Kotlin Constants in Android: Top-level vs. Companion-enclosed: Analyzes their effect on APK size, memory usage, and performance through bytecode inspection and R8 optimizations.💡10+ Common Kotlin Coroutine Mistakes Senior Android Developers Should Avoid: Covers blocking the main thread, improper exception handling, misusing coroutine scopes, overusing withContext, and more.🌟Advanced Concepts🚀Do Code LLMs Understand Design Patterns?: Examines whether Code LLMs understand design patterns by evaluating their ability to recognize, comprehend, and generate pattern-compliant code.Comprehensive Guide to AI Workflow Design Patterns with PydanticAI code examples: Covers prompt chaining, routing, parallelization, orchestrator-workers, evaluator-optimizer workflows, and autonomous agents.Building a Serverless Fan-Out-Fan-In Mechanism: Explains how to implement a serverless fan-out-fan-in mechanism using AWS Step Functions, SNS, SQS, and DynamoDB to build scalable and fault-tolerant distributed systems.How has DeepSeek improved the Transformer architecture?: Explains how DeepSeek v3 enhances the Transformer architecture through multi-head latent attention (MLA), mixture-of-experts (MoE) improvements, and multi-token prediction.🧠Expert Insight📚Here’s an excerpt from “Chapter 7: Concurrency" in the book, Go Recipes for Developers, by Burak Serdar, published in December 2024.Sharing memoryOne of the most famous Go idioms is: “Do not communicate by sharing memory, share memory by communicating.” Channels are for sharing memory by communicating. Communicating by sharing memory is done using shared variables in multiple goroutines. Even though it isdiscouraged, there are many use cases where shared memory makes more sense than a channel. If at least one of the goroutines updates a shared variable that is read by other goroutines, you have to ensure that there are no memory races.A memory race happens when a goroutine updates a variable concurrently while another goroutine reads from it or writes to it. When this happens, there is no guarantee that the update to that variable will be seen by other goroutines. A famous example of this situation is thebusy-waitloop:func main() { done:=false go func() { // Wait while done==false for !done {} fmt.Println("Done is true now") }() done=true // Wait indefinitely select{}}This program has a memory race. Thedone=trueassignment is concurrent with thefor !doneloop. That means, even though the main goroutine runsdone=true, the goroutine readingdonemay never see that update, staying in theforloop indefinitely.Updating shared variables concurrentlyThe Go memory model guarantees that the effect of a variable write is visible to instructions that come after that write within that goroutine only. That is, if you update a shared variable, you have to use special tools to make that update visible to other goroutines. A simple way to ensure this is to use a mutex. Mutex stands for “mutual exclusion.” A mutex is a tool you can use to ensurethe following:Only one goroutine updates a variable at anygiven timeOnce that update is done and the mutex is released, all goroutines can seethat updateIn this recipe, we show how thisis done.How to do it...The section of a program that updates shared variables is a “critical section.” You use a mutex to ensure that only a single goroutine can enter itscritical section.Declare a mutex to protect acritical section:// cacheMutex will be used to protect access to cachevar cacheMutex sync.Mutexvar cache map[string]any = map[string]any{}A mutex protects a set of shared variables. For instance, if you have goroutines that update a single integer, you declare a mutex for the critical sections that update that integer. You must use the same mutex every time you read or write thatinteger value.When updating the shared variable(s), first lock the mutex. Then perform the update and unlockthe mutex:cacheMutex.Lock()cache[key]=valuecacheMutex.Unlock()With this pattern, if multiple goroutines attempt to updatecache, they will queue atcacheMutex.Lock()and only one will be allowed. When that goroutine performs the update, it will callcacheMutex.Unlock(), which will enable one of the waiting goroutines to acquire the lock and update thecache again.When reading the shared variable, first lock the mutex. Then perform the read, and then unlockthe mutex:cacheMutex.Lock()cachedValue, cached := cache[key]cacheMutex.Unlock()if cached { // Value found in cache}Go Recipes for Developerswas published in December 2024. Packt library subscribers can continue reading the entire book for free or you can buy the book here!Get the eBook for $31.99$21.99🛠️Useful Tools⚒️lume: Alightweight CLI and local API server for managing macOS and Linux virtual machines with near-native performance on Apple Silicon, using Apple's Virtualization.Framework.klarity: Analyzes uncertainty in generative model outputs using probability entropy and semantic understanding to reveal model behavior and hallucination risks.iterm-mcp: A Model Context Protocol (MCP) server that enables models to inspect, interact with, and control an active iTerm session efficiently.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.If you have any suggestions or feedback, or would like us to find you a learning resource on a particular subject, 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{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
  • 488

Divya Anne Selvaraj
30 Jan 2025
13 min read
Save for later

ProgrammingPro #87: C++ Bit Counting Tricks, JetBrains’ ‘Junie’ AI, Tailwind CSS 4.0’s Rust Boost, and Rust’s Async Closures

Divya Anne Selvaraj
30 Jan 2025
13 min read
Bite-sized actionable content, practical tutorials, and resources for programmers#87C++ Bit Counting Tricks, JetBrains’ ‘Junie’ AI, Tailwind CSS 4.0’s Rust Boost, and Rust’s Async ClosuresHi ,Welcome to our very first issue for the year 2025.In today’sExpert Insight, we bring you an excerpt from the recently published book, Debunking C++ Myths, which discusses different approaches to counting set bits in a 32-bit integer, comparing manual bitwise operations, the C++20 std::popcount function, and the CPU-level POPCNT instruction.News Highlights:JetBrains launches ‘Junie’ for AI coding in Python, Kotlin, and Java; Tailwind CSS 4.0’s Rust-powered build engine boosts incremental builds up to 100x; Rust 1.85 stabilizes async closures and enhances Linux kernel support; and 11 new languages like Mojo, Wing, and Jakt target AI, memory safety, and edge computing.My top 5 picks from today’s learning resources:JavaScript Temporal is coming⏳3 Python web frameworks for beautiful front ends🎨Rust: Investigating a Strange Out-of-Memory Error🕵️‍♂️The Architecture of Open Source Applications🏛️Inside Atlassian Lithium: How a Dynamic ETL Platform is Transforming Data Movement and Cutting Costs⚡But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefSign Up|Advertise🗞️News and Analysis🔎11 cutting-edge programming languages to learn now: Covers languages focused on theorem proving (Coq), AI-assisted coding (Plang), Python performance enhancements (Mojo, Erg), edge computing (MoonBit, Wing), and memory safety (Rust, Zig, Jakt, Odin, Mojo).JetBrains debuts agentic AI coding with ‘Junie’, but reviews for existing AI Assistant are poor: Junie supports Python, Kotlin, and Java and can develop features, fix bugs, update documentation, add tests, and resolve failed tests.Tailwind CSS 4.0 released with ‘ground-up rewrite’ for faster Rust-powered build: The versionintroduces a Rust-powered build engine (Oxide), achieving up to 5x faster builds (100x for incremental builds), alongside new CSS features.Async closure support is stable for Rust 1.85: The new version, releasing on February 20, will resolve issues like the “Send”-bound problem and make progress on Linux kernel integration, return type notation, and more.Java News Roundup: Stable Values, Payara Platform, Oracle Critical Patch Update, GraalVM, BellSoft: Also covers BellSoft's Liberica JDK, updates on Jakarta EE 11, Spring, Hibernate, Infinispan, Eclipse Vert.x, and Gradle.State of JavaScript: Highlights of the JavaScript developer survey: The results reveal growing adoption of AI code generators, new language features (nullish coalescing, Promise.allSettled), and build tools (Vite, esbuild).Java-based organizations mostly use Java for AI development – report: The Azul 2025 State of Java Report finds that 50% of Java-based organizations use Java for AI development, ahead of JavaScript (44%) and Python (41%).🎓Tutorials and Learning Resources💡Python💡3 Python web frameworks for beautiful front ends: Introduces Anvil, Reflex, and NiceGUI—which allow developers to build interactive front-end applications using only Python, eliminating the need for JavaScript.For more Python resources, go to PythonProC# and .NET🎓Tutorial | Writing a .NET Garbage Collector in C# - Part 1: Demos writing a custom .NET garbage collector in C# using NativeAOT, detailing initialization challenges, debugging methods, and workaround strategies to resolve conflicts.💡Making SIMD Operations in C# Easier: Introduces F8, an open-source C# SIMD library that optimizes floating-point operations by leveraging AVX 256-bit intrinsics, demonstrating its performance benefits over scalar computations.🎓Tutorial | SQL Server Native Vector Search for .NET Developers: Coversembedding generation, vector storage, similarity search, and document classification using C# and T-SQL for AI-powered search and retrieval.C and C++💡Understanding Memory Management, Part 1: C: Covers fundamental concepts like the stack, heap, malloc, free, and fragmentation, while demonstrating manual memory allocation through a simple file-reading program.🗞️C++26: pack indexing: The update allows direct access to specific elements in parameter packs using the subscript operator (T...[index] ), simplifies previously cumbersome methods, and improves readability.💡The surprising struggle to get a UNIX Epoch time from a UTC string in C or C++: Delves into issues with strptime(), locales, daylight saving time, and the best available solutions, including timegm() and C++20’s time zone library.Java🎓Tutorial | How JVM Executable Assembly Jars Work: Explains how the Mill build tool generates directly executable assembly JARs by prepending a launcher script to a ZIP-based JAR, allowing execution without java -jar .💡Making Java nullable fields backwards compatible: Explains how making a Java field nullable can break source and binary compatibility and provides a solution using method overloading to ensure backwards compatibility in SDKs.🎓Tutorial | How To Do Logging In Java: Covers legacy and modern logging libraries, best practices for logging, log levels, centralized logging, and how to choose the right logging approach for different applications.JavaScript and TypeScript🗞️JavaScript Temporal is coming: JavaScript's new Temporal API is being introduced in experimental browser releases, offering a modern, built-in way to handle dates, times, durations, and calendars.💡How long is a second in JavaScript?: Explains how JavaScript measures time using POSIX time, why it ignores leap seconds, the impact of step adjustments vs. smearing, and how this affects applications that require precise time synchronization.💡TypeScript enums: use cases and alternatives: Examines TypeScript enums, their structure, use cases, limitations, and alternative patterns like object literals, string literal unions, and symbol-based approaches.Go🎓Tutorial |Modeling Complex Data Structure in Golang Using Pointers, References, and Reverse Indices: Demonstrates how memory management techniques optimize performance, reduce redundancy, and simplify complex graph lookups.💡Go 1.24'sgo tool is one of the best additions to the ecosystem in years: Discusses Go 1.24’s new go tool command and tool directive in go.mod , which improves dependency management by reducing bloat.Rust🎓Tutorial | Parsing PDFs (and more) in Elixir using Rust: Demonstrates how to efficiently parse PDFs in Elixir using Rust via Native Implemented Functions (NIFs), leveraging the Extractous library.💼Case Study | Rust: Investigating a Strange Out-of-Memory Error: Investigates an unexpected out-of-memory issue in a Rust service, revealing that the anyhow library captures a backtrace on every error.Swift💡The Swift Runtime: Your Silent Partner: Explores how the Swift Runtime (libswiftCore) interacts with compiled Swift programs, managing memory, dynamic dispatch, and core language features through the ABI and system calls.🎓Tutorial | Network Link Conditioner: Simulating Slow Networking: Explains how to use Apple's Network Link Conditioner to simulate slow network conditions on macOS and iOS and introduces RocketSim as a better alternative.PHP🎓Tutorial | Say Goodbye to Hard-Coding: Manage Laravel Model Columns Efficiently: Introduces a Laravel Artisan command that automatically generates model column constants, reducing hard-coded field names.SQLComposable SQL: Critiques SQL's testability, duplication, and denormalization issues, then introduces functors as a structured way to define reusable query components that improve performance, maintainability, and abstraction.Ruby🎓Tutorial | Supercharge SQLite with Ruby Functions: Covers how to enhance SQLite with user-defined Ruby functions (UDFs) to extend query capabilities, automate data processing, and perform custom computations.💡Instrumenting Thread Stalling in Ruby Applications: Introduces GC.total_time for tracking GC impact, gvltools for measuring GVL wait time, and Linux /proc metrics for monitoring CPU scheduling.Kotlin🎓Tutorial | The Liskov Substitution Principle (LSP) in Kotlin — Deep Dive: Provides an in-depth exploration of the Liskov Substitution Principle (LSP) in Kotlin, explaining how subclass behavior must remain consistent with its superclass.💡Modern Android Security Tools: ProGuard, DexGuard, and R8 with Kotlin & Jetpack Compose: Covers protection strategies, configuration rules, best practices, and performance considerations for modern Android development.🌟Best Practices and Advice🚀📖The Architecture of Open Source Applications: Acollection of books where developers of dozens of open source projects explain their software architecture, design choices, and key lessons learned.The End of the Bronze Age: Rethinking the Medallion Architecture: Advocates for the Shift Left approach, which moves data processing upstream to create reliable, reusable data products that support both operational and analytical workloads.Inside Atlassian Lithium: How a Dynamic ETL Platform is Transforming Data Movement and Cutting Costs: Duscusses how Atlassian's platform's ephemeral pipelines, Kafka-based architecture, and modular Workplans enable efficient, scalable data movement.Integration timelines: How to plan for success without surprises: explores SaaS integration challenges, emphasizing realistic timelines, scalability, security, and in-house vs. third-party solutions to prevent resource strain.🧠Expert Insight📚Here’s an excerpt from “Chapter 8: The Fastest C++ Code is Inline Assembly" in the book, Debunking C++ Myths by Alexandru Bolboacă and Ferenc-Lajos Deák, published in December 2024.One instruction to rule them allDear reader. In our previous section of this chapter, unfortunately, we exhausted the only pompous introduction we could borrow from various cultural sources concerning technical interviews, career and life choices, and whether should we take the red pill or the blue one, so let’s focus our attention on more technicalquestions that our candidates might face at a technical interview (the word technical appears four times in this shortintroductory paragraph).One of these questions, served to the author of these lines a few years ago, was to write a short code snippet that will count the number of 1 bits (the on bits) in a 32-bit integer. Let’s draft up a quick application todo this:int countOneBits(uint32_t n) { int count = 0; while (n) { count += n & 1; n >>= 1; } return count;}Here’s what happens. Firstly, we initialize a counter, starting with0. The next step is to loop through the bits. Whilenis non-zero, we add the least significant bit ofnto the counter (n&1gives us this value). Following this, we shiftnright by one bit (discarding the leastsignificant bit).Once all bits are processed (whennbecomes0), return the total count of 1 bits. Not a very complicated process, justraw work.It seems that this procedure of counting bits in numbers must be of a very peculiar interest in computing circles, such as for the purpose of error detection and correction, data compression, cryptography, algorithmic efficiency, digital signal processing, hardware design, and performance metrics, so no wonder it managed to creep itself into the STL (C++ STL, which is the standard template library) too in the form ofstd::popcountfromC++ 20.The interesting part of the story is that not only in the STL do we find this handy operation, but it was deemed so useful that it even exists at the level of the processors, under the infamousPOPCNT mnemonic. Infamous it is, due to the fact that in 2024, it was effectively used in hindering the installation of Windows 11 on older machines that were not officiallysupported (https://www.theregister.com/2024/04/23/windows_11_cpu_requirements/).But what that means for our candidate, who has to write code to impress the interviewers, is that they can simply replace the complicated code from before with the following veryhandy snippet:int countOneBits(uint32_t n) { return std::popcount(n);}Not forgetting to include the<bit>header, after feeding the preceding program intogcc.godbolt.org’s compilers, we get a strange mishmash of results. The code compiled by GCC, regardless of the optimization level, always generates a variation ofthe following:countOneBits(unsigned int): sub rsp, 8 mov edi, edi call __popcountdi2 add rsp, 8 retSo, the code at some level disappears from our eyes into a strange call deep inside the libraries offered by GCC, called__popcountdi2 (https://gcc.gnu.org/onlinedocs/gccint/Integer-library-routines.html). In order to convince GCC to fully utilize the power of the processor that we are running the code on, we need to utilize some of the not-so-well-known command-line options, such as-march(or-mpopcntfor thisspecific purpose).According to the official documentation, (https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html) this command will select the appropriate processor instruction set in order to use the available extensions of the specific processor. Since, at this stage, we know that the POPCNTinstruction was introduced in the early Core i5 and i7 processors, in the Nehalem family, we should simply specify the following to GCC:-march=nehalem. And now, not surprisingly, the compiler generatesthe following:countOneBits(unsigned int): popcnt eax, edi retInterestingly, if we provide the compiler with just the-mpopcntflag, then it generates an extraxor eax, eax(meaning it nulls the EAX register) so maybe we have witnessed some processor-specific extra optimizations by choosing theNehalem architecture:countOneBits(unsigned int): xor eax, eax popcnt eax, edi retWe cannot squeeze more than this out of GCC; there is simply no lower level for this functionality, so we focus our attention on the next compiler onour list.Without explicitly asking to optimize the code, Clang also generates a generic call to astd::popcountfunction, found somewhere in its libraries; however, explicitly asking to optimize the generated code, Clang at various levels of optimization yieldsthe following:countOneBits(unsigned int): mov eax, edi shr eax and eax, 1431655765 sub edi, eax mov eax, edi and eax, 858993459 shr edi, 2 and edi, 858993459 add edi, eax mov eax, edi shr eax, 4 add eax, edi and eax, 252645135 imul eax, eax, 16843009 shr eax, 24 retSurprising as it seems, there is a perfectly logical explanation for this code, found at the bit-twiddling site (https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel) of Sean Eron Anderson at Stanford. Not considering this extra detour, Clang behaves identically to GCC when it comes to handling architecture and specifying the subset of CPU extensions to use while generating code.The last of the big three, Microsoft’s own (we know, tiny, squishy) C++ compiler handles the situation very similarly to Clang. When asking to optimize the code while we specify an architecture that does not support thePOPCNTinstruction, it generates code like the one generated by Clang with low-level bit hacks, while if the architecture has support for thePOPCNTinstruction, it will adjust to the correct type and will callPOPCNTfor the proper parameters (/std:c++latest /arch:SSE4.2 /O1).Good work, tiny,squishy compiler.Debunking C++ Mythswas published in Decemver 2024. Packt library subscribers can continue reading the entire book for free or you can buy the book here!Get the eBook for $31.99$21.99🛠️Useful Tools⚒️DeepSeek-Coder-V2: An open-source MoE code model rivaling GPT-4 Turbo, supporting 338 languages with a 128K context length.Web-Dev-For-Beginners: A 12-week, 24-lesson curriculum by Microsoft covering HTML, CSS, and JavaScript through hands-on projects, quizzes, and assignments.MudBlazor: A Material Design component framework for Blazor, built entirely in C# for ease of use, clear structure, and seamless .NET integration.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.If you have any suggestions or feedback, or would like us to find you a learning resource on a particular subject, 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{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
  • 297

Divya Anne Selvaraj
12 Dec 2024
12 min read
Save for later

ProgrammingPro #86: Python Debugging Best Practices, Go’s API Surge, Google's Jules Coding Agent, and Netflix's Scalable Counters

Divya Anne Selvaraj
12 Dec 2024
12 min read
Bite-sized actionable content, practical tutorials, and resources for programmers🎄#86🥂Python Debugging Best Practices, Go’s API Surge, Google's Jules Coding Agent, and Netflix's Scalable CountersHi ,"It's the Most Wonderful Time of the Year🌟...It's the hap-happiest season of all" 🎵 - Andy WilliamsWelcome to our very last issue, for the year 2024! We will be taking our usual year end break and return again on the 16th of January 2025. In the meanwhile, do keep any eye out. Packt x Santa🎅 are busy working on some unmissable deals for you to unwrap over the holidays! Now let's get down to business.In today’sExpert Insight, we bring you an excerpt from the recently published book, Learn Python Programming - Fourth Edition, which demonstrates best practices for creating custom debugging functions in Python.News Highlights:Python is set to win Tiobe's "Language of the Year" for its growth in AI and data mining; Go overtakes Node.js in API requests with a 40% rise; Google introduces Gemini 2.0 and AI coding agent Jules; and SQLite is re-implemented in Rust for async I/O and memory safety.My top 5 picks from today’s learning resources:Linear Regression in Python📈How AMD Is Taking Standard C/C++ Code To Run Directly On GPUs🚀Data structures as jigs for Go programmers🧩Inside Netflix’s Distributed Counter: Scalable, Accurate, and Real-Time Counting at Global Scale🌍How to Become a Principal Engineer🏗️But there’s more, so dive right in.Before signing off, I would like to say thank you to all readers who have been on this journey with me this year. A very Merry Christmas and Wonderful New Year 2025 to you all!Don't forget to Stay Awesome!Divya Anne SelvarajEditor-in-ChiefSign Up|Advertise🗞️News and Analysis🔎Python a shoo-in for Tiobe language of the year: Python is expected to win Tiobe’s "Programming Language of the Year" for 2024 due to a significant 10% increase in popularity ratings, driven by its dominance in AI, data mining, and ease of learning.Go eclipses Node.js in web API requests, Cloudflare reports: Go has overtaken Node.js as the leading language for automated API requests, accounting for 11.8% of traffic, with Go's share rising 40% and Node.js declining 30%.Ruby on Rails 8.0 Released, Introduces Kamal 2 for Improved Deployments: Key updates also include SQLite-based adapters, a new asset pipeline, enhanced authentication tools, and deprecated feature removals.Java News Roundup: JDK 24 in Rampdown, JDK 25 Expert Group, Jakarta EE 11 Core Profile, Spring Cloud: Other highlights include updates to frameworks like GlassFish, Open Liberty, Quarkus, Apache Camel, and others.Google announces Gemini 2.0 Flash and new coding agent: Jules, an AI-powered coding agent, is designed to assist with Python and JavaScript tasks, including debugging, modifying multiple files, and creating pull requests.SQLite re-implemented in Rust to achieve asynchronous I/O and other changes: Turso is re-implementing SQLite in Rust as "Limbo" to enable asynchronous I/O, memory safety, and modern architecture while ensuring compatibility with SQLite.OpenSilver 3.1 adds new drag-and-drop XAML designer for VS Code: The designer comes with over 100 controls, cross-platform compatibility, a modern UI theme, expanded WPF feature support, and full .NET 9 compatibility.React 19 is stable, team directs devs towards frameworks – especially Next.js: React 19 is now stable, introducing server components to the main channel, improved pre-rendering APIs, and enhanced suspense features.🎓Tutorials and Learning Resources💡Python🎓Tutorial |Linear Regression in Python:Demonstrates implementing simple, multiple, and polynomial regression in Python using libraries like scikit-learn and statsmodels, covering key concepts such as underfitting and overfitting.For more Python resources, go to PythonProC# and .NET🎓Tutorial | Using vectorization in C# to boost performance: Explains how vectorization in C# was used to optimize the Sum method in .NET 8, leveraging SIMD principles and advanced techniques like loop unrolling.🎓Tutorial | Building a Multi-Tenant Configuration Management System with .NET Core, Redis, and Dependency Injection: Combines local disk caching for quick access, Redis for distributed caching, and a Pub/Sub model.🎓Tutorial | Central Package Management (CPM) in .NET — Simplify NuGet Dependencies: Explains how CPM achieves simplification by centralizing package version control in a single Directory.Packages.props file.C and C++💼Case Study | How AMD Is Taking Standard C/C++ Code To Run Directly On GPUs: AMD is working on porting LLVM's C/C++ run-times to GPUs, bypassing the need for GPU-specific languages like OpenMP or OpenACC.🎓Tutorial | Learning to read C++ compiler errors: Nonsensical errors from a function declaration: Explains how conflicting macros in C++ projects can lead to compiler errors, using the case of a macro named ErrorMessage .🎓Tutorial | Refactoring in C++: Top Techniques and Best Practices: Covers methods such as renaming variables, extracting functions, simplifying conditionals, and reducing duplication, along with best practices.Java💼Case Study | QCon SF 2024: Refactoring Large, Stubborn Codebases: Stripe engineers share strategies for refactoring large, stubborn codebases leveraging centralized teams, tools like Sorbet for Ruby, and more.🗞️Malicious Maven Package Impersonating 'XZ for Java' Library Introduces Backdoor Allowing Remote Code Execution: Socket researchers have uncovered a malicious Maven package, io.github.xz-java:xz-java, impersonating the legitimate XZ for Java library (org.tukaani:xz).🎓Tutorial | Peering through the peephole: build a peephole optimiser using the new Java Class-File API: Demonstrates building an optimizer that removes redundant instructions (e.g., unnecessary zero addition) and more.JavaScript and TypeScript💡What is TypeScript? Strongly typed JavaScript: Introduces TypeScript as a strongly typed superset of JavaScript, highlighting its enterprise-level features, compatibility, and advantages for large-scale application development.💡Everything AboutBarrel ExportsInJavaScript: Examines the benefits, challenges, and best practices of using barrel exports to simplify imports, improve code organization, and balance performance and maintainability.🗞️Malicious npm Package Typosquats Popular TypeScript ESLint Plugin, Exfiltrates Data and Enables Remote Exploitation: A secondary malicious package, @typescript_eslinter/prettier, remains live, escalating the risk.Go🎓Tutorial | Data structures as jigs for programmers: Discusses implementations including basic and dynamic arrays, multidimensional arrays, bitsets, binary heaps, and hash tables, with practical use cases and code examples.🗞️Coming in Go 1.24: testing/synctest experiment for time and concurrency testing: Introduces the experimental testing/synctest package in Go 1.24, designed to improve testing involving time and concurrency.Rust💼Case Study |I spent 2 years rebuilding my algorithmic trading platform in Rust. I have no regrets: Discusses the author's experience transitioning their algorithmic trading platform from Typescript to Rust.💡Thoughts on Rust hashing: Critiques Rust's hashing model, which separates Hash and Hasher traits for flexibility, highlighting inefficiencies in handling block-wise hashing, variable-length inputs, and more.Swift🎓Tutorial | Migrating XCTest to Swift Testing: Provides a migration guide using modern features of Swift Testing, such as concurrency and macros, its improved test setup, teardown processes, and flexible assertion macros.🎓Tutorial | SF Symbol: How to for Swift & SwiftUI: Explains how to use, customize, and animate Apple's SF Symbols in Swift and SwiftUI, leveraging the SF Symbols app for integration and design consistency in apps.PHP🎓Tutorial | Parsing HTML with PHP 8.4: Discusses the new HTML5 parser, CSS selector support, and updated DOM classes in PHP 8.4, which improve HTML parsing, DOM manipulation, and web development efficiency.🎓Tutorial | Implementing Dependency Inversion Principle (DIP) using Laravel: Demonstrates implementing DIP by decoupling UserService from specific repository dependencies through a RepositoryManagerInterface .SQL💡Some useful SQL(ite) tips I've learned: Includes tips such as splitting data into buckets, advanced ordering without additional columns, JSON querying with shorthand operators, string concatenation, and default values for NULLs.🎓Tutorial | A Beginner’s Guide to Procedural Programming Beyond SQL with Toad for Oracle: Covers the fundamentals of PL/SQL, its advantages for database programming, and practical tips for efficient PL/SQL development.Ruby🎓Tutorial | Mastering Ruby Debugging: From puts to Professional Tools: Provides a comprehensive guide to debugging in Ruby, covering basic techniques like puts statements, interactive consoles, and advanced tools.💡Advent of Criminally Bad Ruby Code: Humorously chronicles the author's exploration of unconventional and experimental Ruby coding practices, showcasing creative abuses of Ruby features.Kotlin💡When to Use Retrofit and When to Use Ktor: A Guide for Android Developers: Compares two popular HTTP clients for Android, detailing their strengths and scenarios for use.🎓Tutorial | 5 steps to implement MVI architecture with Jetpack Compose: Covers setting up dependencies, defining the Model, ViewState, and Intent layers, managing the state and events in a ViewModel, and creating a reactive UI layer following MVI principles.🌟Best Practices and Advice🚀Inside Netflix’s Distributed Counter: Scalable, Accurate, and Real-Time Counting at Global Scale: Explains the system which balances performance, accuracy, and cost through configurable modes and event-driven architecture.Beat the Plan: Probabilistic Strategies for Successful Software Delivery at Scale: Advocates for adaptive systems over rigid plans, leveraging continuous processes, prioritization, constraints, and a culture of learning.How to Become a Principal Engineer: Discusses the required technical and leadership skills, strategies for career growth, and how companies can define and support the role for maximum impact.On over-engineering; Architecture Edition: Discusses balancing over-engineering and under-engineering in architectural decisions, using the author’s project, Collecto, as an example.🧠Expert Insight📚Here’s an excerpt from “Chapter 11: Debugging and Profiling" in the book, Learn Python Programming - Fourth Edition by Fabrizio Romano and Heinrich Kruger, published in November 2024.Debugging with a custom functionHaving a custom debugging function saved in a file somewhere that you can quickly grab and paste into the code can be particularly useful. If you are fast, you can also code one on the fly. The important thing is to write it in such away that it will not leave anything behind when you eventually remove the calls and their definitions. Therefore, it is important to code it in a way that is completely self-contained. Another good reason for this requirement is that it will avoid potential name clashes with the rest of the code.Let us see an example of such a function:# custom.pydef debug(*msg, print_separator=True): print(*msg) if print_separator: print("-" * 40)debug("Data is ...")debug("Different", "Strings", "Are not a problem")debug("After while loop", print_separator=False)$ python custom.pyData is ...----------------------------------------Different Strings Are not a problem----------------------------------------After while loopAs you can see, there is no separator after the last line.This is just one easy way to augment a simple call to theprint()function. Let us see how we can calculate a time difference between calls, using one of Python’s tricky features to our advantage:# custom_timestamp.pyfrom time import sleepdef debug(*msg, timestamp=[None]): from time import time # local import print(*msg) if timestamp[0] is None: timestamp[0] = time() # 1 else: now = time() print(f" Time elapsed: {now - timestamp[0]:.3f}s") timestamp[0] = now # 2debug("Entering buggy piece of code...")sleep(0.3)debug("First step done.")sleep(0.5)debug("Second step done.")This is a bit more complicated. First, notice that we used animportstatementinsidethedebug()function to import thetime()function from thetimemodule. This allows us to avoid having to add thatimportoutside the function and risk forgetting to remove it.Look at how we definedtimestamp. It is a function parameter with a list as its default value. InChapter 4,Functions, the Building Blocks of Code, we warned against using mutable defaults for parameters because the default value is initialized when Python parses the function, and the same object persists across different calls to the function. Most of the time, this is not the behavior you want. In this case, however, we are taking advantage of this feature to store a timestamp from the previous call to the function, without having to use an external global variable. We borrowed this trick from our studies onclosures, a technique that we encourage you to read about.After printing the message, we inspect the content of the only item intimestamp. If it isNone, we have no previous timestamp, so we set the value to the current time (#1). On the other hand, if we have a previous timestamp, we can calculate a difference (which we neatly format to three decimal digits), and finally, we put the current time intimestamp(#2).Running this code outputs the following:$ python custom_timestamp.pyEntering buggy piece of code...First step done.Time elapsed: 0.300sSecond step done.Time elapsed: 0.500sUsing a custom debug function solves some of the problems associated with just usingprint(). It reduces duplication of debugging code and makes it easier to remove all your debugging code when you no longer need it. However, it still requires modifying the code and running it in a console where you can inspect the output. Later in this chapter, we will see how we can overcome those difficulties by adding logging to our code.Learn Python Programming - Fourth Editionwas published in Novemver 2024. Packt library subscribers can continue reading the entire book for free or you can buy the book here!Get the eBook for $35.99$24.99🛠️Useful Tools⚒️Holos: A Go CLI tool using CUE to replace YAML templating in Kubernetes, streamlining Helm and Kustomize configurations with type-safe, unified management.cal.com: An open-source, self-hosted alternative to Calendly, offering complete control over scheduling, data, and workflows, with extensive customizability.sqlfluff: A highly configurable, dialect-flexible SQL linter and auto-formatter that supports templating systems like Jinja and dbt, ensuring error-free SQL code.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.If you have any suggestions or feedback, or would like us to find you a learning resource on a particular subject, 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{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
  • 488

Divya Anne Selvaraj
05 Dec 2024
10 min read
Save for later

ProgrammingPro #85: Blazor Routing in C#, Kotlin 2.1's when Expressions, GraalVM JIT for Java, and Python Speed Boosts with Cython

Divya Anne Selvaraj
05 Dec 2024
10 min read
Bite-sized actionable content, practical tutorials, and resources for programmers#85Blazor Routing in C#, Kotlin 2.1's when Expressions, GraalVM JIT for Java, and Python Speed Boosts with CythonHi ,Welcome to this week’s edition of ProgrammingPro!In today’sExpert Insight, we bring you an excerpt from the recently published book, C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals - Ninth Edition, which demonstrates defining routable page components, passing route parameters, and navigating routes in Blazor.News Highlights:Kotlin 2.1.0 previews advanced when expressions; Rust 1.83 enhances Multiplatform and Gradle tools; AWS Q Developer adds AI-driven testing and modernization; and Oracle launches GraalVM JIT for its JDK only.My top 5 picks from today’s learning resources:Cython tutorial: How to speed up Python🐇Hans Wennborg: C++ switch statements under the hood in LLVM🔧Understanding JavaScript Hoisting: The Magic Behind Variable and Function Declarations🎩Reaching Your Automatic Testing Goals by Enhancing Your Test Architecture🤖Faster Features, Happier Customers: Introducing The Platform That Transformed Our Grocery App🚀But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefSign Up|Advertise🗞️News and Analysis🔎Kotlin previews guard conditions in when expressions: Kotlin 2.1.0 introduces guard conditions for more flexible when expressions, non-local breaks/continues, and multi-dollar string interpolation as preview features.Rust 1.83 expands const capabilities: The updates improve Kotlin Multiplatform library publishing, add Swift export, stabilize Gradle DSLs, and enhance K2 compiler checks.AWS enhances Q Developer: Test and review code, upgrade to modern .NET, migrate mainframe applications: Features include AI-driven unit testing, code reviews, operational troubleshooting, and migration tools.Microsoft fixed slow package restore in .NET 9.0, but with annoying early bugs: The SDK introduces a 15x faster package restore with NuGet 6.12, but bugs like downloading unused packages remain.Java News Roundup: Last of the JEPs Targeted to JDK 24, Quarkus 3.17, Maven 4.0-RC1, Kotlin 2.1: Updates also include Hibernate Search 7.2.2, Eclipse Vert.x 5.0, and the latest JDKUpdater version.Oracle Ships GraalVM Java JIT Compiler - but Only in Its Own JDK: The compiler offers better performance and maintainability than standard OpenJDK JIT compilers.New report finds signs of slowing supply chain security momentum, plateaued DevOps maturity: According to Snyk's State of Open Source report, organizations report reduced adoption of new tools and training due to security fatigue.JavaScript-based APIs have the lowest quality scores among all languages: The 2024 treblle Anatomy of an API report also notes explosive AI-driven API growth, rising complexity, and the critical need for better governance.🎓Tutorials and Learning Resources💡Python🎓Tutorial | Cython tutorial: How to speed up Python: Provides step-by-step guidance on optimizing Python functions, integrating Cython with Python libraries, compiling code, and profiling for speed improvements.💡Goodbye Make and Shell, Hello... Python?:Advocates using Python for build and project tooling over traditional Makefiles and shell scripts, emphasizing its benefits for maintainability, debuggability, and flexibility.For more Python resources, go to PythonProC# and .NET🎓Tutorial | How to use ref structs in C# 13: Covers the implementation, benefits, limitations, and extended capabilities of ref structs in C# 13 for high-performance, stack-only memory management.🎓Tutorial | File Operations C# .NET: Part 01 — File and Directory Handling: Covers path manipulation, copying, moving, deleting, exception handling, and best practices, using .NET 8, C# 12, and Visual Studio 2022.🎓Tutorial | Deep Dive into .NET Hosted Services: Delves into the BackgroundService class, its lifecycle methods (StartAsync, StopAsync), and integration with the Host class for managing long-running tasks.C and C++🎥Hans Wennborg: C++ switch statements under the hood in LLVM: Explains how LLVM uses clustering, jump tables, bit masking, and binary search trees for efficient code generation and addresses edge cases.💡Legacy Safety: The Wrocław C++ Meeting: Discusses the challenges of improving C++ memory safety focusing on the tension between two approaches: Profiles, incremental safety rules for existing code, and Safe C++, a borrow-checking approach.🎓Tutorial | Build Your Own In-Memory Data Store with C: A Step-by-Step Guide (Part 2): Provides guidance for creating the table, inserting, retrieving, deleting, and cleaning up data, basic test setup, and compiling with CMake.Java🗞️Oracle's Java price hikes push CIOs to brew new licensing strategies: Many are exploring open-source Java alternatives, which could cut costs by 50%, but the transition requires top-level involvement to assess risks.🎓Tutorial | Spring Security Guide:Part 1: Provides an overview of how security works in Spring-based web applications, focusing on middleware for authentication (identifying users) and authorization (checking permissions).🎓Tutorial | Linked List Complexity: Delves into the efficiency of linked list operation for insertions and deletions compared to array-based structures, and provides examples of using Java's LinkedList class and more.JavaScript and TypeScript🎓Tutorial | Understanding JavaScript Hoisting: The Magic Behind Variable and Function Declarations: Explains thedifferences between var, let, const , function declarations, and function expressions.🎓Tutorial | React file nesting design pattern: Introduces thedesign pattern using the VSCode extension File Nesting Explorer, enabling a hierarchical folder structure that mirrors the UI/UX tree of the application.💼Case Study | A leap in the evolution of Airtable’s codebase: Scaling TypeScript to thousands of projects: Discusses how Airtable scaled its codebase from 50 to nearly 3000 projects, reducing typechecking time by 65%.Go🎓Tutorial | Building a distributed log using S3 (under 150 lines of Go): Demonstrates how to build a durable, distributed log, covering its design for appending, reading, checksums, crash recovery, and failover handling.💡Dependency management fatigue, or why I forever ditched React for Go+HTMX+Templ: Focuses on how the Go+HTMX+Templ stack allows developers to focus on feature development and minimize maintenance.Rust💼Case Study | Optimization adventures: making a parallel Rust workload 10x faster with (or without) Rayon: Dicusses optimization by replacing Rayon with a custom thread pool and work-stealing implementation.📖Open Access Book | Writing NES Emulator in Rust: Covers essential topics such as emulating the NES CPU, memory management, picture processing unit (PPU), audio processing unit (APU), and input handling.Swift🎓Tutorial | Native Swift on Android, Part 2: Your First Swift Android App: Demonstrating how to build a "Hello Swift" app that integrates native Swift functionality and Kotlin/Jetpack Compose via bridging.🎓Tutorial | Enum explained in-depth with code examples in Swift: Covers definitions, raw values, associated values, CaseIterable protocol, Equatable conformance, advanced usage with if/guard case, and more.PHP🎓Tutorial | Exploring PHP Lazy Objects: A Practical Implementation: Introduces PHP Lazy Objects, a new feature in PHP 8.4 that optimizes object initialization using two strategies: Ghost Objects and Virtual Proxies.🎓Tutorial | Graceful Error Handling with Laravel’s rescue Function: Delves into Laravel’s rescue function which offers a concise and readable way to handle exceptions without disrupting application flow.SQL🎓Tutorial | Writing Composable SQL using Knex and Pipelines: Explains how to write composable SQL queries using Knex, a Node.js query builder, and pipelines for a functional programming approach.🗞️AWS announces Aurora DSQL, a new distributed SQL database that promises virtually unlimited scalability: This serverless distributed SQL database offers 99.999% availability, strong consistency, and PostgreSQL compatibility.Ruby🎓Tutorial | Speeding up Ruby by rewriting C… in Ruby: Explores the challenges and progress in optimizing Ruby's performance, especially through rewriting C-based methods in Ruby to leverage Yet Another Ruby JIT.🎓Tutorial | Calculating the largest known prime in Ruby: Explains how Ruby 3.4 introduces support for calculating large numbers like the largest known prime, which previously returned infinity.Kotlin🎓Tutorial | Kotlin Flows Animated (Scan, Fold, Reduce): Delves into Kotlin Flows' state accumulation operators, explaining their use cases with examples.🎓Tutorial | Deploy Kotlin Mutliplatform WasmJS to Github Pages: Demonstrates using a GitHub Actions workflow to automate building and deploying a Kotlin/wasmJs project from a structured directory.🌟Best Practices and Advice🚀How to Use Programming Rules and Guidelines: Discusses the proper use of programming rules and guidelines, emphasizing their impact on code consistency and readability.Navigating Responsible AI in the FinTech Landscape: Discusses the EU AI Act, balancing transparency and efficiency, cross-functional collaboration, and risk management, highlighting FinTech’s potential to lead in ethical AI adoption.Reaching Your Automatic Testing Goals by Enhancing Your Test Architecture: Discusses integrating technical tools and human collaboration, focusing on trends over individual failures, using ML for auto-triaging, and more.Faster Features, Happier Customers: Introducing The Platform That Transformed Our Grocery App: Discusses how Picnic transformed its app by adopting React Native, enabling faster feature delivery through cross-platform development, modular architecture, and real-time rule evaluation.🧠Expert Insight📚Here’s an excerpt from “Chapter 14: Building Interactive Web Components Using Blazor" in the book, C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals - Ninth Edition by Mark J. Price, published in November 2024.How to define a routable page componentTo create a routable page component, add the@pagedirective to the top of a component’s.razorfile, as shown in the following markup:@page "/customers"The preceding code is the equivalent of a mapped endpoint inProgram.cs, as shown in the following code:app.MapGet("/customers", () => ...);TheRoutercomponent scans the assembly specifically in itsAppAssemblyparameter for Blazor components with the@pagedirective, registering their URL paths as endpoints.At runtime, a page component is merged with any specific layout that you have specified in theRoutes.razorfile<RouteView>component. By default, the Blazor Web App project template definesMainLayout.razoras the layout for page components.Pro Tip: Good Practice: By convention, put routable page Blazor components in theComponents\Pagesfolder.How to navigate routes and pass route parametersMicrosoft provides a dependency service namedNavigationManagerthat understands Blazor routing and theNavLinkcomponent. TheNavigateTomethod is used to go to the specified URL.Blazor routes can include case-insensitive named parameters, and your code can most easily access the values passed by binding the parameter to a property in the code block, using the[Parameter]attribute, as shown in the following markup:@page "/customers/{country}"<div>Country parameter as the value: @Country</div>@code { [Parameter] public string Country { get; set; }}The recommended way to handle a parameter that should have a default value when it is missing is to suffix the parameter with?and use the null-coalescing operator in theOnParametersSetmethod, as shown in the following markup:@page "/customers/{country?}"<div>Country parameter as the value: @Country</div>@code { [Parameter] public string Country { get; set; } protected override void OnParametersSet() { // If the automatically set property is null, then // set its value to USA. Country = Country ?? "USA"; }}C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals - Ninth Editionwas published in Novemver 2024. Packt library subscribers can continue reading the entire book for free or you can buy the book*{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
  • 302

Divya Anne Selvaraj
28 Nov 2024
14 min read
Save for later

ProgrammingPro #84: TypeScript 5.7's Never-Initialized Checks, Angular v19's Server Performance, and Cython 3.1's No-GIL Builds

Divya Anne Selvaraj
28 Nov 2024
14 min read
Bite-sized actionable content, practical tutorials, and resources for programmers#84TypeScript 5.7's Never-Initialized Checks, Angular v19's Server Performance, and Cython 3.1's 'No-GIL' BuildsHi ,Welcome to this week’s edition of ProgrammingPro andHappy Thanksgiving if you celebrate! We're grateful for your continued support and passion for learning.In today’sExpert Insight, we bring you an excerpt from the recently published book, Mastering Angular Test-Driven Development, which explains the concept of code smells in Angular applications—indicators of potential issues in code that hinder maintainability and scalability.News Highlights: TypeScript 5.7 adds never-initialized checks and ECMAScript 2024 support; Vite 6.0 debuts with modern Sass API and asset updates; Cython 3.1 supports Python's "no-GIL" builds for better parallelism; and USPTO petitioned to cancel Oracle's JavaScript trademark over alleged abandonment.My top 5 picks from today’s learning resources:Top 65+ Data Science Projects with Source Code📊Replaying Kafka messages: Practical guide with sample code🔄Concepts in C++20💡Architectural Intelligence – The Next AI🏛️The top 25 weaknesses in software in 2024🚨But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefP.S.:Thank you all who participated in this month's survey. With this issue, we have fulfilled all content requests made this month.Sign Up|Advertise🗞️News and Analysis🔎Announcing TypeScript 5.7: The version introduces new features like checks for never-initialized variables, path rewriting for relative imports, support for ECMAScript 2024, and validated JSON imports in Node.js.Release Vite 6.0: Updates include an Experimental Environment API for improved development-production parity, enhanced JSON handling, expanded HTML asset referencing, and modern Sass API as default.Uno Platform Launches Hot Design, a Cross-Platform Visual Designer for .NET Apps: The suite also includesHot Reloadfor code updates andDesign-to-Code, a Figma plugin generating XAML and C# from prototypes.Java News Roundup: OpenJDK and Jakarta EE 11 Updates, Payara Platform, Vert.x, Log4j, JobRunr: Updates also includeMicronaut 4.7.1,JobRunr 7.3.2, and Gradle 8.11.1 maintenance releases.Python to C: What’s new in Cython 3.1: The version introduces significant updates, including experimental support for Python's free-threaded "no-GIL" builds in Python 3.13, enhancing parallelism for CPU-bound threads.USPTO petitioned to cancel Oracle’s JavaScript trademark: Deno Land has petitioned the USPTO to cancel Oracle's ownership of the JavaScript trademark, accusing Oracle of abandonment and fraud, citing no active role since 2009.Kotlin to lose scripting features: JetBrains plans to phase out certain scripting features in Kotlin, including REPL functionality, Java Specification Request 223 support, the KotlinScriptMojo Maven plugin, and kotlin-scripting-ide-services.🎓Tutorials and Learning Resources💡Python💡Top 65+ Data Science Projects with Source Code: Covers diverse areas like machine learning, NLP, deep learning, web scraping, and data visualization with real-world datasets and practical challenges.🎓Tutorial | Speed Up Your Python Program With Concurrency: Explains threading, asynchronous tasks, and multiprocessing, demonstrating how to optimize I/O-bound and CPU-bound tasks for improved performance.For more Python resources, go to PythonProNoSQL and Spark🎓Tutorial | Evolving a NoSQL Database Schema: Covers creating a single-table design, optimizing queries with keys and indexes, handling sharding for scalability, and enabling efficient cross-partition querying.💡Spark structured streaming — Checkpointing: Explains how Checkpointing aids in fault tolerance by maintaining stream state and offsets along with implementation details and surprising behaviors when configuring parameters.C# and .NET🎓Tutorial | Master Cache in C#: Covers IMemoryCache,IDistributedCache, andHybridCache and discusses when to use caching, its benefits, challenges, and patterns, including cache invalidation and metrics.🎓Tutorial | My process for creating API clients: Outlines a structured process for creating API clients in C# using Flurl, balancing automation and control between tools like HttpClient, Refit, and Kiota.💡C# puzzles: Presents two C# puzzles focusing on unconventional behavior: making modifications to StringBuilderobjects through aSecretSaucefunction without unsafe operations or external interference.C and C++🎓Tutorial | Concepts in C++20:Explains how C++20 concepts simplify template constraints, replacing SFINAE with readable, expressive syntax and highlights four ways to apply concepts for enhanced error clarity.🎥💡How Designing Carbon C++ Interop Taught me About C++ Variadics & Bound Members - Chandler Carruth: Introduces Carbon's type-checked variadic functions, enabling safer and more reliable templates.🎓Tutorial | Bubble Sort Implementation Using a Single for Loop in C: Presents an alternative implementation of Bubble Sort in C using a single forloop instead of nested loops.Java🎓Tutorial | Replaying Kafka messages: Practical guide with sample code: Covers three approaches: offset-based replay, mirror topics, and custom replay services and explains use cases with sample Java code.💡How Fast Does Java Compile?: Examines the speed of Java compilation, revealing that the Java compiler (javac)can process over100,000 lines of code per second on a single core when warmed up.Reactive Real-Time Notifications with SSE, Spring Boot, and Redis Pub/Sub: Highlights the advantages of a reactive approach, such as improved scalability and resource utilization, along with practical integration guidance.JavaScript and TypeScriptDevelop AI apps with JavaScript: Includes quickstart guides, libraries, templates, and training for tasks like text generation, image analysis, and NLP, focusing on Azure OpenAI Service and other Azure AI services.🎓Tutorial | JavaScript Sets and Maps: Beyond Arrays and Objects: Discusses Sets and Maps' advantages over arrays and objects, when to use them, and their ability to handle unique values and maintain key types.🎓Tutorial | Almost Perfect tsconfig.json Options for Your Angular Projects: Provides a step-by-step guide to optimizing the tsconfig.json file for Angular 18 projects, covering configurations for TypeScript compiler options.Go🎓Tutorial | Go Production Performance Gotcha - GOMAXPROCS: Discusses a performance issue in a Go-based workload caused by not explicitly setting the GOMAXPROCS parameter, leading to high CPU usage.💼Case Study | Are Golang Generics Simple or Incomplete? A Design Study: Explores the simplicity versus incompleteness of Go's generics by presenting a case study involving Map,MutableMap, andIndextypes in a version-controlled SQL database.Rust🎓Tutorial | Rust for AWS Lambda, the Docker Way: Walks you through using Cargo Lambda for simplified Rust Lambda development and presents two Dockerfile configurations including one supporting cross-compilation.💼Case Study | Making Rust a first-class citizen for Xen: Discusses Vates' efforts to integrate Rust into the Xen Project by developing pure-Rust alternatives to C-based libraries, creating safer, more efficient tools.Swift🎓Tutorial | Calling Hidden Swift Functions: Delves into techniques for calling hidden Swift functions, specifically those within Apple's frameworks, which are not directly accessible due to access level restrictions.🎓Tutorial | Mock Your Remote Config🧑‍💻: Provides a step-by-step guide on using protocols, dependency injection, and mock implementations.PHP🎓Tutorial | Step-by-Step Guide to Installing PHP 8.4 on Ubuntu 24.04 with Nginx & MySQL: Covers system updates, adding the Ondřej PHP repository, installing PHP with necessary extensions and configuring PHP-FPM with Nginx.SQL📜Towards Optimizing SQL Generation via LLM Routing: This paper introduces the first LLM routing approach for Text-to-SQL, dynamically selecting cost-effective LLMs for accurate SQL generation based on query complexity.Ruby💡10 Costly Ruby on Rails Upgrade Mistakes to Avoid in 2025: Identifies common pitfalls and provides actionable strategies to ensure a secure, performant, and seamless transition, reducing costs and enhancing stability.Powershell💡Attacking PowerShell CLIXML Deserialization: Explores vulnerabilities which can lead to remote code execution through untrusted data and recommends including patching systems, limiting third-party PowerShell modules, and more.Kotlin🎓Tutorial | Kotlin for Java developers: Concurrency with coroutines: Covers Kotlin's concurrency model using coroutines, demonstrating key features like scopes, dispatchers, contexts, channels, and flows.🌟Best Practices and Advice🚀Architectural Intelligence – The Next AI: Advocates for using traditional trade-off analysis to evaluate the appropriateness of AI for specific scenarios, distinguishing between suitable, questionable, and inappropriate use cases.What if AI eventually makes programmers smarter, not dumber: Argues that AI, particularly through LLMs, is transforming programming by reducing the time spent on repetitive coding tasks and enabling you to focus on problem-solving.How McDonald Sells Millions of Burgers Per Day With Event-Driven Architecture:Discusses how the architecture facilitates asynchronous operations, transactional processing, and real-time event handling.State of Software Architecture Report — 2024: Discovered widespread use of diagramming tools (96%) and collaborative wikis (79%) for documenting architecture, with microservices (67%) and event-driven patterns (62%) being the most common.The top 25 weaknesses in software in 2024: This year’s list, based on 31,779 CVEs, emphasizes classic weaknesses alongside notable changes, including upward movements for Cross-Site Request Forgery (CSRF) and Code Injection.🧠Expert Insight📚Here’s an excerpt from “Chapter 11: Refactoring and Improving Angular Code through TDD" in the book, Mastering Angular Test-Driven Development by Ezéchiel Amen AGBLA, published in October 2024.Identifying code smells and areas for improvement in Angular applicationsWhile your Angular application might seem functional on the surface, there could be underlying issues waiting to erupt. These issues, known as code smells, don’t necessarily causeimmediate problems but indicate areas in your codebase that could benefit from refactoring. Just like a cluttered room can be stressful and unproductive, smelly code can make it difficult to maintain, understand, and extend your application. This section delves into the world of code smells in Angular applications. We’ll explore what they are, why they matter, and how to identify them proactively. By understanding these code smells, you’ll be equipped to prioritize refactoring efforts using TDD, ultimately leading to a cleaner, more maintainable, and robust code base.What are code smells?Imagine walking into a kitchen where dirty dishes are piled up high in the sink, spices are scattered across the counter, and expired food lingers in the fridge. This unpleasant scene might not prevent you from cooking a basic meal, but it certainly wouldn’t be an enjoyable or efficient experience. Code smells are analogous to this messy kitchen in the softwaredevelopment world.Coined by Martin Fowler in his book,Refactoring: Improving the Design of Existing Code, code smells are indicators of potential problems within your code base. They don’t necessarily represent functional bugs that cause the application to crash. Instead, they signify areas that could be improved for better readability, maintainability, and long-term health ofyour code.Code smells are not bugs, but they can attract bugs in the future. They act like red flags, warning you of potential trouble spots that could become problematic as yourapplication evolves.Why should we care about code smells in Angular?Ignoring a messy kitchen might lead to unpleasant odors, fruit flies, and frustration when you need to cook a meal. Similarly, neglecting code smells in your Angular application can have severalnegative consequences:Decreased maintainability: Smelly code becomes difficult to understand and modify over time. As your application grows and features are added, the complexity of tangled code can make changes cumbersome anderror prone.Increased debugging time: When bugs arise in smelly code, it can be challenging to pinpoint the root cause. The lack of clear structure and organization makes it like searching for a needle in a haystack, wasting valuabledeveloper time.Reduced team productivity: Working with smelly code can be frustrating and demotivating for developers. The cognitive overhead of deciphering tangled logic slows down development andhinders collaboration.Technical debt: Unattended code smells accumulate over time, creating a technical debt that needs to be addressed eventually. This debt can become a significant burden, requiring dedicated resources and potentially delaying newfeature development.By proactively identifying and refactoring code smells, you can dothe following:Improve code readability: Clean and well-structured code is easier to understand for both you and other developers working on the project. This reduces onboarding time for new team members and fostersbetter collaboration.Enhance maintainability: Refactored code is easier to modify and adapt as your application’s requirements evolve. This allows you to introduce new features and bug fixesmore efficiently.Reduce debugging time: Cleaner code with a clear separation of concerns makes it easier to isolate and fix problems whenbugs arise.Boost team productivity: Working with well-structured code improves developer experience and satisfaction. This leads to higher productivity and a more positivedevelopment environment.Minimize technical debt: By addressing code smells early on, you prevent them from accumulating and becoming a significant burden inthe future.In essence, prioritizing code smell refactoring is an investment in the long-term health and maintainability of yourAngular application.Identifying the most common code smells in Angular applicationsNow that we understand the importance of identifying code smells, let’s take a look at some of the most common offenses you might encounter in yourAngular application:The long and winding method: Imagine a method in your service that stretches across dozens of lines, handling various tasks. This is a prime example of a long method, a code smell suggesting a lack of modularity. These methods can be difficult to understand, test, and modify. Refactoring involves breaking down such behemoths into smaller, well-defined functions, each focusing on a specific task. This enhances code readabilityand maintainability.The god component: Have you encountered a component overloaded with responsibilities? This is a “god component,” handling everything from data fetching to complex UI logic. Such components become maintenance nightmares as changes in one area can ripple through the entire component, causing unintended consequences. Refactoring can involvethe following:Creating dedicated services: Extract functionalities related to data access, business logic, or calculations into separate services. These services can be reused by multiple components, promotingbetter organization.Splitting the component: Break down the god component into smaller, more focused components, each handling a specific aspect of the UIor functionality.The code duplication monster: Seeing the same block of code copy-pasted across different parts of your application? This code duplication not only wastes space but also makes maintenance a challenge. Any bug fix in one instance needs to be replicated across all copies. Refactoring involves identifying these repetitive code snippets and creatingthe following:Reusable components: If the duplicated code deals with UI elements, consider creating a reusable component that can be used inmultiple places.Services or utility functions: For duplicated logic unrelated to the UI, extract them into services or utility functions that can be sharedacross components.The magic number mystery: Scattered numeric constants with no clear meaning throughout your code base are like magic tricks; they are confusing and difficult to maintain. Imagine having a constant10used for pagination but its purpose is unclear. Refactoring involves replacing these magic numbers with named variables or constants. For example, useITEMS_PER_PAGEinstead of10, making the code more self-documenting and easierto understand.The spaghetti code maze: Imagine code that winds and twists, lacking clear structure and organization. This is spaghetti code, making it a challenge to navigate, understand, and modify. TDD can be a powerful tool to combat spaghetti code. By writing tests first and then refactoring the code to meet those tests, you can introduce structure and improve the overall organization of yourcode base.Mastering Angular Test-Driven Developmentwas published in October 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.98🛠️Useful Tools⚒️superflex-vscode: AI-driven VSCode tool turning Figma, images, and prompts into production-ready frontend code.jekyll-sqlite: A a plugin enabling SQLite as a data source for dynamic Jekyll sites using SQL queries.lovable: AI-driven full-stack assistant that rapidly converts ideas into production-ready apps, enabling fast prototyping, editing, and deployment.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.If you have any suggestions or feedback, or would like us to find you a learning resource on a particular subject, 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{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
  • 807
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 $15.99/month. Cancel anytime
Divya Anne Selvaraj
22 Nov 2024
12 min read
Save for later

ProgrammingPro #83: Unreal Engine 5's AI Perception, Fil-C's Memory Safety for C++, and Go's AI Evolution

Divya Anne Selvaraj
22 Nov 2024
12 min read
Bite-sized actionable content, practical tutorials, and resources for programmers#83Unreal Engine 5's AI Perception, Fil-C's Memory Safety for C++, Go's AI Evolution, and Python In-Memory ComputingScale your scrapers with Apify’s Black Friday Boost plan!Get a 30% prepaid usage bonus on Apify this Black Friday. Scrape data for app integrations, performance tracking, competitive research, or custom pipelines. Use pre-built scrapers, build your own from scratch, or use quick-start code templates.The Boost plan ends December 5 - grab it while you can!Claim your bonus now!Hi ,Welcome to this week’s edition of ProgrammingPro!In today’sExpert Insight, we bring you an excerpt from the recently published book, Artificial Intelligence in Unreal Engine 5, which introduces Unreal Engine 5's AI Perception System, detailing its components, predefined sense configurations, and how developers can use or customize it.News Highlights: Fil-C tackles memory safety in C/C++ without requiring a new language; Go advances for AI and hardware efficiency with improved garbage collection; Rust Foundation enhances C++ interoperability with better tools and collaboration; and F# 9 introduces nullable reference types, computation expressions, and library upgrades.My top 5 picks from today’s learning resources:Researchers develop Python code for in-memory computing — in-memory computation comes to Python code🧠Speeding up the Rust edit-build-run cycle⚡C# 13 and .NET 9: Personal Highlights🎯Clean Architecture: The Missing Chapter🏗️How I Used Event-Driven Architecture in the Wrong Way🔄But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefP.S.:This month'ssurvey 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🔎Java News Roundup: Spring Framework 6.2, OpenJDK JEPs, Micronaut 4.7, Gradle 8.11: Other highlights include Project Reactor 2024.0.0, with enhancements spanning dependency upgrades and other new features.Rust haters, unite! Fil-C aims to Make C Great Again: Fil-C, a memory-safe variant of C and C++ developed by Filip Pizlo aims to address memory safety vulnerabilities, without requiring developers to learn a new language.F# 9 adds nullable reference types: The version also introduces empty-bodied computation expressions, and standard library enhancements like random sampling and shuffling functions.Go language evolving for future hardware, AI workloads:The Go team is working on improving garbage collection, introducing hardware-efficient features, and integrating AI SDKs like LangChainGo.Rust Foundation moves forward on C++ and Rust interoperability: The initiative focuses on enhancing tools, building consensus for long-term solutions, and collaborating with the C++ community to address challenges.JetBrains releases IntelliJ IDEA 2024.3 and other IDEs, still struggles to convince devs of benefits of new UI: Updates have been made to PHPStorm, PyCharm, and GoLand. Improvements include Logical code structure view.Uno Hot Design aims to meet demand for a visual designer for modern .NET: Hot Design isa visual design tool in the Uno Platform Studio suite to address the lack of a designer for modern .NET development, including WinUI.🎓Tutorials and Learning Resources💡Python🗞️Researchers develop Python code for in-memory computing — in-memory computation comes to Python code:Technion researchers have developedPyPIM, a tool that translates Python code into machine code for in-memory computing, enabling programmers to use Python without adaptation.For more Python resources, go to PythonProC# and .NET🎓Tutorial | Events and Delegates in C#: Covers the definition, implementation, and practical use of events and delegates in C#, including their benefits, use cases, and challenges, with examples and best practices.💡C# 13 and .NET 9: Personal Highlights: Reviews highlights of C# 13 and .NET 9, including enhanced performance, AI integration, improved params collections, new thread synchronization tools, and implicit index access.🎓Tutorial | Mastering Divide and Conquer (D&C): A Fundamental Algorithmic Paradigm: Explains the paradigm, detailing its practical applications with examples like Merge Sort and curated LeetCode problems.C and C++💼Case Study | Retrofitting spatial safety to hundreds of millions of lines of C++: Outlines Google's efforts to enhance spatial memory safety in its vast C++ codebase by retrofitting hardened libc++ with bounds checking.🎓Tutorial | Non-allocating Circular Buffer in C++: Explains circular buffers in C++, highlighting their fixed capacity and ability to overwrite the oldest data when full.🎓Tutorial | You can use C-Reduce for any language: Demonstrates the versatility of C-Reduce, a tool initially designed to minimize C compiler bug reproducers, with an example involving RustPython.Java🎓Tutorial | A Basic Introduction to the Classfile API: Introduces the Classfile API, providing a basic guide to generating JVM bytecode by constructing class files programmatically.🎓Tutorial | The Ultimate Linked List Guide: Become a Hero with All Methods and Theory in Java (Part-2): Introduces methods for inserting nodes at the start, end, or a specific index in the list to maintain the structure.💼Case Study | Java Backend Observability with OpenTelemetry Traces and Minimal Code: Explores how the MY.GAMES team integrated OpenTelemetry into their Java backend for Rush Royale to improve system observability.JavaScript and TypeScript🎓Tutorial | Importing a frontend Javascript library without a build system: Covers the three main types of JavaScript files (classic, ES Modules, and CommonJS), their characteristics, and methods for importing them.🗞️Meet Angular v19: Key updates include incremental hydration for server-side rendering, event replay stabilization, route-level render modes, and experimental zoneless support.💼Case Study | Adopting Bazel for Web at Scale: details Airbnb's migration of its large-scale web monorepo to Bazel, highlighting challenges, custom solutions, and performance gains in CI processes and developer workflows.Go🎓Tutorial | Constraints in Go: Explores constraints as tools for enhancing type safety and functionality in generic programming by defining permissible operations for types through method sets, unions, and approximations.🎓Tutorial | Testing with Go and PostgreSQL: ephemeral DBs: Explains how to integrate ephemeral PostgreSQL instances into Go testing workflows, optimizing setup for convenience, resource efficiency, and reduced test times.Rust🎓Tutorial | Speeding up the Rust edit-build-run cycle: Showcases steps like using faster linkers (e.g., Mold), minimizing debug information, and creating non-position-independent executables.🎓Tutorial | Build your own SQLite, Part 3: SQL parsing 101: Introduces tokenization and parsing concepts, implements a tokenizer to process SQL strings, defines an AST structure for SQL statements, and more.Swift🎓Tutorial | Syntax Highlighting SwiftUI Code with Swift Syntax: Demonstrates how to implement native SwiftUI syntax highlighting in an app using the swift-syntax library.🎓Tutorial | MainActor usage in Swift explained to dispatch to the main thread: Explains the usage of @MainActor in Swift, a global actor introduced in Swift 5.5 to ensure tasks are executed on the main thread.PHP📜Fuzzing the PHP Interpreter via Dataflow Fusion: Presents FlowFusion, the first automated fuzzing framework, validated by PHP developers, tailored to detect memory errors in the PHP interpreter.🗞️PHP 8.4.0 Released!: The major update introduces property hooks for computed properties, asymmetric visibility for enhanced property access control, the #[\Deprecated] attribute for user-defined deprecation warnings, and more.SQL💼Case Study | Presto® Express: Speeding up Query Processing with Minimal Resources: Delves into Uber's Presto Express which optimizes short-running SQL queries and reduces end-to-end SLA.💡SQL Style Guide: Covers best practices for naming conventions, query syntax, and formatting, aiming to enhance code clarity and facilitate collaboration among developers.Ruby🗞️2024 Ruby on Rails Community Survey Results: Highlights include a growing focus on maintaining applications with the latest Ruby and Rails versions despite challenges like dependency management.💡Elixir-like pipes in Ruby (oh no not again): Explores an experimental implementation of an Elixir-style pipe operator in Ruby, leveraging abstract syntax tree (AST) transformations to enable pipeline-style coding.Kotlin🗞️State of Kotlin Scripting 2024: Highlights that while Kotlin scripting remains a vital part of the Kotlin ecosystem, its adoption has been limited.🎓Tutorial | Understanding Properties in Kotlin: Covers mutable and read-only properties, custom getters and setters, backing fields, compile-time constants, late-initialized properties, and delegated properties.🌟Best Practices and Advice🚀Transforming Legacy Healthcare Systems: A Journey to Cloud-Native Architecture: Examines the challenges of modernizing legacy healthcare systems into cloud-native architectures, using Livi's transformation of its MJog platform as an example.Clean Architecture: The Missing Chapter: Critiques traditional layer-based structures for scattering related components, advocating instead for organizing code by features or components.To Dare or Not to Dare: the MVA Dilemma: Explores the challenges of balancing business and technical risks when developing a Minimum Viable Product (MVP) and its supporting Minimum Viable Architecture (MVA).How I Used Event-Driven Architecture in the Wrong Way: Reflects on the challenges of implementing event-driven architecture, highlighting issues such as managing two-way communication and handling complex event chains.🧠Expert Insight📚Here’s an excerpt from “Chapter 10: Improving Agents with the Perception System" in the book, Artificial Intelligence in Unreal Engine 5 by Marco Secchi, published in October 2024.Presenting the Perception System...One of the key components when creating intelligent and reactive AI agents in Unreal Engine is the AI Perception System; this powerful system allows AI controllers – and, consequently, AI agents – to perceive and respond to different stimuli intheirvirtual environment.At the core of the AI Perception System aresensesandstimuli. A sense – such as sight or hearing – represents a way for an AI agent to perceive its surroundings and is configured to detect specific types of stimuli, which are sources of perception data emanating from other actors in thegame world.As an example,sight senseis preconfigured to detect any visible pawn actors, whiledamage sensetriggers when the associated AI controller’s pawn takes damage from anexternal source.NoteAs a developer, you can create custom senses tailored to your game’s specific needs by extending theAISense class, if you are working with C++, or the AISense_Blueprintclass, if you are workingwith Blueprints.Presenting the Perception SystemThe AI Perception System consists of the followingmain classes:AIPerceptionSystem: This is the core manager that keeps track of all AIstimuli sources.AIPerceptionComponent: This represents the AI agent’s mind and handles processing perceived stimuli. It needs to be attached to an AI controller toproperly work.AIPerceptionStimuliSourceComponent: This component is added to actors that can generate stimuli and is in charge of broadcasting perception data tolistening elements.AIPerceptionSenseConfig: This defines the properties of a specific sense, what actors can be perceived, and how perception decays over timeor distance.When an actor withAIPerceptionStimuliSourceComponentgenerates a stimulus, nearbyAIPerceptionComponentsdetect it through their configured senses. This perceived data is then processed by the AI controller to triggerdesired behaviors.Once you have addedAIPerceptionComponentto an AI controller, you will need to add one or moreAIPerceptionSenseConfigelements in order to give your AI agent dedicated senses.Figure 10.1shows an example where perception is basedon touch:Figure 10.1 – The touch sense configFrom the previous screenshot, you may have noticed aDominant Senseproperty; this property allows you to designate a specific sense that takes priority over others when determining the location of asensed actor.Let’s explore the available sense configs that, as mentioned earlier, define the properties of eachspecific sense:AIPerceptionSenseConfig typesUnreal Engine offers a range of predefinedAIPerceptionSenseConfigclasses that are highly likely to meet your specific requirements. Let’s take a look at theavailable options:AIDamage: Use this configuration if your AI agent needs to respond to damage events such asAny Damage,Point Damage, orRadial DamageAIHearing: Use this configuration if you need to detect sounds generated in thesurrounding environmentAIPrediction: Use this configuration when you need to predict the target actor location in the nextfew momentsAISight: Use this configuration when you want your AI agent to see things inthe levelAITeam: Use this configuration if you want to notify the AI agent that some allyis nearbyAITouch: Use this configuration when the AI agent touches some other actor or, vice versa, when something is touching theAI agentStimuli sourceTheAIPerceptionStimuliSourceComponentclass allows an actor to register itself as a source of stimuli for one or more senses. For instance, you can register an actor as a stimuli source for sight. This registration allows an AI agent to visually perceive the actor in thegame level.A stimuli source can be registered – or unregistered – for a sense, making it detectable – or undetectable – by thePerception System.Artificial Intelligence in Unreal Engine 5was published in October 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.98🛠️Useful Tools⚒️fast-graphrag: Acost-efficient, dynamic, and interpretable framework for building scalable, agent-driven retrieval-augmented generation pipelines.pglite-fusion: A PostgreSQL extension that embeds SQLite databases into table columns, offering streamlined multitenancy and efficient data isolation.fireproof: An open-source live-update database enabling real-time collaboration, seamless integration with any stack, and deployment anywhere.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.If you have any suggestions or feedback, or would like us to find you a 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{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
  • 527

Divya Anne Selvaraj
18 Nov 2024
2 min read
Save for later

Essential Guides to C# 13 and .NET 9, AI in Unreal Engine 5, and Angular TDD

Divya Anne Selvaraj
18 Nov 2024
2 min read
Curated for software engineers, game developers, and frontend specialistsEssential Guides to C# 13 and .NET 9, AI in Unreal Engine 5, and Angular TDDHi ,This week, we’re bringing you three new books for developers working with today’s most in-demand tools. Master C# 13 and .NET 9 for cross-platform development, create smarter AI-driven games with Unreal Engine 5, or deliver high-quality code with test-driven development in Angular—each now at upto 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:C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals - Ninth Edition by Mark J. PriceStart building websites and services with ASP.NET Core 9, Blazor, and EF Core 9>Explore the newest additions to C# 13, the .NET 9 class libraries, and Entity Framework Core 9>Build professional websites and services with ASP.NET Core 9 and Blazor>Enhance your skills with step-by-step code examples and best practices tipsGet the eBook for $35.99$24.99Get the Print book for $44.99Artificial Intelligence in Unreal Engine 5 by Marco SecchiUnleash the power of AI for next-gen game development with UE5 by using Blueprints and C++>Adopt AI techniques for developing immersive gameplay experiences>Learn how to use the Unreal Engine gameplay framework system with C++ and Blueprints>Plan and develop AI behaviors carefully from start to finishGet the eBook for $39.99$27.98Get the Print book for $49.99Mastering Angular Test-Driven DevelopmentbyBuild high-quality Angular apps with step-by-step instructions and practical examples>Implement test-driven development practices in Angular using tools like Jasmine, Karma, and Cypress>Understand end-to-end testing through real-world scenarios and practical examples>Discover best practices for incorporating TDD into continuous integration and deployment (CI/CD) processesGet the eBook for $30.99$20.99Get the Print book for $37.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
  • 378

Divya Anne Selvaraj
14 Nov 2024
13 min read
Save for later

ProgrammingPro #82: Domain-Driven Design for Micro Frontends, .NET 9's JSON Boost, and Python Automation Scripts

Divya Anne Selvaraj
14 Nov 2024
13 min read
Bite-sized actionable content, practical tutorials, and resources for programmers#82Domain-Driven Design for Micro Frontends, .NET 9's JSON Boost, and Python Automation ScriptsHi ,Welcome to this week’s edition of ProgrammingPro!In today’sExpert Insight, we bring you an excerpt from the recently published book, The Art of Micro Frontends - Second Edition, which explains how Domain-Driven Design principles can help define and organize boundaries for micro frontends to ensure modular, isolated, and efficient architecture.News Highlights: .NET 9 launches with major performance boosts, including a 50% JSON processing gain; Java 24 targets memory savings with smaller object headers via Project Lilliput; the US urges developers to move from C and C++ for security; and GitHub Copilot chat adds prompt rewording guidance.My top 5 picks from today’s learning resources:20 Python scripts to automate common daily tasks⚙️Implementing the Repository Pattern with Multiple Databases in C# Clean Architecture🏗️Optimize Database Performance in Ruby on Rails and ActiveRecord🚄Top 50 System Design Terminologies You Must Know📚Netflix’s Distributed Counter Abstraction📊But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefP.S.:This month'ssurveyis now 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🔎.NET 9 is now available with several performance improvements:The version introduces a 15% increase in requests per second, optimized Server GC, faster LINQ operations, and a 50% boost in System.Text.Jsonprocessing.Java 24 to Reduce Object Header Size and Save Memory: This optimization is part of Project Lilliput and aims to improve memory density, reduce garbage collection pressure, and benefit workloads with small object sizes.Go language rises in Tiobe popularity index: The Google-developed Go language has reached its highest rank, seventh, in November 2024. Go aims to overtake JavaScript (ranked sixth) within three years.OpenJDK News Roundup: Instance Main Methods, Flexible Constructor Bodies, Module Import Declarations: With 19 JEPs targeted so far, JDK 24 is set for release in March 2025, featuring a robust set of updates aimed at performance, security, and language flexibility.The US government wants developers to stop using C and C++: While CISA mandates roadmaps for migration by 2026, widespread adoption is unlikely in the near future due to resistance, cost, and existing industry priorities.GitHub Copilot chat now provides guidance on rewording prompts: The updated chat suggests more specific prompts when a query lacks context, available in Visual Studio 2022 17.12 Preview 3 and aboveCloudflare Advocates for Broader Adoption of security.txt Standard for Vulnerability Reporting: Cloudflare has introduced a dashboard to create and manage security.txt files for vulnerability reporting, aligning with the RFC9116.🎓Tutorials and Learning Resources💡Python💡20 Python scripts to automate common daily tasks:Lists scripts for tasks such as sending emails, scraping news, downloading stock prices, backing up files, posting to social media, fetching weather updates, and resizing images.For more Python resources, go to PythonProC# and .NET🎓Tutorial | Pushed Authorization Requests (PAR) in ASP.NET Core 9: Explains how the new support for PAR enhances security in OAuth and OpenID Connect by moving sensitive data to secure back-channel requests.💡You Probably Don’t Need Those Interfaces: Challenges the common practice of using interfaces for every dependency, arguing that interfaces may be unnecessary for unit testing (due to modern mocking frameworks).🎓Tutorial | Implementing the Repository Pattern with Multiple Databases in C# Clean Architecture: Demonstrates using separate DbContext instances for different data types and a RepositoryFactory .C and C++🗞️A new chapter, and thoughts on a pivotal year for C++: Herb Sutter, the ISO C++ committee chair, has joined Citadel Securities, where he will lead C++ training and strategy while continuing his C++ standards work.🎓Tutorial | Around the World in C++: Exploring Time Zones with std::chrono: Explores time zone handling using C++20’s <chrono> library, demonstrating how to identify unusual time zones with non-hour UTC offsets.🧾The Design of a Self-Compiling C Transpiler Targeting POSIX Shell: Presents pnut, a C-to-POSIX shell transpiler designed to counteract software supply chain risks by enabling reproducible builds without relying on precompiled binaries.Java📖Open Access Book | Modern Java by Ethan McCue: Provides a structured introduction to Java, covering basics like data types, control flow, and methods, then progressing to complex topics such as classes and data structures.🎓Tutorial | How to Handle Errors Cleanly in Java: Principles for Scalable, Maintainable Code: Covers using custom exceptions, avoiding generic catch-all blocks, leveraging checked exceptions, and utilizing Optional to handle nulls.🎓Tutorial | Creating GenAI Apps in Java with SD4J (Stable Diffusion for Java) and the ONNX Runtime — Part 1: Details the setup of prerequisites such as JDK, ONNX Runtime, and Hugging Face tools, followed by step-by-step instructions to generate custom images from text prompts.JavaScript and TypeScript🎓Tutorial | JavaScript's ??= Operator: Default Values Made Simple: Explains the operator'sfunctionality, benefits over previous methods, and practical use cases for retaining meaningful falsy values.🎓Tutorial | Generating Random Mazes with JavaScript: Walks you through building a random maze generator in JavaScript using a three-step process with tips on handling blocked paths and using helper functions to manage grid cells.🎓Tutorial | Exploring Effect in TypeScript: Simplifying Async and Error Handling: Showcases how Effect can replace multiple libraries like Zod and Lodash, improving code readability and robustness in complex applications.Go🎓Tutorial | Functional programming in Go: Focuses on using functions as the primary control structures, enabling operations likemap,filter, andreduceto simplify and streamline data processing tasks.🎓Tutorial | ML in Go with a Python sidecar: Explores using ML in Go applications, focusing on techniques to integrate Python-based ML models, from cloud-based APIs to local sidecar servers.Rust💼Case Study | Why I love Rust for tokenising and parsing: Covers the author’s development experience using Rust to buildsqleibniz , a static analysis tool for SQLite, focusing on Rust’s macro system, testing frameworks, and more.🎓Tutorial | How to rewrite a C++ codebase successfully: Provides a structured guide for incrementally rewriting a legacy C++ codebase in Rust, focusing on real-world challenges such as cross-platform compatibility.Swift🎓Tutorial | Migrating to Swift 6: Provides a comprehensive framework for migration, including strategies for enabling concurrency checking, resolving common compiler errors, and incrementally adopting concurrency features.💡Problematic Swift Concurrency Patterns: Highlights common pitfalls and patterns to avoid when using Swift’s concurrency features, addressing issues like split isolation, excessive reliance on Task.detached , and more.PHP💡New error messages in PHP 8.4: Key updates include stricter handling of nullable parameters, limitations on unsetting hooked properties, and clearer messaging on invalid operations.SQL🎓Tutorial | 8 Steps in Writing Analytical SQL Queries: Steps covered include defining goals in plain language, inspecting and confirming basic data, incrementally adding joins without calculations, and using CTEs for summations.Ruby🎓Tutorial | Optimize Database Performance in Ruby on Rails and ActiveRecord: Covers best practices in ActiveRecord query optimization, indexing, reducing N+1 queries, batching, and caching techniques.💼Case Study | How we made a Ruby method 200x faster: Details how the team at Campsite identified and resolved a specific performance issue in their codebase, providing insights into their debugging process.Kotlin🎓Tutorial | Modeling ViewModel State in Android: A Guide to Clean, Scalable Patterns: Critiques using plain data classes with multiple Boolean flags, as this approach can lead to conflicting states and increased boilerplate.🌟Best Practices and Advice🚀Efficient Resource Management with Small Language Models (SLMs) in Edge Computing: Covers model optimization, latency reduction, and memory efficiency to support AI capabilities on limited hardware.Netflix’s Distributed Counter Abstraction: Delves into Netflix's Distributed Counter Abstraction, a system that enables high-throughput, low-latency counting within distributed applications.Top 50 System Design Terminologies You Must Know: Outlines essential system design terms covering key concepts like scalability, microservices, CAP theorem, sharding, and more.📖Open Access Book | Architectural Metapatterns by Denys Poltorak: Delves into over a hundred architectural patterns and structures, such as monoliths, layers, services, proxies, orchestrators, and more.🧠Expert Insight📚Here’s an excerpt from “Chapter 4: Domain Decomposition" in the book, The Art of Micro Frontends - Second EditionbyFlorian Rappl, published in October 2024.Principles of DDDThe idea of DDD was first popularized by Eric Evans. In his book, he describes the basic pillars that form DDD, according to his vision. While the book certainly has a lot of truth to it, the entire army of ideas was probably rarely—if ever—realized in real-world projects. Let’s try to distill the most importantideas for our use inmicro frontends.When we refer to DDD in the context of micro frontends, we will not include parts such as value objects or the need for a ubiquitous language. Instead, we almost exclusively take DDD as a blueprint to help us with the followingtwo things:Defining micro frontends withclear boundariesComing up with a strategy to establishthese boundariesWhile DDD uses the wordmodules, which was back then an alias forpackages, we will refer to this unit as amicro frontend. The other thing that DDD introduces is a so-called bounded context. Finally, DDD defines a context map to make sense of it. But let’s back off and look at eacharea separately.ModulesAmoduleserves as a container for a specific set of functionalities in your application. For a web application, this could relate to a full page or parts of a page. For instance, a module dealing with the order process could be responsible for showing a cart symbol on the pages of a web shop, such as the product catalog orproduct details.As mentioned, a module in DDD is usually what we will bring to the table in the form of a micro frontend. Nevertheless, keeping to a general notation here makes sense; after all, this helps us to see that good architectures rarely have anything to do with specific implementations but actually would work in multiple variants. In micro frontends, the functionality will be mostly designedaround components.A module is, however, a part of the full problem domain, focused on a specific area (or subdomain). The general design principles for modules are low coupling and high cohesion. As such, a micro frontend should represent a single unit to solve one problem without relying on any other microfrontend directly.In reality, we will be tempted to rely on other micro frontends to simplify the code. The one strong advice here is to avoid doing that, as the immediate simplification will usually backfire in a more complicated and less flexible solution later. When we start looking at the different architectural patterns later inChapter 7onward, we’ll see how to decouple themicro frontends.To help us figure out what could be part of a module, DDD introduces the theoretical concept of abounded context.Bounded contextAbounded contextis used to define the boundaries of the functionality of a subdomain. This is an area where only the functionality from a certain domainmakes sense.While this may initially seem similar to a module, it is actually quite different. Multiple modules live within the same bounded context. The bounded context is an umbrella connecting them and has nothing to do withruntime considerations.Bounded contexts are also broader than modules as they contain both unrelated concepts and shared concepts. Naturally, this will result in some overlap and duplication between differentbounded contexts.The following diagram illustrates the relationship of two bounded contexts within an exampleproblem domain:Figure 4.1 – Relation of two bounded contexts in an example problem domainHow we split a bounded context into modules is up to us. In the end, however, a more critical question is,what are the bounded contexts in our problem domain?There is no blueprint here, but a nice way to visualize and think about contexts generally is in the form of acontext map.Context mapAcontext mapis a useful tool to illustrate the involved contexts of a system, including their connections. Instead of reusing objects from other contexts, a transformation defined by the context map should be used to always createdomain-specific objects.For our design decisions, a context map can be helpful to see where sharing occurs and how to still produce isolated micro frontends. To do this, we need to first identify these self-contained domains. This is where two principal ways come into play: strategic domain design and—as an alternative—tactical design. Let’s lookat both.Strategic domain design versus tactical designWhile strategic domain design helps us to extend knowledge of a problem domain and come up with useful guidelines, tactical design tries to come up with design patterns and building blocks that form a system. In other words, strategic domain design identifies the different domains and the communication between them, while tactical design is all about structuringthese domains.In our micro frontend space, we have the choice of leaving the tactical design to the implementers of the micro frontends, giving them some guidance, or predefining a structure that needs to be followed already. We will see later on how these architectural boundaries can actuallybe decided.In contrast, strategic domain design is helpful for decomposing a full problem domain into smaller (sub) domains. Starting with a full problem domain, we derive the individual subdomains and extract their bounded contexts. The relationship between the contexts is then captured in a context map. The following diagram shows thistheoretical process:Figure 4.2 – The idealized process of deriving a full domain decomposition from a given problem domain, including a working context mapThe Art of Micro Frontends - Second Edition was published in October 2024. Packt library subscribers can continue reading the entire book for free or you can buy the bookhere!Get the eBook for $29.99$20.98🛠️Useful Tools⚒️Aide: An open-source, AI-native IDE that proactively supports developers with context-aware code edits, error fixes, and easy rollbacks.Arch: An open-source prompt gateway that helps build scalable, secure AI apps with prompt safeguards, API triggers, and built-in monitoring.Sulie: An open-source platform for advanced time series forecasting with the Mimosa foundation model, offering zero-shot and fine-tuned predictions.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.If you have any suggestions or feedback, or would like us to find you a 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{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
  • 390

Divya Anne Selvaraj
11 Nov 2024
3 min read
Save for later

Microsoft Tools for Cybersecurity and App Development: 4 Essential Guides

Divya Anne Selvaraj
11 Nov 2024
3 min read
Curated for cybersecurity pros, app developers, and DevOps expertsMaster Microsoft’s Best-Kept Secrets in Cybersecurity, DevOps, and App DevelopmentHi ,Whether you’re fortifying cybersecurity, streamlining app management, customizing ERP workflows, or building responsive apps, mastering Microsoft’s ecosystem is crucial. This week, we bring you four new guides that transform Microsoft’s complexity into clear, actionable skills across security, Power Platform, Dynamics 365, and Power Apps—all now 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:Microsoft Cybersecurity Architect Exam Ref SC-100 - Second Edition by Abu Zobayer, Graham Gold, and Dwayne NatwickA high-demand certification book for IT pros focused on advancing their cybersecurity skills and passing the SC-100 exam.>Prepare for the SC-100 exam with in-depth coverage, mock tests, and practical examples.>Master zero-trust architecture, encryption standards, and threat intelligence.>Elevate your security expertise by optimizing operations with SIEM and SOAR.Get the eBook for $39.99$27.98Get the Print book for $49.99Microsoft Power Apps Cookbook - Third Edition by Eickhel MendozaAppeals broadly to app developers, IT pros, and non-developers looking to build custom business solutions in a low-code environment.>Create apps with AI-powered Copilot, custom UI components, and advanced automation.>Accelerate development using ready-made recipes for Power Apps.>Expand app functionality with Dataverse, RPA, and Power Pages integration.Get the eBook for $39.99$27.98Get the Print book for $49.99Application Lifecycle Management on Microsoft Power Platform byBenedikt BergmannA valuable resource for developers and DevOps specialists managing app deployments on the Power Platform.>Automate builds and deployments with Azure DevOps and GitHub Actions.>Implement a robust ALM strategy tailored to Power Platform solutions.>Streamline environment management across Power Apps, Power Automate, and Power Virtual Agents.Get the eBook for $35.99$24.99Get the Print book for $44.99Programming Microsoft Dynamics 365 Business Central - Seventh Edition byChristopher D. Studebaker, Natalie Karolak, Marije Brummel, and David StudebakerIdeal for ERP consultants and developers focused on customizing and extending Business Central for complex business needs.>Customize Business Central workflows using AL language and Visual Studio Code.>Integrate external systems with Business Central using API web services.>Optimize business solutions with best practices for scalability and reliability.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
  • 366
Divya Anne Selvaraj
07 Nov 2024
11 min read
Save for later

ProgrammingPro #81: Debugging Linux Scripts, Tabnine's Code Review Agent, and Zed Editor's SSH Remoting

Divya Anne Selvaraj
07 Nov 2024
11 min read
Bite-sized actionable content, practical tutorials, and resources for programmers#81Debugging Linux Scripts, Tabnine's Code Review Agent, and Zed Editor's SSH RemotingHi ,Welcome to this week’s edition of ProgrammingPro!In today’sExpert Insight, we bring you an excerpt from the recently published book, The Ultimate Linux Shell Scripting Guide, which explains how to use -u and set -u in shell scripts to identify uninitialized variables and prevent related errors during debugging.News Highlights:Zed editor adds SSH remoting for faster remote workflows; IBM’s AI agents automate GitHub issue resolution; Java’s JEP 491 boosts concurrency with virtual thread improvements; and Tabnine’s Code Review Agent enforces custom coding standards.My top 5 picks from today’s learning resources:Hidden Python Libraries That Will Blow Your Mind✨The magic of keeping one level of abstraction per function🎩Writing secure Go code🐹Being a Responsible Developer in the Age of AI Hype⚖️Using certifications to level up your development career🏆But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-Chief🚀Join this 3-hour AI Workshop (worth $399) - FREE for ProgrammingPro readers to learn AI strategies & hacks to 10X work output and grow your business.🗓️ Tomorrow | ⏱️ 10 AM ESTClick here to register (FREE for the First 100 people only)!Sign Up|Advertise🗞️News and Analysis🔎Rust-based Zed editor preview adds direct SSH remoting, a key feature for potential VS Code switchers: Zed emphasizes speed, performance, and real-time collaboration, appealing to developers seeking a faster, lighter alternative.Tabnine’s new Code Review Agent validates code based on a dev team’s unique best practices and standards: The agent is an AI tool that validates code, flags issues during code reviews, and offers fixes.IBM releases open AI agents for resolving GitHub issues: IBM’s SWE-Agent 1.0, a set of AI-powered open agents, automates GitHub issue resolution, helping developers by localizing, suggesting fixes, and executing tests.Java Evolves to Tackle Virtual Threads Pinning with JEP 491: The change would improve scalability and performance in highly concurrent applications by allowing threads to unmount from platform threads during synchronization.Apache Tomcat 11.0 Delivers Support for Virtual Threads and Jakarta EE 11: The update enhances concurrency, scalability, and security for modern web applications, with upgrades in WebSocket and Servlet performance.Microsoft Introduces Modern Web App Pattern for .NET: Accelerating App Modernization to the Cloud: The pattern guides developers in transforming monolithic applications to cloud-native architectures with a focus on scalability.Amazon Q Developer is not just for coding and not just for AWS, claims cloud giant:It includes features like multi-file edits, unit testing, and security scanning, and plans to add support for Eclipse IDE.🎓Tutorials and Learning Resources💡PythonHidden Python Libraries That Will Blow Your Mind:Introduces six powerful yet lesser-known Python libraries including Streamlit for quick app-building, PyWhatKit for task automation, and Typer for simplified CLIs.For more Python resources, go to PythonProC# and .NET🎓Tutorial | Unlocking the Power of GitHub Models in .NET with Semantic Kernel: Explains how to set up necessary packages, configure access with GitHub tokens, establish a Semantic Kernel client, and run a chat-based application.🎓Tutorial | eShop infused with AI – a comprehensive intelligent app sample: Demonstrates how to integrate AI functionalities like semantic search, summarization, classification, and sentiment analysis into business applications.🎓Tutorial | How to prevent XSS Attacks in ASP.NET Core Web API: Covers essential practices such as input validation, output encoding, and advanced measures like Content Security Policy (CSP) and secure cookies.C and C++🎓Tutorial | Deep Threads Diving Into The Core Of Concurrent Programming With C: Covers core concepts like threads vs. processes, key functions in POSIX threads (pthreads), and synchronization techniques.📖Open Access Book | Is Parallel Programming Hard, And, If So, What Can You Do About It?: Serves as a guide for programming shared-memory parallel systems, offering foundational techniques to prevent common pitfalls.C++, Complexity, and Compiler Bugs: Explores challenges such as temporary lifetime extension, differences in designated initializers between C++ and C, and inconsistent handling of template disambiguation across compilers.JavaJava-Based No-Code and Low-Code Application Bootstrapping Tools: Reviews four Java-based no-code and low-code platforms: Appsmith, Wavemaker, Openkoda, and JHipster.🎓Tutorial | Building thread-safe abstractions in Java versus Go: Through examples, the author compares Java's synchronized keyword for mutual exclusion with Go’s sync.Mutex and channels, showcasing adaptations needed.🎓Tutorial | Server-Side Rendering with Spring Boot: Explains how to use WebJars for managing client-side dependencies via Maven and Thymeleaf for server-side rendering in Spring Boot.JavaScript and TypeScript🎓Tutorial | The magic of keeping one level of abstraction per function: Advocates for breaking down complex tasks into focused, smaller functions, to achieve cleaner code that is easier to update, reuse, and understand.Summary of the AJAX frameworks comparison: Compares Vue.js, Alpine.js, HTMX, and Vaadin—across frontend skills required, team integration, setup ease, and styling flexibility.20 TypeScript Tips for Cleaner, More Efficient Code in 2024: Tips include NonNullable, Partial, Readonly, Mapped Types, Union Exhaustiveness, and Generics, with practical examples demonstrating each.Go🎓Tutorial | Writing secure Go code: Covers tools like go vet, staticcheck, golangci-lint, govulncheck, and gosec which support code analysis and vulnerability detection, and fuzz testing which helps find security flaws.🎓Tutorial | Ranging over functions in Go 1.23: Introduces Go 1.23’s new feature allowing for-range iteration over functions, enhancing custom container iteration without exposing internal data structures.RustRust's Most Subtle Syntax: Explores how Rust’s pattern-matching rules with constants can introduce subtle bugs, especially if naming conventions aren’t followed consistently.Bringing faster exceptions to Rust: Explores speeding up Rust’s panic handling by optimizing the unwinding mechanism, resulting in a 4.3x speed improvement without changing the Rust compiler or system unwinder.Swift🎓Tutorial | swift-format GitHub Action: Covers setting up swift-format as a GitHub Action to automate linting and formatting for Swift projects, including configuration tips and integration with Xcode 16.🎓Tutorial | How to Use URLSession with Async/Await for Network Requests in Swift: Covers GET and POST methods, adding parameters, and decoding JSON responses into Swift structs.PHP🎥🎓Tutorial | Laravel for Beginners:This video series offers a step-by-step introduction to Laravel, covering essentials like setting up, routing, views, Blade directives, layouts, components, and CSS integration with Tailwind.SQL🎓Tutorial | Advanced SQL for Data Professionals: Covers common table expressions (CTEs) for recursive queries, methods to remove duplicates, ways to identify new records, strategies for filling gaps in data, and more.Ruby🎓Tutorial | Understanding Ruby 3.3 Concurrency: A Comprehensive Guide: Covers Threads, Fibers, and Ractors, explaining each's distinct use cases, performance trade-offs, and resource utilization.Kotlin🎓Tutorial | Serializing SQL: Building Serializable Data Classes in Kotlin: Describes building a system in Kotlin to serialize SQL queries into data classes using JSON, enabling dynamic SQL functions like SUM, and COUNT.🌟Best Practices and Advice🚀Cell-Based Architecture Adoption Guidelines: Outlines guidelines for adopting cell-based architecture, a strategy that enhances system resilience by isolating failures, ideal for high-availability systems.Being a Responsible Developer in the Age of AI Hype: Discusses recognizing that AI models like LLMs generate plausible text rather than true reasoning, questioning claims of AI’s capabilities, and addressing biases and ethical risks.A deep look into our new massive multitenant architecture: Explores the the architectural overhaul undertaken by Glauber Costa's team at Turso, focusing on adopting Deterministic Simulation Testing (DST).Using certifications to level up your development career: Explains how obtaining relevant, vendor-neutral certifications can boost developers' careers by validating their skills, improving job prospects, and potentially increasing pay.🧠Expert Insight📚Here’s an excerpt from “Chapter 21: Debugging Shell Scripts" in the book, The Ultimate Linux Shell Scripting Guide byDonald A. Tevault, published in October 2024.Checking for Undefined VariablesAs I said at the beginning of this chapter, in theUnderstanding Common Scripting Errors section, it’s sometimes desirable to define a variable in a script without assigning an initial value to it. But, sometimes it isn’t. You can track down uninitialized variables by appending a -uto the end of your shebang line.In bashfor example, you can use#!/bin/bash -u, which will turn this feature on for the entire script. Or, you can place aset -u command any place in the script where you’d like to start checking. For example, let’s look at the unassigned_var1.sh script, which has variable checking turned off:#!/bin/bashecho "The uninitialized myvar, without setting -u, looks like this : " $myvarechomyvar=Donnieecho "I've just initialized myvar."echo "The value of myvar is: " $myvarHere’s the output:donnie@fedora:~$ ./unassigned_var1.shThe uninitialized myvar, without setting -u, looks like this :I've just initialized myvar.The value of myvar is: Donniedonnie@fedora:~$As you see, without the-usetting, the script runs to completion. It’s just that trying to echo the value of the uninitializedmyvarjust shows us a blank space. Next, let’s turn on variable checking by adding the-u option, as you see in the unassigned_var2.sh script:#!/bin/bash -uecho "The uninitialized myvar, without setting -u, looks like this : " $myvarechomyvar=Donnieecho "I've just initialized myvar."echo "The value of myvar is: " $myvarLet’s see what this does:donnie@fedora:~$ ./unassigned_var2.sh./unassigned_var2.sh: line 2: myvar: unbound variabledonnie@fedora:~$This time the script failed as soon as it saw the uninitialized variable.You can set the-uoption anywhere in the script you like, by usingset -u, as you see here in theunassigned_var3.shscript:#!/bin/bashecho "The uninitialized myvar, without setting -u, looks like this : " $myvarechoecho "I'm now setting -u."set -umyvar=Donnieecho "I've just initialized myvar."echo "The value of myvar is: " $myvarechoecho "Let's now try another uninitialized variable."echo "Here's the uninitialized " $myvar2So now, I have one uninitialized variable at the top, on line 2. (Let’s just say that for whatever reason, I want this particular variable to be uninitialized.) I then turn on variable checking on line 5. Let’s see how this runs:donnie@fedora:~$ ./unassigned_var3.shThe uninitialized myvar, without setting -u, looks like this :I'm now setting -u.I've just initialized myvar.The value of myvar is: DonnieLet's now try another uninitialized variable../unassigned_var3.sh: line 11: myvar2: unbound variabledonnie@fedora:~$Before I turn on variable checking, the uninitializedmyvarjust shows us a blank space. After I turn on variable checking, I initializedmyvarwith a value ofDonnie, and it prints out normally. But, the uninitializedmyvar2at the end crashes the script.NOTE:If you search the web for shell scripting security tutorials, you’ll find several that tell you to make either -uorset -ua permanent part of your scripts. The authors of these tutorials say that it enhances the security of your scripts, without giving any convincing explanation of why or how. Using-uorset -uis great for debugging, but it should only be used for just that—debugging! So, when you’re through debugging your scripts, be sure to remove the-uor theset -ubefore you place the script into production. Otherwise, your scripts could give you some rather unpredictable results.Also, be aware that using-ucan also help you detect typos in your scripts. For example, if you define a variable asmynum=1, but accidentally call back the value with$mymum, the-uwill detect thatmymumis an unset variable.The Ultimate Linux Shell Scripting Guidewas published in October 2024. Packt library subscribers can continue reading the entire book for free or you can buy the bookhere!Get the eBook for $43.99$29.99🛠️Useful Tools⚒️PipelineDP4j: Google’s open-source JVM library for differential privacy in Java, Kotlin, and Scala, supporting Apache Beam.Whirlwind: A high-performance, asynchronous sharded HashMap in Rust for thread-safe, concurrent data access.Modus: An open-source, serverless framework for fast APIs and AI functions using WebAssembly, with support for AssemblyScript and Go.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}}
Read more
  • 0
  • 0
  • 799

Divya Anne Selvaraj
04 Nov 2024
3 min read
Save for later

Master Python for AI, Forecasting, and Data Engineering

Divya Anne Selvaraj
04 Nov 2024
3 min read
Curated for data scientists, AI engineers, and Python developersMaster Python for AI, Forecasting, and Data EngineeringHi ,This week, we’ve handpicked five essential titles, all newly published in October 2024, to advance your Python skills across AI, data science, and machine learning. From time series forecasting and pandas data manipulation to mastering Apache Airflow workflows, building large language models, and creating AI applications with OpenAI APIs, these books are designed for practical, real-world application—each now at upto 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:Modern Time Series Forecasting with Python - Second Edition by Manu Joseph and Jeffrey TackesIndustry-ready machine learning and deep learning time series analysis with PyTorch and pandas>Apply cutting-edge ML and deep learning models to boost forecasting accuracy.>Explore probabilistic forecasting methods for handling real-world uncertainties.>Master techniques for deploying robust time series models with PyTorch and pandas.Get the eBook for $46.99$31.99Get the Print book for $57.99Pandas Cookbook - Third Edition byWilliam Ayd and Matthew HarrisonPractical recipes for scientific computing, time series, and exploratory data analysis using Python>Unlock practical recipes for data manipulation, time series analysis, and data exploration.>Master the latest in pandas 2.x for streamlined data workflows.>Solve real-world data challenges with clear, structured solutions and advanced techniques.Get the eBook for $39.99$27.98Get the Print book for $49.99Apache Airflow Best Practices byDylan Intorf, Dylan Storey, and Kendrick van DoornA practical guide to orchestrating data workflow with Apache Airflow>Build resilient data workflows and pipelines using real-world Apache Airflow use cases.>Optimize workflow orchestration to scale data operations effectively.>Implement best practices for Airflow 2.x, from DAG authoring to cloud deployment.Get the eBook for $35.99$24.99Get the Print book for $44.99LLM Engineer's Handbook byPaul Iusztin, Maxime Labonne, Julien Chaumond, and Hamza TahirMaster the art of engineering large language models from concept to production>Learn how to design, deploy, and optimize LLMs for production use.>Implement data pipelines, fine-tune models, and manage deployment with MLOps techniques.>Master advanced LLM operations, including preference alignment and inference optimization.Get the eBook for$47.99Get the Print book for $59.99 $53.98Building AI Applications with OpenAI APIs - Second Edition byMartin YanevLeverage ChatGPT, Whisper, and DALL-E APIs to build 10 innovative AI projects>Develop AI-powered projects with ChatGPT, Whisper, and DALL-E APIs across 10 innovative projects.>Integrate AI seamlessly into web and desktop applications, from NLP to speech recognition.>Monetize your creations by adding payment systems and using fine-tuning for specific applications.Get the eBook for $31.99$21.99Get the Print book for $39.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
  • 230

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
Modal Close icon
Modal Close icon