Search Results

Search found 45031 results on 1802 pages for 'same name'.

Page 88/1802 | < Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >

  • Getting the id of child element based on the parents class name

    - by sea_1987
    I am currently playing around with jqueries drag and drop, basically I currently have a div (.drag_check) that holds a checkbox, I have the drag and drop working but I want to alert out the checkbox's ID once the element is dropped, I assume I have to use child but all my attempts have returned 'undefined'. Below is my code, $('.drag_check').draggable({ containment: 'document', opacity:0.6, revert: 'invalid', helper: 'clone', zIndex: 100 }); $("ul.searchPage").droppable({ drop: function(e, ui) { var param = $(ui.draggable).attr('class') addlist(param) alert(param) } })

    Read the article

  • Creating a new object destroys an older object with different name in C++

    - by Mikael
    First question here! So, I am having some problems with pointers in Visual C++ 2008. I'm writing a program which will control six cameras and do some processing on them so to clean things up I have created a Camera Manager class. This class handles all operations which will be carried out on all the cameras. Below this is a Camera class which interacts with each individual camera driver and does some basic image processing. Now, the idea is that when the manager is initialised it creates two cameras and adds them to a vector so that I can access them later. The catch here is that when I create the second camera (camera2) the first camera's destructor is called for some reason, which then disconnects the camera. Normally I'd assume that the problem is somewhere in the Camera class, but in this case everything works perfectly as long as I don't create the camera2 object. What's gone wrong? CameraManager.h: #include "stdafx.h" #include <vector> #include "Camera.h" class CameraManager{ std::vector<Camera> cameras; public: CameraManager(); ~CameraManager(); void CaptureAll(); void ShowAll(); }; CameraManager.cpp: #include "stdafx.h" #include "CameraManager.h" CameraManager::CameraManager() { printf("Camera Manager: Initializing\n"); [...] Camera *camera1 = new Camera(NodeInfo,1, -44,0,0); cameras.push_back(*camera1); // Adding the following two lines causes camera1's destructor to be called. Why? Camera *camera2 = new Camera(NodeInfo,0, 44,0,0); cameras.push_back(*camera2); printf("Camera Manager: Ready\n"); }

    Read the article

  • How to get to the key name of a referenced entity property from an entity instance without a datastore read in google app engine?

    - by Sumeet Pareek
    Consider I have the following models - class Team(db.Model): # say I have just 5 teams name = db.StringProperty() class Player(db.Model): # say I have thousands of players name = db.StringProperty() team = db.ReferenceProperty(Team, collection_name="player_set") Key name for each Team entity = 'team_' , and for each Player entity = 'player_' By some prior arrangement I have a Team entity's (key_name, name) mapping available to me. For example (team_01, United States Of America), (team_02, Russia) etc I have to show all the players and their teams on a page. One way of doing this would be - players = Player.all().fetch(1000) # This is 1 DB read for player in players: # This will iterate 1000 times self.response.out.write(player.name) # This is obviously not a DB read self.response.out.write(player.team.name) #This is a total of 1x1000 = 1000 DB reads That is a 1001 DB reads for a silly thing. The interesting part is that when I do a db.to_dict() on players, it shows that for every player in that list there is 'name' of the player and there is the 'key_name' of the team available too. So how can I do the below ?? players = Player.all().fetch(1000) # This is 1 DB read for player in players: # This will iterate 1000 times self.response.out.write(player.name) # This is obviously not a DB read self.response.out.write(team_list[player.<SOME WAY OF GETTING TEAM KEY NAME>]) # Here 'team_list' already has (key_name, name) for all 5 teams I have been struggling with this for a long time. Have read every available documentation. I could just hug the person that can help me here :-) Disclaimer: The above problem description is not a real scenario. It is a simplified arrangement that represents my problem exactly. I have run into it in a rater complex and big GAE appication.

    Read the article

  • invalid file name in matlab when using file split

    - by klijo
    here jj will be the value of FN, but the trouble is iam getting a error message ??? Error using == fopen Invalid filename. DirName = 'Samples\mattest\jj'; FileName = split('\\',DirName); [a,b] = size(FileName); FN = FileName(b); file_1 = fopen(FN,'w'); split method was found at http://www.mathworks.com/matlabcentral/fileexchange/4873 Doesnt the code seem correct ? Could someone please help me ?

    Read the article

  • Porting C++-code from Windows to Unix: systemcalls colliding with name of functions

    - by marvin2k
    Hi I'm porting some crufty C++ Windows-code to Linux, which uses functions called "open" and "close" inside every class... Very bad style, or? Luckily that wasn't a problem in windows, since their systemcalls are named different. When I try to call the systemcalls open() or close() I'm getting some compiler error about "no matching function for call for class:open()". I can't rename all our functions named "class::open" and "class::close" in the whole code, and I have to use open() and close() since I'm working with serial ports. So my question is: How can I tell the compiler, which open I mean? How can I escape or hide the namespace of a class in C++?

    Read the article

  • Pulling name value pair from a structured adsense code block contained in a txt file

    - by Scott B
    I have a txt file which contains a google adsense code block and I'm trying to pull in the file via file_get_contents to extract the values of the google_ad_client and google_ad_slot variables. In the examples below, I want to return to my calling function: $google_ad_client = 'pub-1234567890987654'; $google_ad_slot = '1234567890' The file may contain one of either of these two formats and I wont know which the user has chosen: Newer Ad Unit Style <script type="text/javascript"><!-- google_ad_client = "pub-1234567890987654"; google_ad_slot = "1234567890"; google_ad_width = 336; google_ad_height = 280; //--> </script> <script type="text/javascript" src="path-to-google-script"></script> Classic Style <script type="text/javascript"><!-- google_ad_client = "pub-1234567890987654"; /* 336x280, created 8/6/09 */ google_ad_slot = "1234567890"; google_ad_width = 336; google_ad_height = 280; google_ad_format="336x280_as"; google_ad_type="text_image"; google_color_border="FFFFFF"; google_color_bg="FFFFFF"; google_color_link="2200CC"; google_color_url="000000"; google_color_text="777777"; //--> </script>

    Read the article

  • www disappear when using Name-based virtual host.

    - by Tianzhou Chen
    Below is my config file NameVirtualHost 12.34.56.78:80 ServerAdmin [email protected] ServerName domain1.com ServerAlias www.domain1.com DocumentRoot /srv/www/domain1.com/public_html1/ ErrorLog /srv/www/domain1.com/logs/error.log CustomLog /srv/www/domain1.com/logs/access.log combined ServerAdmin [email protected] ServerName domain2.com ServerAlias www.domain2.com DocumentRoot /srv/www/domain2.com/public_html1/ ErrorLog /srv/www/domain2.com/logs/error.log CustomLog /srv/www/domain2.com/logs/access.log combined The thing is when I put www.domain1.com into browser, it will be automatically changed to domain1.com. However, if I put www.domain2.com, the address remains the same. I don't know why this happens. BTW, I haven't put .htaccess file under their document root. Thanks for your advice! Tianzhou

    Read the article

  • How to get route "name" when in route controller

    - by Murph
    I'm using routing in asp.net to get nice URLs When I define routes in global.asax I create two distinct routes that use the same controller (c#): // Setup code for route a... routes.Add("routeb", routea); // Setup code for route b... routes.Add("routeb", routeb); (How) is it possible to determine from within the controller what the "key" value is that directed the user to this controller? Alternatively is the pattern of use wrong - it would be straightforward to subclass the Controller (again) to distinguish between the two and retain common code if that is a more appropriate solution.

    Read the article

  • Why it's important to specify the complete class name in your association when using namespaces

    - by Carmine Paolino
    In my Rails application there is a model that has some has_one associations (this is a fabricated example): class Person::Admin < ActiveRecord::Base has_one :person_monthly_revenue has_one :dude_monthly_niceness accepts_nested_attributes_for :person_monthly_revenue, :dude_monthly_niceness end class Person::MonthlyRevenue < ActiveRecord::Base belongs_to :person_admin end class Dude::MonthlyNiceness < ActiveRecord::Base belongs_to :person_admin end The application talks to a backend that computes some data and returns a piece of JSON like this: { "dude_monthly_niceness": { "february": 1.1153232569518972, "october": 1.1250217200558268, "march": 1.3965786869658541, "august": 1.6293418014601631, "september": 1.4062771500697835, "may": 1.7166279693955291, "january": 1.0086401628086725, "june": 1.5711510228365859, "april": 1.5614525597326563, "december": 0.99894169970474289, "july": 1.7263264324994585, "november": 0.95044938418509506 }, "person_monthly_revenue": { "february": 10.585596551505297, "october": 10.574823016656749, "march": 9.9125274764852787, "august": 9.2111604702328922, "september": 9.7905249446675153, "may": 9.1329712474607962, "january": 10.479614016604238, "june": 9.3710235926961936, "april": 9.5897372624830304, "december": 10.052587677671438, "july": 8.9508877843925561, "november": 10.925339756096172 }, } To deserialize it, I use ActiveRecord's from_json, but instead of a Person::Admin object with all the associations in place, I get this error: >> Person::Admin.new.from_json(json) NameError: uninitialized constant Person::Admin::DudeMonthlyNiceness Am I doing something wrong? Is there a better way to deserialize data? (I can modify the backend easily) UPDATE: the original title was "How to deserialize from json to ActiveRecord objects with associations?" but it ended up being my mistake in specifying associations so I changed the title.

    Read the article

  • Interface name as a Type

    - by user1889148
    I am trying to understand interfaces in Java and have this task to do which I am a stack with. It must be something easy, but I don't seem to see the solution. Interface contains a few methods, one of them should return true if all elements of this set are also in the set. I.e. public interface ISet{ //some methods boolean isSubsetOf(ISet x); } Then the class: public class myClass implements ISet{ ArrayList<Integer> mySet; public myClass{ mySet = new ArrayList<Integer>(); } //some methods public boolean isSubsetOf(ISet x){ //method body } } What do I need to write in method body? How do I check that the instance of myClass is a subset of ISet collection? I was trying to cast, but it gives an error: ArrayList<Integer> param = (ArrayList<Integer>)x; return param.containsAll(mySet);

    Read the article

  • Class name to view path

    - by Alexey Poimtsev
    Hi, I have a RoR application and model SomeModel. I have views for this model and I want to know - is there any method to get the view's path? Of course I can use for this model instance m = SomeModel.new v = m.class.class_name.pluralize.downcase It's working, but maybe you know a better way? :)

    Read the article

  • Apache htdocs in folder with unicode name

    - by Zsolti
    I have my apache (for windows) htdocs in a folder like c:\anything1\????\anything2. The problem is that in this case php won't execute any scripts from here and will display an error message like this: `Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0 Fatal error: Unknown: Failed opening required 'c:/anything1/????/anything2/index.php' (include_path='.;C:\php5\pear') in Unknown on line 0 ` If I try to open a html file, it is served by apache, so it seems that the problem appears only with php. Do you have an idea how to solve this?

    Read the article

  • IIS - IP Address and Domain Name Restrictions - not blocking IP addresses

    - by Funky
    I have added an IP address in IIS7 in the IP address and domain restrictions. From what I have read this should block all traffic to the folder apart from the allowed IP address. For some reason this does not work. If I access the section from my work computer all ok, when I access it from my phone I can still see the page. Does anyone have any idea why IIS is not blocking all the other IPs out? Thanks

    Read the article

  • create XSD for element with same name

    - by aaa
    how to make xsd for element with same names that only identifyed by attribute value example :- <a> <b n="structure one"> <c n="inner element 1"/> <c n="inner element 2"/> <c n="inner element 3"/> </b> <b n="structure two"> <c n="inner element 1 for structure two"/> <c n="inner element 2 for structure two"/> <c n="inner element 3 for structure two"/> </b> </a> notice that from the XML i have to mention specific value that belong to the inner element same for structure

    Read the article

  • Cannot refer to a template name nested in a template parameter

    - by chila
    I have the following code: template <typename Provider> inline void use() { typedef Provider::Data<int> D; } Where I'm basically trying to use a template class member 'Data' of some 'Provider' class, applied to 'int', but I get the following errors: util.cpp:5: error: expected init-declarator before '<' token util.cpp:5: error: expected `,' or `;' before '<' token I'm using GCC 4.3.3 on a Solaris System.

    Read the article

  • sql query with alias name

    - by Ranjana
    i have a table with this columns--- Or orgid ispaid validity noofthingstoTake 1 yes 2010-06-05 20 2 yes 2010-06-09 7 i have used this query(to join two more tableS): select distinct B.RequirementID,A.OrganizationID from Organization A,RequirementsDetailsforOrganization B,validityorgdet F where A.OrganizationID=B.OrganizationID and F.orgid=A.OrganizationID and F.ispaid=1 and F.validity>=GETDATE() and F.noofthingstoTake> ?? but i dont know how to check the (noofthingstaken) over here. it should not exceed 20. im passing this query from my code behind page to the Sql. how to get the query excute to check it should not exceed the noofthingstaken pls help me out....????

    Read the article

  • Apache installation in folder with chinese characters in name

    - by Zsolti
    I would like to install an Apache server into a folder like c:\anything\???\anything2\ under windows. When I try to start the service it sais that: httpd: Syntax error on line xx of C:/anything/\xe6\x80\x98\xe6\x80\x99\e6\80\9a/anything2/apache/conf/httpd.conf: ServerRoot must be a valid directory Does anyone have a solution?

    Read the article

  • Override as_json or to_json model class name

    - by Jack
    I'd like to modify the classname when calling to_json on an AR model. i.e. Book.first.to_json #=> "{\"book\":{\"created_at\":\"2010-03-23 Book.first.to_json(:root => 'libro') #=> "{\"libro\":{\"created_at\":\"2010-03-23 Is there an option to do this?

    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

< Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >