containers

How to make GCE instance stop when its deployed container finishes?

三世轮回 提交于 2019-11-29 14:22:05
问题 I have a Docker container that performs a single large computation. This computation requires lots of memory and takes about 12 hours to run. I can create a Google Compute Engine VM of the appropriate size and use the "Deploy a container image to this VM instance" option to run this job perfectly. However once the job is finished the container quits but the VM is still running (and charging). How can I make the VM exit/stop/delete when the container exits? When the VM is in its zombie mode

Moving an image randomly around a page

徘徊边缘 提交于 2019-11-29 14:19:45
问题 I created three .png images of hot air balloons. Each are different sizes so that they give off the idea of "depth." What is the best way to code these .png's so that they move and float around my container like hot air balloons? I've tried the following code from the Spritely website which I adapted as so: $('#balloon1') .sprite({fps: 3, no_of_frames: 1}) .spRandom({ top: 70, left: 100, right: 200, bottom: 340, speed: 10000, pause: 3000 }); I put this code for the other two balloons (

Is it safe to move elements of a initializer list? [duplicate]

为君一笑 提交于 2019-11-29 14:06:32
Possible Duplicate: initializer_list and move semantics In this code: #include <vector> #include <initializer_list> template<typename T> class some_custom_container : public std::vector<T> { public: some_custom_container(const std::initializer_list<T>& contents) { for (auto& i : contents) this->emplace_back(std::move(i)); } }; class test_class {}; int main() { test_class a; some_custom_container<test_class> i = { a, test_class(), a }; } If I've understand it, all objects in { a, test_class(), a } are safe-constructed: the named-objects are copied and the unnamed objects are moved to construct

Communicating between Docker containers in different networks on the same host

时光毁灭记忆、已成空白 提交于 2019-11-29 13:41:39
问题 Any possibility to make containers in different networks within the same host to communicate? Please note that I am not using docker-compose at the moment. The following is a summary of what I did. I created two networks using the following commands docker network create --driver bridge mynetwork1 docker network create --driver bridge mynetwork2 Then I ran two containers on each of these created networks using the commands: docker run --net=mynetwork1 -it name=mynet1container1

Should std::list be deprecated?

时间秒杀一切 提交于 2019-11-29 13:11:40
问题 According to Bjarne Stroustrup's slides from his Going Native 2012 keynote, insertion and deletion in a std::list are terribly inefficient on modern hardware: Vector beats list massively for insertion and deletion If this is indeed true, what use cases are left for std::list ? Shouldn't it be deprecated then? 回答1: Vector and list solve different problems. List provides the guarantee that iterators never become invalidated as you insert and remove other elements. Vector doesn't make that

How to Dockerize windows application

夙愿已清 提交于 2019-11-29 12:47:14
i have a windows application which I want to containerize. Its a windows desktop application (not web application). I did some searching and found very little about containerizing desktop application. The application which I want to containerize works fine on WindowsServerCore. I have Windowsservercore image on my machine. I want to know how can I go about containerizing it. Any documentation or useful videos are available? when i completed dockerfile can i interact with my application gui??? how??? You can find tons of example of WindowsServiceCore-based applications in StefanScherer

Where to place and configure IoC container in a WPF application?

拥有回忆 提交于 2019-11-29 12:31:45
问题 I am working on a middle sized WPF application (MVVM) that should be extensible and maintainable in the future. Thus I decided to use an IoC container (Unity in this case) to keep things flexible. However I am not sure where to place and configure Unity in a WPF application. I guess container should be accessible globally so it should probably go to Application class. But should I make it as static property? Should I configure it in Application_Startup() event handler? Eg: /// <summary> ///

Docker->Maven->Failsafe->Surefire starting fork fails with “The forked VM terminated without properly saying goodbye. VM crash or System.exit called?”

我是研究僧i 提交于 2019-11-29 12:26:54
问题 As per title: I'm trying to run Maven automated test from Jenkins slave that is containerized and after battling this for a week now I'm running out of ideas. It works as is on AWS instance with 4G of RAM but in unrestricted (on RAM and CPU) container it fails with error like below. The only circumstances when it runs is when I disable forking for Failsafe plugin but that is not an option going forward. I tried all sorts of Java/Maven/Failsafe/Surefire options I could have found using Google

Python equivalent for C++ STL vector/list containers

孤人 提交于 2019-11-29 12:03:42
问题 Is there something similar in Python that I would use for a container that's like a vector and a list? Any links would be helpful too. 回答1: You can use the inbuilt list - underlying implementation is similar to C++ vector. Although some things differ - for example, you can put objects of different type in one and the same list. http://effbot.org/zone/python-list.htm 回答2: Have a look at Python's datastructures page. Here's a rough translation: () => boost::Tuple (with one important distinction

How to make my uninitialised_allocator safe?

怎甘沉沦 提交于 2019-11-29 11:09:28
Following from this question , I want to use an unitialised_allocator with, say, std::vector to avoid default initialisation of elements upon construction (or resize() of the std::vector (see also here for a use case). My current design looks like this: // based on a design by Jared Hoberock template<typename T, typename base_allocator > struct uninitialised_allocator : base_allocator::template rebind<T>::other { // added by Walter Q: IS THIS THE CORRECT CONDITION? static_assert(std::is_trivially_default_constructible<T>::value, "value type must be default constructible"); // added by Walter Q