Wikipedia

Search results

11 February 2021

Sort directories by size in OSX

 In the Terminal application we'll be using the du command.



Let's specify depth as one so to avoid listing files and subdirectories, and the output in gigabytes. I know this particular folder is roughly 9 gigabytes overweight, and I'm looking for a > 5g whale.

Before that, let's pipe it to a sort operation to list directories by size in descending order with sort. This will take the -n option to sort by number and -r to list in reverse (descending) order.


Found it!





31 August 2020

Establishment Media

The bias from news and political shows, including John Oliver and Trevor Noah, are completely one sided in an eery chorus that holds an eery pitch on one wavelength.

What's going on is absolutely insane. These people promote GoFundMe donations for white supremacist, bolshevik and/or neonazi, serial pedophiles, yet fail to mention their carrying of guns during riots, nor the murders they cause.

This was starkly voiced during the time of Mr. Dorn's murder. However, the establishment media, with all infinite possibilities of having different voices and opinions (tunes), continues their chorus. It's been a recent symphony during the past 4 years Nancy Pelosi has been continuing to drive war and other questionable expenditures, and without said establishment media scrutinizing in any appreciable manner.

09 July 2020

Collage




To Show just how much in common countries have with one another.


21 April 2020

Network load performance between Starlette and Flask with urllib3, requests, and httpx clients

Flask and Starlette performance with urllib3, requests, and httpx

Source code available at https://github.com/aug2uag/starlette-flask-benchmark

The purpose of this benchmark was to evaluate the performance difference under load for a Flask and Starlette microframework with various popular HTTP clients.

These benchmark results were from 1000 cycles.

Results

Flask @ 1000 cycles (testing smaller JSON response)
urllib3:     6.009076181
requests:    8.310135888
httpx:       14.922275728
Flask @ 1000 cycles (testing larger text response)
urllib3:     6.489965677
requests:    7.959935096000001
httpx:       15.216326602
Starlette @ 1000 cycles (testing smaller JSON response)
urllib3:     6.489965677
requests:    7.959935096000001
httpx:       15.216326602
Starlette @ 1000 cycles (testing larger text response)
urllib3:     0.861392250999998
requests:    7.092012402999998
httpx:       12.933335759999999
HTTP libraries
Across the board, the httpx library underperformed relative to requests and urllib3. This might be because the httpx.get method is not benefiting from its async capabilities. The most efficient library of the three was consistently urllib3, followed by the requests library.

The size difference in the request body in this experiment had little or no effect, and indicates the difference in the request bodies was nominal.
Frameworks
Both Flask and Starlette are similar in implementation. Flask is more focused on delivering a full-stack experience, while Starlette is organized to be more biased towards headless services.

The performance of Starlette was modestly more good relative to the requests library. However, Starlette was significantly more performant with urllib3.


Discussion


The urllib3 results for Starlette may be indicating failure, although the server logs looked Ok-- the performance of urllib3 with Starlette is simply unbelievable. Starlette and Python 3 are optimized with subroutines, which may explain the dramatic differences between Flask and Starlette in their performance with urllib3 in case it is working. In that case there are clear multithreading capabilities at work that are stratespherically advantageous to utilize in high performance network I/O applications written in Python. Whereas Flask utilizes WGSI, Starlette implements ASGI that seems to be on its way for taking over Python internet gateways.

Therefore, Starlette with ASGI has superior advantages over Flask for microframework architectures.

08 November 2019

Global Constants in Rust

It's really straight forward.

static WORLD: &'static str = "Foo";
static NUMBA: i32 = 143;

fn main() {
    // Access constant in the main thread
    if NUMBA > 0 {
        println!("Hello {}", WORLD);
    }
}

outputs:

$ ./target/debug/js_stack
Hello Foo

17 October 2019

OSX broken pip and virtualenv after brew update

Working on a new project and needed to download some new brew packages that ended up breaking my virtualenv.

This is how I got it back to speed:


xcode-select --install
rm '/usr/local/bin/pip'
# or 
# mv /usr/local/bin/pip /usr/local/bin/pip.old

sudo /usr/bin/easy_install pip
sudo pip install virtualenv --upgrade

06 October 2019

Newton Raphson method to solve roots of higher-degree equations

Roots of High-Degree Equations

Equations can be polynomials, radicals, trigonometric, logarithmic, and other.

Simplest example is the quadratic function. More complex equations will often require numerical methods to solve.


Newton Raphson Method algorithm:

- similar to Simple Iteration except it handles the equation as a function, not a rearrangement
- first step is to put the equation as a function
- second step is to calculate the first derivative of the function
- third step is to iterate as the simple iteration method

This method is an optimization of the simple iteration method.


for example:

'''
for equation:
x^3 - x^2 + 7 = 10
x^3 - x^2 - 3 = 0

derivative
3x^2 - 2x = 0

Newton Raphson equation:

y = x - (x^3 - x^2 - 3) / (3x^2 - 2x)

'''

x = 2 # initial guess, derive multiple roots with different guesses
for i in range(100):
y = x - (x^3 - x^2 - 3) / (3x^2 - 2x)
if x == y: # or within tolerable range
break
x = y

# y now approximates the value of the root