Daily Archives

Articles indexed Monday June 14 2010

Page 24/108 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • Performance profiler for a java application

    - by Nitin Garg
    I need to optimize a java application. It makes some 3rd party calls. I need some good tool to accurately measure the time taken by individual api calls. To give an idea of complexity- the application takes a data source file containing 10 lakh rows, and it takes around one hour to complete the processing. As a part of processing , it makes some 3rd party calls (including some network calls). I need to identify which calls are taking more time then others, and based on that, find out a way to optimize the application. Any suggestions would be appreciated.

    Read the article

  • difference between #define and enum{} in C

    - by guest
    when should one use enum {BUFFER = 1234}; over #define BUFFER 1234 ? what are the advantages enum brings compared to #define? i know, that #define is just simple text substitution and enum names the constant somehow. but why would one need that at all?

    Read the article

  • java Thread class run() method

    - by JavaUser
    Hi, Thread class has run method to implement the business logic that could be executed in parallel.But I want implement different business logics in a single run method and to run simultaneously.How to get this feature. thanks

    Read the article

  • ReSharper show warning with SqlDataReader

    - by Belousov Pavel
    When I write something like this: using (var connection = new SqlConnection("ConnectionString")) { using(var cmd= new SqlCommand("Command")) { using (var reader = cmd.ExecuteReader()) { while (reader.Read()) { } } } } ReSharper shows warning on reader.Read(), and tells that reader can be null. But in what cases can it be null? As I know if command returns nothing reader is not null, it only have nothing.

    Read the article

  • Help Window using StatET in Eclipse

    - by Btibert3
    Hi All, I have been getting into R recently and have been using the StatET plugin for Eclipse. When I search for help, it prints the 'contents' of the help to the console. I am hoping to have the help open up in a new window, similar to what happens when in R itself. I am hoping this is just a setting. Any help will be greatly appreciated! Brock

    Read the article

  • Why TortoiseHg not show the "merge conflict"?

    - by Jian Lin
    Short version of the question: Since I already have TortoiseHg, I right clicked on that file trying to see the merge conflict visually, but there is no way to see it? Details: To make a simple case of merge conflict, I hg init a repo on Win 7, and then clone it to another folder. Now, in one working directory, i added the line "the code is 123", committed. And in the other folder, i did an "hg pull" and "hg update" Now, I go back to the first folder, and change "123" to "123abc", and then do an "hg commit" And then I go to the other folder and edit "123" to "123xyz" over there, and do an "hg commit", and when "hg push", it says it can't. So I try to use any visual tool to see how the conflict is like, but ... TortoiseHg doesn't seem to have any option to do that?

    Read the article

  • La CNIL autorise les premiers ayants droits à collecter des adresses IP, la machine Hadopi se met en

    Mise à jour du 14.06.2010 par Katleen La CNIL autorise les premiers ayants droits à collecter des adresses IP, la machine Hadopi se met en marche Quelques semaines après la mise en place de l'équipe chargée de la mettre en oeuvre, la loi Hadopi semble prête à décoller. La CNIL (Commission nationale informatique et libertés) viendrait en effet d'autoriser les premiers ayants droits à collecter de manière automatisée les adresses IP d'utilisateurs soupçonnés de téléchargement illégal. Ceci leur permettra de ficher les contrevenants présumés pour ensuite en avertir Hadopi. Concrètement, c'est la société Trident Media Guard qui sera seule habilitée à collecter ces adresses pour le...

    Read the article

  • Accessing SVN repository from CCNet (CruiseControl.net) using an Active Directory user

    - by Tr1stan
    I have CCNet setup to talk to our SVN repository, which has it's ACLs setup using Active Directory groups. This is working fine, except I'm not happy with having the user name and password of the AD user stored in plain text on the CCNet instance. Is there a way to either encrypt the AD username/password, or get the CCNet service (I've tried running the service as the user and removing the the username/password section of the CCNet/SVN config) to use a domain account outside of the standard config?

    Read the article

  • Code picks up value from selectOneMenu and selectBooleanCheckbox, even though it is not rendered

    - by hpe
    I've got code the following code in my .xhtml <t:panelGroup rendered="false"> <t:selectOneMenu id="id" value="#{row.someValue}" displayValueOnly="#{form.readState}"> <f:selectItems value="#{row.listOfValues}"/> </t:selectOneMenu> </t:panelGroup> The listOfValues is set in a form populator, and is thus present in the form object. Also, as expected, the portion outlined above is not rendered in the output HTML. But, when clicking the save button in the page the following code tries to get the value from the XHTML, even though it is not rendered. It will thus not copy the value present in the form, but set it to null (as it is not set in the XHTML). object1.setSomeValue(form.getSomeValue()); As far as I can see this only happens with selectBooleanCheckbox and selectOneMenu. E.g. inputText works fine. Any idea on how to fix it?

    Read the article

  • Google Chrome is doing things wrong again

    - by Stefan Liebenberg
    Chrome is wrongly reporting width and height values for images during, or just after, load time. Jquery is used in this code example: <img id='image01' alt='picture that is 145x134' src='/images/picture.jpg' /> <script> var img = $( 'img#image01' ) img.width() // would return 145 in Firefox and 0 in Chrome. img.height() // would return 134 in Firefox and 0 in Chrome. </script> If you put the script in a onload function, the result is the same. but if you run the code a few seconds after the page has loaded, chrome returns the correct result. <script> function example () { var img = $( 'img#image01' ); img.width() // returns 145 in both Firefox and Chrome. img.height() // returns 134 in both Firefox and Chrome. } window.setTimeout( example, 1000 ) </script> Also if you specify the width and height values in the img tag, the script seems to work as expected in both Firefox and Chrome. <img id='image01' src='/images/picture.jpg' width=145 height=134 /> But as you cannot always control the html input, this is not an ideal workaround. Can jQuery be patched with a better workaround for this problem? or will I need to specify the width and height for every image in my code?

    Read the article

  • Getting list of all existing vtables.

    - by Patrick
    In my application I have quite some void-pointers (this is because of historical reasons, application was originally written in pure C). In one of my modules I know that the void-pointers points to instances of classes that could inherit from a known base class, but I cannot be 100% sure of it. Therefore, doing a dynamic_cast on the void-pointer might give problems. Possibly, the void-pointer even points to a plain-struct (so no vptr in the struct). I would like to investigate the first 4 bytes of the memory the void-pointer is pointing to, to see if this is the address of the valid vtable. I know this is platform, maybe even compiler-version-specific, but it could help me in moving the application forward, and getting rid of all the void-pointers over a limited time period (let's say 3 years). Is there a way to get a list of all vtables in the application, or a way to check whether a pointer points to a valid vtable, and whether that instance pointing to the vtable inherits from a known base class?

    Read the article

  • Should I make a ImageHelper in this situation?

    - by Dejan.S
    Hi I'm working with a project (asp.net mvc) where I need to show pictures on one site. They gone have jquery and be surrounded by a div like <div><img/></div> I'm relatively new on MVC so I'm not sure what ways are the best to work in it yet. Should I do a ImageHelper so i can access it like <% Html.ImageJquery() %> or should i just do it plain in the view what are your thoughts on this?

    Read the article

  • Issue accessing class variable from thread.

    - by James
    Hello, The code below is meant to take an arraylist of product objects as an input, spun thread for each product(and add the product to the arraylist 'products'), check product image(product.imageURL) availability, remove the products without images(remove the product from the arraylist 'products'), and return an arraylist of products with image available. package com.catgen.thread; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import com.catgen.Product; import com.catgen.Utils; public class ProductFilterThread extends Thread{ private Product product; private List<Product> products = new ArrayList<Product>(); public ProductFilterThread(){ } public ProductFilterThread(Product product){ this.product = product; } public synchronized void addProduct(Product product){ System.out.println("Before add: "+getProducts().size()); getProducts().add(product); System.out.println("After add: "+getProducts().size()); } public synchronized void removeProduct(Product product){ System.out.println("Before rem: "+getProducts().size()); getProducts().remove(product); System.out.println("After rem: "+getProducts().size()); } public synchronized List<Product> getProducts(){ return this.products; } public synchronized void setProducts(List<Product> products){ this.products = products; } public void run(){ boolean imageExists = Utils.fileExists(this.product.ImageURL); if(!imageExists){ System.out.println(this.product.ImageURL); removeProduct(this.product); } } public List<Product> getProductsWithImageOnly(List<Product> products){ ProductFilterThread pft = null; try{ List<ProductFilterThread> threads = new ArrayList<ProductFilterThread>(); for(Product product: products){ pft = new ProductFilterThread(product); addProduct(product); pft.start(); threads.add(pft); } Iterator<ProductFilterThread> threadsIter = threads.iterator(); while(threadsIter.hasNext()){ ProductFilterThread thread = threadsIter.next(); thread.join(); } }catch(Exception e){ e.printStackTrace(); } System.out.println("Total returned products = "+getProducts().size()); return getProducts(); } } Calling statement: displayProducts = new ProductFilterThread().getProductsWithImageOnly(displayProducts); Here, when addProduct(product) is called from within getProductsWithImageOnly(), getProducts() returns the list of products, but that's not the case(no products are returned) when the method removeProduct() is called by a thread, because of which the products without images are never removed. As a result, all the products are returned by the module whether or not the contained products have images. What can be the problem here? Thanks in advance. James.

    Read the article

  • Hybrid EAV/CR model via WCF (and statically-typed language)?

    - by Pat
    Background I'm working on the architecture for a cloud-based LOB application, using Silverlight for the client, WCF, ASP.NET/C# for server and SQL Server for storage. The data model requires some flexibility per user (ability to add custom properties and define validation rules for them, for example), and a hybrid EAV/CR persistence model on the server side will suit nicely. Problem I need an efficient and maintainable technology and approach to handle the transformation from the persisted EAV model to/from WCF (and similarly allow the client to bind to the resulting data - DataGrid is a key UI element)? Admission: I don't yet know enough about WCF to understand if it supports ExpandoObject directly, but I suspect it will. Options I started off looking at WCF RIA services, but quickly discovered they're heavily dependent upon both static type data and compile-time code generation. Neither of these appeal. The options I'm considering include: Using WCF RIA services and pass the data over the network directly in EAV form (i.e. Dictionary), and handle the binding issue purely on the client side (like this) Using a dynamic language (probably IronPython) to handle both ends of the communication, with plumbing to generate the necessary CLR type data on the client to allow binding, and transform to/from EAV form on the server (spam preventer stopped me from posting a URL here, I'll try it in a comment). Dynamic LINQ (CreateClass() and friends), although I'm way out of my depth there and don't know what the limitations on that approach might be yet. I'm interested in comments on these approaches as well as alternative approaches that might solve the problem. Other Notes The Silverlight client will not be the only consumer of the service, making me slightly uncomfortable with option #1 above. While the data model is flexible, it's not expected to be modified heavily. For argument's sake, we could assume that we might have 25 distinct data models active at a given time, with something like 10-20 unique data fields/rules each. Modifications to the data model will happen infrequently (typically when a new user is initially configured).

    Read the article

  • communication between remote servlets

    - by Venkatesh
    I have two web applications say App1 and App2. I want to call a servlet which is in App2 from a servlet in App1. I'm using URLConnection for this. I'm able to pass parameters to the servlet in App2 also and I'm also able to receive response from the servlet as string. But I want to send java objects from the servlet in App2 and receive them in servlet of App1. How to achieve this?

    Read the article

  • jQuery-ajax call: async property is not working?

    - by user269386
    Hi, given to certain circumstances, I'm forced to keep page settings (Javascript-values) in the session and it has to be done right before leaving the page (I can't use cookies, since "pageSettings" can become quite large and localStorage is not an option yet ;) ). So this is how I tried it. However it seems that when I call the page directly again, the call of "http://blabla.com/bla" happens asynchronous, even though the async-attribute is set (I don't receive the settings of the previous call, but of the one before): $jQ(document).ready(function () { $jQ(window).unload(Main.__setSessionValues); }); var Main = { pageSettings: {}, __setSessionValues: function __setSessionValues() { $jQ.ajax({ type: "POST", async: false, url: "http://blabla.com/bla", data: { pageSettings: Object.toJSON(Main.pageSettings) } }); } }; Does anyone know what the problem might be? thanks in advance

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >