projection

NHibernate Criteria using Projections for Substring with in clause

I had a scenario in Oracle where i neeed to match a substring part of column with a list of values. i was using sqlfunction projection for applying the substring on the required column , and addeed that projection as part of an In Clause Restriction. Below is the simplified criteria i wrote for that. ICriteria criteriaQuery = session.C...

How to setup OpenGL camera for a racing game

I need the view to show the road polygon (a rectangle 3.f * 100.f) with a vanishing point for a road being at 3/4 height of the viewport and the nearest road edge as a viewport's bottom side. See Crazy Taxi game for an example of what I wish to do. I'm using iPhone SDK 3.1.2 default OpenGL ES project template. I setup the projection ma...

How to "undo" a Projection in Fluent NHibernate?

I have to display some objects which are stored in a relational database and I use fluent NHibernate to get them. Since I need paging, I have to get both - the count of all objects, and the objects for the current page themselves. The ICriteria for both purposes is very similar up to a point - for count i finally add .SetProjection(Pro...

Rendering a point light using 6 spot lights?

I'm trying to render 6 spot lights to create a point light for a shadow mapping algorithm. I'm not sure if I'm doing this right, I've more or less followed the instructions here when setting up my view and projection matrices but the end result looks like this: White areas are parts which are covered by one of the 6 shadow maps, the...

Best way to test for total reachability

I have a set of nodes, each of which is connected to at least one other node. I would like to know if the connections are such that each node is reachable from every other. For example: 1--2 | 3--4 Versus: 1--2 3--4 I am convinced this kind of reachability testing can be projected in terms of an exact cover problem, however I c...

gluProject on NDS?

I've been struggling with this for a good while now. I'm trying to determine the screen coordinates of the vertexes in a model on the screen of my NDS using devKitPro. The library seems to implement some functionality of OpenGL, but in particular, the gluProject function is missing, which would (I assume) allow me to do just exactly that...

Cubic image converter?

I am looking for software (preferably free) that runs on either windows or osx that can take a list cubic images (broken into front, back, up, down, left, right) and turn them into a video. I am also looking for software to create fisheye projections from these images. Have had a bit of a look around and can't seem to find anything that...

GIS, Mercator projection, calculate Y position

I am doing some stuff with GIS(or map), and I know how to calculate Y position from latitude in mercator projection. But I don't know how it comes? Why it is ln(tan(x)+sec(x)) ? I couldn't figure out why there is a 'ln'? I know it is not directly related to programming, but I hope some one could help me understanding about this (bett...

Mercator longitude and latitude calculations to x and y on a cropped map (of the UK)

Hi I have this image: http://imgur.com/99tSz.png. A map of the UK (not including Southern Ireland). I have successfully managed to get a latitude and longitude and plot it onto this map by taking the leftmost longitude and rightmost longitude of the UK and using them to work out where to put the point on the map. This is the code (for...

LINQ projection to presentation model

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 (propertie...

Return entity via projection query

Is it possible to return an entity using a projection query? I've successfully done it with a SQL query (see below), but can't find how to do it with a projection query. Dim sql As String = "SELECT {a.*}, {b.*} FROM a LEFT OUTER JOIN b ON a.pk = b.fk") ' Convert SQL results into entities {a} and {b} Dim query As IQuery = session.Creat...

Does type projection have an opposite, or is it still projection (or just mapping)?

This is based on my assumption that taking an object of type: public class Fruit : IBasicFruit, IFruitDetails { // IBasicFruit implementation public string name { get; set; } public string color { get; set; } // IFruitDetails implementation public string scientific_name { get; set; } public bool often_mistaken_f...

How can I use a Mapnik-Backgroundlayer with lat-lon layers in one map with OpenLayers?

I have an application with a map-client using OpenLayers. I want to use Mapnik-data as background-layer, as provided with the class OpenLayers.Layer.OSM.Mapnik. For that I have to switch to the projection EPSG:900913. But I also want to display some layers, that I can only request in EPSG:4326. Can I combine both layers with the differen...

NHibernate Projection using SqlQuery...

Hi, I'm trying to reproduce the HqlQuery style 'select new ObjectToProjectOut' functionality. i.e. take a list of columns returned from a query and return as a list of ObjectToProjectOut types that are instantiated using a Constructor with as many parameters as the columns in the query. This is in effect what 'select new ObjectToProjec...

Projections in NHibernate

suppose in an entity there are attributes id, username, age, address. Now I just want id and username and I use this code for it. Projections enable the returning of something other than a list of entities from a query. var proj = Projections.ProjectionList() .Add(Projections.Property("Id"), "Id") .Add(Projections.Property("Use...

Linq to xml and counters across multiple projections

Similar to this question: http://stackoverflow.com/questions/372945/linq-iterators-selecting-and-projection I'm wanting to use a counter or incrementing variable in a projection - however I'm wanting to use the same counter across multiple projections. I'm constructing an xml document using a number of projections based on different da...

NHibernate projection: How to get a typed type using the Criteria API with projection

List<object[]> products = GetSession().CreateCriteria<Product>() .SetProjection(Projections.ProjectionList() .Add(Projections.Property("Id")) .Add(Projections.Property("Name")) .Add(Projections.Property("Price")) ) ...

Why does sign matter in opengl projection matrix

I'm working on a computer vision problem which requires rendering a 3d model using a calibrated camera. I'm writing a function that breaks the calibrated camera matrix into a modelview matrix and a projection matrix, but I've run into an interesting phenomenon in opengl that defies explanation (at least by me). The short description is...

Another repository-pattern question: how to deal with domain model projections?

Hi all, I've read a lot about repository pattern implementation and I still can't find out how should I implement entity projections querying? For example I have large and complex product entity, but I want to display only product's name and it's id. Where should i implement this projection? In my entity repository or in a caller code?...

how do I group by a property of a related entity in a criteria?

Hi. I'm writing a criteria that should group the results by a property of a related entity. I've tried using an alias, tried using the property path itself, but so far I get nothing. say my classes are (rough sketch): class A{ @ManyToOne(...) B b; } class B{ @OneToOne(...) C c; } class C{ String s; } and I want a criteria that r...