patch

3d patches from a 3d matrix

↘锁芯ラ 提交于 2019-12-22 08:44:51
问题 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? 回答1: 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

Patch not applied after it gets merged

寵の児 提交于 2019-12-22 08:17:09
问题 Using the git flow tool, I created a feature branch (branched off dev ), made a bunch of changes, and merged the branch back onto dev . There is a file which I have modified in the feature branch. I can confirm that the revision (let's call it REV-A ) that modifies the file ( FILE-A ) is present and applied in the feature branch. However, after the merge, FILE-A is in its original (pre-merge) state on the dev branch. I can see REV-A when I do git log on dev , and if I follow the lines

PATCH/PUT not accepting multipart/form-data file uploads?

情到浓时终转凉″ 提交于 2019-12-22 05:37:05
问题 Any idea why PATCH and PUT wouldn't be accepting multipart/form-data file uploads? When I run var_dump($_FILES) it outputs array(0) { } . Any ideas why this is happening? If I POST the file, it works fine. Below is an example of the request I am running. Thanks in advance! PUT /test.php HTTP/1.1 Content-Type: multipart/form-data; boundary=__X_PAW_BOUNDARY__ Host: [redacted] Connection: close User-Agent: Paw/2.1.1 (Macintosh; OS X/10.10.2) GCDHTTPRequest Content-Length: 17961 --__X_PAW

quilt patch with a new file

主宰稳场 提交于 2019-12-22 03:52:49
问题 I'm trying to create a new quilt patch with only one file added. Unfortunately the file seems to be ignored. I did quilt new some_patch and quilt add some_file . I can see the file in quilt files then, but when I refresh, I get back: Nothing in patch some_patch After I pop some_patch, the added file is not removed and nothing is actually saved into the patch (patch file is not created). What am I doing wrong here? 回答1: You have to add the file to quilt first, before writing it. So that quilt

quilt patch with a new file

此生再无相见时 提交于 2019-12-22 03:52:44
问题 I'm trying to create a new quilt patch with only one file added. Unfortunately the file seems to be ignored. I did quilt new some_patch and quilt add some_file . I can see the file in quilt files then, but when I refresh, I get back: Nothing in patch some_patch After I pop some_patch, the added file is not removed and nothing is actually saved into the patch (patch file is not created). What am I doing wrong here? 回答1: You have to add the file to quilt first, before writing it. So that quilt

Python: how to create a choropleth map out of a shapefile of Canada?

女生的网名这么多〃 提交于 2019-12-22 01:50:30
问题 My goal here is to create a choropleth map of Canada in Python. Suppose I have a dictionary with values referring to each Canadian province/territory: myvalues={'Alberta': 1.0, 'British Columbia': 2.0, 'Manitoba': 3.0, 'New Brunswick': 4.0, 'Newfoundland and Labrador': 5.0, 'Northwest Territories': 6.0, 'Nova Scotia': 7.0, 'Nunavut': 8.0, 'Ontario': 9.0, 'Prince Edward Island': 10.0, 'Quebec': 11.0, 'Saskatchewan': 12.0, 'Yukon': 13.0} Now I want to color each province based on the

Distributed Source Control - pushing individual changesets

核能气质少年 提交于 2019-12-21 23:29:43
问题 Working on a bit of a sticky problem and was hoping for some help from the community. Basically, our dev team is split up into two teams, lets say "Red" and "Blue" 3 repos: 1: Master 2: Red >> Clone of master 3: Blue >> Clone of master Each developer is cloning red or blue on their local machine where they are working. Both teams are working on various tasks for our main application. Each team has a clone of our Shared "Master" Repository on which they are applying their changesets. The

Plotting multiple 3D rectangles using patch in Matlab

二次信任 提交于 2019-12-21 21:33:01
问题 I have x, y, and z coordinates of multiple rectangles' corners. All coordinates are in one matrix; ordered as x, y, z. Every three columns contain one rectangle's four corner coordinates. I want to show all rectangles in one plot. However, it does not show any of rectangles. Here is my code: %Coordinates(1,3*i-2:3*i) = top left corners' x y z coordinates %Coordinates(2,3*i-2:3*i) = down left corners' x y z coordinates %Coordinates(3,3*i-2:3*i) = down right corners' x y z coordinates

Plotting multiple 3D rectangles using patch in Matlab

不羁岁月 提交于 2019-12-21 21:26:20
问题 I have x, y, and z coordinates of multiple rectangles' corners. All coordinates are in one matrix; ordered as x, y, z. Every three columns contain one rectangle's four corner coordinates. I want to show all rectangles in one plot. However, it does not show any of rectangles. Here is my code: %Coordinates(1,3*i-2:3*i) = top left corners' x y z coordinates %Coordinates(2,3*i-2:3*i) = down left corners' x y z coordinates %Coordinates(3,3*i-2:3*i) = down right corners' x y z coordinates

Diff/compare two files by file descriptor (fd) instead of file name

China☆狼群 提交于 2019-12-21 18:07:30
问题 Is there any way in Linux, using c, to generate a diff/patch of two files stored in memory, using a common format (ie: unified diff, like with the command-line diff utility)? I'm working on a system where I generate two text files in memory, and no external storage is available, or desired. I need to create a line-by-line diff of the two files, and since they are mmap 'ed, they don't have file names, preventing me from simply calling system("diff file1.txt file2.txt") . I have file