FAQ Database Discussion Community


Why “removing any who's ViewModel PropertyType is an interface” when creating the MvvMCross View lookup table

xamarin,viewmodel,mvvmcross,lookup-tables
When creating the default View lookup table in MvvMCross, there is a step "removing any who's ViewModel PropertyType is an interface". (http://slodge.blogspot.de/2013/01/overriding-view-lookup-convention-used.html) Why is this step performed? It's clear, that you can't instantiate an interface, but I can navigate to Interface implementing ViewModels with ShowViewModel<IMyViewModel>(), if I write Mvx.Register<IMyViewModel, MyViewModel>()....

Accessing data within elements of a lookup table

javascript,jquery,arrays,lookup-tables
I have the following array, which each element contains a information that corresponds to a start value, and end value and an id (i.e. start 5, end 10 and the id being apples). var fruits = [ [5, 10, apples], [11, 15, oranges] ]; for (var i = 0; i...

Elixir/Erlang: Fast lookup with static table

erlang,elixir,lookup-tables
In my application I need to convert integer to some term; for example: 1 → :red 2 → :green 3 → :blue The table is static, it is known during compilation time and its indices range from <1, n>. There is around 60 of them. In which way should the...

Alpha blending using table lookup is not as fast as expected

c,performance,optimization,alphablending,lookup-tables
I thought memory access would be faster than the multiplication and division (although compiler-optimized) done with alpha blending. But it wasn't as fast as expected. The 16 megabytes used for the table is not an issue in this case. But it is a problem if table lookup could even be...

Updating table with the closest value from a lookup matrix

sql,sql-server,matrix,sql-update,lookup-tables
TABLE 1 First table is the matrix containing reference values, something like this: create table dm_matrix (x float, z float, avgValue float) insert into dm_matrix values (1,1, rand()) insert into dm_matrix values (1,2, rand()) ... insert into dm_matrix values (4,3, rand()) insert into dm_matrix values (4,4, rand()) Creating a matrix...

Is there a Python equivalent to Matlab's makelut, applylut?

python,image-processing,lookup-tables,binary-image
I am working with some image processing routines, using binary images. In Matlab I can create a lookup table which provides the output for every possible 2^9=512 configurations of 3 x 3 neighbourhoods. That is, I can write a function func which produces a 0 or 1 for such a...

FPGA: Divide range by fixed number using a look-up table

math,signal-processing,vhdl,fpga,lookup-tables
I have implemented a block in an FPGA which supports hardware multiplication. This block does some division by using hardly any logic elements because it's able to use some internal DSP. This block has to be ported to another design, but here I have 2k less logic elements and no...

How to change an integer into a specific string in a data.frame in R

r,lookup-tables
I guess this is a very simple question but for some reason I'm stuck on it. I have a data frame with two columns. The second column contains only integers. More precisely it contains 0,1,2,3 and some NA's. Something like this: id1 0 id2 1 id3 0 id4 2 id5...

How to find offset in a sine lookup table (LUT) using fixed point arithmetic

algorithm,embedded,lookup-tables,fixed-point
I am generating a LUT dividing 0-2PI into 512 fragments and then finding sine of these values and storing them as Q1.31 values. Example: LUT[0] = 0 LUT[1] = sin((1/512) * 2*PI) * (2^31) .. .. LUT[511] = sin((511/512) * 2*PI) * (2^31) My inputs are also values in the...