How to copy a “Dictionary” in Swift?

A ‘Dictionary’ is actually a Struct in swift, which is a value type. So copying it is as easy as: let myDictionary = … let copyOfMyDictionary = myDictionary To copy an object (which is a reference type) has a couple of different answers. If the object adopts the NSCopying protocol, then you can just do: … Read more

how to copy the dependencies libraries JARs in gradle

Add: build.dependsOn(copyToLib) When gradle build runs, Gradle builds tasks and whatever tasks depend on it (declared by dependsOn). Without setting build.dependsOn(copyToLib), Gradle will not associate the copy task with the build task. So: apply plugin: ‘java’ apply plugin: ‘application’ manifest.mainAttributes(‘Main-Class’: ‘com.test.HelloWorld’) repositories { mavenCentral() } dependencies { compile ( ‘commons-codec:commons-codec:1.6’, ‘commons-logging:commons-logging:1.1.1’, ‘org.apache.httpcomponents:httpclient:4.2.1’, ‘org.apache.httpcomponents:httpclient:4.2.1’, ‘org.apache.httpcomponents:httpcore:4.2.1’, ‘org.apache.httpcomponents:httpmime:4.2.1’, … Read more

Dockerfile copy keep subdirectory structure

Remove star from COPY, with this Dockerfile: FROM ubuntu COPY files/ /files/ RUN ls -la /files/* Structure is there: $ docker build . Sending build context to Docker daemon 5.632 kB Sending build context to Docker daemon Step 0 : FROM ubuntu —> d0955f21bf24 Step 1 : COPY files/ /files/ —> 5cc4ae8708a6 Removing intermediate container … Read more