Search Results

Search found 29508 results on 1181 pages for 'object initializers'.

Page 121/1181 | < Previous Page | 117 118 119 120 121 122 123 124 125 126 127 128  | Next Page >

  • javascript object's - private methods: which way is better.

    - by Praveen Prasad
    (function () { function User() { //some properties } //private fn 1 User.prototype._aPrivateFn = function () { //private function defined just like a public function, //for convetion underscore character is added } //private function type 2 //a closure function _anotherPrivateFunction() { // do something } //public function User.prototype.APublicFunction = function () { //call private fn1 this._aPrivateFn(); //call private fn2 _anotherPrivateFunction(); } window.UserX = User; })(); //which of the two ways of defining private methods of a javascript object is better way, specially in sense of memory management and performance.

    Read the article

  • drag object vertically

    - by blacksheep
    i like to drag this object vertically instead of horizontally, which is doin it now: (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; CGPoint location = [touch locationInView:touch.view]; if (CGRectContainsPoint(myObject.frame, location)){ CGPoint xLocation = CGPointMake(location.x, myObject.center.y); myObject.center = xLocation; } }

    Read the article

  • using json object data in jquery select

    - by Ratna
    {"names": [ {"patientName": "Ratna"}, {"patientName": "raju" }, {"patientName": "krishna"}, {"patientName": "kishore"}, {"patientName": "Kishore1"}, {"patientName": "mahesh"} ]} this is the JSON object i'm getting from Ajax call so now i want to add all patientName values to select box through jquery can any one tell me how to accomplish this ?? here i'm using $.ajax() function for ajax call thanks in advance

    Read the article

  • C# / Visual Studio - Object is null unless I have a Breakpoint

    - by user576611
    Hi Everyone, I'm specifically using the Google Contacts API at the moment, but this could be true of other scinarios as well. I have the following code: Contact newContact = new Contact(); When I let the code run without any breakpoints, I get a NullReferenceException on all of the properties of this object. However, if I put a breakpoint just after this line, I can see all of the properties have been initialises and the rest of my code executes fine. Any idea's would be greatly appreciated

    Read the article

  • Passing DataSource object from a servlet to a JavaBean

    - by Slavko
    I like the ease of using @Resource annotation to get a DataSource, but as far as I know, it's not possible to use it in a regular JavaBean. Would it be considered a bad practice if I pass the DataSource object from a servlet to a bean along with the other data to avoid having that lookup code in the bean?

    Read the article

  • LinkedList insert tied to inserted object

    - by wrongusername
    I have code that looks like this: public class Polynomial { List<Term> term = new LinkedList<Term>(); and it seems that whenever I do something like term.add(anotherTerm), with anotherTerm being... another Term object, it seems anotherTerm is referencing the same thing as what I've just inserted into term so that whenever I try to change anotherTerm, term.get(2) (let's say) get's changed too. How can I prevent this from happening?

    Read the article

  • Modifying the Codec List Object in an ASF file

    - by scompt.com
    Is it possible to modify the Codec List Object in an ASF file? In particular, I would like to edit the codec name and description. I realize that this won't actually change the content of the video, but it's necessary for the video to be verified by an external tool. Does anyone know of a tool that will allow me to do this? If not, does anyone have any suggestions about how I might go about doing it using the Windows Media Format 11 SDK?

    Read the article

  • Cast into new Object, Copy values by Property Name

    - by Alex
    Hello, I have the following: Class 1 (Text, State, Level) Class 2 (Text, State, Level, Ident) Is there a way for me to cast an object of Class 2 into into Class 1, and not having to do the usual cast code (Text = c.Text, State = c.State etc.)? Possibly by identifying the property names of each class and copying the value over?

    Read the article

  • How to checking wether an object has a specific method or not

    - by Ghommey
    Hey, I want to use a method of an object. Like $myObject->helloWorld(). However there are a couple of methods so I loop through an array of method names and call the method like this: my $methodName ="helloWorld"; $myObject->$methodNames; This works quite nice but some objects don't have all methods. How can I tell wether $myObject has a method called helloWorld or not?

    Read the article

  • PHP: Object Oriented Programming -> Operator

    - by oman9589
    So I've been reading through the book PHP Solutions, Dynamic Web Design Made Easy by David Powers. I read through the short section on Object Oriented PHP, and I am having a hard time grasping the idea of the - operator. Can anyone try to give me a solid explanation on the - operator in OOP PHP? Example: $westcost = new DateTimeZone('America/Los_Angeles'); $now->setTimezone($westcoast); Also,a more general example: $someObject->propertyName Thanks

    Read the article

  • PHP object exchange between servers

    - by bensiu
    I got script what read from database and manipulate it so on the end I got $result array... on one server is it possible to serialize this object and pass it to other script so this $result array could be available for other script on second server... I got on first server: return serialize ( $results ); and on second: $data = unserialize ( file_get_contents ( 'http://www.......com/reader.php' ) ); ...but there is no communication between .... What I am doing wrong ? Bensiu

    Read the article

  • Serialization of an object

    - by sandhya
    Hi I am Serialing an object using GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("string1",subobject1); info.AddValue("string2",subobject2); } what will be stored in stream? do the strings also store?

    Read the article

  • What is the role of the Router Object in MVC based frameworks

    - by Saif Bechan
    In most MVC based framework I see a router object. If I look at it splits up the uri and decides what controller should be used, and which action should be fired. Even though this makes a lot of sense, I can not give this a place in the MVC patern. Is splitting up the uri not the job of the controller. And then the controller should just decide which class and function to run.

    Read the article

  • In NHibernate (Fluent), How do you map a property on referenced object into parent object?

    - by JChristian
    I want to map the Name column from the Child table into the Parent object. How do you do this (using Fluent NHibernate)? public class Parent { public int Key { get; set; } public string ChildName { get; set; } } Tables +--------------+ +------------------+ | Parent | | Child | +--------------+ +------------------+ | Key INT | +--->| Key INT | | ChildKey INT |-----+ | Name VARCHAR(20) | +--------------+ +------------------+

    Read the article

  • Dictionary to Json object, "Expected expression"

    - by MrW
    I'm trying to convert a dictionery into a json object, so that I can work with it in my front end. sortFields = <%= SchrodersHtmlHelper.ToJson(ViewData["SortInfo"])%>; However, I keep on getting "Expected expression" for this all the time and I'm clueless why. Could anyone explain to me what I'm doing wrong? Edit: The conversion works fine, but I still get this issue in the front end, causing the browser to complain about it.

    Read the article

< Previous Page | 117 118 119 120 121 122 123 124 125 126 127 128  | Next Page >