Wednesday, April 25, 2012

How to get different random numbers?

I have a String array with many elements (as I haven't still finished the Application, I don't know exactly the number), maybe about 200. I would like to get 20 random elements of this array, but being certain that every random element occurs only once, like, I don't want to get in those 20 elements the 5th element (for example) twice. How can I do this?





Pruning a AbstractTableModel without getValueAt() complications

Is there a way to derive a pruned AbstractTableModel from a full AbstractTableModel without getValueAt() complications?



My full data (including userIds) is loaded into a JTable AbstractTableModel. However, for display purposes, I wish to derive a pruned AbstractTableModel of data associated with a particular userId.



I am beginning to think this is not possible because getValueAt intervenes and throws IndexOutOfBounds exceptions? These exceptions seem to occur becuase the pruned Data is not populated.



public class PrunedUserIdTableModel extends AbstractTableModel {

TableModel fullModel;
List columnIdentifiers;
List tempDatum;
List tempData; // holds tempDatums
int rowCount; // reports pruned rowCount through getRowCount() method
List prunedData; // intended to hold data of matched userId rows

public PrunedUserIdTableModel(JTable fullTable, String userId) {
fullModel = fullTable.getModel();
columnIdentifiers = new ArrayList();
tempDatum = new ArrayList();
tempData = new ArrayList();
rowCount = 0;

List<Integer> userCount = new ArrayList<>();

// Load columnIdentifiers from fullModel; omitted here

// Go through fullModel searching for rows with matching userIds

for (int i = 0; i < fullModel.getRowCount(); i++) {
for (int k = 0; k < fullModel.getColumnCount(); k++) {
tempDatum.add(fullModel.getValueAt(i,k);
if ((fullModel.getValueAt(i,k).equals(userId)) {
// Matching userId found; record relevant row
userCount.add(g);
}
}
tempData.add(tempDatum);
tempDatum.clear();
}

// Now populate prunedData
for (int j = 0; j < userCount.size(); j++) {
prunedData.add(tempData.get(userCount.get(j)));
rowCount=rowCount+1;
}

fireTableChanged(null);
}
@Override
public int getRowCount() {
return rowCount;
}
@Override
public int getColumnCount() {
return fullModel.getColumnCount();
}
@Override
public int getValueAt(int rowIndex, int columnIndex) {
// THROWS INDEX OUT OF BOUNDS EXCEPTION: Index 0; size 0
List rowList = (List)prunedData.get(rowIndex);
return rowList.get(columnIndex);
}
}




CSS3 transitions want to add a colour and fade it away

I want to make a DIV background (which doesn't have a background color) flash red then ease out to blank again. now I have used JS to add a new CLASS (which adds the red) to the DIV in question and CSS3 to add an easing to the background color. but it eases it IN, what I want is it to go RED then ease out. I guess I could do this by using JS to add multiple CLasss after a delay. but can CSS3 be used to do this entirely?



cheers





Dom parsing in android

i have parsed xml using dom parser,but when the xml element contains no value it throws null pointer Exception.how to check this?...
here my code



NodeList TrackName1 = fstElmnt2.getElementsByTagName("Artist_Name");    


Element TrackElement1 = (Element) TrackName1.item(0);

TrackName1 = TrackElement1.getChildNodes();
result=result+((Node) TrackName1.item(0)).getNodeValue()

String Artistname=((Node)TrackName1.item(0)).getNodeValue();



}




Combotree in javascript (jquery)

I'm looking for a component which enable display tree in combo (select).
Something like that: http://www.jeasyui.com/demo/index.php



But this component doesn't allow import JSON directly, only from file.



It works in that way:



$('#cc').combotree({  
url:'tree_data.json'
});


I need (pseudocode):



$('#cc').combotree({  
data:'[{"id":1,"text":"City","children":[{"id":11,"text":"Wyoming","children":[{"id":111,"text":"Albin"}]}]}]'
});


Or (pseudocode):



$('#cc').combotree({  
data:'<?php $json_string; ?>'
});


Is it possible? Or maybe do you know any components which enable to do that?



Regards,
Chris





Frame with 50 png in iPhone

I have a ViewController with 16 buttons. Each button loads a popover that show 50 frames renders in moving.



What is the best form to do it?



I know that imageWithName is bad because it load all images in cache, and for this reason im doing it with:



myAnimatedView.animationImages=[NSArray arrayWithObjects:
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@0000",nombrePieza]ofType:@"png"]],
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@0001",nombrePieza]ofType:@"png"]],
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@0002",nombrePieza]ofType:@"png"]],
...
...
... [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@0050",nombrePieza]ofType:@"png"]],nil];


But when i load about 10 times the popover with differents frames, i have a leak of memory only on my device, but not in the simulator.



For this reason, i want know which is the best form to do it?



With a video? or with CAAnimation?



Thanks for help.





How to hide the code of firefox extension

I made an IE toolbar by BHO with C#. And now I want to make a firefox version.
I planned to use xul but it will show the source code to the user.
Seems DLL is not a good way in firefox.



I tried some toolbar like yahoo, google which will not create files in extension folder.
How can I make something like that?





Android SAX parsing retrieval very slow

In my app i have some 50 to 100 data to be parsed...also some images within 2 MB size...All these are to be retrieved to a single activity and are sorted and displayed there...



But its taking about 2 minutes...thats too much.



What to do for reducing the parse time?



Or am i wrong using SAX parsing???Suggestions please....



SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
XMLReader xr = sp.getXMLReader();

/** Send URL to parse XML Tags */
URL sourceUrl = new URL(url);

/** Create handler to handle XML Tags ( extends DefaultHandler ) */
XmlHandler xmlHandler4Profile = new XmlHandler();
xr.setContentHandler(xmlHandler4Profile);
xr.parse(new InputSource(sourceUrl.openStream()));

}




How to add g729 codec plug-in in JMF 2.1.1e

I have a g729 codec package, but I couldn't able to add it in JMF.
How can I make a JMF codec plugin, so that I can transmit audio in
g729 format.



In a straight forward way, how to enable JMF to support additional
codec plugin.



I searched through, but couldn't find any straight forward answer.





Spring Security Implementation in Legacy Application

Let say i have a screen name ITEM thats performs different actions
Save,Updata, Delete



i have given a user ADMIN with a role of ADMIN
and the ADMIN role can only perform SAVE and UPDATE operations on this screen
how to customize this using spring security



Mehtod Level Security checks only on roles but not one step further
but that must pe possible with spring security
as i have currently not so much knowledge of this therefore i am asking this
from spring experts



thanks





Conditional Coloring of Datatable in PF or var vs binding tags in a datatable

I have a datatable and a collector. Each row in the datatable has a button and this button adds the corresponding row to the collector. I want to add conditional coloring to this datatable. Condition is whether the selected rows are in the collector or not.



<p:dataTable rowStyleClass="#{backingBean.selectedMemberList.contains(aMember) ? 'passive' : 'active'}" style="width: 100%;" id="dTable" var="aMember" value="#{backingBean.memberList}">
<p:column>
...
</p:column>

<p:column>
<p:commandButton id="btn_add" value="Add" update=":mf:op" process=":mf:op_uk">
<p:collector value="#{aMember}" addTo="#{backingBean.selectedMemberList}" />
</p:commandButton>
</p:column>


backing bean:



List<Member> selectedMemberList;
List<Member> memberList;

//getter and setter methods


Above code does passive style class but does not add active style. I thought it is maybe because I can not pass var (which is request scoped) to backing bean.. So I tried binding the value to a backing bean value:



<p:dataTable binding="#{backingBean.anotherMember}" rowStyleClass="#{backingBean.selectedMemberList.contains(aMember) ? 'passive' : 'active'}" style="width: 100%;" id="dTable" var="aMember" value="#{backingBean.memberList}">


backingBean:



private Member anotherMember;
//getter and setter methods


but it did not work either. Does anyone have any recommendation about this issue?



PrimeFaces ver 2.2.1



EDIT:
css contains these fields:



.active{    
background-image: none !important;
}

.passive{
background-color:gainsboro !important;
background-image: none !important;
}




How to use a Custom Controller in a JSF Application

I have an existing Java EE based web Application having JSP as a view component and a Servlet as a controller (name: Control1), which has the entire application logic.



The requirement is to use JSF 2.0 Facelets as UI Components. The Facelets have been written.



Now the problem is navigation. Since it is an existing application there is a huge amount of code and logic inside the controller Control1, which I have to reuse without evaluating the design trade-off.



Please suggest when I submit the form in my newly written xhtml pages how the request can be forwarded to my controller Control1, with the HTTP request object and parameters from the Faces Servlet.





C# - Can't get column types from MySQL

Here's some code:



OdbcConnection connection = new OdbcConnection(@"DRIVER={MySQL ODBC 5.1 Driver};SERVER=" + ip + ";DATABASE=db_name;USER=user;PASSWORD=" + dbPw + ";");
connection.Open();

string queryString = query;
OdbcCommand command = new OdbcCommand(queryString);

command.Connection = connection;
OdbcDataReader myReader = command.ExecuteReader();
int fieldsN = myReader.FieldCount;

StringBuilder sb = new StringBuilder();

while (myReader.Read())
{
for (int i = 0; i < fieldsN; i++ )
{
sb.Append(myReader.GetString(i) + " ");
}
sb.Append(", ");
}

connection.Close();

//Console.WriteLine(sb.ToString());


This code works fine with queries like "SELECT * FROM some_table" or "SELECT (something, something_else) FROM some_table."



However it fails when I use "SHOW COLUMNS FROM some_table."



Here's the error I get:




Unable to cast object of type 'System.DBNull' to type 'System.String'.




This error happens somewhere in the myReader.GetString() line.



I've tried creating an if statement that checks if myReader.GetString(i) is System.DBNull to no avail. Whatever I do it always errors out. I don't understand what is going on.



Thanks for any help!





PHP: how to create a search form that will link to my search script

I have a PHP search script which I've altered slightly and works well for me. But there is one part Im not sure how to do, and that is linking the script up to a search form, that a user can complete.



The script is below, and it searches a text file for key words. Currently the "key word" is entered directly into the script. But that is no good for someone visiting my site - so I wanted to create a search form. But not sure if I should use POST or GET or something else. And I dont know how I should link the code up from the form, to the script below. I've searched for quite a bit of time to find this, but cant see anything that covers it, and my attempts at getting it to link up arent going well. If anyone could help it would be most appreciated.



(original code borrowed from Lekensteyn - http://stackoverflow.com/a/3686246/1322744 (thanks))



<?php
$file = 'users.txt';
$searchfor = 'entersearchterm';

$contents = file_get_contents($file);
$pattern = preg_quote($searchfor, '/');
$pattern = "/^.*$pattern.*\$/m";

if(preg_match_all($pattern, $contents, $matches)){
echo "Found matches:<br />";
echo implode("<br />", $matches[0]);
}
else{
echo "No matches found";
fclose ($file);
}
?>




generate next color randomly if the color is still available

I m working on an app for android and I'm struggling at some points. One of them would be to chose the next color (out of four) but keeping in mind, that the color chosen, could be empty already, in this case the next of the four colors shall be chosen



I have two ways of doing it, but one of them is way too much code and the other one is causing a crash (I guess that happens because it can end up in an endless loop)



Thanks in advance



public void nextColor(Canvas canvas) {
Random rnd = new Random(System.currentTimeMillis());
int theNextColor = rnd.nextInt(4);
switch (theNextColor) {
case 0:
if (!blue.isEmpty()) {
currentPaint = paintBlue;
} else
nextColor(canvas);

case 1:
if (!grey.isEmpty()) {
currentPaint = paintGray;
} else
nextColor(canvas);
case 2:
if (!gold.isEmpty()) {
currentPaint = paintGold;
} else
nextColor(canvas);
case 3:
if (!red.isEmpty()) {
currentPaint = paintRed;
} else
nextColor(canvas);
}




scala map / type instantiation

can someone explain the best way to get around the following,
rather curious type error. Suppose I create a list of tuples like so:



scala> val ys = List((1,2), (3,4), (5,6))
ys: List[(Int, Int)] = List((1,2), (3,4), (5,6))


Now, if I want to map this to a List(Int)



scala> ys.map((a: Int, b: Int) => a + b)
<console>:9: error: type mismatch;
found : (Int, Int) => Int
required: ((Int, Int)) => ?
ys.map((a: Int, b: Int) => a + b)
^


Any clues? I know I can use the for comprehension



scala> for ((a, b) <- ys) yield a + b
res1: List[Int] = List(3, 7, 11)


But it feels wrong to bust out a comprehension in this setting. Thanks!





Show specific page when opening Account window

Following on from my previous Dynamics CRM question (Show popup/alert if account has related entity records)



In the OnLoad event of the Account form, I want to set the window to open with a specific sub-navigation item loaded into the right-hand frame.



For example, by default, when you open the Account window, it loads the account details. Listed on the left are various related items. I have a custom related entity called Alert. If a specific criteria is met in my javascript, I want the Alert entity view to be loaded into the right-hand view instead of the Account details.



Is this possible?





How Can I Change the Icon for an Existing Shortcut in shell script

I have installed my flash application using packagemaker installer. I have created short cut to desktop using shell Script. Now i want to change the default short cut Icon. Please tell me shell script to change the short cut icon.



MAC OS 10.7.2





Codeigniter Profiler with method execution count, times etc

Is there any CI library that I can use for profiling, finding bottlenecks, seeing unnecessary execution times etc in my local php environment using beside the CI's default profiler?



I'm going to use it remotely and my host doesn't have any debug extensions installed, and I don't want to ask them to install, and if there's any PHP solution of it, it'll be nice.





Execute Immediate Alter User Bind Variable

The following procedure:



create or replace
PROCEDURE ChangePassword
(
p_Name VARCHAR2,
p_Password VARCHAR2
)
AS
EXECUTE IMMEDIATE 'ALTER USER :a IDENTIFIED BY :b' USING p_Name, p_Password;
END;


compiles successfuly, but when executed:



exec ChangePassword('TestUser', 'newPassword');


results in error:



01935. 00000 -  "missing user or role name"
*Cause: A user or role name was expected.
*Action: Specify a user or role name.


Why?





Compatibility assistance issue in window 7

After creating an installer whenever I am running my application (from installer) , I am getting program compatibility assistant message. To fix this issue I have added the below code in my manifest file. but still I am getting the same issue . I am facing this issues in 2 of my applications one is in vs2010 and other is in VS2005. Below code fixes the issue in VS2010 application. But for the other application , still the issue is present.



  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.

<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />

Specifying requestedExecutionLevel node will disable file and registry virtualization.
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>








  <!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>

</application>




can any one help me in resolving the above mentioned problem



Regards,



Vidya





ASP.NET MVC Ajax Form: Is enctype correct? Why doesn't file get uploaded?

In the case that the user doesn't have Javascript activated, in order to draw a form, I begin this way:



<% using (Html.BeginForm("Create", "Language", FormMethod.Post,
new {enctype="multipart/form-data"}))
{ %>


If the user has Javascript activated, the following code is used:



<% using (Ajax.BeginForm("Create", "Language",
new AjaxOptions { UpdateTargetId = "CommonArea" },
new { enctype = "multipart/form-data" }))
{ %>


The problem is this:



In the first case, I can get the file uploaded using the following instruction in the business layer:



// Get the uploaded file
HttpPostedFile Flag = HttpContext.Current.Request.Files["Flag"];


In the second case, this instruction doesn't work. How do I know upload that file using the Ajax.BeginForm? Is the code right? Can anyone more experience advise about using jQuery plug-in to upload file before the form submission?



Thank you





Repackaging the .jar file

I need to add some jars from JRE7 library to my Android project. But for example rt.jar is in conflict with android.jar from Adroid 2.2 SDK, so I get this error:



Ill-advised or mistaken usage of a core class (java.* or javax.*)
when not building a core library.

This is often due to inadvertently including a core library file
in your application's project, when using an IDE (such as
Eclipse). If you are sure you're not intentionally defining a
core class, then this is the most likely explanation of what's
going on.

However, you might actually be trying to define a class in a core
namespace, the source of which you may have taken, for example,
from a non-Android virtual machine project. This will most
assuredly not work. At a minimum, it jeopardizes the
compatibility of your app with future versions of the platform.
It is also often of questionable legality.

If you really intend to build a core library -- which is only
appropriate as part of creating a full virtual machine
distribution, as opposed to compiling an application -- then use
the "--core-library" option to suppress this error message.

If you go ahead and use "--core-library" but are in fact
building an application, then be forewarned that your application
will still fail to build or run, at some point. Please be
prepared for angry customers who find, for example, that your
application ceases to function once they upgrade their operating
system. You will be to blame for this problem.

If you are legitimately using some code that happens to be in a
core package, then the easiest safe alternative you have is to
repackage that code. That is, move the classes in question into
your own package namespace. This means that they will never be in
conflict with core system classes. JarJar is a tool that may help
you in this endeavor. If you find that you cannot do this, then
that is an indication that the path you are on will ultimately
lead to pain, suffering, grief, and lamentation.


I know there have been several threads about it and things like JarJar, OneJar or FatJar might be good for me. But I don't know how to make any of them work and documentation doesn't really make it clear (for me). I guess they use Ant commands, but I have always used Eclipse built-in builder and now I have no idea how to use neither Ant nor any of mentioned above.



So my question is: how can I repack this rt.jar so I could compile it in my Android project?



Thank you!





How to check whether the port 80 is available using a batch file in windows xp

I'm writing a batch file to automatically checks the port 80 availability and give an error message if it is using by another program. But I'm not sure how to check the port 80 availability in a batch file.



I found following command to check that with terminal.



 netstat -o -n -a | findstr 0.0:80


But I need to check it with a batch file like follows



if (!//port 80 is available) {
// Give an error message
} else {
// Continue with the rest
}


Can someone please help me on this.





Google Contacts API asp.net settings and authorization token

Is there any good example that shows how to fill the application settings creating the settings for request?



this is code from google



using Google.Contacts;
using Google.GData.Contacts;
using Google.GData.Client;
using Google.GData.Extensions;
// ...
RequestSettings settings = new RequestSettings("<var>YOUR_APPLICATION_NAME</var>");
// Add authorization token.
//
// ...
ContactsRequest cr = new ContactsRequest(settings);


Do I have to specify the token that I get from oAuth request, and no more?



The value for YOUR_APPLICATION_NAME could be any string value?





jQuery input updates all IDs, rather than just the one required

The issue I'm having is fairly hard for me to explain, but I have replicated it in a jsFiddle http://jsfiddle.net/6ms4T/1/



What I am trying to achieve is by updating the 'Quantity' text box, I want to display the value elsewhere (the line below which I'll refer to as the 'Cost line').



Basically, updating the first input box (qty_item_1) is updating all the (quant_) IDs in the 'Cost line', rather than just the one related to that product.



function recalc(){

$("[id^=quant_]").text($("input[id^=qty_item_]").val());


etc...



Full code is here: http://jsfiddle.net/6ms4T/1/



Any help would be appreciated.





How to start selenium server with log4j

I want to start selenium server with log4j so that all server related logs go there. I'm starting the server with ANT using the following ANT target



<target name="startserver" depends="setClassPath">
<java jar="${test.home}/lib/selenium-server-standalone-2.20.0.jar" fork="true">
<arg line="-Djava.util.logging.config.file=log4j.properties"/>
<arg line="-firefoxProfileTemplate 'D:\selenium.default'"/>
<arg line="-browserSideLog"/>
</java>
</target>


My log4j.properties is as below:



log4j.rootLogger=INFO, R, stdout

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=./logs/sellog.log
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n


But I'm not getting any server logs after I start the server from the target.



Also, I have a selenium test where I'm throwing the log into log4j as below:



private LogManager lm;
private Logger logger = lm.getLogger(this.getClass().getName());
logger.info("Selenium Client started...");


I'm getting application logs in log4j log.



What I want is to have all the logs (selenium server log + app log) in log4j log.



Any help is greatly appreciated.





nested ul menu - pass variables between windows?

I have a simple ul menu with nested ul menus here



http://www.ttmt.org.uk/forum/reload/



When the page loads the nested menus are hidden.



When the parent links are clicked I want them the nested ul to slidedown
and show the menu.



The first link 'One' is connected to another page, when it's clicked I want it's nested
menu to appear when the new page loads.



I'm thinking the only way to do this is pass a variable to the new page so it's knows which nested menu to open.



Is this the bested way to do this or is there a better way.



How can I pass a variable to the new page to open the nested menu.



    <!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.4.1/build/cssreset/cssreset-min.css">

<style type="text/css">
#nav{
margin:50px;
width:200px;
}
#nav li a{
background:#aaa;
display:block;
padding:5px;
margin:0 0 2px 0;
text-decoration:none;
}
#nav ul li a{
background:red;
color:white;
display:block;
padding:5px;
margin:0 0 2px 5px;
}
h1{
margin:50px;
font:bold 1.5em sans-serif;
}
</style>

</head>

<body>

<h1>Home</h1>

<ul id="nav">
<li><a href="one.html">One</a>
<ul class="children">
<li><a href="one.html">One/One</a></li>
<li><a href="#">One/Two</a></li>
<li><a href="#">One/Three</a></li>
</ul>
</li>
<li><a href="#">Two</a></li>
<li><a href="#">Three</a>
<ul class="children">
<li><a href="#">Three/One</a></li>
<li><a href="#">Three/Two</a></li>
</ul>
</li>
</ul>

<script type="text/javascript">

$('#nav li ul').slideUp();

$('#nav > li > a').click(function(){

if ($(this).attr('class') != 'active'){
$(this).next().slideToggle();
$('#nav li a').removeClass('active');
$(this).addClass('active');
}
});

</script>

</body>

</html>




How to fetch/optimize huge volume for PAGINATION of data through Hibernet Java Struts

Current Problem: We are currently trying to fetch over 500k (Five hundred thousand) records from the database and then I have to show 50 records per page on a JSP (using struts 2). Problem is it takes time loading long time or even some time it does not. Once it is loaded we are able to navigate smoothly.



Solution Needed: Like to load limited records as per the pagination defined records, for eg: each page upto 100 records.Has anyone implemented similar functionality in struts or similar framework? also i dont want to get all records at once. please guide me how to implement?





Open only single instance of view

From my ShellViewModel I have below command binding to open another window "Remote View"



public ICommand RemoteViewCommand
{
get { return new RelayCommand(RemoteViewExecute, CanRemoteViewExecute); }
}

private void RemoteViewExecute()
{
if (!CanRemoteViewExecute())
{
return;
}

//call restore view
//new ShellRemoteView().Show();

ShellRemoteView shellRemoteView = Application._Container.Resolve<ShellRemoteView>();
shellRemoteView.DataContext = Application._Container.Resolve<ShellRemoteViewModel>();
shellRemoteView.Show();
}


ie Every time I click button on shellView -> it opens as much instances of remote view.
How can I achieve only single instance of RemoteView to be opened/activate each time.
Any help would be really appreciated