This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################## | |
# /etc/elasticsearch/elasticsearch.yml | |
# | |
# Base configuration for a write heavy cluster | |
# | |
# Cluster / Node Basics | |
cluster.name: logng | |
# Node can have abritrary attributes we can use for routing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import random | |
import time | |
from threading import * | |
class Philosopher(Thread): | |
def __init__(self, waiter, lfork, rfork): | |
Thread.__init__(self) | |
self.waiter = waiter | |
self.lfork = lfork |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import random | |
import time | |
from threading import * | |
class Producer(Thread): | |
def __init__(self, items, can_produce, can_consume): | |
Thread.__init__(self) | |
self.items = items | |
self.can_produce = can_produce |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include "utils.h" | |
#include "hash.h" | |
#include "hashtable.h" | |
#define DEBUG 0 | |
hashtable *create_hashtable(int length) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef LIB | |
#define LIB | |
typedef struct { | |
int type; | |
int len; | |
char payload[1400]; | |
} msg; | |
void init(char* remote,int remote_port); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <sys/time.h> | |
double **new_matrix(int n) | |
{ | |
double **m; | |
double *buf; | |
buf = (double *) calloc(n * n, sizeof(double)); | |
int i; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpGet] | |
public async Task<IEnumerable<AddressModel>> GetAddresses(ODataQueryOptions<AddressModel> queryOptions, CancellationToken cancellationToken) | |
{ | |
var repository = new AddressRepository(_context); | |
var service = new AddressService(repository); | |
var filter = queryOptions.ToModelQueryFilter<AddressModel>(); | |
return await service.QueryByStreetAsync("StreetName", filter, cancellationToken); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern alias redis; | |
using Castle.Core.Logging; | |
using redis::StackExchange.Redis; | |
using System; | |
using System.Net; | |
using UiPath.Core; | |
namespace UiPath.Web.Communication | |
{ | |
public static class RedisConnector |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class DatabaseExtensions | |
{ | |
public static SqlQuery<T> SqlQuery<T>(this DatabaseFacade database, string sqlQuery, object parameters = null) | |
where T : class | |
{ | |
return new SqlQuery<T> | |
{ | |
Database = database, | |
Query = sqlQuery, | |
Parameters = GetParameters(parameters) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* TRUNCATE ALL TABLES IN A DATABASE */ | |
DECLARE @dropAndCreateConstraintsTable TABLE | |
( | |
DropStmt VARCHAR(MAX) | |
,CreateStmt VARCHAR(MAX) | |
) | |
/* Gather information to drop and then recreate the current foreign key constraints */ | |
INSERT @dropAndCreateConstraintsTable | |
SELECT DropStmt = 'ALTER TABLE [' + ForeignKeys.ForeignTableSchema | |
+ '].[' + ForeignKeys.ForeignTableName + '] DROP CONSTRAINT [' |
OlderNewer