text
stringlengths
301
426
source
stringclasses
3 values
__index_level_0__
int64
0
404k
Energy Efficiency, Blockchain, Covid-19, Woz. through technology. Thus a new era begins: a democratisation process in which everyone will finally be able to experience the benefits of energy efficiency first hand. Energy Efficiency. Reinvented. EFFORCE is the first platform that allows contributors to benefit from the energy savings generated
medium
3,544
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. Astrophysicists proposed a solution to the three-body problem inspired by statistical mechanics. Many things go by a rule of three. A trio of words often creates a satisfying flow in prose or speech; a triad of notes helps construct the feel-good harmonies in a tune; a triple deity (such as the
medium
3,546
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. Holy Trinity) prevails throughout various cultures and religions. Three is also a magical number in physics. There are three spatial dimensions, three generations of particles, and three identical bosons that comprise the exotic “Efimov state”. Throw three massive objects together, and you now have
medium
3,547
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. the “three-body problem”. The problem is the following: given three point masses under the influence of only their mutual gravitational attraction, how will their trajectories evolve if we know their initial positions and velocities? Writing in his 1687 masterpiece Principia, Isaac Newton
medium
3,548
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. formulated and solved the preceding two-body problem, where two masses are considered instead of three, with relative ease. The solutions are the familiar circular, elliptic, parabolic, or hyperbolic orbits that many physics students encounter in their first foray into celestial mechanics. Newton
medium
3,549
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. also took the first steps in tackling the three-body problem; little did he know, however, that it would remain unsolved today, over 300 years later. To be precise, the question is unsolved in the sense that no general closed-form solution (i.e. exact formula for the orbits) is known to exist.
medium
3,550
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. Nevertheless, mathematicians and physicists have chipped away at the problem for centuries by providing explicit formulas for the orbits in special cases. The list of brave pioneers who have attacked the problem — Leonhard Euler, Joseph-Louis Lagrange, Henri Poincare, to name a few — hints at the
medium
3,551
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. problem’s difficulty. A natural question arises: how is it that when we add an additional mass to the two-body case, governed under the simplicity of Newton’s laws of motion, we face such notorious adversity in predicting the trajectories? In the 1890s, Poincare discovered that the three-body
medium
3,552
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. problem exhibited chaotic dynamics. That is, the evolution of the system is random due to its extreme sensitivity to initial conditions. This leads to unpredictability in long-term, despite it being described by deterministic physical laws. Poincare thence showed that the general three-body problem
medium
3,553
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. is analytically unsolvable and provided an explanation for the difficulty even in finding exact solutions under restricted conditions. Theorists have since branched into developing techniques to generate approximate solutions as ongoing efforts searched for explicit formulas under new families of
medium
3,554
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. conditions. Such approximate methods include perturbation theory, which produces solutions expressed in an infinite series; and numerical integration, whereby finite segments of orbits are calculated on a computer. A third approach — one inspired by statistical mechanics — has also been gaining
medium
3,555
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. traction. Probable solutions In 2019, astrophysicists Nicholas Stone and Nathan Leigh from the Hebrew University of Jerusalem’s Racah Institute of Physics and Chile’s La Universidad de Concepción, respectively, derived a statistical solution to the chaotic, non-hierarchical three-body problem.
medium
3,556
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. While hierarchical regimes refer to situations where the masses or separations of the three bodies differ greatly, non-hierarchical regimes impose no such restrictions. This lack of a scale hierarchy has made analytical solutions describing a resulting orbit intractable in the latter regimes,
medium
3,557
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. compared to the former where analytic treatments exist. On the contrary, the statistical solution of Stone and Leigh takes the form of a probability distribution over a set of outcome trajectories. The key to the duo’s approach is to leverage the chaotic nature of the trinary system instead of
medium
3,558
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. being intimidated by it. In particular, chaos allows one to reasonably invoke the ergodic hypothesis, which states that the system will uniformly explore the phase space volume accessible to it over a sufficiently long time. The assumption draws parallels with the microcanonical ensemble in
medium
3,559
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. statistical physics — the three bodies being isolated from their environment is analogous to a particle system not interacting with a heat bath. “In this way, we may turn the chaotic nature of the three-body problem — which has so far frustrated general, deterministic, analytic mappings from one
medium
3,560
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. set of initial conditions to one set of outcomes — into a tool that simplifies the mapping from distributions of initial conditions to distributions of outcomes, ” they explained in their paper, published in Nature. Numerical integrations have shown that bound, non-hierarchical triple systems
medium
3,561
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. almost always disintegrate into a single escaping mass (the “escaper”) and a stable bound binary (the “surviving binary”). Considering this generic outcome, Stone and Leigh’s results built upon prior work involving similar statistical strategies dating back to 1976. Such analyses, however, were
medium
3,562
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. limited in several aspects: they yielded poor predictive power when verified against detailed numerical approaches, involved such mathematical difficulty that prevented the calculation of closed-form outcome distributions, or were only adequate for highly constrained configurations. The
medium
3,563
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. shortcomings have been attributed to several reasons. For one, early attempts failed to include the conservation of angular momentum in their derivations, which was assumed to be appropriate for low angular momentum systems. Even when such a kinetic constraint was accounted for, theorists were able
medium
3,564
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. to present a fully analytical formalism only for the special case of planar motion. Thirdly, and perhaps where Stone and Leigh made the most improvement, is that the interaction energy between the escaper and surviving binary was neglected. (a) Two-dimensional projection of the chaotic trajectories
medium
3,565
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. exhibited by three interacting bodies. An interloper star (red) encounters a binary (blue and black), forming an interacting trinary system before disintegrating in a partner swap. (b) Schematic illustration of the metastable trinary system at the moment of disintegration. Source: Stone and Leigh
medium
3,566
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. (2019) A step forward The researchers began with a general geometry and built into their formalism an interaction energy between the escaper and surviving binary, in addition to the conservation of angular momentum. Not shy to the rule of three themselves, they made three significant assumptions:
medium
3,567
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. (i) the ergodic hypothesis; (ii) that the disintegration in the triple system is instantaneous; and (iii) that the escaper sees the receding binary as a point particle. As explained earlier, assumption (i) underpins Stone and Leigh’s results. Assumption (ii) is vital in calculating the probability
medium
3,568
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. distributions from the accessible phase space. Assumption (iii) factors into the interaction between the escaper and binary. Overall, their derivation bore out of fewer premises compared to their predecessors. Working through pages of complex integrals and grueling algebra, the duo succeeded in
medium
3,569
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. producing a mathematically well-defined (that is, non-divergent) estimate of the phase space volume and ultimately a closed-form expression for the distribution of outcomes. Their distributions are also qualitatively different compared to those from past analyses. Comparing against numerical
medium
3,570
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. experiments Thus, having established appropriate presumptions and powered through the math, here comes the third act — testing the results. The pair executed this stage by conducting a series of numerical experiments and comparing the outcomes with their probability distributions. They numerically
medium
3,571
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. integrated the equations of motion starting from initial conditions that described several ensembles of non-hierarchical three-body systems. This generated ensembles of orbits from which an empirical distribution was constructed. It is here that they ran into a worrying observation. “Many of our
medium
3,572
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. [experiments] do not form resonant three-body systems, but instead resolve abruptly in a prompt exchange, where it is unlikely that the ergodic hypothesis can be applied,” they noted in their paper. A resonant three-body system describes triples that exert regular, periodic gravitational forces on
medium
3,573
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. each other over a time interval, which can place the system in a metastable state. For the ergodic hypothesis to be valid, interactions will have to unfold over several dynamical times before the system disintegrates, allowing for chaotic evolution to arise. But there must be a resolution to the
medium
3,574
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. conundrum. Indeed, Stone and Leigh found a key dynamical mechanism that helped them identify subsets of experiments exhibiting a high degree of ergodicity — the “scramble”. As frisky as its name is, a scramble is defined as a period of time when no pairwise binaries exist in the trinary system.
medium
3,575
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. This occurs when all three bodies interact so strongly with each other that they enter a phase of intense chaos. The researchers kept track of the number of scrambles throughout each integration in each ensemble and used it to filter trajectories that are suitably ‘ergodicized’. With this extra
medium
3,576
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. tool in hand, they returned to comparing their derived distributions against the numerical experiments. “We…find good agreement, so long as we restrict ourselves to ‘resonant’ encounters,” Stone and Leigh concluded in their paper. These “‘resonant’ encounters” are precisely the trajectories that
medium
3,577
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. include multiple scrambles and undergo chaotic evolution. Of course, as with any research endeavor, there are still aspects to improve upon. “In most cases we see data that match analytic predictions to leading order but also exhibit some level of higher-order structure, ” they cautioned, “The
medium
3,578
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. nature of these superimposed, second-order structures is not altogether clear.” The investigation of these features has been deferred to future work. Epilogue The duo’s findings are not only interesting from a mathematical point of view but also have substantial applications in the study of
medium
3,579
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. astrophysical processes. Three-body processes are ubiquitous in the universe and are responsible for phenomena, including planetary evolution in the solar system, binary–single star scattering in dense star clusters, and the formation of binary black holes. In particular, Stone and Leigh cite the
medium
3,580
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. study of leftover binaries produced in binary–single scattering events as a possible application of their formalism. In the arena of celestial mechanics, it seems that one’s lonely, two’s company, and three’s a chaotic crowd. As we’ve seen, chaos doesn’t just spell trouble, though — it allowed one
medium
3,581
Three Body Problem, Astrophysics, Chaos Theory, Planetary Science, Statistical Mechanics. statistical inspiration to lead two to tackle the three-body problem, bringing to the fore intriguing new results. Moreover, one can’t deny the beautiful connection the problem has threaded between brilliant thinkers through the fabric of time. Stone and Leigh now add their names to the ends of
medium
3,582
Climate, Environment, Transportation, Energy. By Laurie Mazur Our nation’s climate-changing carbon emissions have declined overall since 1990, but one sector — transportation — is headed in the opposite direction. Transportation remains the largest emitter of greenhouse gas emissions in the United States, accounting for 29 percent of the
medium
3,584
Climate, Environment, Transportation, Energy. country’s total. After a brief, pandemic-related drop of 13 percent in 2020, transportation emissions accelerated in 2021, increasing by 12 percent. But local governments and metropolitan regions have the power to bend the curve of transportation-related emissions. It is municipalities, for
medium
3,585
Climate, Environment, Transportation, Energy. example, that determine the location of jobs and housing, and therefore the length of commutes, through zoning laws and other land-use regulations. Longer, more-car-dependent commutes mean more climate-changing emissions. According to the American Council for an Energy-Efficient Economy’s (ACEEE)
medium
3,586
Climate, Environment, Transportation, Energy. just-released 2024 City Clean Energy Scorecard, 31 of the 75 cities studied have set targets to reduce their emissions from transportation. Several of those cities are actually seeing progress at reducing those emissions, and the range of approaches they are using should inspire other localities to
medium
3,587
Climate, Environment, Transportation, Energy. strive for the same. San Francisco took the top spot in the ACEEE scorecard for transportation, winning points for its excellent transit service, bike network and numerous EV charging stations. The city’s transit agency and central school district are also working to electrify their bus fleets.
medium
3,588
Climate, Environment, Transportation, Energy. Portland, Ore., came in second on transportation, in part for its efforts to reduce emissions by promoting affordable housing near public transit. Equity is central to Portland’s decarbonization efforts: The city’s Transportation Wallet program gives low-income residents an annual transit pass
medium
3,589
Climate, Environment, Transportation, Energy. preloaded with $200, membership in a bike-share program and a $75 prepaid Visa card for other transportation expenses. Oakland, Calif., which placed third, also prioritizes equity: The city favors affordable housing developments located within a third of a mile of public transit. Those cities and
medium
3,590
Climate, Environment, Transportation, Energy. others making progress on controlling transportation emissions are employing a range of strategies and approaches: Plans and targets. Cities that have successfully reduced emissions set out comprehensive plans to decarbonize mobility. San Diego’s 2015 Climate Action Plan set a 2030 target to reduce
medium
3,591
Climate, Environment, Transportation, Energy. per capita emissions from transportation, and the city is on track to achieve that goal. It is seeing per capita emissions decline by about 2.4 percent annually — one of only four cities in the report with a downward trend. According to city data, much of that decrease comes from more-efficient
medium
3,592
Climate, Environment, Transportation, Energy. vehicles and the rapid adoption of EVs, thanks in part to California’s robust incentives for EVs and chargers. Zoning changes. After World War II, zoning was used to segregate manufacturing from residential areas, while a massive investment in highways fostered sprawl. As a result, Americans
medium
3,593
Climate, Environment, Transportation, Energy. typically spend an hour getting to and from work each day, mostly by car. Many cities are rethinking that zoning model, adopting codes that encourage walkable, mixed-use, “location-efficient” communities. For example, Spokane, Wash., modified its zoning code to allow up to four units per lot in all
medium
3,594
Climate, Environment, Transportation, Energy. residential districts, allowing more people to live near employment and transit. Charlotte, N.C.’s new code eliminates parking minimums in some areas, fostering more density and encouraging transit use. Alternative ways to get around. Still, 87 percent of daily trips in the U.S. are made in private
medium
3,595
Climate, Environment, Transportation, Energy. vehicles. Investments in transit, bicycle and pedestrian infrastructure are key to turning that around. And cities can actively encourage other modes of transportation. Encouragement may take the form of incentives, like Portland’s subsidized access to transit and bike-share programs. Or it may
medium
3,596
Climate, Environment, Transportation, Energy. involve disincentives, like New York City’s congestion-pricing plan, which, if it survives legal challenges, will charge drivers for entering Manhattan’s central business district. It would reduce pollution while raising $15 billion for the city’s transit system. Similar plans are under
medium
3,597
Climate, Environment, Transportation, Energy. consideration in other cities, including Portland and Los Angeles. Efficient vehicles. Adoption of EVs and hybrids has been limited by high prices and a dearth of charging stations. Many cities are working to change that by offering incentives to purchase cleaner vehicles and by building out their
medium
3,598
Climate, Environment, Transportation, Energy. charging infrastructure. For example, Los Angeles offers a $1,500 rebate on the purchase of a used EV, with an additional $1,000 for low-income, senior or disabled customers. Denver offers rebates of up to $2,000 for homeowners to upgrade wiring and install EV chargers; the city is also working to
medium
3,599
Climate, Environment, Transportation, Energy. provide electric car-share vehicles and chargers at affordable housing in under-resourced communities. At the same time, many cities are switching their bus fleets from diesel to electric. Efficient freight systems. Fully 30 percent of transportation emissions come from the trucks that ferry
medium
3,600
Climate, Environment, Transportation, Energy. freight into and out of our cities. As such, efficient freight is an important — and underutilized — opportunity to reduce emissions. Successful strategies include truck-loading plans that utilize space more efficiently, last-mile delivery solutions (such as bicycle deliveries) and off-hour
medium
3,601
Climate, Environment, Transportation, Energy. delivery programs. Open data portals can boost efficiency by providing real-time information that helps freight carriers reduce congestion and idling. Oakland, for example, has a sustainable freight plan and an open data portal, and is working to replace diesel-fueled cargo handling equipment with
medium
3,602
Climate, Environment, Transportation, Energy. cleaner alternatives. The carbon-spewing cities we inhabit today were not inevitable, and they are not immutable. Our cities were shaped by decades’ worth of decisions on transit, land use and more. Today, local governments must make different decisions. Of course, cities can’t do it alone;
medium
3,603
Climate, Environment, Transportation, Energy. transportation policies are often shaped by states and regional planning organizations. But local governments can build on the efforts of those larger jurisdictions. In this way, we can bend the curve of carbon emissions while making our cities greener, fairer and easier to navigate. Laurie Mazur
medium
3,604
Climate, Environment, Transportation, Energy. is the editor of the Island Press Urban Resilience Project, which is supported by The Kresge Foundation and The JPB Foundation. This article was published in collaboration with the Island Press Urban Resilience Project, which is supported by The Kresge Foundation and The JPB Foundation. It was
medium
3,605
Golang, Go, Software Development, Microservices, Networking. Hi, everyone. In this article, I present working with the built-in Go net/http library to create HTTP clients without using external libraries like restyor requests . Go 1.22 adds many new features to allow developers to write modular code while writing HTTP clients and servers. In this article, we
medium
3,607
Golang, Go, Software Development, Microservices, Networking. are more interested in writing different clients using native Go libraries. Let’s jump into action by building a simple HTTP client. Note: Please note I interchange words object and instance for struct instances. HTTP Go Client & Variations An HTTP client makes an HTTP request to an HTTP server.
medium
3,608
Golang, Go, Software Development, Microservices, Networking. Curl is a well-known, language-agnostic HTTP client used by hundreds of thousands of developers world wide. Let’s see different variations of HTTP clients from hereon. A Hello World client — variant 1 Go already ships a well-designed client in the standard library, and we can make an HTTP Get
medium
3,609
Golang, Go, Software Development, Microservices, Networking. request to an endpoint using http.getfunction. simple client architecture The prog_01.goprogram imports the net/http package and uses a function called Get to make an HTTP request to the domain: https://httpbin.org to a path /get. This function is quick and easy, but in the real world HTTP, clients
medium
3,610
Golang, Go, Software Development, Microservices, Networking. are complex. They need to configure HTTP headers, set a timeout, or configure query parameters, etc. We will see options available in Go to make real-world HTTP requests. Improved client with a custom timeout — variant 2 To improve the previous client, let’s take a different approach. Create a
medium
3,611
Golang, Go, Software Development, Microservices, Networking. *http.Client instance and add a timeout of 5 seconds. This is to avoid the client indefinitely hanging on the HTTP server. This cannot be done with a simple client. We should use http.Client struct and call a Get method. client struct architecture This version of the client is slightly different
medium
3,612
Golang, Go, Software Development, Microservices, Networking. from the previous version. Here, we are instantiating a struct called http.Client and configuring properties on it. One of the properties is Timeout which specifies the time.Duration type. Because duration is not a native Go type (int32, int64), we need to convert the integer to duration by
medium
3,613
Golang, Go, Software Development, Microservices, Networking. multiplying with time.Duration. This client has the same functionality as the hello-world one but with a time out. Why set timeout on a HTTP request ? Setting a timeout on a client request is a good practice and provides a quick feedback loop to client if a server is overloaded or protected by a
medium
3,614
Golang, Go, Software Development, Microservices, Networking. firewall. You can checkout this great article by Zalando to know the importance of setting timeouts. https://engineering.zalando.com/posts/2023/07/all-you-need-to-know-about-timeouts.html Quoting the relevant suggestion from article: The default timeout is your enemy, always set timeouts
medium
3,615
Golang, Go, Software Development, Microservices, Networking. explicitly! As you saw with the `Timeout`, you need to set the properties of the client. Let’s go a level deeper to customize a HTTP request. Advance the client with configurable Requests — variant 3 We can even configure a client at the request level. There is a constructor function called
medium
3,616
Golang, Go, Software Development, Microservices, Networking. http.NewRequest to create a *http.Requestand pass it to the client do method like the below. We can also attach HTTP headers on that request with the `req.Header.add` method. The returned response object will have a reference to the original request. Configure a client with request In this variant,
medium
3,617
Golang, Go, Software Development, Microservices, Networking. we are manually creating an HTTP Request, and using the client’s do method to request on-demand. This means we can create a request at a prior time, before doing an actual request. Also, we can: Modify the client & requests on-demand Keep client fixed, and change requests on demand Anyway, this
medium
3,618
Golang, Go, Software Development, Microservices, Networking. provides greater flexibility to the initial version of http.Get. We can go a level deeper to control how idle connections are handled for a given client. This is helpful to create a pool of connections for a given client to utilize for multiple requests. Make HTTP requests with a configurable
medium
3,619
Golang, Go, Software Development, Microservices, Networking. transport — variant 4 A Transport defines how idle connections are handled for a given HTTP client like the number of maximum idle connections allowed, Maximum idle connections per host, or idle Connection Timeout, etc. These transport options can be defined once on a client to reuse them across
medium
3,620
Golang, Go, Software Development, Microservices, Networking. multiple requests. We can create a new transport directly using *http.Transport struct (no constructor required). Let’s see how to make the same request as the previous one but using a Transport. configure client with a request & a transport architecture In prog_04.go, we create and plug an HTTP
medium
3,621
Golang, Go, Software Development, Microservices, Networking. Transport into a Client instance. The rest is the same as the previous example. As you can see from line numbers: 12–14, transport is defining hard limits to `keep-alive` connections spawned by client. Next. let’s see how to make a CA certificate verification in a Go client. Setting client
medium
3,622
Golang, Go, Software Development, Microservices, Networking. TLSConfig for trusted CA verification — variant 5 TLS (Transport Layer Security) is a security protocol that powers HTTPS encryption. All HTTPS servers use SSL certificates issued by a standard CA (Certificate Authority). For example, httpbin.org got its certificate signed by Amazon Root
medium
3,623
Golang, Go, Software Development, Microservices, Networking. Certificate Authority. We can enhance client security and stop middle-man attacks by verifying the server CA certificate ourselves. For that, export the certificate of https://httpbin.org server to httpbin.cer and place it in your client program directory. You can also load it over the network
medium
3,624
Golang, Go, Software Development, Microservices, Networking. instead of a local filesystem (for dynamic certs). We can create a quick function that parses an x509 certificate (Public key) and returns a certificate pool. The getCertPool function uses the crypto/x509 package to parse a given certificate file and adds the parsed certificate to the pool. If we
medium
3,625
Golang, Go, Software Development, Microservices, Networking. need to verify multiple hosts, we can add those host certificates to the same pool. This pool should be wrapped into a TLS config object and passed to the TLSClientConfig struct field of an http Transport (Line No: 48 in prog_05.go) Cert pool architecture Verify Private CA certificates generated
medium
3,626
Golang, Go, Software Development, Microservices, Networking. for a local server leveraging the above technique. This concludes the 5 variations of using a built-in net/http package to make HTTP requests. The Do method allows one to perform different types of methods (GET, POST, PUT, PATCH, HEAD, DELETE, and OPTIONS) Once again, the Libraries like restyand
medium
3,627
Golang, Go, Software Development, Microservices, Networking. requests are built to reduce boilerplate in Go code but can abstract important details about how things work underneath. This article is one such attempt to visualize how the `net/http` package can be used to create different types of HTTP/S requests in Go. Now lookup source code of any third-party
medium
3,628
Golang, Go, Software Development, Microservices, Networking. library and everything will make sense 😎 with knowledge of net/http . That’s another way of learning the package. Resources https://pkg.go.dev/net/http https://pkg.go.dev/crypto/tls https://pkg.go.dev/crypto/x509 https://stackoverflow.com/a/67084619/3229128
medium
3,629
Programming, Software Development, Coding, Python, Data Driven Fiction. Python is a powerful programming language used for a variety of applications. While many of its features are well-known, there are some hidden gems that are less commonly known. In this article, we will explore the top 10 less known features in Python. Walrus Operator Photo by Chris Ried on
medium
3,631
Programming, Software Development, Coding, Python, Data Driven Fiction. Unsplash The Walrus Operator, also known as the “assignment expression,” is a new feature introduced in Python 3.8. It allows you to assign a value to a variable as part of an expression. For example, you can use it to simplify code like this: n = int(input()) if n > 10: print(n) to this: if (n :=
medium
3,632
Programming, Software Development, Coding, Python, Data Driven Fiction. int(input())) > 10: print(n) Type Hints Type hints are a way of indicating the expected type of a variable or function argument in Python. They were introduced in Python 3.5 and can help improve the readability and maintainability of your code. For example: def greet(name: str) -> str: return
medium
3,633
Programming, Software Development, Coding, Python, Data Driven Fiction. "Hello, " + name Context Managers Context managers allow you to manage resources in Python, such as files or network connections, in a safe and efficient way. They are used with the with statement and ensure that resources are properly closed when they are no longer needed. For example: with
medium
3,634
Programming, Software Development, Coding, Python, Data Driven Fiction. open("file.txt") as f: content = f.read() Enumerations Photo by Alex Chumak on Unsplash Enumerations are a way of defining a set of named values in Python. They were introduced in Python 3.4 and can help improve the readability and maintainability of your code. For example: from enum import Enum
medium
3,635
Programming, Software Development, Coding, Python, Data Driven Fiction. class Color(Enum): RED = 1 GREEN = 2 BLUE = 3 Underscores in Numeric Literals In Python 3.6 and later, you can use underscores in numeric literals to improve their readability. For example: one_million = 1_000_000 Extended Iterable Unpacking Extended iterable unpacking allows you to assign multiple
medium
3,636
Programming, Software Development, Coding, Python, Data Driven Fiction. values to multiple variables at once in Python. It was introduced in Python 3.0 and can help simplify your code. For example: first, *middle, last = [1, 2, 3, 4, 5] F-Strings F-strings, also known as formatted string literals, are a way of creating strings that include variables in Python. They
medium
3,637
Programming, Software Development, Coding, Python, Data Driven Fiction. were introduced in Python 3.6 and can help improve the readability of your code. For example: name = "John" age = 30 print(f"My name is {name} and I am {age} years old.") defaultdict The defaultdict is a subclass of Python’s built-in dictionary that provides a default value for keys that do not
medium
3,638
Programming, Software Development, Coding, Python, Data Driven Fiction. exist. It can help simplify your code by eliminating the need for if statements. For example:py from collections import defaultdict d = defaultdict(int) d["foo"] += 1 functools.lru_cache The lru_cache decorator in Python's functools module provides a way to cache the results of a function for
medium
3,639
Programming, Software Development, Coding, Python, Data Driven Fiction. improved performance. It can help speed up your code by avoiding unnecessary calculations. For example: from functools import lru_cache @lru_cache(maxsize=None) def fib(n): if n <= 1: return n return fib(n-1) + fib(n-2) sys.intern The sys.intern function in Python allows you to cache strings for
medium
3,640
Programming, Software Development, Coding, Python, Data Driven Fiction. improved memory efficiency. pythonCopy code import sys # Define two strings with the same value string1 = "hello world" string2 = "hello world" # Check if the two strings are the same object in memory if string1 is string2: print("string1 and string2 are the same object in memory") else:
medium
3,641
Programming, Software Development, Coding, Python, Data Driven Fiction. print("string1 and string2 are different objects in memory") # Use sys.intern to cache the strings string1 = sys.intern(string1) string2 = sys.intern(string2) # Check if the two strings are the same object in memory after interning if string1 is string2: print("string1 and string2 are the same
medium
3,642
Programming, Software Development, Coding, Python, Data Driven Fiction. object in memory after interning") else: print("string1 and string2 are different objects in memory after interning" In this code, we define two strings with the same value ("hello world") and check if they are the same object in memory. Since strings are immutable in Python, the interpreter may
medium
3,643
Programming, Software Development, Coding, Python, Data Driven Fiction. optimize by storing both strings in the same location in memory. However, we can use sys.intern to force the interpreter to cache the strings, ensuring that they are the same object in memory. After calling sys.intern on the two strings, we check if they are the same object in memory using the is
medium
3,644
Programming, Software Development, Coding, Python, Data Driven Fiction. keyword. If they are, we print a message indicating that they are the same object after interning. If not, we print a message indicating that they are different objects after interning. Buy some cool fashion products and electronic gadgets from future — FadinGeek Store FadinGeekfadingeek.org That
medium
3,645
Programming, Software Development, Coding, Python, Data Driven Fiction. being said, I’ll be making more such videos on YouTube. If you feel like contributing to me, feel free to do so at Patreon and follow my socials for more content. I’ll catch you asap. You’re Awesome :) FadinGeek Become a writer AI-power for digital ART how to submit ? Data-Driven Fictionmedium.com
medium
3,646
Technology, Artificial Intelligence, Machine Learning, Data Science, Deep Learning. Towards a geometric understanding of Spatio Temporal Graph Convolution Networks(arXiv) Author : Pratyusha Das, Sarath Shekkizhar, Antonio Ortega Abstract : Spatiotemporal graph convolutional networks (STGCNs) have emerged as a desirable model for skeleton-based human action recognition. Despite
medium
3,647