Beispiel #1
0
 internal static long Add(long a, long b)
 {
     return(a + b);
 }
Beispiel #2
0
 public SimulationObject GetObject(long A_0) => _internal.a((long)A_0);
Beispiel #3
0
 public SeiyuuBuilder WithMalId(long malId)
 {
     _malId = malId;
     return(this);
 }
Beispiel #4
0
 PurchaseInfo(PurchaseTypes purchaseType, int itemId, string description, short purchaseId, long price)
 {
     PurchaseType    = purchaseType;
     PurchaseItemId  = itemId;
     PurchaseGroupId = purchaseId;
     Description     = description;
     Price           = price;
 }
Beispiel #5
0
 public static Stream PUT(Uri uri, long ContentLength, bool timeout, bool do_log)
 {
     if (do_log)
         log.DebugFormat("HTTP PUTTING file to {0}", uri);
     return HTTP.PUT(uri, XenAdminConfigManager.Provider.GetProxyFromSettings(null), ContentLength, XenAdminConfigManager.Provider.GetProxyTimeout(timeout));
 }
Beispiel #6
0
 /** <inheritdoc /> */
 public IAtomicSequence GetAtomicSequence(string name, long initialValue, bool create)
 {
     return _ignite.GetAtomicSequence(name, initialValue, create);
 }
Beispiel #7
0
 public static PurchaseInfo NewFeature(short groupId, int itemId, string description, long price)
 {
     return(new PurchaseInfo(PurchaseTypes.Feature, itemId, description, groupId, price));
 }
Beispiel #8
0
 public static List <T> SkipTake(long skip, long take, string sql, params object[] args)
 {
     return(repo.SkipTake <T>(skip, take, sql, args));
 }
Beispiel #9
0
 public static List <T> SkipTake(long skip, long take, Sql sql)
 {
     return(repo.SkipTake <T>(skip, take, sql));
 }
Beispiel #10
0
 public static List <T> Fetch(long page, long itemsPerPage, string sql, params object[] args)
 {
     return(repo.Fetch <T>(page, itemsPerPage, sql, args));
 }
Beispiel #11
0
 public static List <T> Fetch(long page, long itemsPerPage, Sql sql)
 {
     return(repo.Fetch <T>(page, itemsPerPage, sql));
 }
Beispiel #12
0
 internal static long Divide(long a, long b)
 {
     return(a / b);
 }
Beispiel #13
0
 internal static long Multiply(long a, long b)
 {
     return(a * b);
 }
Beispiel #14
0
 internal static long Subtract(long a, long b)
 {
     return(a - b);
 }
Beispiel #15
0
 /** <inheritdoc /> */
 public ICollection<IClusterNode> GetTopology(long ver)
 {
     return _ignite.GetCluster().GetTopology(ver);
 }
Beispiel #16
0
 public static Page <T> Page(long page, long itemsPerPage, string sql, params object[] args)
 {
     return(repo.Page <T>(page, itemsPerPage, sql, args));
 }
Beispiel #17
0
 /** <inheritdoc /> */
 public IAtomicLong GetAtomicLong(string name, long initialValue, bool create)
 {
     return _ignite.GetAtomicLong(name, initialValue, create);
 }
Beispiel #18
0
 public static Page <T> Page(long page, long itemsPerPage, Sql sql)
 {
     return(repo.Page <T>(page, itemsPerPage, sql));
 }
Beispiel #19
0
 public BinaryState(long sessionId, bool isTrue)
 {
     this      = default(BinaryState);
     SessionId = sessionId;
     IsTrue    = isTrue;
 }
        private async Task AddUserLogAsync(long userId, LogType logType)
        {
            var addUserLogModel = new AddUserLogModel(userId, logType);

            await UserLogApplicationService.AddAsync(addUserLogModel);
        }
Beispiel #21
0
 public static PurchaseInfo NewSubscription(short groupId, int itemId, string description, long price, long duration)
 {
     return(new PurchaseInfo(itemId, description, groupId, price, duration));
 }
 public async Task<UserModel> SelectAsync(long userId)
 {
     return await UserRepository.SelectAsync<UserModel>(userId);
 }
Beispiel #23
0
 PurchaseInfo(int itemId, string description, short purchaseId, long price, long duration) : this(PurchaseTypes.Subscription, itemId, description, purchaseId, price)
 {
     Duration = duration;
 }
