Search Results

Search found 4417 results on 177 pages for 'purpose'.

Page 4/177 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • purpose of php consutructor

    - by Bharanikumar
    Hi , Am working in the classes and object class structure , but not extream level , Just class and function , then in one place instantiation . that's it , not much big functions like __construct etc , Please tell me very simply , 1.what is th purpose of constructor ad destructor , But i know theoretical explanation school level , But i am expecting something like in real time , which situation we have to use, and is there any example for that please tell me, Regards

    Read the article

  • Purpose of PHP constructors

    - by Bharanikumar
    Hi, I am working with classes and object class structure, but not at a complex level – just classes and functions, then, in one place, instantiation. As to __construct and __destruct, please tell me very simply: what is the purpose of constructors and destructors? I know the school level theoretical explanation, but i am expecting something like in real world, as in which situations we have to use them. Provide also an example, please. Regards

    Read the article

  • IMetadataExchange endpoint purpose

    - by Paresh.Bijvani
    What is the purpose of IMetadataExchange endpoint. Some places i found that if i dont define this endpoint, adding service reference will not work OR creating proxy using svcutil wont work. But both of this working without having IMetadataExchange defined. If we have other endpoint with httpGetEnabled = true, we are able to create proxy from client. Also, some article says that we should delete IMetadataExchange before moving code to production and it should development period only so that other client cant see metadata. Doesnt this stop the behaviour of service having self describing itself? And if I have defined this IMetadataExchange endpoint, how can i see that on browser. Address whoch i have provided for this endpoint is not pulling any metadata in browser.

    Read the article

  • Implementation of a general-purpose object structure (property bag)

    - by Thomas Wanner
    We need to implement some general-purpose object structure, much like an object in dynamic languages, that would give us a possibility of creating the whole object graph on-the-fly. This class has to be serializable and somehow user friendly. So far we have made some experiments with class derived from Dictionary<string, object> using the dot notation path to store properties and collections in the object tree. We have also find an article that implements something similar, but it doesn't seem to fit completely into our picture either. Do you know about some good implementations / libraries that deal with a similar problem or do you have any (non-trivial) ideas that could help us with our own implementation ? Also, I probably have to say that we are using .NET 3.5, so we can't take advantage of the new features in .NET 4.0 like dynamic type etc. (as far as I know it's also not possible to use any subset of it in .NET 3.5 solution).

    Read the article

  • What is the purpose of return'ing $this when setting vars in the model

    - by TaMeR
    I am a self thought hobby programmer and therefore don't have the fundamentals always down the way you professionals do. So please excuse me if this is basic. What is the purpose or benefit of return'ing $this when setting vars in the model. I have seen this done in other places too but cant figure this out. Sample code: public function setAlias($Alias){ $this->_Alias = (string) $Alias; return $this; } public function getAlias(){ return $this->_Alias; }

    Read the article

  • v8 is too slow for my purpose

    - by Scott
    I'm working on a music visualization plugin for libvisual. It's an AVS clone -- AVS being from Winamp. Right now I have a superscope plugin. This element has 4 scripts, and "point" is run at every pixel. You can imagine that it has to be rather fast. The original libvisual avs clone had a JIT compiler that was really fast, but it had some bugs and wasn't fully implemented, so I decided to try v8. Well, v8 is too slow running the compiled script at every pixel. Is there any other script engine that would be pretty fast for this purpose?

    Read the article

  • Purpose of Trigraph sequences in C++?

    - by Kirill V. Lyadvinsky
    According to C++'03 Standard 2.3/1: Before any other processing takes place, each occurrence of one of the following sequences of three characters (“trigraph sequences”) is replaced by the single character indicated in Table 1. ---------------------------------------------------------------------------- | trigraph | replacement | trigraph | replacement | trigraph | replacement | ---------------------------------------------------------------------------- | ??= | # | ??( | [ | ??< | { | | ??/ | \ | ??) | ] | ??> | } | | ??’ | ˆ | ??! | | | ??- | ˜ | ---------------------------------------------------------------------------- In real life that means that code printf( "What??!\n" ); will result in printing What| because ??! is a trigraph sequence that is replaced with the | character. My question is what purpose of using trigraphs? Is there any practical advantage of using trigraphs? UPD: In answers was mentioned that some European keyboards don't have all the punctuation characters, so non-US programmers have to use trigraphs in everyday life? UPD2: Visual Studio 2010 has trigraph support turned off by default.

    Read the article

  • Changing a datatype solely for the purpose of Excel Export in Crystal Reports

    - by yeahumok
    I have a report that has several numerical fields. To fill a project requirement, i had to use the following formula: if {DataTable1.No of Investments}>9999 then '*****' else toText({DataTable1.No of Investments},0) Basically, if the number fed in is bigger than 9999 it turns into * on the report. Now, when i try to export into excel, not only is the data type for all fields, strings...but the * show up versus numbers. I was wondering if there was a way to re-cast this back into a numerical value SOLELY for the purpose of excel exportation so that i'd be able to use excel formulas as well as see numbers instead of asterisks. I'd only be doing data-only excel exports. Any ideas?

    Read the article

  • Purpose of boost::checked_delete

    - by Channel72
    I don't understand the purpose of boost::checked_delete. The documentation says: The C++ Standard allows, in 5.3.5/5, pointers to incomplete class types to be deleted with a delete-expression. When the class has a non-trivial destructor, or a class-specific operator delete, the behavior is undefined. Some compilers issue a warning when an incomplete type is deleted, but unfortunately, not all do, and programmers sometimes ignore or disable warnings. The supplied function and class templates can be used to prevent these problems, as they require a complete type, and cause a compilation error otherwise. So the C++ standard allows you to delete incomplete types, which causes undefined behavior if the type has a non-trivial destructor. What? How can an incomplete type have any destructor at all? Isn't an incomplete type just a prototype?

    Read the article

  • Purpose of IF, ELSE, FOR macros ?

    - by psihodelia
    I have a source code of a library which has a lot of strange IF, ELSE, FOR, etc. macros for all common C-keywords instead of using just usual if,else,for,while keywords. These macros are defined like this: #define IF( a) if( increment_if(), a) where increment_if() function is defined so: static __inline void increment_if( void) { // If the "IF" operator comes just after an "ELSE", its counter // must not be incremented. ... //implementation } I don't really understand, what is the purpose of such macros? This library is for a real-time application and I suppose that using such macros must slow-down an application.

    Read the article

  • What purpose does “using” serve when used the following way

    - by user287745
    What purpose does “using” serve when used the following way:- ONE EXAMPLE IS THIS, (AN ANSWERER- @richj - USED THIS CODE TO SOLVE A PROBLEM THANKS) private Method(SqlConnection connection) { using (SqlTransaction transaction = connection.BeginTransaction()) { try { // Use the connection here .... transaction.Commit(); } catch { transaction.Rollback(); throw; } } } OTHER EXAMPLE I FOUND WHILE READING ON MICROSOFT SUPPORT SITE public static void ShowSqlException(string connectionString) { string queryString = "EXECUTE NonExistantStoredProcedure"; StringBuilder errorMessages = new StringBuilder(); using (SqlConnection connection = new SqlConnection(connectionString)) { SqlCommand command = new SqlCommand(queryString, connection); try { command.Connection.Open(); command.ExecuteNonQuery(); } catch (SqlException ex) { for (int i = 0; i < ex.Errors.Count; i++) { errorMessages.Append("Index #" + i + "\n" + "Message: " + ex.Errors[i].Message + "\n" + "LineNumber: " + ex.Errors[i].LineNumber + "\n" + "Source: " + ex.Errors[i].Source + "\n" + "Procedure: " + ex.Errors[i].Procedure + "\n"); } Console.WriteLine(errorMessages.ToString()); } } } I AM doing at top of page as using system.data.sqlclient etc so why this using thing in middle of code, What if I omit it (I know the code will work) but what functionality will I be losing

    Read the article

  • purpose of 3rd party mvc ?

    - by Honey
    ive seen many third party mvcs or frameworks such as codeignitor , cakephp, and so on. what i want to know is what are their purposes? ive created my own framework call it an mvc or framework (in my opinion their all the same). in my framework i have all the classes in one folder called classes and all functions in another. its all organized and when a new project comes in i am able to complete it fast. i have looked at the applications that i mentioned and it seems to have huge articles and tutorials to study. what is the purpose? why not study the main language such as php, javascript/ajax or jquery, and so on then build something that you know the ins and outs of so that any project comes your way you know what to do. ive known some people who use cakephp and for every project they get stuck and need to figure out what to do. another guy i knew worked with joomla and every basic company website that came his way he would reverse engineer joomla to make it work with the site. are people using these applications because they lack knowledge in the languages? or sometimes have no choice but to make a site while lacking language and put something together.

    Read the article

  • What's the purpose of "import package"?

    - by codethief
    As I just found out import package does not make the package's modules available through package.module. The same obviously holds true for from package import subpackage as well as from package import * What's the purpose of importing a package at all then if I can't access its submodules but only the objects defined in __init__.py? It makes sense to me that from package import * would bloat the namespace, which, however, doesn't apply in case of the other two ways! I also understand that loading all submodules might take a long time. But I don't know what these unwanted side-effects, "that should only happen when the sub-module is explicitly imported", are which the author of the previous link mentions. To me it looks like doing an import package[.subpackage] (or from package import subpackage) makes absolutely no sense if I don't exactly want to access objects provided in __init__.py. Are those unwanted side effects really that serious that the language actually has to protect the programmer from causing them? Actually, I thought that Python was a little bit more about "If the programmer wants to do it, let him do it." In my case, I really do want to import all submodules with the single statement from package import subpackage, because I need all of them! Telling Python in the init.py file which submodules I'm exactly talking about (all of them!) is quite cumbersome from my point of view. Please enlighten me. :)

    Read the article

  • Best practices for JQuery namespaces + general purpose utility functions

    - by Armchair Bronco
    What are some current "rules of thumb" for implementing JQuery namespaces to host general purpose utility functions? I have a number of JavaScript utility methods scattered in various files that I'd like to consolidate into one (or more) namespaces. What's the best way to do this? I'm currently looking at two different syntaxes, listed in order of preference: //****************************** // JQuery Namespace syntax #1 //****************************** if (typeof(MyNamespace) === "undefined") { MyNamespace = {}; } MyNamespace.SayHello = function () { alert("Hello from MyNamespace!"); } MyNamespace.AddEmUp = function (a, b) { return a + b; } //****************************** // JQuery Namespace syntax #2 //****************************** if (typeof (MyNamespace2) === "undefined") { MyNamespace2 = { SayHello: function () { alert("Hello from MyNamespace2!"); }, AddEmUp: function (a, b) { return a + b; } }; } Syntax #1 is more verbose but it seems like it would be easier to maintain down the road. I don't need to add commas between methods, and I can left align all my functions. Are there other, better ways to do this?

    Read the article

  • The Purpose of a Service Layer and ASP.NET MVC 2

    - by user332022
    In an effort to understand MVC 2 and attempt to get my company to adopt it as a viable platform for future development, I have been doing a lot of reading lately. Having worked with ASP.NET pretty exclusively for the past few years, I had some catching up to do. Currently, I understand the repository pattern, models, controllers, data annotations, etc. But there is one thing that is keeping me from completely understanding enough to start work on a reference application. The first is the Service Layer Pattern. I have read many blog posts and questions here on Stack Overflow, but I still don't completely understand the purpose of this pattern. I watched the entire video series at MVCCentral on the Golf Tracker Application and also looked at the demo code he posted and it looks to me like the service layer is just another wrapper around the repository pattern that doesn't perform any work at all. I also read this post: http://www.asp.net/Learn/mvc/tutorial-38-cs.aspx and it seemed to somewhat answer my question, however, if you are using data annotations to perform your validation, this seems unnecessary. I have looked for demonstrations, posts, etc. but I can't seem to find anything that simply explains the pattern and gives me compelling evidence to use it. Can someone please provide me with a 2nd grade (ok, maybe 5th grade) reason to use this pattern, what I would lose if I don't, and what I gain if I do?a

    Read the article

  • What does "general purpose system" mean for Java SE Embedded?

    - by Majid Azimi
    The Oracle website says this about Java SE Embedded license: development is free, but royalties are required upon deployment on anything other than general purpose systems What does "general purpose system" mean here? We have a sensor network around the country. On each box we have installed, there is a micro controller based board that gets data from the environment and send data on serial port to a ARM based embedded board. On this board system there is a Java process which reads and submits data to our central server using JMS. Is this categorized as general purpose system? Sorry I'm asking this here. We are in Iran, there is no Oracle office here to ask.

    Read the article

  • what is the purpose of getEventType() method in XMLStreamReader Class

    - by KItis
    I have sample code written for parsing xml file using javax.xml package. it uses the method called getEventType() , but I can not understand the purpose of this method. i wrote simple application to understand its usefulness, but it output only some random numbers for which I can not make any sense, could some one help me to get this point right. Here is the sample code I have written. public List parseXML(File f) throws XMLStreamException{ xmlInputFactory = new WstxInputFactory(); xmlInputFactory.setProperty(XMLInputFactory2.IS_REPLACING_ENTITY_REFERENCES, Boolean.FALSE); xmlInputFactory.setProperty(XMLInputFactory2.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE); xmlInputFactory.setProperty(XMLInputFactory2.IS_COALESCING,Boolean.FALSE); xmlInputFactory.setProperty(XMLInputFactory2.IS_VALIDATING,Boolean.FALSE); xmlInputFactory.configureForSpeed(); List<Task> tasks = new LinkedList<Task>(); //xmlStreamReader = xmlInputFactory.createXMLStreamReader(new StringReader(dmml)); xmlStreamReader = xmlInputFactory.createXMLStreamReader(f); int eventType = xmlStreamReader.getEventType(); eventType = xmlStreamReader.next(); System.out.println(eventType); eventType = xmlStreamReader.next(); System.out.println(eventType); eventType = xmlStreamReader.next(); System.out.println(eventType); eventType = xmlStreamReader.next(); System.out.println(eventType); eventType = xmlStreamReader.next(); System.out.println(eventType); eventType = xmlStreamReader.next(); System.out.println(eventType); eventType = xmlStreamReader.next(); System.out.println(eventType); eventType = xmlStreamReader.next(); System.out.println(eventType); eventType = xmlStreamReader.next(); System.out.println(eventType); eventType = xmlStreamReader.next(); System.out.println(eventType); eventType = xmlStreamReader.next(); System.out.println(eventType); /*String currentElement = ""; String currentElementText = ""; }

    Read the article

  • Purpose of overloading operators in C++?

    - by Geo Drawkcab
    What is the main purpose of overloading operators in C++? In the code below, << and >> are overloaded; what is the advantage to doing so? #include <iostream> #include <string> using namespace std; class book { string name,gvari; double cost; int year; public: book(){}; book(string a, string b, double c, int d) { a=name;b=gvari;c=cost;d=year; } ~book() {} double setprice(double a) { return a=cost; } friend ostream& operator <<(ostream& , book&); void printbook(){ cout<<"wignis saxeli "<<name<<endl; cout<<"wignis avtori "<<gvari<<endl; cout<<"girebuleba "<<cost<<endl; cout<<"weli "<<year<<endl; } }; ostream& operator <<(ostream& out, book& a){ out<<"wignis saxeli "<<a.name<<endl; out<<"wignis avtori "<<a.gvari<<endl; out<<"girebuleba "<<a.cost<<endl; out<<"weli "<<a.year<<endl; return out; } class library_card : public book { string nomeri; int raod; public: library_card(){}; library_card( string a, int b){a=nomeri;b=raod;} ~library_card() {}; void printcard(){ cout<<"katalogis nomeri "<<nomeri<<endl; cout<<"gacemis raodenoba "<<raod<<endl; } friend ostream& operator <<(ostream& , library_card&); }; ostream& operator <<(ostream& out, library_card& b) { out<<"katalogis nomeri "<<b.nomeri<<endl; out<<"gacemis raodenoba "<<b.raod<<endl; return out; } int main() { book A("robizon kruno","giorgi",15,1992); library_card B("910CPP",123); A.printbook(); B.printbook(); A.setprice(15); B.printbook(); system("pause"); return 0; }

    Read the article

  • whats the point of using template?

    - by netrox
    I am under the impression that if I set it as a template in Dreamweaver, any changes made should be saved to a new filename. I've copied the "template" that I made and sometimes I forget to save it as a different file name and it would overwrite previous web content. I just don't get the point of "save as template" if it works just like a document... it doesn't force me to save as a different filename. Common sense in me thinks that the software should evaluate like this, "if this is a template, always save as a different filename when it's modified so nothing is changed to the template, but rather a new file is created with the new content following that template." Am I missing something? Am I always doomed to using Save As...?

    Read the article

  • When can we say that we have mastered something

    - by Thinking
    I donot know if this is a valid question to ask here or not but I have asked this as because i have the doubt In many interviews , the interviewer ask as how much you want ot rate yourself on a scale of 10 in C#, Jave etc. Some says 6 some 7 .... My question is how to judge where I am standing at present? And when can we say that we have mastered a language or a topic. As everything is huge and everyday we learn something.. so there is no end to it... so how can I judge that? Thanks

    Read the article

  • What is the purpose of both target API and minSDK

    - by Scott Ferguson
    Can somebody explain to me the difference between the project target and the minimum SDK? I want my app to run on Donut devices, and the APK I built with a target of 7 worked just fine. When I set an explicit minimum SDK in the Android manifest of 4 (1.6) the compiler bitched at me that the target exceeded the minimum. I reset the target to 4 only to see what would happen, and now I've got compiler errors. An example is the START_NOT_STICKY constant in android.app.Service. It doesn't exist in API level 4, but does exist in API level 7. This is also the case with Service.onStartCommand(). In API level 7 you need to explicity override this method, whereas in API level 4 you don't. So why does the app work in 1.6 despite all this? How could 1.6 know how to use SERVICE_NOT_STICKY when the associated API level doesn't know about it?

    Read the article

  • What is the purpose of WCF reliable session?

    - by bsnote
    The documentation around this topic is poor. I use WCF services with NetTcpBinding hosted in Windows service. The problem is that a session is dropped when it is inactive for some time. What I need is the session which is always alive. Is WCF reliable session something that can help? Or I can just play with timeout settings?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >