Skip to content

Instantly share code, notes, and snippets.

@tombatron
tombatron / example.cs
Created September 1, 2021 22:43
Example of writing a JSON object and then updating a property via its JSONPath with a filter...
using System;
using System.Text.Json;
using System.Threading.Tasks;
using NReJSON;
using StackExchange.Redis;
namespace RedisJsonTest
{
class Program
{
@tombatron
tombatron / JSONPathExample.cs
Created April 30, 2022 17:57
Demonstration settings and getting JSON values within an array using JSONPath syntax with NReJSON.
// Make sure that the version of the RedisJson module that you're
// using is equal to or greater than version 20007. I'm using the
// following: redis/redis-stack-server:latest
using System.Text.Json;
using NReJSON;
using StackExchange.Redis;
// Let's define an example model instance to persist to Redis...
var example = new TestModel
@tombatron
tombatron / example.cs
Created April 21, 2023 19:58
Example Code
var vectorBytes = new byte[item.Features.Length * sizeof(float)];
Buffer.BlockCopy(item.Features, 0, vectorBytes, 0, vectorBytes.Length);
db.HashSet($"Order:{item.OrderNumber}", new []
{
new HashEntry("order_number", item.OrderNumber),
new HashEntry("quote", item.Quote),
new HashEntry("vectorized_order", vectorBytes)
});

Chinese EV Subsidies & The BYD vs. Ford Question

Initial Question

In response to a Chinese car company possibly encroaching on American firms, someone said:

"The problem is that the US has to make something. Chinese model subsidizes Chinese auto industry and other manufacturing beyond the scope of what western countries do (and we absolutely subsidize them). To hit the Chinese price point would require paying below subsistence wages and obtaining inputs at a price that can match what is essentially a vertically integrated Chinese supply chain. It won't happen. So yeah, Chinese autos would destroy US auto production regardless what management or design choices."

Something doesn't seem completely right about this. They are basically saying that the CCP subsidizes a major percentage of every car? Is that true or possible?