public void Put <K, V>(K key, V value, PutOption option = PutOption.Unspecific) { ISerializer <K> keySerializer = SerializerRegistry.Get <K>(); ISerializer <V> valueSerializer = SerializerRegistry.Get <V>(); Put(keySerializer.Serialize(key), valueSerializer.Serialize(value), option); }
internal static void Put(IntPtr txn, uint dbi, DbValue key, DbValue value, PutOption options) { int err = _putDelegate(txn, dbi, ref key, ref value, (uint)options); if (err != 0) { throw new MdbxException("mdbx_put", err); } }
public void ReturnTheCorrectValueOfPut(double S, double K, double t, double sigma, double r, double expectedPriceValue) { BlackScholesParametersModel inputs = new BlackScholesParametersModel(S, K, t, sigma, r); PutOption putOption = new PutOption(); OptionModel put = putOption.GetOptionData(inputs); Assert.AreEqual(expectedPriceValue, put.Value, 0.0001); }
public PutResponse Put(ByteSequence key, ByteSequence value, PutOption option) { Etcdserverpb.PutRequest request = new Etcdserverpb.PutRequest(); request.Key = key.GetByteString(); request.Value = value.GetByteString(); request.Lease = option.LeaseId; request.PrevKv = option.PrevKV; var rsp = kVClient.Put(request); PutResponse response = new PutResponse(rsp); return(response); //return Util.ToCompletableFutureWithRetry( // stub.Put(request), // new FunctionResponse<Etcdserverpb.PutRequest, PutResponse>(), // Util.IsRetriable //); }
public void Put(byte[] key, byte[] value, PutOption option = PutOption.Unspecific) { IntPtr keyPtr = Marshal.AllocHGlobal(key.Length); IntPtr valuePtr = Marshal.AllocHGlobal(value.Length); try { Marshal.Copy(key, 0, keyPtr, key.Length); Marshal.Copy(value, 0, valuePtr, value.Length); DbValue dbKey = new DbValue(keyPtr, key.Length); DbValue dbValue = new DbValue(valuePtr, value.Length); Dbi.Put(_tran._txnPtr, _dbi, dbKey, dbValue, option); } finally { Marshal.FreeHGlobal(keyPtr); Marshal.FreeHGlobal(valuePtr); } }
public void ComputeOptionsPrice() { try { if (!UsefulTools.IsBlackScholesVariablesValid(Inputs.InputParametersDict.Values.ToList())) { UpdateAppStatus("Invalid input, Please enter all five variables."); return; } CallOption callOption = new CallOption(); Call = callOption.GetOptionData(Inputs); PutOption putOption = new PutOption(); Put = putOption.GetOptionData(Inputs); UpdateAppStatus("Compute operation successfully completed."); } catch (Exception ex) { UpdateAppStatus(ex.Message); } }
private static int RunCommand(PutOption opts) { using (MediaDevice device = MediaDevice.GetDevices().FirstOrDefault(opts)) { if (device != null) { device.Connect(); string destDir = Path.GetDirectoryName(opts.Destination); if (!device.DirectoryExists(destDir)) { device.CreateDirectory(destDir); } device.UploadFile(opts.Source, opts.Destination); device.Disconnect(); } else { Console.WriteLine("No device connected."); return(1); } } return(0); }
public PutOp(ByteString key, ByteString value, PutOption option) : base(Type.PUT, key) { this.value = value; this.option = option; }
public static PutOp Put(ByteSequence key, ByteSequence value, PutOption option) { return(new PutOp(ByteString.CopyFrom(key.GetBytes()), ByteString.CopyFrom(value.GetBytes()), option)); }
private PutOption(PutOption.Builder builder) : base(builder) { }