• 12.3 million of concurrent WebSockets

    One thing about WebSockets is that you need a lot of resources on the client's side to generate high enough load for the server to actually eat up all the CPU resources.

    There are several challenges you have to overcome because the WebSockets protocol is more CPU demanding on the client's side than on the server's side. At the same time you need a lot of RAM to store information about open connections if you have millions of them.

    I've been lucky enough to get a couple of new servers for a limited period of time at my disposal for the hardware "burnout" tests. So I decided to use my Lua Application Server — LAppS to do both jobs: test the hardware and perform the LAppS high load tests.

    Read more →
  • Best Copy-Paste Algorithms for C and C++. Haiku OS Cookbook

      Numerous typos and Copy-Paste code became the main topic of the additional article about checking the Haiku code by the PVS-Studio analyzer. Yet this article mostly tells about errors related to thoughtlessness and failed refactoring, rather than to typos. The errors found demonstrate how strong the human factor is in software development.

      Picture 1
      Read more →
    • How to shoot yourself in the foot in C and C++. Haiku OS Cookbook

        The story of how the PVS-Studio static analyzer and the Haiku OS code met goes back to the year 2015. It was an exciting experiment and useful experience for teams of both projects. Why the experiment? At that moment, we didn't have the analyzer for Linux and we wouldn't have it for another year and a half. Anyway, efforts of enthusiasts from our team have been rewarded: we got acquainted with Haiku developers and increased the code quality, widened our error base with rare bugs made by developers and refined the analyzer. Now you can check the Haiku code for errors easily and quickly.
        Picture 1

        Read more →
      • 50 Best Sources on Product Management to Read, Listen and Watch

          Young product managers aim to rapidly learn the fundamentals of their role and master the craft. However, there are no magic power, specific book or a class that can give you 100% of professional mastery.

          You want it all, you want it now. But it will surely take some time to make you a product management guru. This post contains a set of relevant resources about product management for those who prefer to read, listen and watch.

          Read more →
          • +10
          • 9.2k
          • 2
        • What's the Use of Dynamic Analysis When You Have Static Analysis?

            In order to verify the quality of software, you have to use a lot of different tools, including static and dynamic analyzers. In this article, we'll try to figure out why only one type of analysis, whether static or dynamic, may not be enough for comprehensive software analysis and why it's preferable to use both.

            Рисунок 1

            Read more →
          • “Maybe” monad through async/await in C# (No Tasks!)

              Generalized async return types — it is a new C#7 feature that allows using not only Task as a return type of async methods but also other types (classes or structures) that satisfy some specific requirements.

              At the same time, async/await is a way to call a set of "continuation" functions inside some context which is an essence of another design pattern — Monad. So, can we use async/await to write a code which will behave in the same way like if we used monads? It turns out that — yes (with some reservations). For example, the code below is compilable and working:

              async Task Main()
                foreach (var s in new[] { "1,2", "3,7,1", null, "1" })
                    var res = await Sum(s).GetMaybeResult();
                    Console.WriteLine(res.IsNothing ? "Nothing" : res.GetValue().ToString());
                // 3, 11, Nothing, Nothing
              async Maybe<int> Sum(string input)
                  var args = await Split(input);//No result checking
                  var result = 0;
                  foreach (var arg in args)
                      result += await Parse(arg);//No result checking
                  return result;
              Maybe<string[]> Split(string str)
                var parts = str?.Split(',').Where(s=>!string.IsNullOrWhiteSpace(s)).ToArray();
                return parts == null || parts.Length < 2 ? Maybe<string[]>.Nothing() : parts;
              Maybe<int> Parse(string str)
                  => int.TryParse(str, out var result) ? result : Maybe<int>.Nothing();

              Further, I will explain how the code works...

              Read more →
            • Ads
              AdBlock has stolen the banner, but banners are not teeth — they will be back

            • How to use PHP to implement microservices?


                Why should talk service governance?

                With the increasing popularity of the Internet, the traditional MVC architecture has become more and more bloated and very difficult to maintain as the scale of applications continues to expand.

                We need to take actions to split a large system into multiple applications according to business characteristics. For example, a large e-commerce system may include user system, product system, order system, evaluation system, etc., and we can separate them into multiple individual applications. The characteristics of multi-application architecture are applications run independently and they are unable to call each other.

                Read more →
              • Finally, rejuvenation is a thing


                  What is ageing? We can define ageing as a process of accumulation of the damage which is just a side-effect of normal metabolism. While researchers still poorly understand how metabolic processes cause damage accumulation, and how accumulated damage causes pathology, the damage itself – the structural difference between old tissue and young tissue – is categorized and understood pretty well. By repairing damage and restoring the previous undamaged – young – state of an organism, we can really rejuvenate it! It sounds very promising, and so it is. And for some types of damage (for example, for senescent cells) it is already proved to work!

                  Today in our virtual studio, somewhere between cold, rainy Saint-Petersburg and warm, sunny Mountain View, we meet Aubrey de Grey, again! For those of you who are not familiar with him, here is a brief introduction.
                  Read more →
                • Announcing XAML Hot Reload for Xamarin.Forms

                    Today at Xamarin Developer Summit, we announced XAML Hot Reload for Xamarin.Forms, which enables you to make changes to your XAML UI and see them reflected live, without requiring another build and deploy.

                    XAML Hot Reload for Xamarin.Forms speeds up your development and makes it easier to build, experiment, and iterate on your user interface. And this means that you no longer have to rebuild your app each time you tweak your UI – it instantly shows you your changes in your running app!

                    When your application is compiled using XAML Hot Reload, it works with all libraries and third-party controls. It will be available for iOS and Android in Visual Studio 2019 and Visual Studio 2019 for Mac. This works on all valid deployment targets, including simulators, emulators, and physical devices.

                    XAML Hot Reload will be available later in 2019, but you can sign up to to participate in the preview phase:

                    Sign Up for the Preview Now

                    Read more →
                  • Detecting in C++ whether a type is defined: Predeclaring things you want to probe

                      Last time, we used SFINAE to detect whether a type had a definition, and we used that in combination with if constexpr and generic lambdas so that code could use the type if it is defined, while still being accepted by the compiler (and being discarded) if the type is not defined.

                      However, our usage had a few issues, some minor annoyance, some more frustrating.

                      • You had to say struct all the time.
                      • If the type didn’t exist, the act of naming it caused the type to be injected into the current namespace, not the namespace you expected the type to be in.
                      • You must use the struct technique with an unqualified name. You can’t use it to probe a type that you didn’t import into the current namespace.

                      We can fix all three of the problems with a single solution: Predeclare the type in the desired namespace.

                      Read more →
                    • 5 Methods to Run an Effective Brainstorm

                        Successful decisions are being achieved by the efforts of individuals. Their collaboration is the key to success. No matter if they have won a basketball champ or released a new software product.

                        Where does the team path to success begin? In this post, we share ten essential tips on how to improve team meeting discussions and describe five powerful methods that accelerate brainstorming sessions. IT professionals, this will perfectly suit you too.

                        Read more →
                      • Configuration file htaccess

                        Let’s begin from a far distance with the goal that the novices can see how the file described in the article works. To work the website on the Internet, you need not just a PC and access to the network, yet additionally, extraordinary programming introduced on it, which gives access to information utilizing the HTTP and HTTPS conventions. This product is the web server. There are different sorts of web servers, however, the most widely recognized is Apache. It is based on the open-source code, free, is continually being improved and enhanced, compatible with many scripts, and works on almost all platforms, including Windows, Linux, Netware 5.x.
                        Read more →
                      • Checklist for writing great Visual Studio extensions

                          Great Visual Studio extensions share a few key features that sets them apart from the rest. They look and feel well crafted, are performant and reliable, do what they advertise to perfection, and blend in naturally among Visual Studio’s own features.

                          To make it easier to write great extensions, we’ve worked with the extensibility community to come up with a simple checklist to follow. There’s even a GitHub issue template you can use so you remember to go through the checklist.

                          Read more →
                        • A declarative data-processing pipeline on top of actors? Why not?

                            Some time ago, in a discussion on one of SObjectizer's releases, we were asked: "Is it possible to make a DSL to describe a data-processing pipeline?" In other words, is it possible to write something like that:

                            A | B | C | D

                            and get a working pipeline where messages are going from A to B, and then to C, and then to D. With control that B receives exactly that type that A returns. And C receives exactly that type that B returns. And so on.

                            It was an interesting task with a surprisingly simple solution. For example, that's how the creation of a pipeline can look like:

                            auto pipeline = make_pipeline(env, stage(A) | stage(B) | stage(C) | stage(D));

                            Or, in a more complex case (that will be discussed below):

                            auto pipeline = make_pipeline( sobj.environment(),
                                    stage(validation) | stage(conversion) | broadcast(
                                        stage(range_checking) | stage(alarm_detector{}) | broadcast(
                                            stage( []( const alarm_detected & v ) {
                                                    alarm_distribution( cerr, v );
                                                } )
                                        ) );

                            In this article, we'll speak about the implementation of such pipeline DSL. We'll discuss mostly parts related to stage(), broadcast() and operator|() functions with several examples of usage of C++ templates. So I hope it will be interesting even for readers who don't know about SObjectizer (if you never heard of SObjectizer here is an overview of this tool).

                            Read more →
                          • Write Better Code Faster with Roslyn Analyzers

                              Roslyn, the .NET compiler platform, helps you catch bugs even before you run your code. One example is Roslyn’s spellcheck analyzer that is built into Visual Studio. Let’s say you are creating a static method and misspelled the word static as statc. You will be able to see this spelling error before you run your code because Roslyn can produce warnings in your code as you type even before you’ve finished the line. In other words, you don’t have to build your code to find out that you made a mistake.

                              Roslyn analyzers can also surface an automatic code fix through the Visual Studio light bulb icon that allows you to fix your code immediately.

                              Read more →
                            • 14 Best Kanban Board Tools in 2019

                                When it comes to optimizing overwhelmed daily workloads, to-do lists may not cope. In this case, it's worth to look for something that will keep track of all tasks your team is working on and tasks that are yet to be started, as well as to show the full picture of all the tasks that are completed.

                                A powerful Kanban board is the solution. This excellent project collaboration tool is widely used in software development, digital marketing, construction, innovative solutions and among other cases where there is a steady workflow of tasks. The Kanban approach helps teams to visualize workflow, analyze processes and achieve greater task management efficiencies. In this post, we describe 14 Kanban tools with advanced features. Compare them and choose the best one right for your needs!

                                Read more →
                              • PHP microservices framework — Swoft 2.0.3 published


                                What is Swoft?

                                Swoft is a PHP microservices coroutine framework based on the Swoole extension. Like Go, Swoft has a built-in coroutine web server and a common coroutine client and is resident in memory, independent of traditional PHP-FPM. There are similar Go language operations, similar to the Spring Cloud framework flexible annotations, powerful global dependency injection container, comprehensive service governance, flexible and powerful AOP, standard PSR specification implementation and so on.

                                Through three years of accumulation and direction exploration, Swoft has made Swoft the Spring Cloud in the PHP world, which is the best choice for PHP's high-performance framework and microservices management.

                                Elegant service governance

                                Swoft officially recommends that developers use service mesh patterns, such as the Istio/Envoy framework, to separate business and service governance, but Swoft also provides a set of microservices components for small and medium-sized businesses to quickly build microservices.

                                Read more →