Questions tagged [instances]

An instance is a specific realization of any object.

516 questions
9
votes
3 answers

Python max with same number of instances

I have a list: hello = ['1', '1', '2', '1', '2', '2', '7'] I wanted to display the most common element of the list, so I used: m = max(set(hello), key=hello.count) However, I realised that there could be two elements of the list that occur the…
james_kansas
  • 165
  • 2
  • 7
9
votes
4 answers

Cloning vs. Instantiating a new class

Is cloning good practice in this case? How to do it better? public ModelCollection startParsing() { return parseFeed(new ModelSpecialEntry); } public ModelCollection parseFeed(ModelEntry pattern) { ModelCollection modelCollection = new…
OneWorld
  • 17,512
  • 21
  • 86
  • 136
9
votes
3 answers

How to run multiple instances of jetty with maven

So, what I want to do is configure maven plugin jetty to run multiple - in my case two - instances of jetty server on different ports and with different apps. So, I want to have something like: localhost:8080/webapp1 localhost:8081/webapp2 And I…
Johnny
  • 113
  • 1
  • 4
8
votes
2 answers

App Engine - Too many open instances

My app is running on App engine Java SDK, and since this morning I noticed that open instances are not handling new requests, and instead, new Frontent instances are being started. So now i have about 250 open instances (a lot more than…
Andrei F
  • 4,205
  • 9
  • 35
  • 66
7
votes
1 answer

GAE: memcache: is it the same across multiple app instances

I have a pretty basic question: In GAE, if I use memcache to store some data once it was retrieved for the first time from the db, if then that data remains in the cache for like 2 days, do ALL instances of said application get to "see" it and…
Shivan Dragon
  • 15,004
  • 9
  • 62
  • 103
7
votes
1 answer

Delete a mutex from another process

Using the topic Overview - Handle Enumeration, number 5, the attempt Close mutex of another process and and information from Mutex analysis, the canary in the coal mine and discovering new families of malware/, I have came up with: Attempt 1:…
ParoX
  • 5,685
  • 23
  • 81
  • 152
7
votes
2 answers

Mysql 5.7 Could not create unix socket lock file

I am trying to create multiple instances of MySQL 5.7 in the same Ubuntu 16.10 32-bit box. I have copied the original data dir to the new one. Created separate log folder for the new instance(the logs are working). Changed the owner to mysql:mysql…
Mallik Kumar
  • 540
  • 1
  • 5
  • 28
7
votes
1 answer

Creating Instance of Eq for custom data type in Haskell

I have made some custom Data types for number representation in Haskell, now I want to implement Eq instances for it, but I am somehow stuck. So I have already made: data Digit = Zero | One | Two type Digits = [Digit] data Sign = Pos | Neg -- Pos…
Pegasus Thorn
  • 159
  • 1
  • 2
  • 12
7
votes
2 answers

How do you create an instance of an instance in JavaScript

I want to make unique instances of a set of cars that different people can hold. The cars will have similar base specs but some of their properties and methods will vary. The problem I have is that I can't work out how this should work. How do you…
jamcd
  • 101
  • 4
7
votes
1 answer

Data.Vector.Binary overlaps Binary [a] instance

In my application I need to serialize a vector containing an arbitrary datatype, in this case is a list of Doubles. For serializing the vector I'm importing Data.Vector.Binary. When loading the module in GHCi the following error arises: Overlapping…
uu1101
  • 73
  • 1
  • 4
7
votes
2 answers

Python: functions in a class and memory

If I have a class with several functions: class Example: def func1(self): print 'Hi1' def func2(self): print 'Hi2' def func3(self): print 'Hi3' If I create several instances of 'Example', does each instance…
Squall Leohart
  • 657
  • 2
  • 8
  • 20
6
votes
3 answers

Open multiple firefox instances with different profiles on Mac OS X

What is the best way to open different firefox instances (firefox 3 to 10) with different profiles (on 10.5, 10.6 and 10.7)? With versions prior to Firefox-7, modifying the content of the firefox package and adding -no-remote -P {PROFILE}…
Andreas Calvo
  • 63
  • 1
  • 4
6
votes
2 answers

Trying to render a new instance in ReactJS

As an example (real tried code) I have a component of which I want to initiate a NEW instance for rendering. import React, { Component } from 'react'; export default class TinyObject extends Component { constructor(props) { …
Reneb
  • 121
  • 2
  • 9
6
votes
2 answers

Java: prefer Utility Class depending on a class instance or static methods?

I've a Java class that does something like this public class MyObjectUtil { private final MyObject myObject; public MyObjectUtil (MyObject myObject){ this.myObject = myObject; } public boolean…
spike07
  • 809
  • 2
  • 12
  • 21
6
votes
1 answer

Polymorphic class-constrained instances

I want to make all types that are instances of Enum and Bounded also an instances of Random. The following code does this and should work (with the appropriate extensions enabled): import System.Random instance (Enum r, Bounded r) => Random r…
Ollie Saunders
  • 7,787
  • 3
  • 29
  • 37
1
2
3
34 35