projection

LINQ projection to presentation model

女生的网名这么多〃 提交于 2019-12-11 02:16:12
问题 I'm pretty new to LINQ and a lot of modern data-driven application design techniques in general, so this may be a pretty basic question. I'm trying to create a projection of a couple different Entity Framework entities to a simple presentation model. Let's say I have the entites Parent (properties are ID, Name, Age) and Child (properties are ID, Name, Age, with a reference to a Parent). I want to project these to PresentationParent and PresentationChild, where all the properties are the same,

flash 10 orthographic projection

我只是一个虾纸丫 提交于 2019-12-11 01:57:21
问题 I've been playing a bit with the new flash 10 3d possibilities, and found out that rotating a sprite in 3d is fairly easy: var card:Sprite = new MyCard() card.x = 100 card.y = 100 card.z = 200 card.rotationX = -60 addChild(card) Simple and effective, this shows the card rotated with perspective. Now I want to use an orthographic projection, and I have no clue where to start. DisplayObject does have a perspectiveProjection member, but that can only make perspective projections of course. Maybe

Projection matrix to project a point in a plane

泪湿孤枕 提交于 2019-12-11 01:55:13
问题 How to determinate the 4x4 S matrix so that the P gets projected into Q, on the XZ (Y=0) plane? Q = S P 回答1: I will give the general solution for central projection from a point C to a plane E (assuming that L is not contained in E ). I will use Octave/MATLAB notation for convenience. Let L be given in homogeneous coordinates L=[lx ly lz 1]' And E be given in Hessian normal form (also homogeneous coordinates) E=[nx, ny, ,nz, d]' where [nx, ny, nz] is the normal to the plane and d is its

How to determine the projection (2D or 3D) of a matplotlib axes object?

送分小仙女□ 提交于 2019-12-10 20:55:50
问题 In Python's matplotlib library it is easy to specify the projection of an axes object on creation: import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D ax = plt.axes(projection='3d') But how do I determine the projection of an existing axes object? There's no ax.get_projection , ax.properties contains no "projection" key, and a quick google search hasn't turned up anything useful. 回答1: I don't think there is an automated way, but there are obviously some properties that

Projection media query: browser support and workarounds?

邮差的信 提交于 2019-12-10 20:18:54
问题 I'm trying to get styles applied to a page only when the page is projected on the wall (by a projector, when someone is giving a presentation). As the moment, I can only get this in Opera in fullscreen mode. Is there any way to get @media projection to take affect in other browsers? Also, is there a way to make it only apply to the projection, and not the laptop its projecting from? If not, are there any viable workarounds to this? I am trying to create a slideshow in css, but also offer a

Matplotlib basemap + contourf with irregular 2d numpy array

夙愿已清 提交于 2019-12-10 19:36:59
问题 With 2d numpy arrays of data retrieved from a 40 km Lambert conformal conic projection, this matplotlib/basemap plot of irregularly-spaced coordinates and data does not look correct. The values are correct but pcolormesh and contourf show discontinuities. With a square grid the discontinuities disappear. The code: from mpl_toolkits.basemap import Basemap, cm import matplotlib.pyplot as plt import numpy as np fig = plt.figure(figsize=(8,8)) ax = fig.add_axes([0.1,0.1,0.8,0.8]) lats = np.array(

Filter a managedQuery by file extension (or, alternatively, file type) for an Android Cursor

一个人想着一个人 提交于 2019-12-10 18:42:51
问题 I want to do a managedQuery using Android SDK where the results returned are filtered by their respective file extension (e.g. not the name, necessarily). I've done quite a bit of researching and am tired and hoping the community can help me.. I'm sure the answer is out there but, in lieu of reading an SQL book or whatever, I'm just trying to do something that should be pretty simple but not finding the solution. What I want to do is, essentially, something like: managedQuery(Audio.Media

grails 3.3 gorm where query with projection count() different than list().size()

与世无争的帅哥 提交于 2019-12-10 18:26:42
问题 According to the Gorm 6 documentation section 7.4 the Where Query returns a DetachedCriteria , which provides a method count() that is supposed to return the number of records returned by the query. In fact, as far as I can tell, if dc is an instance of DetachedCriteria , then dc.count() == dc.list().size() must hold true. In the case of a Where Query containing a projection, count() seems to return something else. In this simple example: query = Runner.where { projections { groupProperty

From AutoMapper to Emit Mapper

妖精的绣舞 提交于 2019-12-10 17:29:37
问题 I've recently discovered AutoMapper for bridging ViewModels and my actual DB objects. I use it in the way decribed here: http://automapper.codeplex.com/wikipage?title=Projection&referringTitle=Home I've discovered Emit Mapper to :), but I can't find anytning similar to (where I can specify custom projecting rules): .ForMember(dest => dest.EventDate, opt => opt.MapFrom(src => src.EventDate.Date)) Thanks in advance! 回答1: For the Record this is the best solution that I came across on how to do

NHibernate: How to select the root entity in a projection

自闭症网瘾萝莉.ら 提交于 2019-12-10 14:29:50
问题 Ayende describes a really great way to get page count, and a specific page of data in a single query here: http://ayende.com/blog/2334/paged-data-count-with-nhibernate-the-really-easy-way His method looks like: IList list = session.CreateQuery("select b, rowcount() from Blog b") .SetFirstResult(5) .SetMaxResults(10) .List(); The only problem is this example is in HQL, and I need to do the same thing in an ICriteria query. To achieve the equivalent with ICriteria, I need to do something like: