Questions tagged [heterogeneous]

This tag is ambiguous. Please use other, more specific tags to narrow down the scope of your question.

This tag is ambiguous. Please use other, more specific tags to narrow down the scope of your question.

116 questions
6
votes
1 answer

What's better for performance, cell arrays of objects or heterogeneous arrays?

Suppose I have some classes foo < handle, and bar < foo, baz < foo, and maybe qux < foo. There are a couple ways I can store an array of these objects: As a cell array: A = {foo bar baz qux} % A(1) would be a cell, A{1} gives me a foo…
Dang Khoa
  • 5,693
  • 8
  • 51
  • 80
5
votes
2 answers

Type-safe way to store two types of object in a collection

I've been implementing an enhanced Shunting-Yard algorithm for parsing an arithmetic expression. One aspect of the algorithm, is that it maintains a Queue, and a Stack. In my implementation, the Queue contains Expressions and Operators. The Stack…
Vladislav
  • 4,806
  • 1
  • 18
  • 15
4
votes
2 answers

ANTLR3 Hetero nodes are not created

I am trying to create a heterogeneous tree based on a sample provided here: http://www.antlr.org/wiki/display/ANTLR3/Tree+construction#Treeconstruction-Heterogeneoustreenodes I have created a grammar file as follows: grammar T; options { …
dcg
  • 1,144
  • 1
  • 22
  • 38
4
votes
1 answer

heterogeneous kubernetes cluster, container performance difference

Suppose there is a k8s cluster which is made up of nodes of different hardware specs. Then 2 pods are allocated to 2 different nodes. Suppose the container in the pod had specified 1000m cpu. Could the two containers running on those 2 different…
Cui Pengfei 崔鹏飞
  • 8,017
  • 6
  • 46
  • 87
4
votes
0 answers

Apache Avro "heterogeneous array"

Could someone please advise how to use heterogeneous arrays in Avro (if possible). Cannot figure out what the trick is. My schema is: { "type": "array", "items": ["null", "string"] } I am not using the generated headers, just trying to do it all…
SergeyT
  • 51
  • 4
3
votes
1 answer

Extend ANTLR3 AST's

With ANTLR2, you could define something like this in grammar definition file: options { language = "CSharp"; namespace = "Extended.Tokens"; } tokens { TOKEN; } And then, you could create a class: public…
dcg
  • 1,144
  • 1
  • 22
  • 38
3
votes
1 answer

Best way to debug OpenCL Kernel

I have following openCL kernel I want to debug. I have put some printf in it but those are not useful as work items are schedules randomly and values printed are not always right. How I can make my work items in kernel execute in serial for…
3
votes
1 answer

Heterogeneous list of GADT in ocaml

I would like to create a heterogenous list of expression using the canonical example for GADT. Given the following types: type _ value = | Bool : bool -> bool value | Int : int -> int value type _ expr = | Value : 'a value -> 'a expr | If : bool…
Daiwen
  • 727
  • 1
  • 4
  • 15
3
votes
0 answers

Existing solutions for hash map with multitype values

I am looking for implementation of heterogeneous map. By heterogeneous map I mean a structure HMap[KeyType, Any] with defined methods: get[ValueType](key : KeyType] : Option[ValueType] +(key : KeyType, value : Any) : HMap[KeyType, Any] There are…
3
votes
2 answers

Heterogeneous Map in Scala, is it possible?

So the problem is in title. Here r some exaplanations: As we know, we can use HList to store objects with its types. SomeCL[Int], SomeCL[String], SomeCL[MyType1] :: ... :: HNil Where SomeCL is some class. So I want to make make map, which can…
DaunnC
  • 1,301
  • 15
  • 30
3
votes
1 answer

Heterogeneous Lists in Scala; using map function

So the problem is in understandig HLists of shapeless library https://github.com/milessabin/shapeless ; I'm using HLists to store some functions i.e. : val list = HList( function1(_), function2(_), .... functionn(_) ); And it works…
DaunnC
  • 1,301
  • 15
  • 30
3
votes
4 answers

synchronizing two heterogeneous databases

I have 2 heterogeneous databases. One in mysql and one in ms sql. I want to keep them in sync. There will be flow of data periodically and information flow will be both ways Anyone got any strategies / approaches to it?
Anand Sunderraman
  • 7,900
  • 31
  • 90
  • 150
3
votes
3 answers

Heterogeneous polymorphism in Haskell (correct way)

Let a module to abstract Area operations (bad definition) class Area someShapeType where area :: someShapeType -> Float -- module utilities sumAreas :: Area someShapeType => [someShapeType] sumAreas = sum . map area Let a posteriori explicit…
josejuan
  • 9,338
  • 24
  • 31
2
votes
3 answers

What types of code domains is OpenCL suited to?

I read the OpenCL overview, and it states it is suitable for code that runs of CPUs, GPGPUs, DSPs, etc. However, from looking through the command reference, it seems to be all math and image type operations. I didn't see anything for say…
IamIC
  • 17,747
  • 20
  • 91
  • 154
2
votes
0 answers

how to optimizer sql join query over heterogeneous datasource in calcite

I am new to calcite.What i want to do is to provide a simple tool to analyse data from different datasource,such as mysql,rest service , mongo and so on. I think calcite is just what i need. But after some trying, I found some problem using…