Search Results

Search found 32130 results on 1286 pages for 'method chaining'.

Page 11/1286 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • ASP.NET Error Handling: Creating an extension method to send error email

    - by Jalpesh P. Vadgama
    Error handling in asp.net required to handle any kind of error occurred. We all are using that in one or another scenario. But some errors are there which will occur in some specific scenario in production environment in this case We can’t show our programming errors to the End user. So we are going to put a error page over there or whatever best suited as per our requirement. But as a programmer we should know that error so we can track the scenario and we can solve that error or can handle error. In this kind of situation an Error Email comes handy. Whenever any occurs in system it will going to send error in our email. Here I am going to write a extension method which will send errors in email. From asp.net 3.5 or higher version of .NET framework  its provides a unique way to extend your classes. Here you can fine more information about extension method. So lets create extension method via implementing a static class like following. I am going to use same code for sending email via my Gmail account from here. Following is code for that. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Net.Mail; namespace Experiement { public static class MyExtension { public static void SendErrorEmail(this Exception ex) { MailMessage mailMessage = new MailMessage(new MailAddress("[email protected]") , new MailAddress("[email protected]")); mailMessage.Subject = "Exception Occured in your site"; mailMessage.IsBodyHtml = true; System.Text.StringBuilder errorMessage = new System.Text.StringBuilder(); errorMessage.AppendLine(string.Format("<B>{0}</B>:{1}<BR/>","Exception",ex.Message)); errorMessage.AppendLine(string.Format("<B>{0}</B>:{1}<BR/>", "Stack Trace", ex.StackTrace)); if (ex.InnerException != null) { errorMessage.AppendLine(string.Format("<B>{0}</B>:{1}<BR/>", " Inner Exception", ex.InnerException.Message)); errorMessage.AppendLine(string.Format("<B>{0}</B>:{1}<BR/>", "Inner Stack Trace", ex.InnerException.StackTrace)); } mailMessage.Body = errorMessage.ToString(); System.Net.NetworkCredential networkCredentials = new System.Net.NetworkCredential("[email protected]", "password"); SmtpClient smtpClient = new SmtpClient(); smtpClient.EnableSsl = true; smtpClient.UseDefaultCredentials = false; smtpClient.Credentials = networkCredentials; smtpClient.Host = "smtp.gmail.com"; smtpClient.Port = 587; smtpClient.Send(mailMessage); } } } After creating an extension method let us that extension method to handle error like following in page load event of page. using System; namespace Experiement { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender,System.EventArgs e) { try { throw new Exception("My custom Exception"); } catch (Exception ex) { ex.SendErrorEmail(); Response.Write(ex.Message); } } } } Now in above code I have generated custom exception for example but in production It can be any Exception. And you can see I have use ex.SendErrorEmail() function in catch block to send email. That’s it.. Now it will throw exception and you will email in your email box like below.   That’s its. It’s so simple…Stay tuned for more.. Happy programming.. Technorati Tags: Exception,Extension Mehtod,Error Handling,ASP.NET

    Read the article

  • Algorithm for tracking progress of controller method running in background

    - by SilentAssassin
    I am using Codeigniter framework for PHP on Windows platform. My problem is I am trying to track progress of a controller method running in background. The controller extracts data from the database(MySQL) then does some processing and then stores the results again in the database. The complete aforesaid process can be considered as a single task. A new task can be assigned while another task is running. The newly assigned task will be added in a queue. So if I can track progress of the controller, I can show status for each of these tasks. Like I can show "Pending" status for tasks in the queue, "In Progress" for tasks running and "Done" for tasks that are completed. Main Issue: Now first thing I need to find is an algorithm to track the progress of how much amount of execution the controller method has completed and that means tracking how much amount of method has completed execution. For instance, this PHP script tracks progress of array being counted. Here the current state and state after total execution are known so it is possible to track its progress. But I am not able to devise anything analogous to it in my case. Maybe what I am trying to achieve is programmtically not possible. If its not possible then suggest me a workaround or a completely new approach. If some details are pending you can mention them. Sorry for my ignorance this is my first post here. I welcome you to point out my mistakes. EDIT: Database outline: The URL(s) and keyword(s) are first entered by user which are stored in a database table called link_master and keyword_master respectively. Then keywords are extracted from all the links present in this table and compared with keywords entered by user and their frequency is calculated which is the final result. And the results are stored in another table called link_result. Now sub-links are extracted from the domain links and stored in a table called sub_link_master. Now again the keywords are extracted from these sub-links and the corresponding results are stored in a table called sub_link_result. The number of records cannot be defined beforehand as the number of links on any web page can be different. Only the cardinality of *link_result* table can be known which will be equal to multiplication of number of keyword(s) and URL(s) . I insert multiple records at a time using this resource. Controller outline: The controller extracts keywords from a web page and also extracts keywords from all the links present on that page. There is a method called crawlLink. I used Rolling Curl to extract keywords and web page content. It has callback function which I used for extracting keywords alongwith generating results and extracting valid sub-links. There is a insertResult method which stores results for links and sub-links in the respective tables. Yes, the processing depends on the number of records. The more the number of records, the more time it takes to execute: Consider this scenario: Number of Domain Links = 1 Number of Keywords = 3 Number of Domain Links Result generated = 3 (3 x 1 as described in the question) Number of Sub Links generated = 41 Number of Sub Links Result = 117 (41 x 3 = 123 but some links are not valid or searchable) Approximate time taken for above process to complete = 55 seconds. The above result is for a single link. I want to track the progress of the above results getting stored in database. When all results are stored, the task is complete. If results are getting stored, the task is In Progress. I am not clear how can I track this progress.

    Read the article

  • Xuggler errors as soon as you import git

    - by user3241507
    I downloaded the Git straight into Eclipse for Xuggler (Here is the git). But as soon as it loads, there are so many errors I don't know what to do. Most of the errors are "cannot be resolved" type errors. Description Resource Path Location Type The import org.junit cannot be resolved AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 22 Java Problem The import junit cannot be resolved AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 28 Java Problem TestCase cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 30 Java Problem The import org.slf4j cannot be resolved AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 23 Java Problem The import org.slf4j cannot be resolved AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 24 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 94 Java Problem Test cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 97 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 102 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 103 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 86 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 89 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 90 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 93 Java Problem Test cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com /xuggle/ferry line 114 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 120 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 125 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 126 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 106 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 107 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 110 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 111 Java Problem The method assertTrue(String, boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 53 Java Problem The method assertTrue(String, boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 49 Java Problem Ignore cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 57 Java Problem Test cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 56 Java Problem Before cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 37 Java Problem LoggerFactory cannot be resolved AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 32 Java Problem Test cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 44 Java Problem The method getName() is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 40 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 81 Java Problem Test cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 75 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 85 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 82 Java Problem Test cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 64 Java Problem The method assertTrue(String, boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 61 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 72 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 69 Java Problem NameAwareTestClassRunner cannot be resolved BufferTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 44 Java Problem The method assertTrue(String, boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 167 Java Problem The method debug(String, int, String) in the type Logger is not applicable for the arguments (String, int) AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 166 Java Problem The method fail(String) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 163 Java Problem After cannot be resolved to a type BufferTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 47 Java Problem NameAwareTestClassRunner cannot be resolved to a type BufferTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 35 Java Problem The method debug(String, int, String) in the type Logger is not applicable for the arguments (String) AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 162 Java Problem Test cannot be resolved to a type AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 135 Java Problem Before cannot be resolved to a type BufferTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 41 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 131 Java Problem LoggerFactory cannot be resolved BufferTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 38 Java Problem The method assertTrue(boolean) is undefined for the type AtomicIntegerTest AtomicIntegerTest.java /xuggle-xuggler-main/test/src/com/xuggle/ferry line 130 Java Problem The import org.junit cannot be resolved AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 22 Java Problem The import org.slf4j cannot be resolved AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 23 Java Problem The import org.slf4j cannot be resolved AudioSamplesTest.java /xuggle-xuggler-main/test /src/com/xuggle/xuggler line 24 Java Problem The import junit cannot be resolved AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 31 Java Problem TestCase cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 33 Java Problem Logger cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 35 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 82 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 80 Java Problem Logger cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 89 Java Problem Logger cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 84 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 94 Java Problem Logger cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 93 Java Problem Test cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 99 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 96 Java Problem Before cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 37 Java Problem LoggerFactory cannot be resolved AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 35 Java Problem The method getName() is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 40 Java Problem Logger cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 40 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 60 Java Problem Test cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 43 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 67 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 62 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 157 Java Problem Test cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 161 Java Problem Logger cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 154 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 155 Java Problem The method assertEquals(int, long) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 172 Java Problem The method assertEquals(long, long) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 173 Java Problem The method assertNotNull(IAudioSamples) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 168 Java Problem The method assertTrue(boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 171 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 124 Java Problem The method assertNotNull(IAudioSamples) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 129 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 117 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 119 Java Problem Logger cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 145 Java Problem Logger cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 150 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 141 Java Problem The method assertTrue(String, boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 143 Java Problem The method assertTrue(boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 216 Java Problem The method assertEquals(IBuffer.Type, IBuffer.Type) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 212 Java Problem The method assertTrue(boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 208 Java Problem The method assertNotNull(IAudioSamples) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 204 Java Problem The method assertEquals(IBuffer.Type, IBuffer.Type) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 218 Java Problem The method assertEquals(int, long) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 187 Java Problem The method assertTrue(boolean) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 186 Java Problem The method assertNotNull(IAudioSamples) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 183 Java Problem Test cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 176 Java Problem Test cannot be resolved to a type AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 197 Java Problem The method assertEquals(long, long) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 192 Java Problem The method assertEquals(long, long) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 191 Java Problem The method assertEquals(long, long) is undefined for the type AudioSamplesTest AudioSamplesTest.java /xuggle-xuggler-main/test/src/com/xuggle/xuggler line 188 Java Problem For a school project, I would like to build a simple live video stream program (final year in high school) like skype, except not as complicated. Can anyone help me solve these errors? or Is there another platform I can use that would be better/easier?

    Read the article

  • How can I access a method of the consumer class inside a method created at runtime in a method of th

    - by xxxxxxx
    I define a method inside a parametrized role that needs to create a new class at run time using Moose::Meta::Class->create and apply that exact parametrized role to it. I am also making a new method for that role using $new_class->meta->add_method( some_name => sub { my ($self) = @_; ... }) inside the sub {...} I want to access a method of the consumer class and use it for something, I have tried using $self->get_method, it didn't work, how do I do this? Please notice that the $self inside the sub above is MooseX::Role::Parameterized::Meta::Role::Parameterizable I also have another question, if I do this: my $object = Moose::Meta::Class->create( "some_type", ); Why isn't $object of type some_type and it's some ugly MooseX::Role::Parameterized::Meta::Role::Parameterizable and how do I get to the object of type some_type?

    Read the article

  • how to show all method and data when the object not has "__iter__" function in python..

    - by zjm1126
    i find a way : (1):the dir(object) is : a="['__class__', '__contains__', '__delattr__', '__delitem__', '__dict__', '__doc__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__iter__', '__metaclass__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__str__', '__weakref__', '_errors', '_fields', '_prefix', '_unbound_fields', 'confirm', 'data', 'email', 'errors', 'password', 'populate_obj', 'process', 'username', 'validate']" (2): b=eval(a) (3)and it became a list of all method : ['__class__', '__contains__', '__delattr__', '__delitem__', '__dict__', '__doc__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__iter__', '__metaclass__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__str__', '__weakref__', '_errors', '_fields', '_prefix', '_unbound_fields', 'confirm', 'data', 'email', 'errors', 'password', 'populate_obj', 'process', 'username', 'validate'] (3)then show the object's method,and all code is : s='' a=eval(str(dir(object))) for i in a: s+=str(i)+':'+str(object[i]) print s but it show error : KeyError: '__class__' so how to make my code running . thanks

    Read the article

  • Placement of a call to the parent method

    - by Alejandro
    I have a class that has a method. That class has a child class that overrides that method. The child's method has to call the parent's method. In all OO that I've seen or written calls to the parent's version of the same method were on the first line of the method. On a project that I am working on circumstances call for placing that method call at the end of a method. Should I be worried? Is that a code smell? Is this code inherently bad? class Parent { function work() { // stuff } } class Child { function work() { // do thing 1 // do thing 2 parent::work(); // is this a bad practice? // should I call the parent's work() method before // I do anything in this method? } }

    Read the article

  • In C#, What is <T> After a Method Declaration?

    - by Drew
    I'm a VB.Net guy. (because I have to be, because the person who signs my check says so. :P) I grew up in Java and I don't generally struggle to read or write in C# when I get the chance. I came across some syntax today that I have never seen, and that I can't seem to figure out. In the following method declaration, what does < T represent? static void Foo < T (params T[] x) I have seen used in conjunction with declaring generic collections and things, but I can't for the life of me figure out what it does for this method. In case it matters, I came across it when thinking about some C# brain teasers. The sixth teaser contains the entire code snippet.

    Read the article

  • What is the use of Method Overloading in Java when it is achieved by changing the sequence of parameters in the argument list?

    - by MediumOne
    I was reading a Java training manual and it said that Method Overloading in Java can be achieved by having a different argument list. It also said that the argument list could differ in (i). Number of parameters (ii). Datatype of parameters (iii). Sequence of parameters My concern is about (iii). What is the use of trying to overload a method just by changing the sequence of parameters? I am unable to think of any benefits by this way.

    Read the article

  • The Birth of a Method - Where did OUM come from?

    - by user702549
    It seemed fitting to start this blog entry with the OUM vision statement. The vision for the Oracle® Unified Method (OUM) is to support the entire Enterprise IT lifecycle, including support for the successful implementation of every Oracle product.  Well, it’s that time of year again; we just finished testing and packaging OUM 5.6.  It will be released for general availability to qualifying customers and partners this month.  Because of this, I’ve been reflecting back on how the birth of Oracle’s Unified method - OUM came about. As the Release Director of OUM, I’ve been honored to package every method release.  No, maybe you’d say it’s not so special.  Of course, anyone can use packaging software to create an .exe file.  But to me, it is pretty special, because so many people work together to make each release come about.  The rich content that results is what makes OUM’s history worth talking about.   To me, professionally speaking, working on OUM, well it’s been “a labor of love”.  My youngest child was just 8 years old when OUM was born, and she’s now in High School!  Watching her grow and change has been fascinating, if you ask her, she’s grown up hearing about OUM.  My son would often walk into my home office and ask “How is OUM today, Mom?”  I am one of many people that take care of OUM, and have watched the method “mature” over these last 6 years.  Maybe that makes me a "Method Mom" (someone in one of my classes last year actually said this outloud) but there are so many others who collaborate and care about OUM Development. I’ve thought about writing this blog entry for a long time just to reflect on how far the Method has come. Each release, as I prepare the OUM Contributors list, I see how many people’s experience and ideas it has taken to create this wealth of knowledge, process and task guidance as well as templates and examples.  If you’re wondering how many people, just go into OUM select the resources button on the top of most pages of the method, and on that resources page click the ABOUT link. So now back to my nostalgic moment as I finished release 5.6 packaging.  I reflected back, on all the things that happened that cause OUM to become not just a dream but to actually come to fruition.  Here are some key conditions that make it possible for each release of the method: A vision to have one method instead of many methods, thereby focusing on deeper, richer content People within Oracle’s consulting Organization  willing to contribute to OUM providing Subject Matter Experts who are willing to write down and share what they know. Oracle’s continued acquisition of software companies, the need to assimilate high quality existing materials from these companies The need to bring together people from very different backgrounds and provide a common language to support Oracle Product implementations that often involve multiple product families What came first, and then what was the strategy? Initially OUM 4.0 was based on Oracle’s J2EE Custom Development Method (JCDM), it was a good “backbone”  (work breakdown structure) it was Unified Process based, and had good content around UML as well as custom software development.  But it needed to be extended in order to achieve the OUM Vision. What happened after that was to take in the “best of the best”, the legacy and acquired methods were scheduled for assimilation into OUM, one release after another.  We incrementally built OUM.  We didn’t want to lose any of the expertise that was reflected in AIM (Oracle’s legacy Application Implementation Method), Compass (People Soft’s Application implementation method) and so many more. When was OUM born? OUM 4.1 published April 30, 2006.  This release allowed Oracles Advanced Technology groups to begin the very first implementations of Fusion Middleware.  In the early days of the Method we would prepare several releases a year.  Our iterative release development cycle began and continues to be refined with each Method release.  Now we typically see one major release each year. The OUM release development cycle is not unlike many Oracle Implementation projects in that we need to gather requirements, prioritize, prepare the content, test package and then go production.  Typically we develop an OUM release MoSCoW (must have, should have, could have, and won’t have) right after the prior release goes out.   These are the high level requirements.  We break the timeframe into increments, frequent checkpoints that help us assess the content and progress is measured through frequent checkpoints.  We work as a team to prioritize what should be done in each increment. Yes, the team provides the estimates for what can be done within a particular increment.  We sometimes have Method Development workshops (physically or virtually) to accelerate content development on a particular subject area, that is where the best content results. As the written content nears the final stages, it goes through edit and evaluation through peer reviews, and then moves into the release staging environment.  Then content freeze and testing of the method pack take place.  This iterative cycle is run using the OUM artifacts that make sense “fit for purpose”, project plans, MoSCoW lists, Test plans are just a few of the OUM work products we use on a Method Release project. In 2007 OUM 4.3, 4.4 and 4.5 were published.  With the release of 4.5 our Custom BI Method (Data Warehouse Method FastTrack) was assimilated into OUM.  These early releases helped us align Oracle’s Unified method with other industry standards Then in 2008 we made significant changes to the OUM “Backbone” to support Applications Implementation projects with that went to the OUM 5.0 release.  Now things started to get really interesting.  Next we had some major developments in the Envision focus area in the area of Enterprise Architecture.  We acquired some really great content from the former BEA, Liquid Enterprise Method (LEM) along with some SMEs who were willing to work at bringing this content into OUM.  The Service Oriented Architecture content in OUM is extensive and can help support the successful implementation of Fusion Middleware, as well as Fusion Applications. Of course we’ve developed a wealth of OUM training materials that work also helps to improve the method content.  It is one thing to write “how to”, and quite another to be able to teach people how to use the materials to improve the success of their projects.  I’ve learned so much by teaching people how to use OUM. What's next? So here toward the end of 2012, what’s in store in OUM 5.6, well, I’m sure you won’t be surprised the answer is Cloud Computing.   More details to come in the next couple of weeks!  The best part of being involved in the development of OUM is to see how many people have “adopted” OUM over these six years, Clients, Partners, and Oracle Consultants.  The content just gets better with each release.   I’d love to hear your comments on how OUM has evolved, and ideas for new content you’d like to see in the upcoming releases.

    Read the article

  • Obtaining positional information in the IEnumerable Select extension method

    - by Kyle Burns
    This blog entry is intended to provide a narrow and brief look into a way to use the Select extension method that I had until recently overlooked. Every developer who is using IEnumerable extension methods to work with data has been exposed to the Select extension method, because it is a pretty critical piece of almost every query over a collection of objects.  The method is defined on type IEnumerable and takes as its argument a function that accepts an item from the collection and returns an object which will be an item within the returned collection.  This allows you to perform transformations on the source collection.  A somewhat contrived example would be the following code that transforms a collection of strings into a collection of anonymous objects: 1: var media = new[] {"book", "cd", "tape"}; 2: var transformed = media.Select( item => 3: { 4: Media = item 5: } ); This code transforms the array of strings into a collection of objects which each have a string property called Media. If every developer using the LINQ extension methods already knows this, why am I blogging about it?  I’m blogging about it because the method has another overload that I hadn’t seen before I needed it a few weeks back and I thought I would share a little about it with whoever happens upon my blog.  In the other overload, the function defined in the first overload as: 1: Func<TSource, TResult> is instead defined as: 1: Func<TSource, int, TResult>   The additional parameter is an integer representing the current element’s position in the enumerable sequence.  I used this information in what I thought was a pretty cool way to compare collections and I’ll probably blog about that sometime in the near future, but for now we’ll continue with the contrived example I’ve already started to keep things simple and show how this works.  The following code sample shows how the positional information could be used in an alternating color scenario.  I’m using a foreach loop because IEnumerable doesn’t have a ForEach extension, but many libraries do add the ForEach extension to IEnumerable so you can update the code if you’re using one of these libraries or have created your own. 1: var media = new[] {"book", "cd", "tape"}; 2: foreach (var result in media.Select( 3: (item, index) => 4: new { Item = item, Index = index })) 5: { 6: Console.ForegroundColor = result.Index % 2 == 0 7: ? ConsoleColor.Blue : ConsoleColor.Yellow; 8: Console.WriteLine(result.Item); 9: }

    Read the article

  • how to call web method in java application?.

    - by user12344
    Hi, I have created java web application(Web Service). I want to call the setName() method in java application(GUI). how is call web method in application?. package sv; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebService; @WebService() public class MyService { @WebMethod(operationName = "setName") public String setName(@WebParam(name = "name") String name) { return "my string is "+ name; } }

    Read the article

  • Connect a method for window destroy

    - by Roberto
    I have a main window with a Gtk Button named openDialog. If I click on this button another Window (addName) popups. I would like to write a method (or a function, don't know which is the right name in python) in my main window file, called printHi. I would like to run this printHi method (in my main window file), when addName window is destroyed. I tried something like this: def on_addName_destroy(): printHi() But it doesn't work. Any suggestion?

    Read the article

  • Create a delegate from a property getter or setter method

    - by thecoop
    To create a delegate from a method you can use the compile-safe syntax: private int Method() { ... } // and create the delegate to Method... Func<int> d = Method; A property is a wrapper around a getter and setter method, and I want to create a delegate to a property getter method. Something like public int Prop { get; set; } Func<int> d = Prop; // or... Func<int> d = Prop_get; Which doesn't work, unfortunately. I have to create a separate lambda method, which seems unnecessary when the setter method matches the delegate signature anyway: Func<int> d = () => Prop; In order to use the delegate method directly, I have to use nasty reflection, which isn't compile-safe: // something like this, not tested... MethodInfo m = GetType().GetProperty("Prop").GetGetMethod(); Func<int> d = (Func<int>)Delegate.CreateDelegate(typeof(Func<int>), m); Is there any way of creating a delegate on a property getting method directly in a compile-safe way, similar to creating a delegate on a normal method at the top, without needing to use an intermediate lambda method?

    Read the article

  • What is the best way to call a method right AFTER a form loads?

    - by Jordan S
    I have a C# windows forms application. The way I currently have it set up, when Form1_Load() runs it checks for recovered unsaved data and if it finds some it prompts the user if they want to open that data. When the program runs it works alright but the message box is shown right away and the main program form (Form1) does not show until after the user clicks yes or no. I would like the Form1 to pop up first and then the message box prompt. Now to get around this problem before I have created a timer in my Form, started the timer in the Form1_Load() method, and then performed the check and user prompt in the first Timer Tick Event. This technique solves the problem but is seems like there might be a better way. Do you guys have any better ideas? Edit: I think I have also used a background worker to do something similar. It just seems kinda goofy to go through all the trouble of invoking the method to back to the form thread and all that crap just to have it delayed a couple milliseconds!

    Read the article

  • AMD 24 core server memory bandwidth

    - by ntherning
    I need some help to determine whether the memory bandwidth I'm seeing under Linux on my server is normal or not. Here's the server spec: HP ProLiant DL165 G7 2x AMD Opteron 6164 HE 12-Core 40 GB RAM (10 x 4GB DDR1333) Debian 6.0 Using mbw on this server I get the following numbers: foo1:~# mbw -n 3 1024 Long uses 8 bytes. Allocating 2*134217728 elements = 2147483648 bytes of memory. Using 262144 bytes as blocks for memcpy block copy test. Getting down to business... Doing 3 runs per test. 0 Method: MEMCPY Elapsed: 0.58047 MiB: 1024.00000 Copy: 1764.082 MiB/s 1 Method: MEMCPY Elapsed: 0.58012 MiB: 1024.00000 Copy: 1765.152 MiB/s 2 Method: MEMCPY Elapsed: 0.58010 MiB: 1024.00000 Copy: 1765.201 MiB/s AVG Method: MEMCPY Elapsed: 0.58023 MiB: 1024.00000 Copy: 1764.811 MiB/s 0 Method: DUMB Elapsed: 0.36174 MiB: 1024.00000 Copy: 2830.778 MiB/s 1 Method: DUMB Elapsed: 0.35869 MiB: 1024.00000 Copy: 2854.817 MiB/s 2 Method: DUMB Elapsed: 0.35848 MiB: 1024.00000 Copy: 2856.481 MiB/s AVG Method: DUMB Elapsed: 0.35964 MiB: 1024.00000 Copy: 2847.310 MiB/s 0 Method: MCBLOCK Elapsed: 0.23546 MiB: 1024.00000 Copy: 4348.860 MiB/s 1 Method: MCBLOCK Elapsed: 0.23544 MiB: 1024.00000 Copy: 4349.230 MiB/s 2 Method: MCBLOCK Elapsed: 0.23544 MiB: 1024.00000 Copy: 4349.359 MiB/s AVG Method: MCBLOCK Elapsed: 0.23545 MiB: 1024.00000 Copy: 4349.149 MiB/s On one of my other servers (based on Intel Xeon E3-1270): foo2:~# mbw -n 3 1024 Long uses 8 bytes. Allocating 2*134217728 elements = 2147483648 bytes of memory. Using 262144 bytes as blocks for memcpy block copy test. Getting down to business... Doing 3 runs per test. 0 Method: MEMCPY Elapsed: 0.18960 MiB: 1024.00000 Copy: 5400.901 MiB/s 1 Method: MEMCPY Elapsed: 0.18922 MiB: 1024.00000 Copy: 5411.690 MiB/s 2 Method: MEMCPY Elapsed: 0.18944 MiB: 1024.00000 Copy: 5405.491 MiB/s AVG Method: MEMCPY Elapsed: 0.18942 MiB: 1024.00000 Copy: 5406.024 MiB/s 0 Method: DUMB Elapsed: 0.14838 MiB: 1024.00000 Copy: 6901.200 MiB/s 1 Method: DUMB Elapsed: 0.14818 MiB: 1024.00000 Copy: 6910.561 MiB/s 2 Method: DUMB Elapsed: 0.14820 MiB: 1024.00000 Copy: 6909.628 MiB/s AVG Method: DUMB Elapsed: 0.14825 MiB: 1024.00000 Copy: 6907.127 MiB/s 0 Method: MCBLOCK Elapsed: 0.04362 MiB: 1024.00000 Copy: 23477.623 MiB/s 1 Method: MCBLOCK Elapsed: 0.04262 MiB: 1024.00000 Copy: 24025.151 MiB/s 2 Method: MCBLOCK Elapsed: 0.04258 MiB: 1024.00000 Copy: 24048.849 MiB/s AVG Method: MCBLOCK Elapsed: 0.04294 MiB: 1024.00000 Copy: 23847.599 MiB/s For reference here's what I get on my Intel based laptop: laptop:~$ mbw -n 3 1024 Long uses 8 bytes. Allocating 2*134217728 elements = 2147483648 bytes of memory. Using 262144 bytes as blocks for memcpy block copy test. Getting down to business... Doing 3 runs per test. 0 Method: MEMCPY Elapsed: 0.40566 MiB: 1024.00000 Copy: 2524.269 MiB/s 1 Method: MEMCPY Elapsed: 0.38458 MiB: 1024.00000 Copy: 2662.638 MiB/s 2 Method: MEMCPY Elapsed: 0.38876 MiB: 1024.00000 Copy: 2634.043 MiB/s AVG Method: MEMCPY Elapsed: 0.39300 MiB: 1024.00000 Copy: 2605.600 MiB/s 0 Method: DUMB Elapsed: 0.30707 MiB: 1024.00000 Copy: 3334.745 MiB/s 1 Method: DUMB Elapsed: 0.30425 MiB: 1024.00000 Copy: 3365.653 MiB/s 2 Method: DUMB Elapsed: 0.30342 MiB: 1024.00000 Copy: 3374.849 MiB/s AVG Method: DUMB Elapsed: 0.30491 MiB: 1024.00000 Copy: 3358.328 MiB/s 0 Method: MCBLOCK Elapsed: 0.07875 MiB: 1024.00000 Copy: 13003.670 MiB/s 1 Method: MCBLOCK Elapsed: 0.08374 MiB: 1024.00000 Copy: 12228.034 MiB/s 2 Method: MCBLOCK Elapsed: 0.07635 MiB: 1024.00000 Copy: 13411.216 MiB/s AVG Method: MCBLOCK Elapsed: 0.07961 MiB: 1024.00000 Copy: 12862.006 MiB/s So according to mbw my laptop is 3 times faster than the server!!! Please help me explain this. I've also tried to mount a ram disk and use dd to benchmark it and I get similar differences so I don't think mbw is to blame. I've checked the BIOS settings and the memory seem to be running at full speed. According to the hosting company the modules are all OK. Could this have something to do with NUMA? It seems like Node Interleaving is disabled on this server. Will enabling it (thus turning off NUMA) make a difference? foo1:~# numactl --hardware available: 4 nodes (0-3) node 0 cpus: 0 1 2 3 4 5 node 0 size: 8190 MB node 0 free: 7898 MB node 1 cpus: 6 7 8 9 10 11 node 1 size: 12288 MB node 1 free: 12073 MB node 2 cpus: 18 19 20 21 22 23 node 2 size: 12288 MB node 2 free: 12034 MB node 3 cpus: 12 13 14 15 16 17 node 3 size: 8192 MB node 3 free: 8032 MB node distances: node 0 1 2 3 0: 10 20 20 20 1: 20 10 20 20 2: 20 20 10 20 3: 20 20 20 10

    Read the article

  • Enum.HasFlag method in C# 4.0

    - by Jalpesh P. Vadgama
    Enums in dot net programming is a great facility and we all used it to increase code readability. In earlier version of .NET framework we don’t have any method anything that will check whether a value is assigned to it or not. In C# 4.0 we have new static method called HasFlag which will check that particular value is assigned or not. Let’s take an example for that. First I have created a enum called PaymentType which could have two values Credit Card or Debit Card. Just like following. public enum PaymentType { DebitCard=1, CreditCard=2 } Now We are going to assigned one of the value to this enum instance and then with the help of HasFlag method we are going to check whether particular value is assigned to enum or not like following. protected void Page_Load(object sender, EventArgs e) { PaymentType paymentType = PaymentType.CreditCard; if (paymentType.HasFlag(PaymentType.DebitCard)) { Response.Write("Process Debit Card"); } if (paymentType.HasFlag(PaymentType.CreditCard)) { Response.Write("Process Credit Card"); } } Now Let’s check out in browser as following. As expected it will print process Credit Card as we have assigned that value to enum. That’s it It’s so simple and cool. Stay tuned for more.. Happy Programming.. Technorati Tags: Enum,C#4.0,ASP.NET 4.0

    Read the article

  • Why not to use StackTrace to find what method called you

    - by Alex.Davies
    Our obfuscator, SmartAssembly, does some pretty crazy reflection. It's an obfuscator, it's sort of its job to do things in the most awkward way possible. But sometimes, you can go too far. One such time is this little gem from the strings encoding feature: StackTrace stackTrace = new StackTrace(); StackFrame frame = stackTrace.GetFrame(1); Type ownerType = frame.GetMethod().DeclaringType; It's designed to find the type where the calling method is defined. A user found that strings encoding occasionally broke on x64 systems. Very strange. After some debugging (thank god for Reflector Pro, it would be impossible to debug processed assemblies without it) I found that the ownerType I got back was wrong. The reason is that the x64 JIT does tail call optimisation. This saves space on the stack, and speeds things up, by throwing away a method's stack frame if the last thing that it calls is the only thing returned. When this happens, the call to StackTrace faithfully tells you that the calling method is the one that called the one we really wanted. So using StackTrace isn't safe for anything other than debugging, and it will make your code fail in unpredictable ways. Don't use it!

    Read the article

  • Intercept method calls in Groovy for automatic type conversion

    - by kerry
    One of the cooler things you can do with groovy is automatic type conversion.  If you want to convert an object to another type, many times all you have to do is invoke the ‘as’ keyword: def letters = 'abcdefghijklmnopqrstuvwxyz' as List But, what if you are wanting to do something a little fancier, like converting a String to a Date? def christmas = '12-25-2010' as Date ERROR org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '12-25-2010' with class java.lang.String' to class 'java.util.Date' No bueno! I want to be able to do custom type conversions so that my application can do a simple String to Date conversion. Enter the metaMethod. You can intercept method calls in Groovy using the following method: def intercept(name, params, closure) { def original = from.metaClass.getMetaMethod(name, params) from.metaClass[name] = { Class clazz -> closure() original.doMethodInvoke(delegate, clazz) } } Using this method, and a little syntactic sugar, we create the following ‘Convert’ class: // Convert.from( String ).to( Date ).using { } class Convert { private from private to private Convert(clazz) { from = clazz } static def from(clazz) { new Convert(clazz) } def to(clazz) { to = clazz return this } def using(closure) { def originalAsType = from.metaClass.getMetaMethod('asType', [] as Class[]) from.metaClass.asType = { Class clazz -> if( clazz == to ) { closure.setProperty('value', delegate) closure(delegate) } else { originalAsType.doMethodInvoke(delegate, clazz) } } } } Now, we can make the following statement to add the automatic date conversion: Convert.from( String ).to( Date ).using { new java.text.SimpleDateFormat('MM-dd-yyyy').parse(value) } def christmas = '12-25-2010' as Date Groovy baby!

    Read the article

  • Handling Indirection and keeping layers of method calls, objects, and even xml files straight

    - by Cervo
    How do you keep everything straight as you trace deeply into a piece of software through multiple method calls, object constructors, object factories, and even spring wiring. I find that 4 or 5 method calls are easy to keep in my head, but once you are going to 8 or 9 calls deep it gets hard to keep track of everything. Are there strategies for keeping everything straight? In particular, I might be looking for how to do task x, but then as I trace down (or up) I lose track of that goal, or I find multiple layers need changes, but then I lose track of which changes as I trace all the way down. Or I have tentative plans that I find out are not valid but then during the tracing I forget that the plan is invalid and try to consider the same plan all over again killing time.... Is there software that might be able to help out? grep and even eclipse can help me to do the actual tracing from a call to the definition but I'm more worried about keeping track of everything including the de-facto plan for what has to change (which might vary as you go down/up and realize the prior plan was poor). In the past I have dealt with a few big methods that you trace and pretty much can figure out what is going on within a few calls. But now there are dozens of really tiny methods, many just a single call to another method/constructor and it is hard to keep track of them all.

    Read the article

  • Collection RemoveAll Extension Method

    - by João Angelo
    I had previously posted a RemoveAll extension method for the Dictionary<K,V> class, now it’s time to have one for the Collection<T> class. The signature is the same as in the corresponding method already available in List<T> and the implementation relies on the RemoveAt method to perform the actual removal of each element. Finally, here’s the code: public static class CollectionExtensions { /// <summary> /// Removes from the target collection all elements that match the specified predicate. /// </summary> /// <typeparam name="T">The type of elements in the target collection.</typeparam> /// <param name="collection">The target collection.</param> /// <param name="match">The predicate used to match elements.</param> /// <exception cref="ArgumentNullException"> /// The target collection is a null reference. /// <br />-or-<br /> /// The match predicate is a null reference. /// </exception> /// <returns>Returns the number of elements removed.</returns> public static int RemoveAll<T>(this Collection<T> collection, Predicate<T> match) { if (collection == null) throw new ArgumentNullException("collection"); if (match == null) throw new ArgumentNullException("match"); int count = 0; for (int i = collection.Count - 1; i >= 0; i--) { if (match(collection[i])) { collection.RemoveAt(i); count++; } } return count; } }

    Read the article

  • Introducing a (new) test method to a team

    - by Jon List
    A couple of months ago i was hired in a new job. (I'm fresh out of my Masters in software engineering) The company mainly consists of ERP consultants, but I was hired in their fairly small web department (6 developers), our main task is ERP/ecom integration (ERP-integrated web shops). The department is growing, and recently my manager asked me to start thinking about introducing tests to the team, i love a challenge, but frankly I'm a bit scared (I'm the least experience member of the team). Currently the method of testing is clicking around in the web shop and asking the customer if the products are there, if they look okay, and if orders are posted correctly to the ERP. We are getting a lot of support cases on previous projects, where a customer or a customer's customer have run into errors, which - i suppose - is why my manager wants more structured testing. Off the top of my head, I though of some (obvious?) improvements, like looking at the requirement specification, having an issue tracker, enabling team members to register their time on a "tests"-line on the budget, and to circulate tasks amongst members of the team. But as i see it we have three main challenges: general website testing. (javascript, C#, ASP.NET and CMS integration tests) (live) ERP integration testing (customers rarely want to pay for test environments). adopting a method in the team I like the responsibility, but I am afraid that I'm in a little bit over my head. I expect that my manager expects me to set up some kind of workshop for the team where I present some techniques and ideas and where we(the team) can find some solutions together. What I learned in school was mostly unit testing and program verification, not so much testing across multiple systems and applications. What I'm looking for here, is references/advice/pointers/anecdotes; anything that might help me to get smarter and to improve the current method of my team. Thanks!! (TL;DR: read the bold parts)

    Read the article

  • Oracle Unified Method 5 Essentials Exam (Beta)

    - by user535886
    Oracle Unified Method 5 Essentials (1Z1-568) exam The Oracle Unified Method Certified Implementation Specialist Certification identifies professionals who are skilled in Oracle’s all inclusive methodology. The certification covers the core features the Oracle Unified Method suite, including but not limited to, Focus Areas, Use Cases, and Requirements Gathering. The certification proves a baseline of the consultant’s knowledge and allows the implementation team to work as a cohesive team from day 1. Up-to-date training and field experience are highly recommended. Target Audience: implementation consultants. We are offering to Oracle Partners & Employees beta exam vouchers to earn Oracle Implementation Specialist credential. Exam appointments will be open soon for scheduling at authorized Pearson Vue testing centers. Due to the high demand we process the requests on a first-come, first-served basis. If you would like to request a voucher, please send an e-mail to [email protected] with the following information for each participant: first and last name; business email address, company name, and exam name. 

    Read the article

  • Is this method of writing Unit Tests correct?

    - by aspdotnetuser
    I have created a small C# project to help me learn how to write good unit tests. I know that one important rule of unit testing is to test the smallest 'unit' of code possible so that if it fails you know exactly what part of the code needs to fixed. I need help with the following before I continue to implement more unit tests for the project: If I have a Car class, for example, that creates a new Car object which has various attributes that are calculated when its' constructor method is called, would the two following tests be considered as overkill? Should there be one test that tests all calculated attributes of the Car object instead? [Test] public void CarEngineCalculatedValue() { BusinessObjects.Car car= new BusinessObjects.Car(); Assert.GreaterOrEqual(car.Engine, 1); } [Test] public void CarNameCalculatedValue() { BusinessObjects.Car car= new BusinessObjects.Car(); Assert.IsNotNull(car.Name); } Should I have the above two test methods to test these things or should I have one test method that asserts the Car object has first been created and then test these things in the same test method?

    Read the article

  • Override methods should call base method?

    - by Trevor Pilley
    I'm just running NDepend against some code that I have written and one of the warnings is Overrides of Method() should call base.Method(). The places this occurs are where I have a base class which has virtual properties and methods with default behaviour but which can be overridden by a class which inherits from the base class and doesn't call the overridden method. For example, in the base class I have a property defined like this: protected virtual char CloseQuote { get { return '"'; } } And then in an inheriting class which uses a different close quote: protected override char CloseQuote { get { return ']'; } } Not all classes which inherit from the base class use different quote characters hence my initial design. The alternatives I thought of were have get/set properties in the base class with the defaults set in the constructor: protected BaseClass() { this.CloseQuote = '"'; } protected char CloseQuote { get; set; } public InheritingClass() { this.CloseQuote = ']'; } Or make the base class require the values as constructor args: protected BaseClass(char closeQuote, ...) { this.CloseQuote = '"'; } protected char CloseQuote { get; private set; } public InheritingClass() base (closeQuote: ']', ...) { } Should I use virtual in a scenario where the base implementation may be replaced instead of extended or should I opt for one of the alternatives I thought of? If so, which would be preferable and why?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >