using System; | |
using RecordsProducer; | |
var lizard1 = new Reptile(Habitat.Terrestrial) { Name = "Agama" }; | |
var lizard2 = new Reptile(Habitat.Terrestrial) { Name = "Agama" }; | |
//use <LangVersion>latest</LangVersion> | |
var lizard3 = lizard1 with { Name = "Komodo dragon", Habitat = Habitat.Terrestrial }; |
def __init__(self): | |
self.donchian = DonchianChannels() | |
def next(self): | |
if self.data[0] > self.donchian.dch[0]: | |
self.sell() | |
elif self.data[0] < self.donchian.dcl[0]: | |
self.buy() |
"""A Simple Strategy Trading Two Stocks | |
Original code: https://blog.csdn.net/qq_26948675/article/details/80016633 | |
Modified based on: https://www.backtrader.com/blog/posts/2018-04-22-improving-code/improving-code.html | |
Replaced the local CSV files with online data from IEX. | |
Unfortunately, this strategy is not profitable for the two stocks picked. | |
""" |
using System; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace Parallel | |
{ | |
public static class EnumerableExtensions | |
{ |
import requests | |
from pandas.io.common import urlencode | |
from pandas.tseries.frequencies import to_offset | |
ALPHAVANTAGE_API_URL = "http://www.alphavantage.co/query" | |
ALPHAVANTAGE_API_KEY_DEFAULT = "demo" | |
def _init_session(session): |
using System; | |
using System.IO; | |
using System.Threading; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
using System.Collections.Generic; | |
namespace DiscordBotNew.Settings | |
{ | |
public class SettingsManager |
Redis is Database whereas RabbitMQ was designed as a message router or message-orientated-middleware (mom), so I'm sure if you look for benchmarks, you'll find that RabbitMQ will outperform Redis when it comes to message routing.
RabbitMQ is written in Erlang which was specifically designed by the telecom industry to route messages, you get clustering out of the box due to it being written in Erlang which means in a clustered environment, RabbitMQ will outperform Redis even further.
Furthermore, you get guaranteed delivery of messages due to the AMQP protocol, in other words, if the network drops while consuming the message, the consumer won't be able to say thanks for the message, so the consumer will drop the message and Rabbit will requeue the message, if you publish a message and the queue didn't say thanks to the publisher due to network problems or timeouts, Rabbit will drop the message and the publisher will keep on trying to publish the message. You can have publish retries with backoff policies, so
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?