MS Bot Builder: how to set session data to proactive message?
I first send a proactive message to the user via sms channel inside OAuthCallback method ``` var connector = new ConnectorClient(); Message message = new Message(); message.From = new ChannelAccoun...
- Modified
- 22 Apr at 19:27
How is the CLR faster than me when calling Windows API
I tested different ways of generating a timestamp when I found something surprising (to me). Calling Windows's `GetSystemTimeAsFileTime` using P/Invoke is about 3x slower than calling `DateTime.UtcNo...
- Modified
- 19 Jun at 07:23
Axios get access to response header fields
I'm building a frontend app with React and Redux and I'm using [axios](https://github.com/mzabriskie/axios) to perform my requests. I would like to get access to all the fields in the header of the re...
- Modified
- 21 Sep at 10:39
multiple conditions for JavaScript .includes() method
Just wondering, is there a way to add multiple conditions to a .includes method, for example: ``` var value = str.includes("hello", "hi", "howdy"); ``` Imagine the comma states "or". It's asking n...
- Modified
- 8 Jan at 08:11
Error starting userland proxy: listen tcp 0.0.0.0:3306: bind: address already in use
I have to make `Laravel` app and to deliver a Dockerfile, but I'm really stuck with this. Before that I had a nightmare wile installing `laravel` on my machine. I'm trying to get `dockervel` image and...
- Modified
- 8 Oct at 11:33
How to load assemblies located in a folder in .NET Core console app
I'm making a console app on the .NET Core platform and was wondering, how does one load assemblies (.dll files) and instantiate classes using C# dynamic features? It seems so much different than .NET ...
- Modified
- 11 Jan at 00:15
Why does C# allow ambiguous function calls through optional arguments?
I came across this today, and I am surprised that I haven't noticed it before. Given a simple C# program similar to the following: ``` public class Program { public static void Main(string[] args...
- Modified
- 18 Jun at 15:44
Tensorflow set CUDA_VISIBLE_DEVICES within jupyter
I have two GPUs and would like to run two different networks via ipynb simultaneously, however the first notebook always allocates both GPUs. Using CUDA_VISIBLE_DEVICES, I can hide devices for pytho...
- Modified
- 18 Jun at 05:55
Keras, how do I predict after I trained a model?
I'm playing with the reuters-example dataset and it runs fine (my model is trained). I read about how to save a model, so I could load it later to use again. But how do I use this saved model to pre...
- Modified
- 18 Jun at 04:23
Casting to enum vs. Enum.ToObject
I recently saw a project that was using this : ``` (SomeEnum)Enum.ToObject(typeof(SomeEnum), some int) ``` instead of this style: ``` (SomeEnum)some int ``` Why use the former? Is it just a matt...
2 way syncing with Google Calendar/Outlook
I am using [FullCalendar](http://fullcalendar.io/docs/google_calendar/) in my application to display events created via our own application. I have an add/edit form for creating/updating events. The...
- Modified
- 17 Jun at 17:3
Why Uri.TryCreate throws NRE when url contains Turkish character?
I have encountered an interesting situation where I get `NRE` from `Uri.TryCreate` method when it's supposed to return `false`. You can reproduce the issue like below: ``` Uri url; if (Uri.TryCreate...
- Modified
- 17 Jun at 13:42
C# NOT (~) bit wise operator returns negative values
Why does C#'s bitwise `NOT` operator return `(the_number*-1)-1`? ``` byte a = 1; Console.WriteLine(~a); //equals -2 byte b = 9; Console.WriteLine(~b); //equals -10 // Shouldn't a=0 and b=6? ``` How...
- Modified
- 17 Jun at 12:32
MySQL fails on: mysql "ERROR 1524 (HY000): Plugin 'auth_socket' is not loaded"
My local environment is: - - - with installed MySQL 5.7``` sudo apt-get install mysql-common mysql-server ``` --- When I tried to login to MySQL (via CLI): ``` mysql -u root -p ``` I came ac...
- Modified
- 17 Jun at 10:36
How to clear Laravel route caching on server
This is regarding route cache on localhost # About Localhost I have 2 routes in my route.php file. Both are working fine. No problem in that. I was learning route:clear and route:cache and found ...
- Modified
- 16 Aug at 15:57
Exclude values from Random.Range()?
If you are using `Random.Range()` to generate values, is there any way to exclude some values within the range (for example: pick a number between 1 and 20, but not 6 through 8)?
Changing the TransactionScope IsolationLevel to Snapshot in Inmemory DB
I am using the in-memory database (using ServiceStack.OrmLite.Sqlite.Windows) for unit testing in servicestack based web API. the method I am trying to test is as follows. ``` public object Get(object...
- Modified
- 20 Oct at 05:47
Escape dollar sign in string by shell script
Suppose I have a script named dd.sh, and I run it like this ``` ./dd.sh sample$name.mp4 ``` So `$1` is the string `sample$name.mp4`. ``` echo '$1' // shows $1 echo "$1" // shows "sample.mp4"; want "...
Custom ormlite query implementation based on class interface
I'd like to extend certain ORMLite methods based on the object's implementation. E.g., I have an interface: ``` public interface IHaveTimestamps { DateTime CreatedOn { get; set; } DateTime...
- Modified
- 17 Jun at 07:25
How to create empty constructor for data class in Kotlin Android
I have 10+ variables declared in Kotlin data class, and I would like to create an empty constructor for it like how we typically do in Java. Data class: ``` data class Activity( var updated_on: St...
SQL Server is not a valid installation folder how to fix location
I want to install SQL server on my pc, but when I am try to give path for installation, I am getting this error, the C:\Program Files (x86)\Microsoft SQL Server\ is not valid installation folder, I tr...
- Modified
- 31 May at 09:43
How many CPUs does a docker container use?
Lets say I am running a [multiprocessing](https://docs.python.org/2/library/multiprocessing.html) service inside a docker container spawning multiple processes, would docker use all/multiple cores/CPU...
- Modified
- 27 Feb at 01:57
Can built-in logging messages be turned off?
Once logging is configured with ``` LogManager.LogFactory = new Log4NetFactory(configureLog4Net: true); ``` it can be used anywhere with ``` ILog log = LogManager.GetLogger("foo); log.Error("foo...
- Modified
- 16 Jun at 21:19
console.log not working in Angular2 Component (Typescript)
I am relatively new to both Angular2 and typescript. Since typescript is a superset of javascript, I'd expect functions like `console.log` to work. `console.log` works perfectly in `.ts` files when ou...
- Modified
- 16 Jun at 21:19
Is that possible to send HttpWebRequest using TLS1.2 on .NET 4.0 framework
My application connects to Experian server and Experian will soon stop supporting TLS 1.0 and TLS 1.1. All connectivity using HTTPS must use TLS Version 1.2. I want to do some research on that issue ...
- Modified
- 13 May at 13:8