I can't find this answer anywhere. What does it mean when there's a sender parameter in a method header? Does it represent the instance that called it, or the method that called it?
I'm trying to programatically add a series to a Dundas TreeMap but I'm getting a Object reference not set to an instance of an object. error. This error looks to be a bug in Dundas, but I was wondering if anyone has tried/managed to do this?
If I add the series in declaratively then at all works fine.
Hi guys,
I need to delete duplicate users in django (by duplicate I mean two or more users with the same email).
If your instance there are three records like this:
id email
3 [email protected]
56 [email protected]
90 [email protected]
I need to delete records 56 and 90 and leave the oldest record id - 3
Is there a way to quickly do this.
Thanks :)
As far as I know the Websphere Application Server contains a Tomcat instance as servlet container.
I'd like to know which version of Tomcat this is in the Websphere 7.0 Version, since we are planning to use Tomcat for development, but WAS for deployment. Obviously we would like to use the matching version.
All,
As far as I know you can can't pass static parameters to a static constructor in C#.
However I do have 2 static parameters I need to initialize before I create an instance of a class. How do I go about it ?
Thanks,
M
Is it possible to have a datetime scale not consider weekends as part of the time continuum? For instance, if I am plotting stock prices over a 2 week period with a line geometry, I do not want to plot a 2 day period of flattness during the weekend. I would like friday to connect with Monday.
How to rotate an image with PHP, any degree, without having the filled space? For instance, if I rotate an image 10 degrees, the image rotates fine but the container around (square) gets filled with black. Is it possible to get rid of this, when for example merging 2 images?
I have a class which contains a list of items.
I want to serialize an instance of this class to json using the DataContractJsonSerializer as a json array. eg.
class MyClass
{
List<MyItem> _items;
}
class MyItem
{
public string Name {get;set;}
public string Description {get;set;}
}
When serialized to json it should be like this :
[{"Name":"one","Description":"desc1"},{"Name":"two","Description":"desc2"}]
I am experimenting with Less Css, and I am using Visual Studio 2010.
It would be nice if the editor provided support for syntax highlighting and Intellisense for Less, for instance coloring and suggesting variables. What are my options to get that to work ? Do I need to write a plugin for it, or how would one go about adding this to VS ? Does anything exist for this already ?
Hii...
I have a data table 'dt1' that is belongs to 'ds1'. I have created another instance of dataset 'ds2' and try to add the datatable 'dt1' to 'ds2'. Now i got one exception 'DataTable already belongs to another data set'. Is there any reliable way to add the dt1 to ds2?
I wonder if UIScrollView has got an "hidden" subview acting as an container for the content. If I scroll a scroll view, is that content view moved up/down in the scroll view? Or is the scrolling offset applied to the bounds of that UIScrollView instance?
Or: Does UIScrollView use an additional view as container, or is all content added directly to the view? The documentation doesn't tell much about wether it has a content container or not.
I'm making a new Mac OS X application. (not an iPhone app)
This is document-based application.
It shows a new "Untitled" document instance automatically when it starts up. How can I block this behavior? I wish my application show no window at start up.
Anyone familiar with a way how can I can i write something to the stdout from maven.
For instance i would like to write a line everytime i start a new module.
i was trying to create a property which is readonly. i wanted to initialize with a value from the class creating an instance of this class.e.g
@property (readonly) NSString *firstName;
And wanted to initialize it like
-(id)initWithName:(NSString *)n{
self.firstName = n;
}
Once i do this, this compiler shows an error that the readonly property cannot be assigned. So how can i do this?
I'm about ready to bang my head against the wall
I have a class called Map which has a dictionary called tiles.
class Map
{
public Dictionary<Location, Tile> tiles = new Dictionary<Location, Tile>();
public Size mapSize;
public Map(Size size)
{
this.mapSize = size;
}
//etc...
I fill this dictionary temporarily to test some things..
public void FillTemp(Dictionary<int, Item> itemInfo)
{
Random r = new Random();
for(int i =0; i < mapSize.Width; i++)
{
for(int j=0; j<mapSize.Height; j++)
{
Location temp = new Location(i, j, 0);
int rint = r.Next(0, (itemInfo.Count - 1));
Tile t = new Tile(new Item(rint, rint));
tiles[temp] = t;
}
}
}
and in my main program code
Map m = new Map(10, 10);
m.FillTemp(iInfo);
Tile t = m.GetTile(new Location(2, 2, 0)); //The problem line
now, if I add a breakpoint in my code, I can clearly see that my instance (m) of the map class is filled with pairs via the function above, but when I try to access a value with the GetTile function:
public Tile GetTile(Location location)
{
if(this.tiles.ContainsKey(location))
{
return this.tiles[location];
}
else
{
return null;
}
}
it ALWAYS returns null. Again, if I view inside the Map object and find the Location key where x=2,y=2,z=0 , I clearly see the value being a Tile that FillTemp generated..
Why is it doing this? I've had no problems with a Dictionary such as this so far. I have no idea why it's returning null. and again, when debugging, I can CLEARLY see that the Map instance contains the Location key it says it does not...
very frustrating.
Any clues? Need any more info?
Help would be greatly appreciated :)
I'm about ready to bang my head against the wall
I have a class called Map which has a dictionary called tiles.
class Map
{
public Dictionary<Location, Tile> tiles = new Dictionary<Location, Tile>();
public Size mapSize;
public Map(Size size)
{
this.mapSize = size;
}
//etc...
I fill this dictionary temporarily to test some things..
public void FillTemp(Dictionary<int, Item> itemInfo)
{
Random r = new Random();
for(int i =0; i < mapSize.Width; i++)
{
for(int j=0; j<mapSize.Height; j++)
{
Location temp = new Location(i, j, 0);
int rint = r.Next(0, (itemInfo.Count - 1));
Tile t = new Tile(new Item(rint, rint));
tiles[temp] = t;
}
}
}
and in my main program code
Map m = new Map(10, 10);
m.FillTemp(iInfo);
Tile t = m.GetTile(new Location(2, 2, 0)); //The problem line
now, if I add a breakpoint in my code, I can clearly see that my instance (m) of the map class is filled with pairs via the function above, but when I try to access a value with the GetTile function:
public Tile GetTile(Location location)
{
if(this.tiles.ContainsKey(location))
{
return this.tiles[location];
}
else
{
return null;
}
}
it ALWAYS returns null. Again, if I view inside the Map object and find the Location key where x=2,y=2,z=0 , I clearly see the value being a Tile that FillTemp generated..
Why is it doing this? I've had no problems with a Dictionary such as this so far. I have no idea why it's returning null. and again, when debugging, I can CLEARLY see that the Map instance contains the Location key it says it does not...
very frustrating.
Any clues? Need any more info?
Help would be greatly appreciated :)
what is the best way to handle floating point numbers in XML?
If I have, for instance:
double a = 123.456;
and I would like to keep it as
<A> 123.456 </A>
simply using
...
myDoc.createTextNode(a.ToString());
is fine?
Or should it be done with some Globalization stuff to make it region-independent?
Hi,
I am trying to create Excel file using OpenXML SDK. I have one situation to get WorkBookPart from WorkSheet instance. How can I get it?
Thanks.
Ant.
The problem is in being able to catch the instance of the player to control it i.e. Stop it, Play it etc. The code by default creates multiple instances of the same player and overlaps the songs. I am being unable to reference the player specifically.
Do you have an idea as to how we can do so?
Thanks,
Arun
Short of using static IP addresses, is it possible to have a Cisco ASA use a DNS name rather than an IP address? For instance, if I want to limit a host in the DMZ to access only one particular web service, but that web service might be globally load balanced or using DynDNS or cloud, how can the ACL be expressed so that a fixed IP address isn't used and the admin doesn't have to keep opening and closing down IP addresses?
In bash, I want to get the Nth word of a string.
For instance:
STRING="one two three four"
N=3
Result: "three"
What bash command/script could do this?
Thank you!
Hello Everyone,
I am new to design patterns and am trying to learn the MVC implementation. I have written four classes:
DataModel
DataView
DataController
Main
Main serves as the application facade. The main FLA is called HelloWorld. I have a symbol called "Box" in HelloWorld. I just would like to add an instance of the "Box" on the stage. Eventually I would like to place a button and when the button is clicked, the Box instance color will be changed. I would appreciate any help, please help me figure out what am I doing wrong.
Here are my Classes:
DATAMODEL CLASS:
package
{
import flash.events.*;
public class DataModel extends EventDispatcher
{
public static const UPDATE:String = "modelUpdate";
private var _color:Number = (Math.round(Math.random()* 0xffffff));
public function DataModel()
{
trace("DATA MODEL INIT");
}
public function get color():Number
{
return _color;
}
public function set color(p:Number):void
{
_color = p;
notifyObserver();
}
public function notifyObserver():void
{
dispatchEvent(new Event(DataModel.UPDATE));
}
}
}
//DATACONTROLLER CLASS:
package
{
import flash.events.;
import flash.display.;
import flash.errors.*;
public class DataController
{
private var _model:DataModel;
public function DataController(m:DataModel)
{
trace("DATACONTROLLER INIT");
_model = m;
}
}
}
DATAVIEW CLASS:
package
{
import flash.events.;
import flash.display.;
import flash.errors.*;
public class DataView extends Sprite
{
private var _model:DataModel;
private var _controller:DataController;
private var b:Box;
public function DataView(m:DataModel, c:DataController)
{
_model = m;
_controller = c;
b = new Box();
b.x = b.y = 100;
addChild(b);
}
}
}
And Finally THE FACADE:
package
{
import flash.display.;
import flash.events.;
import flash.text.;
import flash.errors.;
public class Main extends Sprite
{
private var _model:DataModel;
private var _controller:DataController;
private var _view:DataView;
public function Main(m:DataModel, c:DataController, v:DataView)
{
_model = m;
_controller = c;
_view = v;
addChild(v);
}
}
}
When I test the movie: I get this error:
ArgumentError: Error #1063: Argument count mismatch on Main(). Expected 3, got 0.
Thanks alot.
Hi,
I have a GridView which has DataKey[0] as productId.
If i have for instance productId = 54, is there any way to search through all
GridView item and set as selected the one who has DataKEy[0] = 54?
In drop down list i have :
ddlProducts.Items.FindByValue(lblProduct.Text.ToString())).Selected = true
Is anything similar for GridView?
Thanks in advance.
Hi!
I have a collection of elements of type B and C, which all extends A. I need to filter the collection to get elements of only B type.
Is there any way to do it except:
for (A a : initCollection) {
if (a instance of B) {
newCollection.add(a)?
}
}
Thanks
So I have a string like this (the hashtags are delimiters)
A1###B2###C3###12345.jpg
I was wondering how would I access A1, B2 and C3
STRING1###STRING2###STRING3###STRING4.jpg
SOME###THING###HERE###MEH.jpg
EXTRACT###THIS###PLEASE###pah.jpg
In one instance I'd like to extract the first string. In another the second, in another the third. I will be using this with Adobe Bridge to extract metadata items from the filename
I am looping through each filename so would need
Var1 = FirstString
Var2 = SecondString
Var3 = ThirdString