Beispiel #24
0
 public CurrentCount(string key, long count)
 {
     this.Key = key;
     this.Count = count;
 }
        static void Main(string[] args)
        {
            string number = Console.ReadLine();
            string result = "";
            bool canFit = false;

            try
            {
                sbyte checkNum = sbyte.Parse(number);
                result += "* sbyte\r\n";
                canFit = true;
            }
            catch { }

            try
            {
                byte checkNum = byte.Parse(number);
                result += "* byte\r\n";
                canFit = true;
            }
            catch { }

            try
            {
                short checkNum = short.Parse(number);
                result += "* short\r\n";
                canFit = true;
            }
            catch { }

            try
            {
                ushort checkNum = ushort.Parse(number);
                result += "* ushort\r\n";
                canFit = true;
            }
            catch { }

            try
            {
                int checkNum = int.Parse(number);
                result += "* int\r\n";
                canFit = true;
            }
            catch { }

            try
            {
                uint checkNum = uint.Parse(number);
                result += "* uint\r\n";
                canFit = true;
            }
            catch { }

            try
            {
                long checkNum = long.Parse(number);
                result += "* long\r\n";
                canFit = true;
            }
            catch { }

            if (canFit)
            {
                Console.WriteLine($"{number} can fit in:\r\n{result}");
            }
            else
            {
                Console.WriteLine($"{number} can't fit in any type");
            }
        }
Beispiel #26
0
 public Counter(string key, long initialValue)
 {
     this.key = key;
     this.count = initialValue;
 }
Beispiel #27
0
 private void RunWriteQueueAction()
 {
     //Dequeue all items until threshold is passed
     long totalLength = 0;
     RecyclableMemoryStream stream = null;
     var streamIdsAvailable = true;
     while (totalLength < CoalescingThreshold)
     {
         OperationState state;
         if (!_writeQueue.TryDequeue(out state))
         {
             //No more items in the write queue
             break;
         }
         short streamId;
         if (!_freeOperations.TryPop(out streamId))
         {
             streamIdsAvailable = false;
             //Queue it up for later.
             _writeQueue.Enqueue(state);
             //When receiving the next complete message, we can process it.
             _logger.Info("Enqueued, no streamIds available. If this message is recurrent consider configuring more connections per host or lower the pressure");
             break;
         }
         _logger.Verbose("Sending #{0} for {1} to {2}", streamId, state.Request.GetType().Name, Address);
         _pendingOperations.AddOrUpdate(streamId, state, (k, oldValue) => state);
         Interlocked.Increment(ref _inFlight);
         int frameLength;
         try
         {
             //lazy initialize the stream
             stream = stream ?? (RecyclableMemoryStream) Configuration.BufferPool.GetStream(GetType().Name + "/SendStream");
             frameLength = state.Request.WriteFrame(streamId, stream);
             if (Configuration.SocketOptions.ReadTimeoutMillis > 0 && Configuration.Timer != null)
             {
                 state.Timeout = Configuration.Timer.NewTimeout(OnTimeout, streamId, Configuration.SocketOptions.ReadTimeoutMillis);
             }
         }
         catch (Exception ex)
         {
             //There was an error while serializing or begin sending
             _logger.Error(ex);
             //The request was not written, clear it from pending operations
             RemoveFromPending(streamId);
             //Callback with the Exception
             state.InvokeCallback(ex);
             break;
         }
         //We will not use the request any more, stop reference it.
         state.Request = null;
         totalLength += frameLength;
     }
     if (totalLength == 0L)
     {
         //nothing to write
         Interlocked.Exchange(ref _isWriteQueueRuning, 0);
         if (streamIdsAvailable && !_writeQueue.IsEmpty)
         {
             //The write queue is not empty
             //An item was added to the queue but we were running: try to launch a new queue
             RunWriteQueue();
         }
         if (stream != null)
         {
             //The stream instance could be created if there was an exception while generating the frame
             stream.Dispose();
         }
         return;
     }
     //Write and close the stream when flushed
     // ReSharper disable once PossibleNullReferenceException : if totalLength > 0 the stream is initialized
     _tcpSocket.Write(stream, () => stream.Dispose());
 }
Beispiel #28
0
 public Entry(string key, long value)
 {
     this.Key = key;
     this.Value = value;
 }
Beispiel #29
0
 /// <summary>
 /// Writes a 64-bit signed integer to the stream, using the bit converter
 /// for this writer. 8 bytes are written.
 /// </summary>
 /// <param name="value">The value to write</param>
 internal void Write(long value)
 {
     BigEndianBitConverter.CopyBytes(value, buffer, 0);
     WriteInternal(buffer, 8);
 }
Beispiel #30
0
 internal static long Modulo(long a, long b)
 {
     return(a % b);
 }