![Utah Cpp Programmers](/img/default-banner.jpg)
- 46
- 143 949
Utah Cpp Programmers
United States
เข้าร่วมเมื่อ 8 เม.ย. 2020
Utah C++ Programmers meets monthly to discuss topics related to C++ programming.
Meetup: www.meetup.com/utah-cpp-programmers/
Blog: utahcpp.wordpress.com/
Meetup: www.meetup.com/utah-cpp-programmers/
Blog: utahcpp.wordpress.com/
Introduction to Coroutines
Coroutines are a new feature in C++20. Wikipedia describes coroutines as "functions whose execution you can pause". What exactly does this mean and how is it exposed in C++?
This month, Richard Thomsons will give us a gentle introduction to coroutines. We'll look at the syntax introduced in C++20 that allows you to define and call coroutines and how they interact with other features in the standard library, such as ranges. We'll compare coroutines to fibers and threads and see how the different types of concurrency compare to each other.
Meetup: meetup.com/utah-cpp-programmers/
Future topics: utahcpp.wordpress.com/future-meeting-topics/
Past topics: utahcpp.wordpress.com/past-meeting-topics/
This month, Richard Thomsons will give us a gentle introduction to coroutines. We'll look at the syntax introduced in C++20 that allows you to define and call coroutines and how they interact with other features in the standard library, such as ranges. We'll compare coroutines to fibers and threads and see how the different types of concurrency compare to each other.
Meetup: meetup.com/utah-cpp-programmers/
Future topics: utahcpp.wordpress.com/future-meeting-topics/
Past topics: utahcpp.wordpress.com/past-meeting-topics/
มุมมอง: 568
วีดีโอ
Debugging Linux Applications Remotely with Visual Studio
มุมมอง 2532 หลายเดือนก่อน
A few years ago, Visual Studio added the ability to remote debug linux applications. This month, Richard Thomson will give us a run-down on exactly how well this works and what constraints apply to this scenario. We'll try out debugging a project on a unix workstation running an ubuntu based distribution. 0:00:00 Introduction 0:00:55 Installation Requirements 0:02:35 Project Requirements 0:03:2...
Parsing JSON at Gigabytes per Second with simdjson
มุมมอง 1.2K3 หลายเดือนก่อน
Parsing JSON inputs is a common task in network oriented services. Many web APIs provide data as JSON outputs that are fed into another process. Parsing and validating JSON text inputs can be a significant bottleneck for a high throughput network service. This month, Richard Thomson will give us an overview of the simdjson library for parsing JSON inputs. From a feature perspective, this librar...
Writing Expressive Tests with Google Test and Google Mock
มุมมอง 3544 หลายเดือนก่อน
There are several unit testing frameworks for C out there. One of the most popular is Google Test (also known as "GTest") for writing tests and its companion library Google Mock (aka "GMock") for creating and interacting with mock objects. Writing a test seems simple enough, until you get into the details. There are some specific challenges to writing tests that are presented by typical legacy ...
Managing Headers with Include What You Use
มุมมอง 2405 หลายเดือนก่อน
Reading and tokenizing header files are consistently shown to be one of the most costliest parts of the C compilation process. Replacing header files with the binary representation of modules was a huge addition to the language in the C 20 standard. What can we do in the meantime until we switch to modules? Include-What-You-Use is a clang-based tool designed to help you properly manage the head...
Solving Common Problems with Boost Utility
มุมมอง 2886 หลายเดือนก่อน
If Batman needs a utility belt, shouldn't you have one? Boost.Utility is a small set of components to help you solve common problems when programming in C . This month, Richard Thomson will give us a guided tour of the components in this small header-only library. The components to be discussed include: - Base From Member idiom - Call Traits to choose the "best" way to pass arguments to templat...
Refactoring Tool Roundup
มุมมอง 2077 หลายเดือนก่อน
Refactoring is an ongoing daily task of programming. Sometimes it's something as simple as renaming a local variable to reflect its changed use within a local scope. Other times it's as complicated as refactoring an application's architecture from "immediate mode" input processing to event driven input. This month, Richard Thomson will give us an update on automated refactoring tools for C . Ho...
Make an Animated Christmas Card with Curses
มุมมอง 1738 หลายเดือนก่อน
Curses is a library for screen oriented text applications. Curses is essentially a window like user interface for text screens. When Bill Joy wrote vi, he wrote some code to optimize repainting the terminal screen and positioning the cursor. This code was borrowed and extended by Kenneth Arnold to create the general-purpose library curses for programming on text terminals. This month, Richard T...
Boost String Algorithms Library
มุมมอง 5629 หลายเดือนก่อน
String manipulation is a common task in many programs. The standard library basic_string class comes with many member functions for performing some basic operations and acts as a compatible container for the generic algorithms in the standard library. Despite this, certain common tasks are missing and the Boost String Algorithms library fills that gap. This month, Richard Thomson will give us a...
Porting from MFC to wxWidgets
มุมมอง 2.1K10 หลายเดือนก่อน
Sometimes we have a useful Microsoft Foundation Classes (MFC) application that we'd like to make available to other platforms. wxWidgets has a programming model very similar to MFC, so porting our application from MFC to wxWidgets seems like the simplest way to get a cross-platform version of our application. This month, Richard Thomson will give us a quick refresher on GUI programming and walk...
Parsing with Boost Spirit X3
มุมมอง 1.5K11 หลายเดือนก่อน
Almost 10 years ago, we looked at Spirit 2.x for parsing. Since that time the Spirit library has evolved to Spirit X3, a C 14 version of Spirit that is "an object-oriented, recursive-descent parser for C ". Spirit X3 is a header-only library that allows you to write your grammar directly in C using the mechanism of expression templates. When expressed as a Spirit X3 grammar in C , the resulting...
Dynamic CUDA with NVIDIA's Runtime Compilation
มุมมอง 676ปีที่แล้ว
Using CUDA is great way to accelerate tasks on the GPU. Regular CUDA programming compiles your C code into code that can execute on the GPU. But what if your problem domain is more dynamic and requires generation of code on the fly? On the CPU you can use techniques like LLVM to compile code Just-in-Time (JIT) into the native CPU instruction set and call this code directly from your application...
Using GitHub Actions for Continuous Integration
มุมมอง 912ปีที่แล้ว
GitHub actions allow you to set up continuous integration for your C project. You can configure, build and test your code in a variety of operating systems and hardware configurations. This month, Richard Thomson will give us an introduction to GitHub actions for continuous integration of C projects. We'll look at how to set up automatic building and testing of code on various repository events...
Promise-Cpp with Boost.Beast
มุมมอง 880ปีที่แล้ว
Over the past few months, we've looked at asynchronous I/O and network programming using Boost.Asio and Boost.Beast. Those libraries connect to your application through the use of callbacks. When orchestrating a sequence of asynchronous operations, it is up to the application to ensure that the callbacks are invoked in the proper sequence. This "callback hell" problem has long been recognized i...
Basic HTTP and WebSocket Programming with Boost.Beast
มุมมอง 8Kปีที่แล้ว
Boost.Beast is a C header-only library serving as a foundation for writing interoperable networking libraries by providing low-level HTTP/1, WebSocket, and networking protocol vocabulary types and algorithms using the consistent asynchronous model of Boost.Asio. This month, Richard Thomson will give us an introduction to Beast and the facilities it provides for HTTP and WebSocket applications. ...
Getting Started with Boost.Asio: Timers and Serial Ports
มุมมอง 7Kปีที่แล้ว
Getting Started with Boost.Asio: Timers and Serial Ports
Writing Native Win32 Applications with WinLamb and Modern C++
มุมมอง 2.6Kปีที่แล้ว
Writing Native Win32 Applications with WinLamb and Modern C
Adding a REST API with Corvusoft's restbed
มุมมอง 2.6K2 ปีที่แล้ว
Adding a REST API with Corvusoft's restbed
Writing a Network Client With Facebook's Wangle is a Fail
มุมมอง 1.4K2 ปีที่แล้ว
Writing a Network Client With Facebook's Wangle is a Fail
Embedded Programming with Raspberry Pi 4B
มุมมอง 4.3K2 ปีที่แล้ว
Embedded Programming with Raspberry Pi 4B
Embedded Programming with Raspberry Pi Pico
มุมมอง 5K2 ปีที่แล้ว
Embedded Programming with Raspberry Pi Pico
Highly looking forward to the Cobalt discussion and symmetric transfer. That is still one of the confusing aspects of coros!
Is there a discord for Utah CPP?
Just 3 years later it kind of seems WinRT is dead. The documentation lacks good examples, Xaml-based apps for unpackaged Win32 C++ apps is not a topic anymore. VS2022 does not include WinRT project templates anymore. An so on. That's MS.
wy microsoft bothered to have init_apartment explicitly
Hi Sir, How i can send POST request from http client ?
Use verb::post www.boost.org/doc/libs/1_85_0/libs/beast/doc/html/beast/ref/boost__beast__http__verb.html
The little IC you are talking about at 1:50 is a DC-DC 3V3 regulator. The QSPI memory is the other little chip (the one between RP2040 and BOOTSEL button).
Thanks for the correction; I don't work with these chips regularly enough to recognize them on-the-fly accurately!
Fantastic, this helped me out in my GUI application reading Data from Arduino, thank you so much!
Compared with QtWinMigrate, wxMfc seems not to be a sound out-of-box library. I am developing a plugin for rhino, which using MFC. Because of I am not familar with MFC, I try to using modal dialogs created from wxWidgets. However, it seems not to work well. When the dialog "ShowMoal". the application not blocked by modal dialog.
Thanks for the content! It's been really helpful. However I feel like I'm having some gaps and struggle to grasp some concepts, like I'm missing some base. Could you point me to some references to learn about networking in C++ (preferable using boost) that are more beginner friendly and explain some concepts in detail?
This video on Boost.Beast builds on several earlier videos using Boost.Asio for network programming. Take a look at our network programming playlist to find them: th-cam.com/play/PLJDO7P5jAoXzQvuy7UjFoDSdSy_FLqfOf.html
@@UtahCppProgrammers thanks for the response!
Boost Spirit X3 has been broken since version 1.78, and nobody is willing to fix it. I had to switch to the old Boost Spirit in my projects. Check issue 707. In brief, Spirit X3 is useless.
Boost.Parser just passed review and was accepted into boost. Boost.Parser is essentially a successor to Boost.Spirit X3. I intend to do a video on that library in the future.
@@UtahCppProgrammers Thank you for the news. I'll check it.
@@UtahCppProgrammers I tried it and found a couple of bugs. However, it looks promising. I especially like that for structure initialization, one doesn't have to use BOOST_FUSION_ADAPT_STRUCT.
@@UtahCppProgrammers Hi, in which version can I use Boost.Parser?
I make one for myself use to wasting time to trying understand what functions and classes do.
Does anybody have an example of integrating this into Waf build system?
Great stuff, thanks for the thorough guide to iwyu!
just found this channel while learning about boost. Thanks for covering!
If you printed out the ctx.run() return value in your main() would it be the count for each time you received a stream that ended in newline?
An IPv6 address is 128 bits not 64. You stated it was 4 x 16 bits. You may be thinking of the host portion of the address, but you'd need to know the full address to communicate.
Thanks for the correction!
Anyone knows what extension enables the auto replace with actual type at: th-cam.com/video/6V_lVZzV6AE/w-d-xo.html ?
That's coming from ReSharper for C++, a commercial add-on for Visual Studio. You can get a free 30 day trial here: www.jetbrains.com/resharper-cpp/ It's my favorite C++ productivity tool!
Great video with historical value. Arcane tools for arcane C++ programming style.
Use discount code CPPOnlineSLC20 for 20% off the CppOnline conference February 29th through March 2nd, 2024! cpponline.uk
Source code: github.com/LegalizeAdulthood/nntp-poco
Is there code repository available?
Source code on github: github.com/LegalizeAdulthood/comicsdb-capnproto
Is it possible to get the source code github link?
I've added a pinned comment with the link.
Thanks for the very interesting talk! Do you have experience with porting modeless dialogs from MFC to WxWidgets? We have a lot of modeless dialogs in our application where the dialog is interacting in a quite complex way with other windows (CAD drawings). Does the mentioned mfc sample handle modeless dialogs and the corresponding event handling? We are not sure, if this could work nicely if we have MFC dialoges in a WxWidget application? Thank you very much!
The main difference between dialog handling in wxWidgets vs. MFC is the way data validation and updates take place. wxWidgets uses validators and doesn't have a one-to-one facility corresponding to DDX/DDV in MFC. Otherwise, it doesn't matter where the dialog is modal or modeless.
@@UtahCppProgrammers: So do you think MFC dialoges (modal or modeless) can be integrated/merged with a wxWidget application. Could there be problems with the different event systems / dialog handling? We have a fairly large program code with more than 800 dialogs and there is a fairly strong interlocking of our interface with the viewing windows. So do you think it makes sence and is it possible to migrate the code in chunks and it is possible to release versions of the program during the migration with both MFC and wxWidgets dialoges? Or is it too error prone and it is better to eliminate all MFC code before. What would take some time of course... Thank you very much for your opinion!
Hi, Yeah, I don't know there are equivalent of ncursor in windows, I just make my console library only from escape code and I m more than 1000 lines .
pdcurses, as shown in the example code and described in the video, is a curses library for DOS/Windows.
I find the compiler errors utterly incomprehensible. It's a cool library, but after a few months of using it, I end up spending more time debugging the library than I ever would manually wiring things. I think it also promotes sloppy design because you don't think about your dependencies as much. That's probably true of every DI framework though.
#including <boost/asio.hpp> header generate bunch of errors in my code.
i have installed boost, i dont know if there is something else i should do
@@Aj_codes This presentation is about the boost string algorithm library not asio. I will add build instructions to the README on github.
Excellent! I write wxWidgets mainly from Mac OS X but porting applications to Win32 is never a problem. wxWidgets is terrific and much nicer to use than Qt.
Serial ports begins at 45m:30s.
I really appreciate the detailed, precise description on how to use this tool. Most of the times you find half assed information, that is not to the point, and "assumes" you know the "trivials". Thank you again, you helped me configure the clang formatter for visual studio 2019. ( which to my humble opinion will still not help us a lot with code clarity because the team is using CamelCase1IllIlliterateDung as standard... great_job_on_explaining_dear_human_fellow.
This video is a statement on how good ZMQ's doc is!
i am calling the async_write like this //created a buffer for my data which is around 5000 bytes and passed this in lemda, so that it will not destroy till the callback invoked. std::unique_ptr<char, DeleteChar> ptrMesssage(new char[strMessage.length() + 1],std::default_delete<char[]>()); memset(ptrMesssage.get(), 0, strMessage.length() + 1); memcpy(ptrMesssage.get(), strMessage.c_str(), strMessage.length()); boost::asio::mutable_buffer objBuff = boost::asio::buffer(ptrMesssage.get(), strlen(ptrMesssage.get())); ws_.async_write(objBuff, [this,ptrMesssage = std::move(ptrMesssage)](beast::error_code ec, std::size_t transfer) { }); actually the issue which i am facing right now is that my program is consuming more memory means ptrMesssage are created much faster then its destroy. For example:- i have send 1000 messages using async write but i received the call back for 600 messages. rest 400 are in the processing. This gap between the number of creation of message and deletion is continuously increasing as the application continue running. How should i hanlded this.
Is there asm-like for GPU as CPU.
PTX (Parallel Thread eXecution) is the assembly language for use with CUDA. When we compiled the CUDA C++ code with nvrtc without linking, the intermediate representation was PTX. The returned data is PTX text that you can examine in the debugger. PTX reference documentation: docs.nvidia.com/cuda/parallel-thread-execution/index.html
Example code: github.com/LegalizeAdulthood/nvrtc-example
Awesome!
Is ZeroMQ a good alternative to dbus?
Is there a recipe example available for restbed that can be used for Yocto projects?
Fantastic examples and very comprehensive explanations! Thanks you so much for making these videos!
One thing you haven't mentioned. If the program waits for a data to send to the server (from a user for example) and there are no asynchronous read/write operations pending, you recommended using executor_work_guard, to keep io_context.run() method busy. But what if the server closes the connection at that moment. How the program will know about this?
If you are attempting to send/receive data to/from a server and it closes the connection, your handler is invoked with an error code indicating the connection was closed. TCP/IP has a specific sequence that the socket goes through in the protocol in order to indicate that one side has closed the connection cleanly. If the other end of a socket just crashes, then you get an error code when you attempt to read or write on that connection, possibly after a timeout period (e.g. you are waiting for acknowledgement of sent data and it doesn't arrive before the timeout).
If I wanted to be notified immediately if the server closed the connection gracefully, should I always have async_read in the background? Will the async_read handler be invoked immediately with an error in such case?
@@bzdzgwa In TCP/IP, when one side closes the connection a FIN packet is sent. So if the server closes the connection, you would get this notification as an error code the next time you attempt to do anything with the connection. That's how I understand it. My advice is to write a simple program and test it out to find out what the exact behavior will be. You can use the sample code I wrote in the linked github repository to try this.
thanks <3
In the serial port example, what will happen if the incoming data doesn't have a newline character? Asio::streambuf will be allocating more and more memory and will eventually run out of it? Or the handler will be invoked with an error?
Can you help me with source of knowledges about boost::asio. Now I do my course work. And the main task is to create client-server application to send messages between clients. So, where I can read more about this topic. I ask this question because there are a lot of sources, but information there is not clear.
😂
Fantastic talk, thanks for uploading!
It's worth noting that the same developer also created **WinSafe**, A rust library which provides a modern api to the win32 library, and **windigo**, a go library which provides a modern api to the win32 library. Great developer
Could you make a boost asio video that handles the json protocol for a communication with python flask please
Don't use python! 😂
thanks for making this!
how did you make CMD divide itself by 4 in the single window? is it CMD feature or just some code to make it look like that
It's actually nuts to me how far C++ has come and it still hasn't figured out reflection, let alone serialization/deserialization. It's embarrassing considering how C++ is basically the go-to systems language while still being behind everything else. Loved this video though. Gave me lots of ideas for how I want to do serialization.
To stop an io_context from running out of work, use the executor_work_guard; this is what I was trying to remember at the end of the video :). See the documentation here: www.boost.org/doc/libs/1_81_0/doc/html/boost_asio/reference/io_context.html#boost_asio.reference.io_context.stopping_the_io_context_from_running_out_of_work