Hi, I have been working on a project and trying to find the source of a large slowdown in execution time and have narrowed it down to a single method which I have managed to optimise out of the logic. The problem is that my solution involves using a reference which makes another section of the code run quite slowly... The question I'd li...
What's the best way to return a Java Map using the JSON format?
My specific need is a key -> value association between a date and a number.
My concern is this: My structure basically contains N elements of the same type (a mapping between a date and a number), and I want to be able to quickly iterate through them in Javascript.
In XML,...
Hello,
I have a Map where Coords is defined as so:
class Coords {
int x;
int y;
public boolean equals(Object o) {
Coords c = (Coords)o;
return c.x==x && c.y==y;
}
public Coords(int x, int y) {
super();
this.x = x;
this.y = y;
}
public int hashCode() {
return new Inte...
I want to display a map in a MFC application (Visual Studo 2008 with MFC Feature Pack).
Off the top of my head I have the following requirements:
I have to be able to add my own markers (plain lat/lon positions), preferrably with different colors/icons so one can distinguish between different types of markers.
If the map data is fetche...
Hi,
I've got a list of strings, is it possible to convert it to an list of ints?
eg:
["1","2"] -> [1,2]
THANKS,
...
I've got classes with mappings like this:
@Entity
public class CurrencyTable {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
private Long id;
@Version
@Column(nullable=false)
private Timestamp version;
@Column(length=32, unique=true)
private String refCode;
@OneToMany(mappedBy="currencyTab...
I'll keep this brief.
I am trying to keep a map between strings and object pointers, and as such, I use std::map. I have a manager that's a global class that keeps track of the map, and whenever an object's destructor is called, it tells the manager that it has been deleted.
The only way I can think of is to search through the map for ...
I'm interested in an answer that explain the best in each situation.
In particular which is best for:
few values
lots of values
many values with only few extensively used
read only or nearly read only map
write-a-lot map
fast membership without retrieval
memory footprint with large value
others
...
Have anyone used the Cumulative Maximum functoid and noticed performance problems?
Abstract
If one wants to map the maximum value of a field you can use the functoid Cumulative Maximum.
Problem
After we had used it for a while we noticed degraded performance on larger files.
Examining the xslt one notices that the max calculation is m...
In python, if I have a few functions that I would like to call based on an input, i can do this:
lookup = {'function1':function1, 'function2':function2, 'function3':function3}
lookup[input]()
That is I have a dictionary of function name mapped to the function, and call the function by a dictionary lookup.
How to do this in java?
...
I have code like this:
class MapIndex
{
private:
typedef std::map<std::string, MapIndex*> Container;
Container mapM;
public:
void add(std::list<std::tring>& values)
{
if (values.empty()) // sanity check
return;
std::string s(*(values.begin()));
values.erase(values.begin());
i...
Why can't I add to a scala.collection.Map? It seems that this trait is pretty useless without this functionality.
Couldn't they have overridden the ++ method in Iterable and reduced the return type to a Map?
P.S. I don't mean that it should be mutable, just that it should be able to return a new Map with an added mapping (or mappings)...
Consider:
#include <map>
int main()
{
std::map< int, int > m;
m[ 0 ] = 0;
m[ 1 ] = 1;
m.erase( 0 ); // ok
m.erase( 2 ); // no-op
m.erase( m.find( 2 ) ); // boom!
}
(OK, so the title talks abouting erasing an end() iterator, but find will return end() for a non-existent key.)
Why is erasing a non-existent ...
For instance, how would you declare a triple map like-
Map<String, Map<String, Map<Boolean, String>>>, with the keys being someKey1, someKey2, and someKey3 (true/false)?
I know until this-
<util:map
id="someMap"
map-class="java.util.HashMap"
key-type="java.lang.String"
value-type="java.lang.String">
<entry key="...
I have a schema that is the souce with an element that is unbounded. I have a similar element on the destination schema that is also unbounded. I'm trying to figure out how in the map I can ignore the first instance in the source map?
...
I have an element in the source schema of a map that contains a code. I am using this as an input to a database lookup functoid. The output of the database lookup functoid is being passed as an input parameter to a value extractor functoid, which is outputting a column value. So far so good all as expected.
My question is how do I handl...
Is there a way to further restrict the lookup performed by a database lookup functoid to include another column?
I have a table containing four columns.
Id (identity not important for this)
MapId int
Ident1 varchar
Ident2 varchar
I'm trying to get Ident2 for a match on Ident1 but wish it to only lookup where MapId = 1.
The functoid o...
It appears to from my simple testing but I'm wondering if this is guaranteed?
Are there conditions where the ordering will be not be guaranteed?
Edit: The case I'm particularly interested in is if I populate a map with a large number of entries, will the order of the itertator be the same across multiple runs of my executable? What if ...
Hi there,
I want to write a map-like object type in PL/SQL. What I mean is a key-value-pair list, where a value can be another key-value-pair list. Simple, or so I thought. Here are the two simplified
CREATE OR REPLACE TYPE TKey AS OBJECT
(
name varchar2(240),
value_text varchar2(2000),
value_map TMap
)
CREATE OR REPLACE T...
What would be the best way to triangulate a wireless network passively. Are there tools available? Algorithms? Libraries?
My goal would be to create a relative map of various objects that sends or receive signals using signal strength (DB's), signal/noise ratio, signal phase, etc. from a few location points. With enough sampling, i'm gu...