Search Results

Search found 20663 results on 827 pages for 'multiple inheritance'.

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

  • Script for Creating Multiple ZIP archives from Multiple Folders

    - by user39288
    I want to be able to right click multiple folders inside of a directory in nautilus, and be able to create seperate zip archives from those folders in that same directory. If possible it would also be great if it automatically deleted the old folders. So, if I have 30 folders, I want to select those using control-shift, then go to scripts and run the script, and just have those 30 folders compressed into seperate .zip archives, and have the old folders deleted (if possible). Anyone know how to accomplish this? I suck with terminal, and am looking for a script solution.

    Read the article

  • Multiple parameters vs single parameter(object with multiple properties)

    - by Shwetanka
    I have an Entity Student with following properties - (name, joinedOn, birthday, age, batch, etc.) and a function fetchStudents(<params>). I want to fetch students based on multiple filters. In my method I have two ways to pass filters. Pass all filters as params to the method Make a class StudentCriteria with filters as fields and then pass the object of this class While working in java I always go with the second option but recently I'm working in php and I was advised to go with the first way. I am unable to figure out which way is better in maintaining the code, reusability and performance wise. Thanks.

    Read the article

  • C++ Exceptions and Inheritance from std::exception

    - by fbrereto
    Given this sample code: #include <iostream> #include <stdexcept> class my_exception_t : std::exception { public: explicit my_exception_t() { } virtual const char* what() const throw() { return "Hello, world!"; } }; int main() { try { throw my_exception_t(); } catch (const std::exception& error) { std::cerr << "Exception: " << error.what() << std::endl; } catch (...) { std::cerr << "Exception: unknown" << std::endl; } return 0; } I get the following output: Exception: unknown Yet simply making the inheritance of my_exception_t from std::exception public, I get the following output: Exception: Hello, world! Could someone please explain to me why the type of inheritance matters in this case? Bonus points for a reference in the standard.

    Read the article

  • How does virtual inheritance solve the diamond problem?

    - by cambr
    class A { public: void eat(){ cout<<"A";} }; class B: virtual public A { public: void eat(){ cout<<"B";} }; class C: virtual public A { public: void eat(){ cout<<"C";} }; class D: public B,C { public: void eat(){ cout<<"D";} }; int main(){ A *a = new D(); a->eat(); } I understand the diamond problem, and above piece of code does not have that problem. How exatly does virtual inheritance solve the problem? What I understand: When I say A *a = new D();, the compiler wants to know if an object of type D can be assigned to a pointer of type A, but it has two paths that it can follow, but cannot decide by itself. So, how does virtual inheritance resolve the issue (help compiler take the decision)?

    Read the article

  • Active Record two belongs_to calls or single table inheritance

    - by ethyreal
    In linking a sports event to two teams, at first this seemed to make sense: events - id:integer - integer:home_team_id - integer:away_team_id teams - integer:id - string:name However I am troubled by how I would link that up in the active record model: class Event belongs_to :home_team, :class_name => 'Team', :foreign_key => "home_team_id" belongs_to :away_team, :class_name => 'Team', :foreign_key => "away_team_id" end Is that the best solution? In an answer to a similar question I was pointed to single table inheritance, and then later found polymorphic associations. Neither of which seemed to fit this association. Perhaps I am looking at this wrong, but I see no need to subclass a team into home and away teams since the distinction is only in where the game is played. If I did go with single table inheritance I wouldn't want each team to belong_to an event so would this work? # app/models/event.rb class Event < ActiveRecord::Base belongs_to :home_team belongs_to :away_team end # app/models/team.rb class Team < ActiveRecord::Base has_many :teams end # app/models/home_team.rb class HomeTeam < Team end # app/models/away_team.rb class AwayTeam < Team end I thought also about a has_many through association but that seems two much as I will only ever need two teams, but those two teams don't belong to any one event. event_teams - integer:event_id - integer:team_id - boolean:is_home Is there a cleaner more semantic way for making these associations in active record? or is one of these solutions the best choice? Thanks

    Read the article

  • Inheritance of closure objects and overriding of methods

    - by bobikk
    I need to extend a class, which is encapsulated in a closure. This base class is following: var PageController = (function(){ // private static variable var _current_view; return function(request, new_view) { ... // priveleged public function, which has access to the _current_view this.execute = function() { alert("PageController::execute"); } } })(); Inheritance is realised using the following function: function extend(subClass, superClass){ var F = function(){ }; F.prototype = superClass.prototype; subClass.prototype = new F(); subClass.prototype.constructor = subClass; subClass.superclass = superClass.prototype; StartController.cache = ''; if (superClass.prototype.constructor == Object.prototype.constructor) { superClass.prototype.constructor = superClass; } } I subclass the PageController: var StartController = function(request){ // calling the constructor of the super class StartController.superclass.constructor.call(this, request, 'start-view'); } // extending the objects extend(StartController, PageController); // overriding the PageController::execute StartController.prototype.execute = function() { alert('StartController::execute'); } Inheritance is working. I can call every PageController's method from StartController's instance. However, method overriding doesn't work: var startCont = new StartController(); startCont.execute(); alerts "PageController::execute". How should I override this method?

    Read the article

  • @PrePersist with entity inheritance

    - by gerry
    I'm having some problems with inheritance and the @PrePersist annotation. My source code looks like the following: _the 'base' class with the annotated updateDates() method: @javax.persistence.Entity @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) public class Base implements Serializable{ ... @Id @GeneratedValue protected Long id; ... @Column(nullable=false) @Temporal(TemporalType.TIMESTAMP) private Date creationDate; @Column(nullable=false) @Temporal(TemporalType.TIMESTAMP) private Date lastModificationDate; ... public Date getCreationDate() { return creationDate; } public void setCreationDate(Date creationDate) { this.creationDate = creationDate; } public Date getLastModificationDate() { return lastModificationDate; } public void setLastModificationDate(Date lastModificationDate) { this.lastModificationDate = lastModificationDate; } ... @PrePersist protected void updateDates() { if (creationDate == null) { creationDate = new Date(); } lastModificationDate = new Date(); } } _ now the 'Child' class that should inherit all methods "and annotations" from the base class: @javax.persistence.Entity @NamedQueries({ @NamedQuery(name=Sensor.QUERY_FIND_ALL, query="SELECT s FROM Sensor s") }) public class Sensor extends Entity { ... // additional attributes @Column(nullable=false) protected String value; ... // additional getters, setters ... } If I store/persist instances of the Base class to the database, everything works fine. The dates are getting updated. But now, if I want to persist a child instance, the database throws the following exception: MySQLIntegrityConstraintViolationException: Column 'CREATIONDATE' cannot be null So, in my opinion, this is caused because in Child the method "@PrePersist protected void updateDates()" is not called/invoked before persisting the instances to the database. What is wrong with my code?

    Read the article

  • Programming exercises in Java inheritance for intern

    - by Tenner
    I work for a small software development team, working primarily in Java, for a very large company. Our new intern showed up sight-unseen (not uncommon in my company). He has some C++ experience but no Java. Worse, he's never worked with inheritance in C++. Our code has a great deal of abstraction and a heavy reliance on inheritance. We need to get him up to speed as quickly as possible. Of course the rest of the team is busy, and so we can't take the time out of our day to teach a one-student 200-level CS course. Instead, I'd like to give him an actual programming project to work on which highlights how classes, interfaces, method overrides, etc. work. I've had him look at Project Euler, but most of the solutions end up being procedural, and not object-oriented programs. Do any of you have any somewhat-straightforward (and relatively quick) projects which you would give to an intern in this situation? Or, any recent (or current) students have a school project they'd be willing to share? Anyone else had this experience?

    Read the article

  • Rails Model inheritance in forms

    - by Tiago
    I'm doing a reporting system for my app. I created a model ReportKind for example, but as I can report a lot of stuff, I wanted to make different groups of report kinds. Since they share a lot of behavior, I'm trying to use inheritance. So I have the main model: model ReportKind << ActiveRecord::Base end and created for example: model UserReportKind << ReportKind end In my table report_kinds I've the type column, and until here its all working. My problem is in the forms/controllers. When I do a ReportKind.new, my form is build with the '*report_kind*' prefix. If a get a UserReportKind, even through a ReportKind.find, the form will build the 'user_report_kind' prefix. This mess everything in the controllers, since sometimes I'll have params[:report_kind], sometimes params[:user_report_kind], and so on for every other inheritance I made. Is there anyway to force it to aways use the 'report_kind' prefix? Also I had to force the attribute 'type' in the controller, because it didn't get the value direct from the form, is there a pretty way to do this? Routing was another problem, since it was trying to build routes based in the inherited models names. I overcome that by adding the other models in routes pointing to the same controller.

    Read the article

  • Asp.net mvc inheritance controllers

    - by Ris90
    Hi, I'm studing asp.net mvc and in my test project I have some problems with inheritance: In my model I use inheritanse in few entities: public class Employee:Entity { /* few public properties */ } It is the base class. And descendants: public class RecruitmentOfficeEmployee: Employee { public virtual RecruitmentOffice AssignedOnRecruitmentOffice { get; set; } } public class ResearchInstituteEmployee: Employee { public virtual ResearchInstitute AssignedOnResearchInstitute { get; set; } } I want to implement a simple CRUD operations to every descedant. What is the better way to inplement controllers and views in descendants: - One controller per every descendant; - Controller inheritance; - Generic controller; - Generic methods in one controller. Or maybe there is an another way? My ORM is NHibernate, I have a generic base repository and every repository is its descedant. Using generic controller, I think, is the best way, but in it I will use only generic base repository and extensibility of the system will be not very good. Please, help the newbie)

    Read the article

  • Problem understanding Inheritance

    - by dhruvbird
    I've been racking my brains over inheritance for a while now, but am still not completely able to get around it. For example, the other day I was thinking about relating an Infallible Human and a Fallible Human. Let's first define the two: Infallible Human: A human that can never make a mistake. It's do_task() method will never throw an exception Fallible Human: A human that will occasionally make a mistakes. It's do_task() method may occasionally throw a ErrorProcessingRequest Exception The question was: IS an infallible human A fallible human OR IS a fallible human AN infallible human? The very nice answer I received was in the form of a question (I love these since it gives me rules to answer future questions I may have). "Can you pass an infallible human where a fallible human is expected OR can you pass a fallible human where an infallible human is expected?" It seems apparent that you can pass an infallible human where a fallible human is expected, but not the other way around. I guess that answered my question. However, it still feels funny saying "An infallible human is a fallible human". Does anyone else feel queasy when they say it? It almost feels as if speaking out inheritance trees is like reading out statements from propositional calculus in plain English (the if/then implication connectives don't mean the same as that in spoken English). Does anyone else feel the same?

    Read the article

  • BAM Data Control in multiple ADF Faces Components

    - by [email protected]
    As we know Oracle BAM data control instance sharing is not supported.When two or more ADF Faces components must display the same data, and are bound to the same Oracle BAM data control definition, we have to make sure that we wrap each ADF Faces component in an ADF task flow, and set the Data Control Scope to isolated. This blog will show a small sample to demonstrate this. In this sample we will create a Pie and Bar using same BAM DC, such that both components use same Data control but have isolated scope.This sample can be downloaded  fromSample1.zip Set-up: Create a BAM data control using employees DO (sample) Steps: Right click on View Controller project and select "New->ADF Task Flow" Check "Create Bounded Task Flow" and give some meaningful name (ex:EmpPieTF.xml ) to the TaskFlow(TF) and click on "OK"CreateTF.bmpFrom the "Components Palette", drag and drop "View" into the task flow diagram. Give a meaningful name to the view. Double Click and Click "Ok" for  "Create New JSF Page Fragment" From "Data Controls" drag and drop "Employees->Query"  into this jsff page as "Graph->Pie" (Pie: Sales_Number and Slices: Salesperson) Repeat step 1 through 4 for another Task Flow (ex: EmpBarTF). From "Data Controls" drag and drop "Employees->Query"  into this jsff page as "Graph->Bar" (Bars :Sales_Number and X-axis : Salesperson). Open the Taskflow created in step 2. In the Structure Pane, right click on "Task Flow Definition -EmpPieTF" Click "Insert inside Task Flow Definition - EmpPieTF -> ADF Task Flow -> Data Control Scope". Click "OK"TFDCScope.bmpFor the "Data Control Scope", In the Property Inspector ->General section, change data control scope from Shared to Isolated. Repeat step 8 through 11 for the 2nd Task flow created. Now create a new jspx page example: Main.jspxDrag and drop both the Task flows (ex: "EmpPieTF" and "EmpBarTF") as regions. Surround with panel components as needed.Run the page Main.jspxMainPage.bmpNow when the page runs although both components are created using same Data control the bindings are not shared and each component will have a separate instance of the data control.

    Read the article

  • How to use multiple monitors effectivelly

    - by maaartinus
    I'm currently using a single monitor, since I see no value in something like this mentioned in this answer. It may be a good exercise for my neck, but besides of this I see no use therein at all. This amounts to 5760x1200 pixels, which is nearly 7M pixels, just fantastic, except for me not being a cyklop-han. The ratio of 24:5 is IMHO too bad for this to be usable. I don't even think that two 16:10 monitors side by side is a good idea. I never tried so I may be completely wrong, but I suppose that the 4:3 ratio would be much better for this. Or even 1:1, but no such thing is available (with some exceptions, either very expensive or very low resolution). Does anybody use two monitors arranged vertically (resulting in 16:20)? or two pivoted monitors side by side (resulting in 20:16)? or another such variant?

    Read the article

  • Settings for multiple monitors are not stored

    - by JJD
    I am running Ubuntu 12.04. on a Lenovo Thinkpad T400. I connected an external monitor as a second display. The laptop stands under the external screen. The laptop has a native resolution of 1440x900 (16:10), the external monitor 1280x1024 (5:4). There are two graphic adapters: one internal Intel GMA 4500 MHD and an discrete ATI card. Currently, the integrated Intel is enabled. I use the Display application to arrange the position of the monitors so it look like this: The problem: Whenever I restart my computer the configuration gets lost. First, the displays are mirrored instead of extended. I have to press Fn + F7 two times to switch to extended mode. Second, the Display settings still look like this: I know this worked once when I was running Ubuntu 10.10. I cannot tell since when it does not work. Do you know how I can permanently store the settings?

    Read the article

  • Why old (301) links stay on Google when breaking site down to multiple domains

    - by Sampo Sarrala
    Some background: We did have single site and single domain (let's call it mainsite.com) with product information, however things have changed since and product database has grown fast. So we decided to move some major products/manufacturers under their own domains (let's call one of them subsite.com) while still using our main database/codebase. What we've done: Added subsite.com domain for product 1 by Great Products Co. Some new nice looking front pages, info pages, etc. Detail pages that will use information from original db. Redirected product/group links from mainsite.com using 301 redirect. Verified that redirects works as expected. Waited some time for Google reindexing (over 30 days, I've heard it should be more than enough). Results: If I search our moved products from Google then it will found them and list them but with old links to our main page like mainsite.com/group/product1 but it should show link to new site subsite.com/product1. Links from Goole redirects as they should, as said redirects are verified [301]. Main question: Any reasons why Google would not follow 301 redirects and update links so that they will point to our new mfg/product site subsite.com?

    Read the article

  • One domain and multiple website in folders

    - by User1212
    I am going to create a network with one domain, e.g. example.com then going to manage my websites in folders. Look below for example: www.example.com/market www.example.com/freebies www.example.com/personalblog www.example.com/shop Consider that all four websites have different design and codes. From SEO perspective, is it recommended or I should use subdomains or buy four domains for each website?

    Read the article

  • Why C# does not support multiple inheritance?

    - by Jalpesh P. Vadgama
    Yesterday, One of my friend Dharmendra ask me that why C# does not support multiple inheritance. This is question most of the people ask every time. So I thought it will be good to write a blog post about it. So why it does not support multiple inheritance? I tried to dig into the problem and I have found the some of good links from C# team from Microsoft for why it’s not supported in it. Following is a link for it. http://blogs.msdn.com/b/csharpfaq/archive/2004/03/07/85562.aspx Also, I was giving some of the example to my friend Dharmendra where multiple inheritance can be a problem.The problem is called the diamond problem. Let me explain a bit. If you have class that is inherited from the more then one classes and If two classes have same signature function then for child class object, It is impossible to call specific parent class method. Here is the link that explains more about diamond problem. http://en.wikipedia.org/wiki/Diamond_problem Now of some of people could ask me then why its supporting same implementation with the interfaces. But for interface you can call that method explicitly that this is the method for the first interface and this the method for second interface. This is not possible with multiple inheritance. Following is a example how we can implement the multiple interface to a class and call the explicit method for particular interface. Multiple Inheritance in C# That’s it. Hope you like it. Stay tuned for more update..Till then happy programming.

    Read the article

  • Hosting multiple client website on single

    - by Bhavesh Gangani
    I'm WebDesiner and i've currently only a few clients for making website. i've unlimited hosting account and i want to host their websites in my account without reseller account ( actually it is not needed for constness). only my client's need is ftp access to their personal directory. so as i questioned it is possible to give them saperate phpmyadmin access in this strategy ? as per my knowledge it is done with "addon" domain pointing on my hosting account's directory with cpanel, am i right ? or there is another solution for it except reseller account ?

    Read the article

  • Connecting/Removing a Second Monitor with Multiple Workspaces

    - by Ben
    I am running 12.04 on a laptop. I use workspaces extensively to manage different projects. When I take my laptop home, I plug in an additional monitor. The problem I am having is that whenever I plug in the additional monitor, all of my windows, regardless of what workspace they were in before I connected the additional monitor, move to workspace 1. This forces me to go through all the windows and manually move the windows back to where I had them. I don't think adding a monitor to each workspace should cause windows to move around between workspaces. Any thoughts or ideas on how to fix this? Know of any workarounds? Thanks in advance!

    Read the article

  • Multiple country-specific domains or one global domain [closed]

    - by CJM
    Possible Duplicate: How should I structure my urls for both SEO and localization? My company currently has its main (English) site on a .com domain with a .co.uk alias. In addition, we have separate sites for certain other countries - these are also hosted in the UK but are distinct sites with a country-specific domain names (.de, .fr, .se, .es), and the sites have differing amounts of distinct but overlapping content, For example, the .es site is entirely in Spanish and has a page for every section of the UK site but little else. Whereas the .de site has much more content (but still less than the UK site), in German, and geared towards our business focus in that country. The main point is that the content in the additional sites is a subset of the UK, is translated into the local language, and although sometimes is simply only a translated version of UK content, it is usually 'tweaked' for the local market, and in certain areas, contains unique content. The other sites get a fraction of the traffic of the UK site. This is perfectly understandable since the biggest chunk of work comes from the UK, and we've been established here for over 30 years. However, we are wanting to build up our overseas business and part of that is building up our websites to support this. The Question: I posed a suggestion to the business that we might consider consolidating all our websites onto the .com domain but with /en/de/fr/se/etc sections, as plenty of other companies seem to do. The theory was that the non-english sites would benefit from the greater reputation of the parent .com domain, and that all the content would be mutually supporting - my fear is that the child domains on their own are too small to compete on their own compared to competitors who are established in these countries. Speaking to an SEO consultant from my hosting company, he feels that this move would have some benefit (for the reasons mentioned), but they would likely be significantly outweighed by the loss of the benefits of localised domains. Specifically, he said that since the Panda update, and particularly the two sets of changes this year, that we would lose more than we would gain. Having done some Panda research since, I've had my eyes opened on many issues, but curiously I haven't come across much that mentions localised domain names, though I do question whether Google would see it as duplicated content. It's not that I disagree with the consultant, I just want to know more before I make recommendations to my company. What is the prevailing opinion in this case? Would I gain anything from consolidating country-specific content onto one domain? Would Google see this as duplicate content? Would there be an even greater penalty from the loss of country-specific domains? And is there anything else I can do to help support the smaller, country-specific domains?

    Read the article

  • Correctly indexing multiple domains with same content in Google and others

    - by AJweb
    I have a client with a dozen territorial domains, like mydomain.co.uk, mydomain.fr, mydomain.de, etc Most of these domains hold a different language of the same dynamic content (shop), but some, like co.uk and .com, have the same language and content, except for some content customized to each country/domain in the front page, contact and other pages. I am aware that we should use the canonical meta tag to mark those duplicated contents, but, we want the co.uk to be present in UK ( indexed in google.co.uk ) and the .com to be present in US and other countries, for example, or least that is the goal. Is there anything we can do to "help" google determine the geographical meaning of each domain? If we mark with canonical tag the .com and co.uk sites, do you know how google will decide which one to show on a given search?

    Read the article

  • Best way to track multiple sites with Google Analytics

    - by stevether
    I currently have 63 websites (and counting) that I'm tracking on one Google Analytics account, and I'm starting to realize... this is becoming a bit cumbersome. What's the best way to collect traffic data in bulk? Are there other resources out there that are better suited for this task? Does Google offer a bulk option for this kind of thing? Would it be better to make separate analytics accounts? I'm just wondering if anyone else has had found a better solution that manually setting up all these accounts/setting up the tracking codes etc, when it comes to large scale management.

    Read the article

  • Hosting multiple client website on single hosting account

    - by Bhavesh Gangani
    I'm WebDesiner and I have currently only a few clients for making website. I've unlimited hosting account and I want to host their websites in my account without reseller account (actually it is not needed for constness). Only my client's need is ftp access to their personal directory. So is it possible to give them saperate phpMyAdmin access in this strategy ? As per my knowledge it is done with "addon" domain pointing on my hosting account's directory with cPanel, am I right ? or there is another solution for it except reseller account ?

    Read the article

  • Multiple displays using AMD drivers

    - by Halik
    I am currently running a dual display setup with nVidia 8800GTS video card, on a Ubuntu 12.10 box. The current setup uses nVidia TwinView to render the image on a 1920x1200 display and 1600x1200 one. I'm planning to add a third, 1280x1024 display to the setup. The change will require me to upgrade my GFX card to one supporting triple displays. I'll probably go with Sapphire Radeon 7770 (FLEX edition, to avoid additional active DP-DVI adapters). Before I invest in new GFX I wanted to ask - how well the AMD drivers will support such a setup. It does not matter whether it's fglrx or the OSS ones. If I remember correctly, when running Fedora on a Radeon x800, I had 'void' areas above and below the working area on my second display. The desktop was rendered in 1920+1280 width and 1200 height (which left 176px of vertical space accessible for my cursor and windows but not displayed on the screen - I'd prefer to avoid that). It may have very well been my misconfiguration back then. Generally, are there any solutions from AMD on par with TwinView? Or is it a non-issue at all? Also, I'm wondering about the usual stuff - hardware h264 decoding support, glitch-free flash support, any issues with Compiz/Unity?

    Read the article

  • Multiple domains

    - by menardmam
    I got 6 domains : company.ca and company.com (because both where free, but we are a canadian company but can do business with the rest of the world). Then, we sell sportwear because of the company name is totally unknown to the world. Our product is we have bought product specific domain : chandails.ca and t-shirt.ca as well as shorts.ca and shorts.com. So those 6 domains are mine. Now what is the best way to do? Now all are 301 redirect to the main company name (.com) or make micro-site, super simple one page optimized for just shirt and one for shorts, then tell people to know more, go to the main site. Because now, I cannot really find the benefit of the search word in domain name edge if never somebody see something in that domain... I got confused and don't find strait answer to this question.

    Read the article

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