patch

3d patches from a 3d matrix

只愿长相守 提交于 2019-12-05 18:13:33
I have a 3d matrix (3x3x3) , and I need to extract 3d patches (2x2x2) and transform them in vectors. In 2d, simply: I=randi(5,3,3); 2d_patches=im2col(I,[2 2],'sliding'); What about 3d? I=randi(5,3,3,3); 3d_patches= ??? im2col just works in 2d. In 3d I should recombine the vectors 1 and 7 , 2 and 8 , ... Is there any fast function for this task? I do not believe that there is any built-in way to do this. If you need it to be fast, it should be fairly simple to write your own mex-function in c and call it from Matlab. Here is my (quick and dirty) solution: im3col.c: #include <mex.h> void

how to apply a git patch as if the author committed to my repo?

落花浮王杯 提交于 2019-12-05 17:40:26
问题 Lets suppose there is a central repository where commits from satellite ones are pushed some time. Developer A makes some commits on his repo while B makes some on his own too. Now, A wants to incorporate one of B's commits into his repo (which he cannot access directly to pull). One way is to have B create a patch and send it to A but in that case there are two problems: 1. The patch will appear as local modifications to A who have then to commit it (with its own name) 2. Once the central

simple way to create patch on deployed grails application

让人想犯罪 __ 提交于 2019-12-05 15:44:55
i have a deployed grails apps on tomcat6 in my client server machine, but the application is still need many fix, so every bug founded or missing feature on client machine, i creating a patch and delivering to client via ftp on .tar.gz file that will replace on deployed folder. i can't send a fully .war files because the apps is big (~80M), so sending a changes .class files is the only option i have. but the process to creating a patch is too time consuming , especially on rebuild the project , cleaning up the target folder and start to compile all files on project. after that i search the

WiX: Patch installer superseding previous versions (1.0.0 -> 1.0.1, 1.0.0 -> 1.0.2, 1.0.1 -> 1.0.2, aso.)

拈花ヽ惹草 提交于 2019-12-05 14:15:34
I am trying to provide a simple installer package (MSI) which I want to support with updates (patches) that supersede all previous patches. So I have a MSI V1.0.0 and 2 patches V1.0.1 and V1.0.2. The user should be able to just install the latest patch regardless which previous patches were already applied to the system. My project contains 2 features (Client and Server). The basis of the patch so is always the RTM package (HelloWorld 1.0.msi / HelloWorld 1.0.wixpdb). The generation (build) of all patches work, so the update procedures 1.0.0 -> 1.0.1 and 1.0.0 -> 1.0.2 do, BUT when i try to

using self in python @patch decorator

风流意气都作罢 提交于 2019-12-05 12:44:09
I'm trying to use python's mock.patch to implement unit tests with nose. class A: def setUp(self): self.b = 8 #contrived example @patch.object('module.class', 'function', lambda x: self.b) def testOne(self): # do test # Here, patch complains that it doesnt know self (which is correct). What is best way to get this kind of functionality in a clean fashion? I know I can use a global variable, or that I can mock it within the test (but that involves me cleaning up the objects at the end of the test). You cannot use self on method decorator because you are in the class definition and the object

How do I apply a patch file in Gradle?

荒凉一梦 提交于 2019-12-05 12:43:30
I have a Gradle build script that successfully builds my project and compiles all the artifacts I need. However, in a couple of cases I'd like to give other developers the option to patch some of the files. For example, in one of the archives there's an xml file with information about database hooks - some of the devs use other versions (or even engines) and need to change these before they can use the build output. Instead of having them make changes to a version-controlled file, which they might commit by mistake, I'd like to give them the option to have a local, individual patch file which

Reusing patch objects in matplotlib without them moving position

∥☆過路亽.° 提交于 2019-12-05 10:51:32
I want to automatically generate a series of plots which are clipped to patches. If I try and reuse a patch object, it moves position across the canvas. This script (based on an answer to a previous question by Yann) demonstrates what is happening. import pylab as plt import scipy as sp import matplotlib.patches as patches sp.random.seed(100) x = sp.random.random(100) y = sp.random.random(100) patch = patches.Circle((.75,.75),radius=.25,fc='none') def doplot(x,y,patch,count): fig = plt.figure() ax = fig.add_subplot(111) im = ax.scatter(x,y) ax.add_patch(patch) im.set_clip_path(patch) plt

Hotfix / Patch build & delivery approach

左心房为你撑大大i 提交于 2019-12-05 09:45:18
We are in the process of adapting our build & release procedure of one of our Java based products to support patch / hotfix releases. Today, we deliver a full installation package (which is a set of RPM packages wrapped in an ISO) out of our build pipeline. However, we aim to also support incremental / more fine grained upgrade / patch shipments as well. To keep things simple as an initial step, we plan to have more fine-grained RPM packages and package a subset (only the changed ones in the scope of a release) of these RPMs in a dedicated hotfix ISO along with the full installation ISO. (We

git apply is making no changes to files

南楼画角 提交于 2019-12-05 03:10:16
问题 I have to apply a patch to my repo and am running git apply --directory=$PWD xxxxx.patch For reasons I won't go into, I cannot use git am in this instance, and I need to use the directory flag. git tells me: $> git apply --directory=$PWD xxxxx.patch code1/xxxxx.patch:337: trailing whitespace. < one partial line of code > warning: 1 line adds whitespace errors. I have read that the whitespace warning is nothing serious and should not stop git from applying the patch. However, whatever the

patching using purely WIX

孤街醉人 提交于 2019-12-05 02:53:25
问题 I am struggling with creating a patch purely using WIX and I was hoping if someone could guide me in the right direction. I have a few hundred source files and I run heat against them to create a harvest file followed by creating a package using candle and light. I need to change a few configuration files and I create a 2nd package with the changes. Using Torch and pyro I create the .wixmst file and then when trying to create the msp file, pyro complains with the following error. pyro.exe :