Search Results

Search found 140 results on 6 pages for 'sunil nishad87'.

Page 5/6 | < Previous Page | 1 2 3 4 5 6  | Next Page >

  • Java HashMap with Int Array

    - by Sunil
    Hello I am using this code to check that array is present in the HashMap. public class Test { public static void main(String[]arg) { HashMap<int[],String> map= new HashMap<int[],String>(); map.put(new int[]{1,2}, "sun"); System.out.println(map.containsKey((new int[]{1,2}))); } } But this prints False. How can I check that array is present in the HashMap. Thanks in advance.

    Read the article

  • Problem in setting backgound color to my TreeCellRenderer

    - by Sunil Kumar Sahoo
    Hi I have cretaed my own renderer. I want the back ground should be blue. I have set background color as blue also. But I donot know what is tha problem that the background color of my renderer always seems to be white. I have post the code. please help where I am wrong so that the background color becomes white. class CheckTreeCellRenderer extends JPanel implements TreeCellRenderer { private CheckTreeSelectionModel selectionModel; private MyRenderer delegate; private TristateCheckBox checkBox = new TristateCheckBox("", null, true); public static final State NOT_SELECTED = new State(); public static final State SELECTED = new State(); public static final State DONT_CARE = new State(); public CheckTreeCellRenderer(MyRenderer delegate, CheckTreeSelectionModel selectionModel) { this.delegate = delegate; this.selectionModel = selectionModel; setLayout(new BorderLayout()); setOpaque(true); setBackground(new Color(207, 219, 234)); checkBox.setState(Boolean.TRUE); checkBox.setOpaque(true); checkBox.setBackground(new Color(207, 219, 234)); } public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { Component renderer = delegate.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); TreePath path = tree.getPathForRow(row); if (path != null) { if (selectionModel.isPathSelected(path, true)) { checkBox.setState(Boolean.TRUE); } else { checkBox.setState(selectionModel.isPartiallySelected(path) ? null : Boolean.FALSE); } } renderer.setBackground(new Color(207, 219, 234)); tree.setOpaque(true); tree.setBackground(new Color(207, 219, 234)); this.setOpaque(true); this.setBackground(new Color(207, 219, 234)); add(checkBox, BorderLayout.WEST); add(renderer, BorderLayout.CENTER); return this; } }

    Read the article

  • Castle windsor security exception

    - by Sunil
    I developed a small WCF service that uses Castle Windsor IoC container and it works fine on my PC. When I deploy it onto a Win 2008 R2 server and host the WCF service in IIS 7 it fails with the following error. I checked the server level web.config and the trust level is set to "Full". What do I need to do to get this to work. As a test I deployed the same service as it is onto a Windows 2003 server with the trust level set to "Full" and it works fine. I am unable to figure out what setting/configuration I am missing on the 2008 server that is making the service fail. Stack Trace: [SecurityException: That assembly does not allow partially trusted callers.] Castle.Windsor.WindsorContainer..ctor() +0 WMS.ServiceContractImplementation.IoC.IoCInstanceProvider..ctor(Type serviceType) in D:\WCF\WCFProofOfConcept\WMSServices \WMS.ServiceContractImplementation\IoC\IoCInstanceProvider.cs:19 WMS.ServiceContractImplementation.IoC.IoCServiceBehavior.ApplyDispatchBehav­ior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase) in D:\WCF \WCFProofOfConcept\WMSServices\WMS.ServiceContractImplementation\IoC \IoCServiceBehavior.cs:24 System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(Ser­viceDescription description, ServiceHostBase serviceHost) +377 System.ServiceModel.ServiceHostBase.InitializeRuntime() +37 System.ServiceModel.ServiceHostBase.OnBeginOpen() +27 System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +49 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +261 System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +121 System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479

    Read the article

  • javascript image toggling

    - by Sunil Ramu
    I have a tree view which has a folder icon by default and once clicked it has to be changed to a checkbox icon. And further on clicking the checkbox icon should display a folder icon. Sample Code, Server side : c# htmlSb.AppendFormat(" {0}", emptyContent); JS code var Test= new Object(); Test.Controls=new Object(); Test.Controls.TreeView = new Object(); **Test.Controls.TreeView.SelectNode = function (TreeId, nodeLabel) { $("#" + TreeId + " li span, ul li span").css("background-color", "transparent"); nodeLabel.style.backgroundColor = "white"; nodeLabel.style.background = "url(../images/selected.gif) 0 0 no-repeat"; }** The other Image : if (nodeLabel.style.background = "url(../images/folderclosed.gif) 0 0 no-repeat") I need to toggle between "selected.gif" and "folderclosed.gif" images. If one is clicked the other should display. and vice versa. Please help.

    Read the article

  • Adding roles from a DB Table

    - by Sunil Ramu
    Can anyone expalin me how to dynamically ger the Role from a DB table instead of hard coding it in the code. ClaimsIdentity outputIdentity = new ClaimsIdentity(); outputIdentity.Claims.Add(new Claim(System.IdentityModel.Claims.ClaimTypes.Name, principal.Identity.Name)); outputIdentity.Claims.Add(new Claim(ClaimTypes.Role, "Manager")); outputIdentity.Claims.Add(new Claim(ClaimTypes.Country, HttpUtilities.GetProgramIdentifierFromUrl())); return outputIdentity;

    Read the article

  • How to get Google Search Query Kind of Content Indexed ?

    - by Sunil
    Hello: I was looking for something like flash grabber and I came across this result http://www.giveawayoftheday.com/flash+grabber+firefox/ I am just wondering how giveawayoftheday has managed to get "flash+grabber+firefox/" indexed in Google ? Did they submit via Google Sitemap or is Google doing this on its own ? Or something else ? Kindly enlighten. Thanks.

    Read the article

  • Populate asp.net MVC Index page with data from the database

    - by Sunil Ramu
    I have a web application in which I need to fetch data from the database and display in the index page. As you know, asp.net mvc has given options to edit delete etc... I need to populate the page using the conventional DB way and it uses a stored procedure to retrieve results. I dont want to use LINQ. This is my model entity class using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace LogMVCApp.Models { public class Property { public int Id { get; set; } public string LogInId { get; set; } public string Username { get; set; } public string Action { get; set; } public string Information { get; set; } public bool Passed{get; set; } public string LogType { get; set; } } } and I need to retrieve data using something like this... var conString = ConfigurationManager.ConnectionStrings["connection"].ToString(); var conn = new SqlConnection(conString); var command = new SqlCommand("LogInsert", conn){CommandType=CommandType.StoredProcedure};

    Read the article

  • Pushing a vector into an vector

    - by Sunil
    I have a 2d vector typedef vector <double> record_t; typedef vector <record_t> data_t; data_t data; So my 2d vector is data here. It has elements like say, 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 Now I want to insert these elements into another 2d vector std::vector< vector<double> > window; So what I did was to create an iterator for traversing through the rows of data and pushing it into windowlike std::vector< std::vector<double> >::iterator data_it; for (data_it = data.begin() ; data_it != data.end() ; ++data_it) window.push_back ( *data_it ); Can anybody tell me where I'm wrong or suggest a way to do this ? Thanks

    Read the article

  • Facebook API question - uids and email

    - by Sunil
    Hello Folks, I am trying to develop a application where The user 'X' has logged into Facebook app has a set of email addresses (possible friends of user 'X') app gets the list of friends of user 'X' (uids) Want to check if user with email address [email protected] is a valid facebook user by using email address and is user X's friend (basically a uid to email mapping) Thanks!

    Read the article

  • Pushing a vector into an vector

    - by Sunil
    I have a 2d vector typedef vector <double> record_t; typedef vector <record_t> data_t; data_t data; So my 2d vector is data here. It has elements like say, 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 Now I want to insert these elements into another 2d vector std::vector< vector<double> > window; So what I did was to create an iterator for traversing through the rows of data and pushing it into window like std::vector< std::vector<double> >::iterator data_it; for (data_it = data.begin() ; data_it != data.end() ; ++data_it){ window.push_back ( *data_it ); // Do something else } Can anybody tell me where I'm wrong or suggest a way to do this ? BTW I want to push it just element by element because I want to be able to do something else inside the loop too. i.e. I want to check for a condition and increment the value of the iterator inside. for example, if a condition satisfies then I'll do data_it+=3 or something like that inside the loop. Thanks P.S. I asked this question last night and didn't get any response and that's why I'm posting it again.

    Read the article

  • How to parse SQL files using C# ?

    - by Sunil Agarwal
    Hi, Can anyone please help me? I am having bunch of .sql files. I want to parse (validate) those files before executing them on server. I have many online sites which parse the code. But I want to parse the code using C#. So please can you guide. If there is any tool, dll I need to use. I just want to parse the file and not execute it

    Read the article

  • Crystal Reports : How to add an external assembly class?

    - by Sunil
    I am using VS2010, CrystalReport13 & MVC3. My problem is unable to add an external assembly in Crystal Report using "Database Expert" Option. I have a class named WeeklyReportModel in an external assembly. In my web project, data retrieving from DB as IEnumerable collection of WeeklyReportModel. I tried ProjectData - .NetObjects in Crystal Report for adding the WeeklyReportModel. But this external assembly is not showing under ".NetObjects". Then I tried other option as Create New Connection - ADO.Net – Make New Connection and pointed this External Assembly. It has been added under Ado.Net node, but while expanding displays as "...no items found..." Totally frustrated. Please help. External Assembly Class: namespace SMS.Domain { public class WeeklyReportModel { public int StoreId { get; set; } public string StoreName{ get; set; } public decimal Saturday { get; set; } public decimal Sunday { get; set; } public decimal Monday { get; set; } public decimal Tuesday { get; set; } public decimal Wednesday { get; set; } public decimal Thurday { get; set; } public decimal Friday { get; set; } public decimal Average { get; set; } public string DateRange { get; set; } } } In Controller-action[Data retrieving as Collection Of WeeklyReportModel] namespace SMS.UI.Controllers { public class ReportController : Controller { public ActionResult StoreWeeklyReport(string id) { DateTime weekStart, weekClose; string[] dateArray = id.Split('_'); weekStart = Convert.ToDateTime(dateArray[0].ToString()); weekClose = Convert.ToDateTime(dateArray[1].ToString()); SMS.Infrastructure.Report.AuditReport weeklyReport = new SMS.Infrastructure.Report.AuditReport(); IEnumerable<SMS.Domain.WeeklyReportModel> weeklyRpt = weeklyReport.ReportByStore().WeeklyReport(weekStart, weekClose); Session["WeeklyData"] = weeklyRpt; Response.Redirect("~/Reports/Weekly/StoreWeekly.aspx"); return View(); } } } Thanks in advance.

    Read the article

  • How to undo SQL changes using installer

    - by Sunil Agarwal
    I have installer to install procedures, scripts, views, etc in SQL server 2005/2008. Now I want to add a condition in the installer like if there is any error while installing, I want to undo all the changes done in SQL server. I tried to store the procedures, views, etc which I am changing while installing and reverting them back if I get any error. But am not able to do it the way I want. Can someone guide me if he had done the same thing? To specify I am using WIX installer. Also if someone has tried SMO, it will be of great help.

    Read the article

  • Pushing an array into a vector.

    - by Sunil
    I've a 2d array, say A[2][3]={{1,2,3},{4,5,6}}; and I want to push it into a 2D vector(vector of vectors). I know you can use two for loops to push the elements one by on on to the first vector and then push that into the another vector which makes it 2d vector but I was wondering if there is any way in C++ to do this in a single loop. For example I want to do something like this: myvector.pushback(A[1]+3); // where 3 is the size or number of columns in the array. I understand this is not a correct code but I put this just for understanding purpose. Thanks

    Read the article

  • yet another logic.

    - by Sunil
    I'm working on a research problem out of curiosity and I don't know how to program the logic that I've in mind. Let me explain it to you : I've 4 vectors say for example, v1 = 1 1 1 1 v2 = 2 2 2 2 v3 = 3 3 3 3 v4 = 4 4 4 4 Now what I want to do is to add them combination-wise. i.e v12 = v1+v2 v13 = v1+v3 v14 = v1+v4 v23 = v2+v3 v24 = v2+v4 v34 = v3+v4 Till this step it is just fine. The problem/trick is now, at the end of each iteration I give the obtained vectors into a black box function and it returns only few of the vectors say v12, v13 and v34. Now, I want to add each of these vectors one vector from v1,v2,v3,v4 which it hasn't added before. For example v3 and v4 hasn't been added to v12 so I want to create v123 and v124. similarly for all the vectors like, v12 should become : v123 = v12+v3 v124 = v12+v4 v13 should become : v132 // this should not occur because I already have v123 v134 = v13+v4; v14,v23 and v24 cannot be considered because it was deleted in the black box function so all we have in our hands to work with is v12,v13 and v34. v34 should become : v341 // cannot occur because we have 134 v342 = v34+v2 It is important that I do not do all at one step at the start like for example I can do (4 choose 3) 4C3 and finish it off but I want to do it step by step at each iteration. I've asked a modified version of this question before (without including the black box function) and got answers here. Can anybody tell me how to do it when the black box function is included ? A modification of the previous answer would also be great. Thanks in advance.

    Read the article

  • jquery 1.3 not(:first) problem in IE

    - by sunil-mand99
    Hi, i have 3 div tags of same class, <div class="redc"> <p>sdfs</p> </div> <div class="redc"> <p>sdfs</p> </div> <div class="redc"> <p>sdfs</p> </div> to select div other than first ,$(".redc:not(:first)") works fine in mozilla,but not in IE Please suggest any alternative for IE Note: vesion jquery 1.3

    Read the article

< Previous Page | 1 2 3 4 5 6  | Next Page >