Search Results

Search found 29498 results on 1180 pages for 'object destruction'.

Page 74/1180 | < Previous Page | 70 71 72 73 74 75 76 77 78 79 80 81  | Next Page >

  • JS: Object itteration fails

    - by Newbie
    Hello! In my JS, I have an object called box_object. It looks like this: ({ id:"3", text:"this is a box object", connection_parent:["1", "2"], connection_child:["5", "6"], connectiondata_child:{ 0:{id:"5", linepoint:"bottom"}, 1:{id:"6", linepoint:"bottom"}}, connectiondata_parent:{ 0:{id:"1", linepoint:"top"}, 1:{id:"2", linepoint:"top"}} }) Now, I want to add some position values to box_object.connectiondata_parent. Using jQuery I can use the .each() method. So I tried it, but it failed. In my function I do the following: $(box_object.connectiondata_parent).each(function(it, obj){ if(typeof(obj[it]) != "undefined" && obj[it].linepoint == "top"){ var point_position_top = new Object(); point_position_top.left = startingpoint_left; point_position_top.top = startingpoint_top; obj[it].position = point_position_top; }else if(typeof(obj[it]) != "undefined" && obj[it].linepoint == "bottom"){ var point_position_bottom = new Object(); point_position_bottom.left = startingpoint_left; point_position_bottom.top = startingpoint_bottom; obj[it].position = point_position_bottom; }else{} }); After the function my box_object looks like this: ({ id:"3", text:"this is third box", connection_parent:["1", "2"], connection_child:["5", "6"], connectiondata_child:{ 0:{id:"5", linepoint:"bottom"}, 1:{id:"6", linepoint:"bottom"}}, connectiondata_parent:{ 0:{id:"1", linepoint:"top", position:{left:500, top:104}}, 1:{id:"2", linepoint:"top"}} }) It seems it only writes the values to the first "value". Any Ideas why?

    Read the article

  • How to print each object in a collection in a separate page in Silverlight

    - by Ash
    I would like to know if its possible to print each object in a collection in separate pages using Silverlight printing API. Suppose I have a class Label public class Label { public string Address { get; set; } public string Country { get; set; } public string Name { get; set; } public string Town { get; set; } } I can use print API and print like this. private PrintDocument pd; private void PrintButton_Click(object sender, RoutedEventArgs e) { pd.Print("Test Print"); } private void pd_PrintPage(object sender, PrintPageEventArgs e) { Label labelToPrint = new Label() { Name = "Fake Name", Address = "Fake Address", Country = "Fake Country", Town = "Town" }; var printpage = new LabelPrint(); printpage.DataContext = new LabelPrintViewModel(labelToPrint); e.PageVisual = printpage; } LabelPrint Xaml <StackPanel x:Name="LayoutRoot" VerticalAlignment="Center" HorizontalAlignment="Center"> <TextBlock Text="{Binding Name}" /> <TextBlock Text="{Binding Address}" /> <TextBlock Text="{Binding Town}" /> <TextBlock Text="{Binding Country}" /> </StackPanel> Now, say I've a collection of Label objects, List<Label> labels = new List<Label>() { labelToPrint, labelToPrint, labelToPrint, labelToPrint }; How can I print each object in the list in separate pages ? Thanks for any suggestions ..

    Read the article

  • "Finding" an object instance of a known class?

    - by Sean C
    My first post here (anywhere for that matter!), re. Cocoa/Obj-C (I'm NOT up to speed on either, please be patient!). I hope I haven't missed the answer already, I did try to find it. I'm an old-school procedural dog (haven't done any programming since the mid 80's, so I probably just can't even learn new tricks), but OOP has my head spinning! My question is: is there any means at all to "discover/find/identify" an instance of an object of a known class, given that some OTHER unknown process instantiated it? eg. somthing that would accomplish this scenario: (id) anObj = [someTarget getMostRecentInstanceOf:[aKnownClass class]]; for that matter, "getAnyInstance" or "getAllInstances" might do the trick too. Background: I'm trying to write a plugin for a commercial application, so much of the heavy lifting is being done by the app, behind the scenes. I have the SDK & header files, I know what class the object is, and what method I need to call (it has only instance methods), I just can't identify the object for targetting. I've spent untold hours and days going over Apples documentation, tutorials and lots of example/sample code on the web (including here at Stack Overflow), and come up empty. Seems that everything requires a known target object to work, and I just don't have one. Since I may not be expressing my problem as clearly as needed, I've put up a web page, with diagram & working sample pages to illustrate: http://www.nulltime.com/svtest/index.html Any help or guidance will be appreciated! Thanks.

    Read the article

  • object construct a class of objects in java

    - by Mgccl
    There is a super class, A, and there are many subclasses, B,C,D... people can write more subclasses. Each of the class have the method dostuff(), each is different in some way. I want an object that constructs any object that belong to A or any of it's subclass. For example I can pass the name of the subclass, or a object of that class, and it will construct another object of the class. Of course I can write A construct(A var){ stuff = var.dostuff(); domorestuff(stuff) return new A(stuff); } B construct(B var){ stuff = var.dostuff(); domorestuff(stuff) return new B(stuff); } C construct(C var){ stuff = var.dostuff(); domorestuff(stuff) return new C(stuff); } but this is not efficient. I have to write a few new lines every time I make a new subclass. It seems I can't use generics either. Because I can't use dostuff() on objects not in any of the subclass of A. What should I do in this situation?

    Read the article

  • How to marshal an object and its content (also objects)

    - by Waldo Spek
    I have a question for which I suspect the answer is a bit complex. At this moment I am programming a DLL (class library) in C#. This DLL uses a 3rd party library and therefore deals with 3rd party objects of which I do not have the source code. Now I am planning to create another DLL, which is going to be used in a later stadium in my application. This second DLL should use the 3rd party objects (with corresponding object states) created by the first DLL. Luckily the 3rd party objects extend the MarshalByRefObject class. I can marshal the objects using System.Runtime.Remoting.Marshal(...). I then serialize the objects using a BinaryFormatter and store the objects as a byte[] array. All goes well. I can deserialize and unmarshal in a the opposite way and end up with my original 3rd party objects...so it appears... Nevertheless, when calling methods on my 3rd party deserialized objects I get object internal exceptions. Normally these methods return other 3rd party objects, but (obviously - I guess) now these objects are missing because they weren't serialized. Now my global question: how would I go about marshalling/serializing all the objects which my 3rd party objects reference...and cascade down the "reference tree" to obtain a full and complete serialized object? Right now my guess is to preprocess: obtain all the objects and build my own custom object and serialize it. But I'm hoping there is some other way...

    Read the article

  • rbind.zoo doesn't seem create consistent zoo object

    - by a-or-b
    I want to rbind.zoo two zoo object together. When I was testing I came across the following issue(?)... Note: The below is an example, there is clearly no point to it apart from being illustrative. I have an zoo object, call it, 'X'. I want to break it into two parts and then rbind.zoo them together. When I compare it to the original object then all.equal gives differences. It appears that the '$class' attribute differs, but I can't see how or why. Is I make these xts objects then the all.equal works as expected. i.e. ..... X.date <- as.POSIXct(paste("2003-", rep(1:4, 4:1), "-", sample(1:28, 10, replace = TRUE), sep = "")) X <- zoo(matrix(rnorm(24), ncol = 2), X.date) a <- X[c(1:3), ] # first 3 elements b <- X[c(4:6), ] # second 3 elements c <- rbind.zoo(a, b) # rbind into an object of 6 elements d <- X[c(1:6), ] # all 6 elements all.equal(c, d) # are they equal? ~~~~ all.equal gives me the following difference: "Attributes: < Component 3: Attributes: < Length mismatch: comparison on first 1 components "

    Read the article

  • How to output multiple rows from an SQL query using the mysqli object

    - by Jonathan
    Assuming that the mysqli object is already instantiatied (and connected) with the global variable $mysql, here is the code I am trying to work with. class Listing { private $mysql; function getListingInfo($l_id = "", $category = "", $subcategory = "", $username = "", $status = "active") { $condition = "`status` = '$status'"; if (!empty($l_id)) $condition .= "AND `L_ID` = '$l_id'"; if (!empty($category)) $condition .= "AND `category` = '$category'"; if (!empty($subcategory)) $condition .= "AND `subcategory` = '$subcategory'"; if (!empty($username)) $condition .= "AND `username` = '$username'"; $result = $this->mysql->query("SELECT * FROM listing WHERE $condition") or die('Error fetching values'); $this->listing = $result->fetch_array() or die('could not create object'); foreach ($this->listing as $key => $value) : $info[$key] = stripslashes(html_entity_decode($value)); endforeach; return $info; } } there are several hundred listings in the db and when I call $result-fetch_array() it places in an array the first row in the db. however when I try to call the object, I can't seem to access more than the first row. for instance: $listing_row = new Listing; while ($listing = $listing_row-getListingInfo()) { echo $listing[0]; } this outputs an infinite loop of the same row in the db. Why does it not advance to the next row? if I move the code: $this->listing = $result->fetch_array() or die('could not create object'); foreach ($this->listing as $key => $value) : $info[$key] = stripslashes(html_entity_decode($value)); endforeach; if I move this outside the class, it works exactly as expected outputting a row at a time while looping through the while statement. Is there a way to write this so that I can keep the fetch_array() call in the class and still loop through the records?

    Read the article

  • Determining an object's variable name dynamically?

    - by ZenBlender
    Let's say I have some objects: ArrayList<SomeObject> list = new ArrayList<SomeObject>(); SomeObject A = new SomeObject(); SomeObject B = new SomeObject(); SomeObject C = new SomeObject(); SomeObject D = new SomeObject(); These constructors automatically add each object to the ArrayList so I can iterate over them but still maintain the variable names for direct access: public SomeObject(){ // init stuff here list.add(this); } But then, let's say I want to output some debug info, and iterate through list and print out the NAME of each object? How can I do that? Essentially, when "SomeObject A = new SomeObject();" is executed, I want to use reflection (if possible) to determine that this variable's name is "A" (a String) and either store that in the object when the constructor executes, or determine it dynamically through reflection when referencing this object with the variable named "A". Does that make sense? How can I do this? Thanks!

    Read the article

  • Issue pushing object into an array JS

    - by Javacadabra
    I'm having an issue placing an object into my array in javascript. This is the code: $('.confirmBtn').click(function(){ //Get reference to the Value in the Text area var comment = $("#comments").val(); //Create Object var orderComment = { 'comment' : comment }; //Add Object to the Array productArray.push(orderComment); //update cookie $.cookie('order_cookie', JSON.stringify(productArray), { expires: 1, path: '/' }); }); However when I print the array this is the output: Array ( [0] => Array ( [stockCode] => CBL202659/A [quantity] => 8 ) [1] => Array ( [stockCode] => CBL201764 [quantity] => 6 ) [2] => TEST TEST ) I would like it to look like this: Array ( [0] => Array ( [stockCode] => CBL202659/A [quantity] => 8 ) [1] => Array ( [stockCode] => CBL201764 [quantity] => 6 ) [2] Array( [comment] => TEST TEST ) I added products to the array in a similar way and it worked fine: var productArray = []; // Will hold order Items $(".orderBtn").click(function(event){ //Check to ensure quantity > 0 if(quantity == 0){ console.log("Quantity must be greater than 0") }else{//It is so continue //Show the order Box $(".order-alert").show(); event.preventDefault(); //Get reference to the product clicked var stockCode = $(this).closest('li').find('.stock_code').html(); //Get reference to the quantity selected var quantity = $(this).closest('li').find('.order_amount').val(); //Order Item (contains stockCode and Quantity) - Can add whatever data I like here var orderItem = { 'stockCode' : stockCode, 'quantity' : quantity }; //Check if cookie exists if($.cookie('order_cookie') === undefined){ console.log("Creating new cookie"); //Add object to the Array productArray.push(orderItem);

    Read the article

  • overload == (and != , of course) operator, can I bypass == to determine whether the object is null

    - by LLS
    Hello, when I try to overload operator == and != in C#, and override Equal as recommended, I found I have no way to distinguish a normal object and null. For example, I defined a class Complex. public static bool operator ==(Complex lhs, Complex rhs) { return lhs.Equals(rhs); } public static bool operator !=(Complex lhs, Complex rhs) { return !lhs.Equals(rhs); } public override bool Equals(object obj) { if (obj is Complex) { return (((Complex)obj).Real == this.Real && ((Complex)obj).Imaginary == this.Imaginary); } else { return false; } } But when I want to use if (temp == null) When temp is really null, some exception happens. And I can't use == to determine whether the lhs is null, which will cause infinite loop. What should I do in this situation. One way I can think of is to us some thing like Class.Equal(object, object) (if it exists) to bypass the == when I do the check. What is the normal way to solve the problem?

    Read the article

  • AppCmd returns error: Object 'SET' is not supported

    - by RHPT
    I am trying to set SSL Host Headers and Secure Site Bindings in IIS7. I followed the directions on this website http://www.digicert.com/ssl-support/ssl-host-headers-iis-7.htm (among others), but when I run the appcmd command mentioned, I get the error "Object 'SET' is not supported. Run 'appcmd.exe /?' to display supported objects". I have also tryed "appcmd site set" but it still returns the same error. What am I doing wrong? The server I am working on is Windows 2008 R2 x64, if that matters. Thank you.

    Read the article

  • What Defines an AD Object as "Inactive"

    - by Malnizzle
    I am going to be using some DSQUERY/DSMOVE scripts to clean up my AD Domin. One option is to move inactive objects to a OU that has restrictive GPOs applied to it. Something like: DSQUERY computer -inactive 10 | DSMOVE -newparent <distinguished name of target OU> My question is what value defines an object, both user and computer, as "inactive" for a period of time? Is it the last time a computer was logged on to for computer accounts, and for users is it the last time that the user account logged on to a computer? But what if, say for example, I had a web server that wasn't rebooted and or logged into for a couple of months but remain powered on and functioning as normal, would it be defined as "inactive" where as technically it's still serving web pages and so on? Thanks for the help!

    Read the article

  • Server 2003 - Default installation of SharePoint throws javascript error 'undefined' is null or not an object

    - by Chris
    I have been handed a server that has a fresh installation of small business server 2003. SharePoint has been installed, and it is a completely fresh copy (no changes made) I know for a fact that everything was paid for so this isn't some dodgy copy. When I try to click any option in any of the floating menu's in IE 8, the browser asks me if I want to debug .. Error: 'undefined' is null or not an object for example, I got to Projects - and click on the sample project, then click delete on the floating menu that pops up and the error appears. This is brand new, I cannot believe I am having this problem! Has anyone come across this, is it an old problem with easy fix? All windows updates installed - see no updates for sharepoint? EDIT: This is WSS2 so I am going to upgrade to WSS3... http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=14117 http://www.techrepublic.com/article/installing-windows-sharepoint-services-30-on-windows-server-2003/6176833 Hopefully this will resolve the problem

    Read the article

  • 'Object variable or With block variable not set' error when setting a range in VBA

    - by David Gard
    I have a function that creates a Pivot Table, but I am getting an error when I try to set a range that will be merged and have a title added to it. In the below code, pivot_title_range is a 'String' variable, and is optional when calling the funtion. title_range is a 'Range' variable. Both lines that set the range (whether or not the users declares pivot_title_range) cause the same error. If pivot_title_range = "" Then title_range = ActiveSheet.Range("B3:E4") Else title_range = ActiveSheet.Range(pivot_title_range) End If Here is the error that I am getting - Run-time error '91': Object variable or With block variable not set If required, here is a Pastebin of the full function - http://pastebin.com/L711jayc. The offending code starts on line 160. Is anybody able to tell me what I am doing wrong? Thanks.

    Read the article

  • Designing An ACL Based Permission System

    - by ryanzec
    I am trying to create a permissions system where everything is going to be stored in MySQL (or some database) and pulled using PHP for a project management system I am building.  I am right now trying to do it is an ACL kind of way.  There are a number key features I want to be able to support: 1.  Being able to assign permissions without being tied to a specific object. The reason for this is that I want to be able to selectively show/hide elements of the UI based on permissions at a point where I am not directly looking at a domain object instance.  For instance, a button to create a new project should only should only be shown to users that have the pm.project.create permission but obviously you can assign a create permission to an domain object instance (as it is already created). 2.  Not have to assign permissions for every single object. Obviously creating permissions entries for every single object (projects, tickets, comments, etc…) would become a nightmare to maintain so I want to have some level of permission inheritance. *3.  Be able to filter queries based on permissions. This would be a really nice to have but I am not sure if it is possible.  What I mean by this is say I have a page that list all projects.  I want the query that pulls all projects to incorporate the ACL so that it would not show projects that the current user does not have pm.project.read access to.  This would have to be incorporated into the main query as if it is a process that is done after that main query (which I know I could do) certain features like pagination become much more difficult. Right now this is my basic design for the tables: AclEntities id - the primary key key - the unique identifier for the domain object (usually the primary key of that object) parentId - the parent of the domain object (like the project object if this was a ticket object) aclDomainObjectId - metadata about the domain object AclDomainObjects id - primary key title - simple string to unique identify the domain object(ie. project, ticket, comment, etc…) fullyQualifiedClassName - the fully qualified class name for use in code (I am using namespaces) There would also be tables mapping AclEntities to Users and UserGroups. I also have this interface that all acl entity based object have to implement: IAclEntity getAclKey() - to the the unique key for this specific instance of the acl domain object (generally return the primary key or a concatenated string of a composite primary key) getAclTitle() - to get the unique title for the domain object (generally just returning a static string) getAclDisplayString() - get the string that represents this entity (generally one or more field on the object) getAclParentEntity() - get the parent acl entity object (or null if no parent) getAclEntity() - get the acl enitty object for this instance of the domain object (or null if one has not been created yet) hasPermission($permissionString, $user = null) - whether or not the user has the permission for this instance of the domain object static getFromAclEntityId($aclEntityId) - get a specific instance of the domain object from an acl entity id. Do any of these features I am looking for seems hard to support or are just way off base? Am I missing or not taking in account anything in my implementation? Is performance something I should keep in mind?

    Read the article

  • Grant account write access to specific attributes on Active Directory User object

    - by Patricker
    I am trying to allow an account to update very specific attributes on all User objects. I am setting this security on the "User" object. When I add the account on the security tab, go to advanced, edit the accounts permissions, and start going through the list of attributes I am only able to find a few, like First Name, but most of the attributes I want to let them write to are missing. How can I grant the account write access to these attributes? Attributes I need to grant permission for: First Name (givenName) Last Name (sn) Initials (initials) Department (department) Company (company) Title (title) Manager (manager) Location Info (physicalDeliveryOfficeName, streetAddress, postOfficeBox) Work Phone (telephoneNumber) Pager (pager) IP Phone (ipPhone) IP Phone Other (otherIpPhone) ThumbnailLogo (thumbnailLogo) jpegPhoto (jpegPhoto) Description (displayName) Thanks

    Read the article

  • Active Directory: Find out which users belong to a Group Policy Object

    - by gentlesea
    Hi, I want to make sure that certain users are available in a group from the windows domain. I installed "Group Policy Management" and can open the Forest, the Domain. But then I am not sure what I am searching. I can select a link to a Group Policy Object (GPO). In Settings i see the Drive Maps and I know them. But how can I display a list of users that use this GPO? Right-click, Edit... is disabled. net group my_gpo does not work since I am not on a Windows Domain Controller. Any possibility to find out anyway?

    Read the article

  • Excel VBA Function runtime error 1004: Application-defined or object-defined error

    - by music2myear
    I'm trying to learn functions for the purpose of simplifying and reusing code whenever necessary. I began by turning something I use pretty often into a function: Returning the integer value of the last non-blank row in a spreadsheet. Function FindLastDataLine(strColName As String) As Long FindLastDataLine = Range(strColName).Offset(Rows.Count - 1, 0).End(xlUp).Row End Function Sub PracticeMacro() intItemCount = FindLastDataLine("A:A") MsgBox ("There are " & intItemCount & " rows of data in column A.") End Sub When I run this I recieve the runtime error '1004' "Application-defined or object-defined error" which Help helpfully defines as "someone else's fault" to quote not quite verbatim. Where might I be going wrong?

    Read the article

  • connection with the application object server could not be established

    - by user44048
    Hello All, I have installed Axapta server on my Axapta(Machine name) machine. When i am going to start the axapta at that time it give error like " connection with the application object server could not be established ". Basic all the steps that i have tested like Service start restart and connection configuration. port number problem. Still i am not able to resolve a problem. please can any one tell me the solution. It's urgent please help as soon as possible. Thank you.

    Read the article

  • Powershell enters foreach loop with null object

    - by SteB
    I'm listing all backups in a given directory: $backups = Get-ChildItem -Path $zipFilepath | Where-Object {($_.lastwritetime -lt (Get-Date).addDays(-7)) -and (-not $_.PSIsContainer) -and ($_.Name -like "backup*")} If I set it to deliberately return no files (.addDays(-600) then the following prints "Empty" (as expected): if (!$backups) { "Empty" } If I try to list the names with an empty $backups variable: foreach ($file in $backups) { $file.FullName; } I get nothing (as expected), if I change this to: "test"+ $file.FullName; then I get a single "test" under the "Empty". How is this possible if $backups is empty?

    Read the article

  • Microsoft JScript runtime error: Object expected for onclick="__doPostBack('ctl01$ContentArea1$ctl0

    - by xrx215
    in ascx page i have added a cutom button as follows xrx:CustomButton id="CustomButton4" runat="server" OnClientClick="Login" Text="Login" / in ascx.cs i have protected void Page_Load(object sender, EventArgs e) { CustomButton4.OnClientClick = Page.ClientScript.GetPostBackEventReference(this.CustomButton4, string.Empty); this.lblAppName.Text = this.AppName; lblsession.Text = this.GetString("SDE_SESSION_EXPIRED_PLEASE1"); } protected void Login(object sender, EventArgs e) { Xerox.FMP.Providers.FormsAuthentication formsAuthHelper = new Xerox.FMP.Providers.FormsAuthentication(); formsAuthHelper.SignOut(); Response.Redirect("~/LoginPage.aspx", true); } when i click on login button the page is not redirecting to loginpage.aspx instead it is throwing an error object expected. Can you please help me with this issue.

    Read the article

  • Deserializing JSON into an object with Json.NET

    - by hmemcpy
    Hello. I'm playing a little bit with the new StackOverflow API. Unfortunately, my JSON is a bit weak, so I need some help. I'm trying to deserialize this JSON of a User: {"user":{ "user_id": 1, "user_type": "moderator", "creation_date": 1217514151, "display_name": "Jeff Atwood", ... "accept_rate": 100 }} into an object which I've decorated with JsonProperty attributes: [JsonObject(MemberSerialization.OptIn)] public class User { [JsonProperty("user_id", Required = Required.Always)] public virtual long UserId { get; set; } [JsonProperty("display_name", Required = Required.Always)] public virtual string Name { get; set; } ... } I get the following exception: Newtonsoft.Json.JsonSerializationException: Required property 'user_id' not found in JSON. Is this because the JSON object is an array? If so, how can I deserialize it to the one User object? Thanks in advance!

    Read the article

  • Serialize .Net object to json, controlled using xml attributes

    - by sprocketonline
    I have a .Net object which I've been serializing to Xml and is decorated with Xml attributes. I would now like to serialize the same object to Json, preferably using the Newtonsoft Json.Net library. I'd like to go directly from the .Net object in memory to a Json string (without serializing to Xml first). I do not wish to add any Json attributes to the class, but instead would like for the Json serializer use the existing Xml attributes. [XmlRoot("hello")] public class world{ [XmlIgnore] public int ignoreMe{ get; } [XmlElement("foo")] public int bar{ get; } [XmlElement("marco")] public int polo{ get; } } becomes "hello":{ "foo":0, "marco":0 }

    Read the article

  • Need help with NHibernate / Fluent NHibernate mapping

    - by Mark Boltuc
    Let's say your have the following table structure: ============================== | Case | ============================== | Id | int | | ReferralType | varchar(10) | +---------| ReferralId | int |---------+ | ============================== | | | | | | | ====================== ====================== ====================== | SourceA | | SourceB | | SourceC | ====================== ====================== ====================== | Id | int | | Id | int | | Id | int | | Name | varchar(50) | | Name | varchar(50) | | Name | varchar(50) | ====================== ====================== ====================== Based on the ReferralType the ReferralId contains id to the SourceA, SourceB, or SourceC I'm trying to figure out how to map this using Fluent NHibernate or just plain NHibernate into an object model. I've tried a bunch of different things but I haven't been succesful. Any ideas? The object model might be something like: public class Case { public int Id { get; set; } public Referral { get; set; } } public class Referral { public string Type { get; set; } public int Id { get; set; } public string Name { get; set; } }

    Read the article

< Previous Page | 70 71 72 73 74 75 76 77 78 79 80 81  | Next Page >