Search Results

Search found 134 results on 6 pages for 'anil namde'.

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

  • Confusions with CSS and JavaScript relations ?

    - by Anil Namde
    I have table cell which has class "cellActive". Which has following defination .cellActive{background:"#DDDDDD"} Now i am trying to read the background color property for the cell and it comes null/"". var bgColor = cell.style.backgroundColor; // returning "" Is that something mistake on my part of its by behavior. If CSS class is assigning CSS to element can't we read its value in JS ? Does this mean that if we are not assigning property directly to the element we cant get it if in case its inheriting it ?

    Read the article

  • Is count(*) really expensive ?

    - by Anil Namde
    I have a page where I have 4 tabs displaying 4 different reports based off different tables. I obtain the row count of each table using a select count(*) from <table> query and display number of rows available in each table on the tabs. As a result, each page postback causes 5 count(*) queries to be executed (4 to get counts and 1 for pagination) and 1 query for getting the report content. Now my question is: are count(*) queries really expensive -- should I keep the row counts (at least those that are displayed on the tab) in the view state of page instead of querying multiple times? How expensive are COUNT(*) queries ?

    Read the article

  • how to remove spaces and newlines from server response ?

    - by Anil Namde
    When i request a page using browser / AJAX request i see lot of spaces and newlines which i think must be adding some overhead for retrieving the response as they too belong to characters means bytes and size. right ? Is there some way it can be removed while sending from the server ? how ? (I am using IIS and asp.net for development)

    Read the article

  • Are ASP.NET readymade controls really production worthy ?

    - by Anil Namde
    I have come across the ASP.NET ready made controls like grid, repeater... etc. For example while dealing with GRID i remember following facts, ASP.NET V1.1 has DataGrid with "virtual row count" which is heavily used for custom paging which is need of big sites to perform well. ASP.NET V2.0 added the GridView with all sort of cool features but also split the DataSource parts as different component. Also "virtual row count" is not supported and for pagination to be done DataSource control is need to be used. After all these thing i thought that ASP.NET control are not made to be used as is for the development. Please let me know whether i am right or wrong? Also if you think i am wrong PLEASE provide inputs/links which can help me come out of this thinking of mine.

    Read the article

  • DataContractJsonSerializer generating Ghost string to JSON keys?

    - by Anil Namde
    DataContractJsonSerializer this is nice class added in the .net framework which can be used to serialize/desirealize object into JSON. Now following is the example i am trying [Serializable] class User { public string name; public string userId; } Now following is the output generated Output : Notice structure where only "name" is expected instead of k__BackingField Now this is the problem after digging so much i am not sure from where < and _BackingField is coming ? { "<name>k__BackingField":"test user", "<userId>k__BackingField":100001}

    Read the article

  • in javascript how to find element is array ?

    - by Anil Namde
    In javascript is there a good(i mean built in) way that i can find whether element if array of not ? one simple i can see is as follows but i don't like it if(ele.push){//its array it has push method} I mean i would like know if something like below exists function x(ele){ if(isArray(ele)){//dosomething} }

    Read the article

  • Things to take care while sending the username and password using Ajax request ?

    - by Anil Namde
    Normally we have login page with username, password filed and signin button. Using the normal form based approach we send the data on and page gets post back. Now i would like to change this using the Ajax. As Ajax too using the normal HTTP so i guess nothing in different from the existing workflow barring postback right ? Now my question is is what all securities issues can be there? and what care should be taken for doing so ? Should we encode data using say base64 or so before sending using Ajax?

    Read the article

  • help me with typecasting problem ...

    - by Anil Namde
    I would like to create a function which can take two arguments object and type and then type cast the object to appropriate type using the type parameter. Is that possible ? how can i achieve it ? public class TEST { public int test; } object ot = new TEST(); Type type = typeof(TEST); TEST t = (type)ot; //Function will be something like this public string SearializeObject(Object obj, Type t) { //check if obj is of type t if(obj is of type t){ //cast obj to type t to read it ((Type t)obj).someMethod } }

    Read the article

  • How to create inmemory HTML/XML document in .NET ?

    - by Anil Namde
    I would like to write application which will iterate trough certain test cases and generated output in HTML file. For this i would like to have something using which i can keep appending the HTML nodes to the output for each test case. Is there nice way in .NET for doing so ? How ? Any pointers or suggestions will be helpful.

    Read the article

  • HIGH CPU usage by PHP on a VPS Magento Server

    - by Anil
    My server running magento is 4gb ram and 4 core cpu. But still i am struggling with the high CPU usage. I only have 10 visitors at any given point of time. I am not sure if the PHP has to take this high % CPU usage. Attached is the TOP result. top - 09:18:32 up 2 days, 15:44, 1 user, load average: 1.16, 2.02, 1.99 Tasks: 179 total, 2 running, 177 sleeping, 0 stopped, 0 zombie Cpu(s): 46.7%us, 3.9%sy, 0.1%ni, 46.9%id, 1.0%wa, 0.0%hi, 0.0%si, 1.4%st Mem: 3919972k total, 3164968k used, 755004k free, 530820k buffers Swap: 1048568k total, 379352k used, 669216k free, 1536388k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 15897 vpsadmin 20 0 431m 168m 54m R 91.7 4.4 2:16.16 php-cgi 12308 vpsadmin 20 0 404m 163m 73m S 29.3 4.3 15:15.90 php-cgi 3644 mysql 20 0 1528m 80m 4944 S 9.8 2.1 1899:58 mysqld 4969 apache 20 0 471m 6228 2824 S 2.0 0.2 0:18.53 httpd 16148 root 20 0 15024 1220 864 R 2.0 0.0 0:00.01 top 1 root 20 0 19364 1064 844 S 0.0 0.0 0:02.50 init

    Read the article

  • System shuts down immediately after few sconds

    - by Anil
    I have a computer with following specification and was working fine after re-installing the system and refitting sink fan unit. Recently it shuts down automatically after a few seconds. I checked PSU by shorting pin no.s 13 & 14 as well as 14 & 15. It worked well means the PSU fan moves. But I never checked the voltages at different wires. I refitted the heat sink fan by applying thermal paste. but it behaved the same. Again I refitted the Heat Sink Fan, then it worked for 2 minutes and again shut down. Now it shuts down immediately after switching on. Mother board : M26GTM-3VP CPU : AMD athlon PSU : 450 watt Can anyone help?

    Read the article

  • Failed dependencies warning while installing pure-ftpd

    - by Anil
    I am trying to install pure-ftpd which is getting failed with the following warnings warning: pure-ftpd-1.0.36-1.el5.rf.i386.rpm: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY error: Failed dependencies: libmysqlclient.so.15 is needed by pure-ftpd-1.0.36-1.el5.rf.i386 libmysqlclient.so.15(libmysqlclient_15) is needed by pure-ftpd-1.0.36-1.el5.rf.i386 libpq.so.4 is needed by pure-ftpd-1.0.36-1.el5.rf.i386 I used locate libmysqlclient libpq where i could find libmysqlclient.so.16 and libpq.so.5 installed in my server I am using CentOS 6 server.

    Read the article

  • How to change the HUDSON owner on ubuntu:

    - by Anil
    I am working with tomcat6 and HUDSON, when I run the hudson job it is running as tomcat6 user, what I want to know is there any way to change the HUDSON user as my system login user instead of tomcat6 so that I can run hudson job as my system user. I just want to know whether it is possible or not and why and how? I tired editing /etc/init.d/tomcat6 and changed tomcat6 user and grop as my login id, and the restarted the tomcat. Still the hudson jobs are running as tomcat6 user.Am i did the righ thing, if so why it is not working. Thanks in advance

    Read the article

  • Forward secrecy in Nginx (CentOS6)

    - by Anil
    I am trying to enable Forward secrecy in CentOS with nginx webserver. What I have tried I have read some tutorials and seems like we should have nginx, openssl latest versions to enable it. So I had installed the openssl latest from source. sudo wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz sudo tar -xvzf openssl-1.0.1e.tar.gz cd openssl-1.0.1e sudo ./config --prefix=/usr/local sudo make sudo make install Now OpenSSL supports the Eliptic Curve ciphers(ECDHE). I tested this with openssl s_server also. It worked well. Next, I replaced Nginx with latest. sudo wget http://nginx.org/packages/centos/6/x86_64/RPMS/nginx-1.4.2-1.el6.ngx.x86_64.rpm sudo rpm -e nginx sudo rpm -ivh nginx-1.4.2-1.el6.ngx.x86_64.rpm and configured Nginx as described in this link ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA256:EECDH+aRSA+RC4:EDH+aRSA:EECDH:RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS; http://baudehlo.wordpress.com/2013/06/24/setting-up-perfect-forward-secrecy-for-nginx-or-stud/ But now Nginx does not support ECDHE ciphers. It supports DHE ciphers. I tried by just enabling ECDHE cipher in nginx still doesn't work. I am using latest web browser(chrome 29 and it support this cipher) Am i missing anything ? Or Having issues with CentOS or Nginx? I read somewhere that ECC patent issues with CentOS, is this causing problem?

    Read the article

  • how to play MP3 files at fast speed

    - by Anil
    I have MP3 file and the contents are continuous and slow. Is there any tool, which converts them to fast speed. I am aware of the fact that with VLC, i can play fast. But, the problem is every time i have to fix the speed of the player. The Question is, i dont want to manipulate/tweak every time i play the file. I wish to have permanent solution to play the slow playing MP3 files to play fast (some thing like saving the file with fast speed etc).

    Read the article

  • how to set jqgrid cell color at runtime

    - by anil
    Hi, i am populating a jqgrid from database and one of its columns is a color column like red, blue, etc. Can i set the cell color of this column based on the value coming from database at run time? how should i set formatter in this case? i tried like this but do not work var colorFormatter = function(cellvalue, options, rowObject) { var colorElementString = ''; return colorElementString; colModel: [ { name: 'GroupName', index: 'GroupName', width: 200, align: 'left' }, { name: 'Description', index: 'Description', width: 300, align: 'left' }, { name: 'Color', index: 'Color', width: 60, align: 'left', formatter: colorFormatter}],

    Read the article

  • How to write a test for accounts controller for forms authenticate

    - by Anil Ali
    Trying to figure out how to adequately test my accounts controller. I am having problem testing the successful logon scenario. Issue 1) Am I missing any other tests.(I am testing the model validation attributes separately) Issue 2) Put_ReturnsOverviewRedirectToRouteResultIfLogonSuccessAndNoReturnUrlGiven() and Put_ReturnsRedirectResultIfLogonSuccessAndReturnUrlGiven() test are not passing. I have narrowed it down to the line where i am calling _membership.validateuser(). Even though during my mock setup of the service i am stating that i want to return true whenever validateuser is called, the method call returns false. Here is what I have gotten so far AccountController.cs [HandleError] public class AccountController : Controller { private IMembershipService _membershipService; public AccountController() : this(null) { } public AccountController(IMembershipService membershipService) { _membershipService = membershipService ?? new AccountMembershipService(); } [HttpGet] public ActionResult LogOn() { return View(); } [HttpPost] public ActionResult LogOn(LogOnModel model, string returnUrl) { if (ModelState.IsValid) { if (_membershipService.ValidateUser(model.UserName,model.Password)) { if (!String.IsNullOrEmpty(returnUrl)) { return Redirect(returnUrl); } return RedirectToAction("Index", "Overview"); } ModelState.AddModelError("*", "The user name or password provided is incorrect."); } return View(model); } } AccountServices.cs public interface IMembershipService { bool ValidateUser(string userName, string password); } public class AccountMembershipService : IMembershipService { public bool ValidateUser(string userName, string password) { throw new System.NotImplementedException(); } } AccountControllerFacts.cs public class AccountControllerFacts { public static AccountController GetAccountControllerForLogonSuccess() { var membershipServiceStub = MockRepository.GenerateStub<IMembershipService>(); var controller = new AccountController(membershipServiceStub); membershipServiceStub .Stub(x => x.ValidateUser("someuser", "somepass")) .Return(true); return controller; } public static AccountController GetAccountControllerForLogonFailure() { var membershipServiceStub = MockRepository.GenerateStub<IMembershipService>(); var controller = new AccountController(membershipServiceStub); membershipServiceStub .Stub(x => x.ValidateUser("someuser", "somepass")) .Return(false); return controller; } public class LogOn { [Fact] public void Get_ReturnsViewResultWithDefaultViewName() { // Arrange var controller = GetAccountControllerForLogonSuccess(); // Act var result = controller.LogOn(); // Assert Assert.IsType<ViewResult>(result); Assert.Empty(((ViewResult)result).ViewName); } [Fact] public void Put_ReturnsOverviewRedirectToRouteResultIfLogonSuccessAndNoReturnUrlGiven() { // Arrange var controller = GetAccountControllerForLogonSuccess(); var user = new LogOnModel(); // Act var result = controller.LogOn(user, null); var redirectresult = (RedirectToRouteResult) result; // Assert Assert.IsType<RedirectToRouteResult>(result); Assert.Equal("Overview", redirectresult.RouteValues["controller"]); Assert.Equal("Index", redirectresult.RouteValues["action"]); } [Fact] public void Put_ReturnsRedirectResultIfLogonSuccessAndReturnUrlGiven() { // Arrange var controller = GetAccountControllerForLogonSuccess(); var user = new LogOnModel(); // Act var result = controller.LogOn(user, "someurl"); var redirectResult = (RedirectResult) result; // Assert Assert.IsType<RedirectResult>(result); Assert.Equal("someurl", redirectResult.Url); } [Fact] public void Put_ReturnsViewIfInvalidModelState() { // Arrange var controller = GetAccountControllerForLogonFailure(); var user = new LogOnModel(); controller.ModelState.AddModelError("*","Invalid model state."); // Act var result = controller.LogOn(user, "someurl"); var viewResult = (ViewResult) result; // Assert Assert.IsType<ViewResult>(result); Assert.Empty(viewResult.ViewName); Assert.Same(user,viewResult.ViewData.Model); } [Fact] public void Put_ReturnsViewIfLogonFailed() { // Arrange var controller = GetAccountControllerForLogonFailure(); var user = new LogOnModel(); // Act var result = controller.LogOn(user, "someurl"); var viewResult = (ViewResult) result; // Assert Assert.IsType<ViewResult>(result); Assert.Empty(viewResult.ViewName); Assert.Same(user,viewResult.ViewData.Model); Assert.Equal(false,viewResult.ViewData.ModelState.IsValid); } } }

    Read the article

  • nth ugly number

    - by Anil Katti
    Numbers whose only prime factors are 2, 3 or 5 are called ugly numbers. Example: 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ... 1 can be considered as 2^0. I am working on finding nth ugly number. Note that these numbers are extremely sparsely distributed as n gets large. I wrote a trivial program that computes if a given number is ugly or not. For n 500 - it became super slow. I tried using memoization - observation: ugly_number * 2, ugly_number * 3, ugly_number * 5 are all ugly. Even with that it is slow. I tried using some properties of log - since that will reduce this problem from multiplication to addition - but, not much luck yet. Thought of sharing this with you all. Any interesting ideas? Using a concept similar to "Sieve of Eratosthenes" (thanks Anon) for (int i(2), uglyCount(0); ; i++) { if (i % 2 == 0) continue; if (i % 3 == 0) continue; if (i % 5 == 0) continue; uglyCount++; if (uglyCount == n - 1) break; } i is the nth ugly number. Even this is pretty slow. I am trying to find 1500th ugly number.

    Read the article

  • Diophantine Equation [closed]

    - by ANIL
    In mathematics, a Diophantine equation (named for Diophantus of Alexandria, a third century Greek mathematician) is a polynomial equation where the variables can only take on integer values. Although you may not realize it, you have seen Diophantine equations before: one of the most famous Diophantine equations is: X^n+Y^n=Z^n We are not certain that McDonald's knows about Diophantine equations (actually we doubt that they do), but they use them! McDonald's sells Chicken McNuggets in packages of 6, 9 or 20 McNuggets. Thus, it is possible, for example, to buy exactly 15 McNuggets (with one package of 6 and a second package of 9), but it is not possible to buy exactly 16 nuggets, since no non- negative integer combination of 6's, 9's and 20's adds up to 16. To determine if it is possible to buy exactly n McNuggets, one has to solve a Diophantine equation: find non-negative integer values of a, b, and c, such that 6a + 9b + 20c = n. Problem 1 Show that it is possible to buy exactly 50, 51, 52, 53, 54, and 55 McNuggets, by finding solutions to the Diophantine equation. You can solve this in your head, using paper and pencil, or writing a program. However you chose to solve this problem, list the combinations of 6, 9 and 20 packs of McNuggets you need to buy in order to get each of the exact amounts. Given that it is possible to buy sets of 50, 51, 52, 53, 54 or 55 McNuggets by combinations of 6, 9 and 20 packs, show that it is possible to buy 56, 57,..., 65 McNuggets. In other words, show how, given solutions for 50-55, one can derive solutions for 56-65. Problem 2 Write an iterative program that finds the largest number of McNuggets that cannot be bought in exact quantity. Your program should print the answer in the following format (where the correct number is provided in place of n): "Largest number of McNuggets that cannot be bought in exact quantity: n" Hints: Hypothesize possible instances of numbers of McNuggets that cannot be purchased exactly, starting with 1 For each possible instance, called n, a. Test if there exists non-negative integers a, b, and c, such that 6a+9b+20c = n. (This can be done by looking at all feasible combinations of a, b, and c) b. If not, n cannot be bought in exact quantity, save n When you have found six consecutive values of n that in fact pass the test of having an exact solution, the last answer that was saved (not the last value of n that had a solution) is the correct answer, since you know by the theorem that any amount larger can also be bought in exact quantity

    Read the article

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