C++ variadic template with doubles

The following code #include <initializer_list> #include <vector> template<int …> const std::vector<int>*make_from_ints(int args…) { return new std::vector<int>(std::initializer_list<int>{args}); } is compiling (with GCC 6.3, on Debian/Sid/x86-64) correctly, and I expect it for a call like auto vec = make_from_ints(1,2,3); to return a pointer to some vector of integers containing 1, 2, 3. However, if I replace int … Read more

Install .NET Framework 3.5 on Windows Server Core Docker

I am struggling to install .NET Framework 3.5 on docker container. I have 4.5 installed already, but need 3.5 to run one Service. Here is my Dockerfile: FROM microsoft/windowsservercore SHELL [“powershell”] RUN Install-WindowsFeature NET-Framework-45-ASPNET ; \ Install-WindowsFeature Web-Asp-Net45 RUN dism /online /enable-feature /featurename:NetFX3 /all COPY Startup Startup COPY Service Service RUN “C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe” WCS.WindowsService.exe RUN mkdir … Read more

Manipulate data in a QAbstractListModel from a QML ListView

I have a QML ListView which uses a QAbstractListModel subclass as a model. ListView { id: myListView x: 208 y: 19 width: 110 height: 160 delegate: myListDelegate {} model: MyListModel opacity: 0 } The model is a list of MyListItems. class MyListModel : public QAbstractListModel { Q_OBJECT public: enum MyRoles { HeadingRole = Qt::UserRole + … Read more

What is the reason that Encoding.UTF8.GetString and Encoding.UTF8.GetBytes are not inverse of each other?

Probably I am missing something, but I do not understand why Encoding.UTF8.GetString and Encoding.UTF8.GetBytes are not working as inverse transformation of each other? In the following example the myOriginalBytes and asBytes are not equal, even their length is different. Could anyone explain what am I missing? byte[] myOriginalBytes = GetRandomByteArray(); var asString = Encoding.UTF8.GetString(myOriginalBytes); var … Read more

C++ debugging with gdb & bazel (& emacs)

I want to debug an executable generated with Bazel. The gdb debugger is lost with the links generated by Bazel and is not able to show me the C++ source code. How to fix that? The project root directory is /home/…/Cpp/ ./Cpp/ ├── bazel-bin -> /home/picaud/.cache/bazel/_bazel_picaud… ├── bazel-Cpp -> /home/picaud/.cache/bazel/_bazel_picaud… ├── bazel-genfiles -> /home/picaud/.cache/bazel/_bazel_picaud… ├── … Read more

EF Core one-to-zero relationship one way

Can a relationship one-to-one be created only one way? public class Class1 { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Class1Id { get; set; } … } public class Class2 { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Class2Id { get; set; } public int? RelationshipId { get; set; } public virtual Class1 Relationship { get; set; } … } And … Read more