How to create a shared library with cmake?

Always specify the minimum required version of cmake cmake_minimum_required(VERSION 3.9) You should declare a project. cmake says it is mandatory and it will define convenient variables PROJECT_NAME, PROJECT_VERSION and PROJECT_DESCRIPTION (this latter variable necessitate cmake 3.9): project(mylib VERSION 1.0.1 DESCRIPTION “mylib description”) Declare a new library target. Please avoid the use of file(GLOB …). This … Read more

Is it possible to dynamically compile and execute C# code fragments?

The best solution in C#/all static .NET languages is to use the CodeDOM for such things. (As a note, its other main purpose is for dynamically constructing bits of code, or even whole classes.) Here’s a nice short example take from LukeH’s blog, which uses some LINQ too just for fun. using System; using System.Collections.Generic; … Read more

Is Java a Compiled or an Interpreted programming language ?

Java implementations typically use a two-step compilation process. Java source code is compiled down to bytecode by the Java compiler. The bytecode is executed by a Java Virtual Machine (JVM). Modern JVMs use a technique called Just-in-Time (JIT) compilation to compile the bytecode to native instructions understood by hardware CPU on the fly at runtime. … Read more

OPTION (RECOMPILE) is Always Faster; Why?

There are times that using OPTION(RECOMPILE) makes sense. In my experience the only time this is a viable option is when you are using dynamic SQL. Before you explore whether this makes sense in your situation I would recommend rebuilding your statistics. This can be done by running the following: EXEC sp_updatestats And then recreating … Read more

How can I use/create dynamic template to compile dynamic Component with Angular 2.0?

EDIT – related to 2.3.0 (2016-12-07) NOTE: to get solution for previous version, check the history of this post Similar topic is discussed here Equivalent of $compile in Angular 2. We need to use JitCompiler and NgModule. Read more about NgModule in Angular2 here: Angular 2 RC5 – NgModules, Lazy Loading and AoT compilation In … Read more

Java method with return type compiles without return statement

Question 1: Why does the following code compile without having a return statement? public int a() { while(true); } This is covered by JLS§8.4.7: If a method is declared to have a return type (§8.4.5), then a compile-time error occurs if the body of the method can complete normally (§14.1). In other words, a method … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)