grid

How to find intersection of a line with a mesh?

青春壹個敷衍的年華 提交于 2019-11-29 02:46:46
I have trajectory data, where each trajectory consists of a sequence of coordinates(x, y points) and each trajectory is identified by a unique ID. These trajectories are in x - y plane, and I want to divide the whole plane into equal sized grid (square grid). This grid is obviously invisible but is used to divide trajectories into sub-segments. Whenever a trajectory intersects with a grid line, it is segmented there and becomes a new sub-trajectory with new_id . I have included a simple handmade graph to make clear what I am expecting. It can be seen how the trajectory is divided at the

Submit form with Kendo MVC Grid and other elements

不想你离开。 提交于 2019-11-29 02:31:57
问题 I am trying to get a form containing a Kendo MVC grid and other elements to submit. The View model contains contains three string fields and an IEnumerable collection. The grid is server bound. I am not adding any elements or deleting any elements from the list using the grid but the grid contains a check box mapped to a boolean column in the list items. Whenever I submit this form the three string elements return in the post method but the list is always null. Here is the data model: public

Programmatically setting the width of a grid column with * in WPF

匆匆过客 提交于 2019-11-29 00:19:37
问题 I want to programmatically configure a wpf grid. I want to be able to set a grid with 2 columns, the first taking up 20% of available space, the second taking up 80%. In xaml I would use the * operator but I cant work out how to do this programmatically. In Xaml I would do: <Grid> <Grid.ColumnDefinitions> <ColumnDefinition width="20*" /> <ColumnDefinition width="80*" /> </Grid> In code I want to do: Grid grid = new Grid(); grid.ColumnDefinitions.Add( new ColumnDefinition(20*) ); grid

Android - Split Drawable

寵の児 提交于 2019-11-29 00:10:37
问题 I am attempting to split an image into pieces, lets say for example 16 chunks (4x4). I have found so many examples with java, but Android does not have BufferedImage and what not... I think. I have a decent IDEA on how to, but I don't really know where to start. Should I use a bitmap or a drawable? Is there a method to split or will I have to make a custom method? Should I use a GridView to hold the split images? I don't want to com across as newbish and wanting to have someone do this for me

Conditionally display an image in webgrid - mvc 3

空扰寡人 提交于 2019-11-28 23:44:37
In my webgrid I need to display images based on the value .. Code is given below @model TraktorumMVC.Models.ManagePhotos @{ ViewBag.Title = "ManagePhotos"; Layout = "~/Views/Shared/_Layout.cshtml"; var grid = new WebGrid(Model.AdPhotos); } @grid.GetHtml( displayHeader: false, columns: grid.Columns( grid.Column(format: (item) => { if (item.IsMainPreview == true) { return @<text><img src="@Url.Content("~/Content/images/preview-photo.gif")" alt="Image "/></text>; } else { return @<text><img src="@Url.Content("~/Content/images/non-preview-photo.gif")" alt="Image "/></text>; } } ), grid.Column

Python - Plotting colored grid based on values

本小妞迷上赌 提交于 2019-11-28 23:36:58
I have been searching here and on the net. I found somehow close questions/answers to what I want, but still couldn't reach to what I'm looking for. I have an array of for example, 100 values. The values are in the range from 0 to 100. I want to plot this array as a grid, filling the squares according to the values in the array. The solutions I found so far are like the followings: Drawing grid pattern in matplotlib and custom matplotlib plot : chess board like table with colored cells In the examples I mentioned, the ranges of the colors vary and are not fixed. However, what I am wondering

How do I initialize the t-variables in “A Fast Voxel Traversal Algorithm for Ray Tracing”?

纵饮孤独 提交于 2019-11-28 21:21:42
I am trying to implement the algorithm explained on this paper, used to traverse grid cells in order following a straight line, which is useful for ray tracing: http://www.cse.yorku.ca/~amana/research/grid.pdf The paper describes the algorithm as two parts: initialisation and iterative traversal. I can undersand the iterative traversal part, but I'm having trouble understanding how some of the variables in the initialisation part are calculated. I need help initialising tMaxX , tMaxY , tDeltaX & tDeltaY . Their initialisation procedure is explained as follows: Next, we determine the value of t

Minor grid with solid lines & grey-color

白昼怎懂夜的黑 提交于 2019-11-28 18:55:20
I'm using the following to display the minor grid in my plot: grid(gca,'minor') set(gca,'MinorGridLineStyle','-') but I'd like to change the color of the grid lines to a nice greyscale. I can't find any option 'grid color' in matlab... Do you know any or any workaround? I found this: http://www.mathworks.com/matlabcentral/fileexchange/9815-gridcolor but as I read of the comments, it doesn't work very well and further it only changes gridcolor, not the color of the minor grid... Thanks! EDIT : Problem with semilogx as posting here now: x = [1e-9 1e-8 1e-7 1e-6 1e-5 1e-4 1e-3 1e-2]'; y1 =

How can I add a line between two columns using Twitter Bootstraps grid system

瘦欲@ 提交于 2019-11-28 17:20:58
问题 Two column layout with a line in the middle. [ ] | [ ] [ ] | [ ] [ ] | [ ] [ Left Column ] | [ Right Column ] [ ] | [ ] [ ] | [ ] [ ] | [ ] [ ] | [ ] 回答1: I think I got your question right... this the below codes. The inline style below is just for illustration. You apply your styling in the css file. <div class="container"> <div class="row-fluid"> <div class="span6" style="padding-right:20px; border-right: 1px solid #ccc;"> <p>Some Contents Here...</p> </div> <div class="span6"> <p>Some

WPF: Grid with column/row margin/padding?

寵の児 提交于 2019-11-28 17:07:35
Is it easily possible to specify a margin and/or padding for rows or columns in a WPF Grid? I could of course add extra columns to space things out, but this seems like a job for padding/margins (it will give much simplier XAML). Has someone derived from the standard Grid to add this functionality? You could write your own GridWithMargin class, inherited from Grid , and override the ArrangeOverride method to apply the margins RowDefinition and ColumnDefinition are of type ContentElement , and Margin is strictly a FrameworkElement property. So to your question, "is it easily possible" the