Search Results

Search found 5349 results on 214 pages for 'override'.

Page 9/214 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Is there a standard SQL Table design for overriding 'big picture' default values with lower level de

    - by RichardHowells
    Here's an example. Suppose we are trying to calculate a service charge. Say sales in the USA attract a 10 dollar charge, sales in the UK attract a 20 dollar charge So far it's easy - we are starting to imagine a table that lists charges by country. Now lets assume that Alaska and Hawaii are treated as special cases they are both 15 dollars That suggests a table with states, Alaska and Hawaii are charged at 15, but presumably we need 48 (redundant) rows all saying 10. This gives us a maintainance problem, our user only wants to type 10 once NOT 48 times. It does not sit well with the UK either. The UK does not have states. Suppose we throw in another couple of cross cutting rules. If you order by phone there is a 10% supplement on the charge. If you order via the web there is a 10% discount. But for some reason best known to the owners of the business the web/phone supplement/discount are not applied in Hawaii. It seems to me that this is quite a common kind of problem and there is probably a well known arrangement of tables to store the data. Most cases get handled by broad brush answers, but there are some very detailed low level variations that give rise to a huge number of theoretical combinations, most of which are not used.

    Read the article

  • How to declare different non-JPA annotations on embedded classes

    - by e99y
    @Embedded public class EmbedMe { private String prop1; private String prop2; } @Entity public class EncryptedEmbedded { @Embeddable private EmbedMe enc; } I am current using Jasypt for encryption. Is there a way to indicate that the @Embeddable in EncryptedEmbedded will use @Type(value = "newDeclaredTypeHere") per attribute (prop1, prop2)? Thanks in advance... ;)

    Read the article

  • Java overloading and overriding

    - by Padmanabh
    We always say that method overloading is static polymorphism and overriding is runtime polymorphism. What exactly do we mean by static here? Is the call to a method resolved on compiling the code? So whats the difference between normal method call and calling a final method? Which one is linked at compile time?

    Read the article

  • Django call function when an object gets added

    - by dotty
    Hay, i have a simple model class Manufacturer(models.Model): name = models.CharField() car_count = models.IntegerField() class Car(models.Model): maker = ForeignKey(Manufacturer) I want to update the car_count field when a car is added to a manufacturer, I'm aware i could just count the Manufacturer.car_set() to get the value, but i want the value to be stored within that car_count field. How would i do this? EDIT Would something like this work? def save(self): if self.id: car_count = self.car_set.count() self.save()

    Read the article

  • Overriding CSS properties for iframe width

    - by user2898989
    I'm trying to put an iframe into a webpage, but no matter what I try to put in either the iframe properties or the custom CSS section of the website builder (or how many times I try to add !important to anything from width to right-margin), I can't get the iframe to extend rightward further than the page's preset width. Here's an example of the page and iframe that I'm working with: http://fmlcapitalinvestment.com/Search_Properties.html I need that script/iframe to be wide enough to show the search area. It seems pointless to copy and paste code and attributes I've tried setting, because nothing I do seems to have any effect, but just for showing how much I have no idea what I'm doing, here's my iframe code: <iframe id="idxFrame" style="padding:0; margin:0; padding-top: 0px; overflow-x:auto; width:1000px!important; border:0px solid transparent; background-color:transparent; max-width:none!important; right-margin:-200px!important" frameborder="0" scrolling="on" src="http://www.themls.com/IDXNET/Default.aspx?wid=8MSsp7Pf9eI55yjkDuB%2blX5awn7LnnVXh5PNYhq2ImAEQL" width="1200px" height="900px"></iframe> The "Website Builder" that I'm forced to use to make these kinds of pages is infuriating, but it does have a "Custom CSS" area where I can input additional CSS information. Is there something I could generically use to set iframes to their own widths?

    Read the article

  • java annotations: library to override annotations with xml files

    - by flybywire
    Java has annotations and that is good. However, some developers feel that it is best to annotate code with metadata using xml files - others prefer annotations but would use metadata to override annotations in source code. I am writing a Java framework that uses annotations. The question is: is there a standard way to define and parse metadata from xml files. I think this is something every framework that uses annotations could benefit from but I can seem to find something like this on the Internet. Must I roll my own xml parsing/validation or has someone already done something like this?

    Read the article

  • JSF2 ResourceBundleLoader override?

    - by CDSO1
    I need to have resource messages that contain EL expressions be resolved when loaded from a ResourceBundle. Basically I have a number of properties files containing the text. Some of the text will look like the following: welcomeText=Welcome #{userbean.name} The only possible way I can see this working currently is implementing a custom taglib so that instead of saying: <f:loadBundle var="messages" basename="application.messages"/> I would have to use <mytaglib:loadBundle var="messages" basename="application.messages"/> #{messages.welcomeText} Given a user with username "User1", this should output Welcome User1 My implementation would then use a custom ResourceBundle class that would override handleGetObject, use the ELResolver to resolve variables etc....Ideas? suggestings? Implementations that are already available? I appreciate your assistance.

    Read the article

  • Override jQuery functions

    - by MotionGrafika
    Is there way to override jQuery's core functions ? Say I wanted to add an alert(this.length) in size: function() Instead of adding it in the source size: function() { alert(this.length) return this.length; }, I was wondering if it would be possible to do something like this : if (console) { console.log("Size of div = " + $("div").size()); var oSize = jQuery.fn.size; jQuery.fn.size = function() { alert(this.length); // Now go back to jQuery's original size() return oSize(this); } console.log("Size of div = " + $("div").size()); }

    Read the article

  • Asp.net override Membership settings at runtime (asp.net mvc)

    - by minal
    I had an application that hooked onto 1 single database. The app now needs to hook into multiple databases. What we want to do is, using the same application/domain/hostname/virtual dir give the user the option on the login screen to select the "App/Database" they want to connect into. Each database has the App tables/data/procs/etc as well as the aspnet membership/roles stuff. When the user enters the username/password and selects (select list) the application, I want to validate the user against the selected applications database. Presently the database connection string for membership services is saved in the web.config. Is there any way I can override this at login time? Also, I need the "remember me" function to work smoothly as well. How does this work when the user comes back to the app in 5 hours... This process should be able to identify the user and application and log in appropriately.

    Read the article

  • Override the neutral language of a specific resource file within an assembly

    - by Sandor Drieënhuizen
    I have an assembly that contains several resource files. Most of them have the neutral language 'nl' (Dutch, specified on the assembly as the neutral language), so I don't specify the 'nl' in their filenames. However, I'm putting strings in the English language in some other resource files (they are internal error messages) and I will never provide Dutch translations of them. If I name those resource files something like 'Errors.en.resx', no designer class is generated (breaks the build) because there is no 'Errors.resx'. This is annoying because now I have to put 'en' strings into a 'nl'-implied resource file and I really don't want to translate those strings to 'nl' or provide empty strings just to satisfy the compiler. Is there a way to override the neutral language on a specific resource file or perhaps somehow have the 'Errors.en.resx' build a designer class?

    Read the article

  • iPhone - Is it ok to override UITableViewCell setSelected:animated

    - by Brian
    I am drawing custom UITableViewCells. My cells are opaque and are completely drawn in the drawRect of the cell to help with performance. I want to handle the look of a selected cell myself. If I don't, then the contents of my cell is covered up by the selectedBackgroundView that is added. Is it common or acceptable to override the setSelected:animated method of my cell so this is done properly. I guess if I did that, then I would not call the super's setSelected method since I would be handling how the cell will show that its selected. I would also have to set the selected property of the cell. Any help would be great. Thanks.

    Read the article

  • Is it safe to override `release` for debugging?

    - by Koning Baard XIV
    Sometimes I need to find out if an object will really be released. I could use Instruments of course, but that takes much time, and I have to search into millions of objects, so I used to do this: -(void)release { NSLog("I'm released"); [super release]; } But the problem is: is this safe to do? Can I get any problems when I override -(void)release. Also, is it really void? And what if I build my application for distribution, but per accident leave it there? Or is it just safe? Thanks

    Read the article

  • QWidget keyPressEvent override

    - by eaigner
    Hi there, I'm trying for half an eternity now overriding QWidgets keyPressEvent function in QT but it just won't work. I've to say i am new to CPP, but I know ObjC and standard C. My problem looks like this: class QSGameBoard : public QWidget { Q_OBJECT public: QSGameBoard(QWidget *p, int w, int h, QGraphicsScene *s); signals: void keyCaught(QKeyEvent *e); protected: virtual void keyPressEvent(QKeyEvent *event); }; QSGameBoard is my QWidget subclass and i need to override the keyPressEvent and fire a SIGNAL on each event to notify some registered objects. My overridden keyPressEvent in QSGameBoard.cpp looks like this: void QSGameBoard::keyPressEvent(QKeyEvent *event) { printf("\nkey event in board: %i", event->key()); //emit keyCaught(event); } When i change QSGameBoard:: to QWidget:: it receives the events, but i cant emit the signal because the compiler complains about the scope. And if i write it like this the function doesn't get called at all. What's the problem here?

    Read the article

  • Suppress/Override application.html.erb

    - by user310628
    Is there any way to suppress the default js and css loaded by application.html.erb on a view by view basis? I'm finding it incredibly difficult to manage a global css and js includes configuration when certain views need different js libraries that for some reason seem to be conflicting with one another. For example, I might want jquery 1.3 for one view and 1.4.2 for another. I don't necessarily want to have to have an include for every view (I do want to have a global site-wide default), but I would also like to be able to override those for any view I want. Thanks!

    Read the article

  • rails override default getter for a relationship (belongs_to)

    - by brad
    So I know how to override the default getters for attributes of an ActiveRecord object using def custom_getter return self[:custom_getter] || some_default_value end I'm trying to achieve the same thing however for a belongs to association. For instance. class Foo < AR belongs_to :bar def bar return self[:bar] || Bar.last end end class Bar < AR has_one :foo end When I say: f = Foo.last I'd like to have the method f.bar return the last Bar, rather than nil if that association doesn't exist yet. This doesn't work however. The reason is that self[:bar] is always undefined. It's actually self[:bar_id]. I can do something naive like: def bar if self[:bar_id] return Bar.find(self[:bar_id]) else return Bar.last end end However this will always make a db call, even if Bar has already been fetched, which is certainly not ideal. Does anyone have an insight as to how I might have a relationship such that the belongs_to attribute is only loaded once and has a default value if not set.

    Read the article

  • How do I override Currency symbols in Java?

    - by edgydruid
    I'm trying to print prices in Turkish Liras (ISO 4217 currency code TRY) with Java. When I do Currency curr = Currency.getInstance("TRY"); Locale trLocale = new Locale("tr", "TR"); System.out.println(curr.getSymbol(trLocale)); the output is: "YTL". However, the currency symbol for Turkish Lira has recently changed from "YTL" to "TL" (as can be seen on the Wikipedia page for Turkish Lira). Formatting with NumberFormat gives a similar result. I really don't want to write yet another Currency class, especially when Java has one built-in. Is there a way to override Java's default currency symbol for TRY to "TL"?

    Read the article

  • Ant ignores attempt to override the LANG environment variable

    - by Steen
    We need to test a java build with the languages set to different values. I can manually (i.e. via export LANG=en_DK.UTF-8 and export LANG=en_DK) test that the unit tests run with the ant build script behaves differently, but I need to set the environment variable from ant. I have tried setting it using these methods (with the shell $LANG set to en_DK.UTF-8): using -D on the command line: ant -DLANG=en_DK using a build.properties file with the line LANG=en_DK in it using the following statements in the build.xml file (sorry for the formatting, I can't get SO to display it otherwise): : <property environment="ANTENV"/> <property name="ANTENV.LANG" value="en_DK"/> Using any of the three possibilities, and when run with -debug, ant reports that: Override ignored for property "LANG" What can I do to set the LANG environment variable from within ant?

    Read the article

  • Override comparison for F# set

    - by Mauricio Scheffer
    Is there any way to override the comparison function in a F# set? I don't see any set construction functions that take a IComparer<T> or comparison function: Set.ofSeq et al don't take a comparison function FSharpSet(IComparer<T> comparer, SetTree<T> tree) constructor is internal, because SetTree is internal and SetTreeModule.ofSeq<a>(IComparer<a> comparer, IEnumerable<a> c) is obviously internal too. My actual problem is that I have a set of ('a * 'a) and I want a comparison such that for example (1,3) = (3,1). I know I could wrap this in a type implementing IComparable<T>, but is there any way to avoid this?

    Read the article

  • Silverlight Navigation - how to override Back button behavior

    - by Stephen Ellis
    I'm trying to override the default behavior of the browser's back button in Silverlight (v4). Each of my XAML pages has an ability to show options. I want these options to be hidden when the user presses the back button, or to move to the previous page if the options are not visible. The Silverlight Frame seems to set back and forward points whenever the user navigates to a page with a new QueryString. Is there any other way of implementing my scenario other than having to implement a querystring component for my ShowOptions property?

    Read the article

  • "Verbose Dictionary" in C#, 'override new' this[] or implement IDictionary

    - by Benjol
    All I want is a dictionary which tells me which key it couldn't find, rather than just saying The given key was not present in the dictionary. I briefly considered doing a subclass with override new this[TKey key], but felt it was a bit hacky, so I've gone with implementing the IDictionary interface, and passing everything through directly to an inner Dictionary, with the only additional logic being in the indexer: public TValue this[TKey key] { get { ThrowIfKeyNotFound(key); return _dic[key]; } set { ThrowIfKeyNotFound(key); _dic[key] = value; } } private void ThrowIfKeyNotFound(TKey key) { if(!_dic.ContainsKey(key)) throw new ArgumentOutOfRangeException("Can't find key [" + key + "] in dictionary"); } Is this the right/only way to go? Would newing over the this[] really be that bad?

    Read the article

  • How to override the behavior of Spring @Autowired

    - by Mark
    Hi a little background: I am Using Spring 2.5, and specifically spring IOC and annotations. I am using @Autowired in my code (the Autowiring is done by type) and use @Component for exposing Classes to the Automatic wiring. The situation described bellow arose while i tried to test my code. now to the problem: Note: i use a different Spring Context for the Test environment. I have a class FOO which is @Autowired but in the test context i want to use a different class of the same type MockFoo (extends FOO) The Spring Setup of course fails do so automatically due to multiple options for the Dependency Injection of the FOO class (both FOO and MockFOO comply to the Type check) I am looking for a way to inject the test bean instead of the original bean. I expected Spring to allow using the Context configurion file to override a bean injection or to order Spring not to autowire a specific bean BUT All these option seem to exists only for the beans which were originally defined in the Spring Context Configuration file

    Read the article

  • Override ~ behaviour in controls

    - by cpf
    Quick backstory: I'm making a "framed" version of my site that has a different master page than normal (one suitable for iframing). It's accessed by mysite.com/Framed/whatever, instead of mysite.com/whatever. This is rewritten in IIS to mysite.com/whatever?framed=true. That works fine. The issue I'm having is that all the links are relative using a ~ like ~/Server.aspx which works fine in the normal site. I need to override that so instead of producing ../Server.aspx (as it "should") it produces ../Framed/Server.aspx or Server.aspx. Currently this means that the page goes back to it's normal view (mystite.com/whatever2) as soon as you click on a link, I want it to continue to stay in mysite.com/Framed/...

    Read the article

  • How to override environment variables when running configure?

    - by Sam
    In any major package for Linux, running ./configure --help will output at the end: Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. How do I use these variables to include a directory? I tried running ./configure --CFLAGS="-I/home/package/custom/" and ./configure CFLAGS="-I/home/package/custom/" however these do not work. Any suggestions?

    Read the article

  • Override Devise Sign-in with reCaptcha

    - by Bashar Abdullah
    I'm trying to override the Rails devise login to include recaptcha. I followed the steps here http://presentations.royvandewater.com/authentication-with-devise.html#8 however for some reason, authentication always fails. To isolate the problem, I removed all my code and called super directly class SessionsController < Devise::SessionsController def create super end end file is at: Rails.root/app/controllers/sessions_controller.rb the slide suggest Rails.root/app/controllers/sessions.rb but I assume that was just a mistake. Trying it out didn't help either. I even copied the full Sessions Controller code into my own, still gives the problem. Authentication fails here specifically: resource = warden.authenticate!(:scope => resource_name, :recall => "#{controller_path}#new") Any idea what I might be doing wrong?

    Read the article

  • Override transparency color when converting transparent PNG to JPG

    - by Alexander Malfait
    I'm using Dragonfly to generate thumbnail images in a Rails app. I'm serving all picture images as JPG's. Now the client is uploading transparent PNG files, like this one: http://www.ibanez.co.jp/products/images/eg2010/ART120_TRF_12_02.png Dragonfly uses RMagick to convert these images to JPG. The problem is that it converts the PNG images to JPG with a black background, and my site's design requires a white background. I've tried to override it like this: encoded_image = Magick::Image.from_blob(image.data).first if encoded_image.format.downcase == format image # do nothing else encoded_image.format = format encoded_image.background_color = "white" encoded_image.transparent_color = "white" encoded_image.to_blob end But the produced JPG images still contain a black background. Does anyone know how to beat RMagick into using a white background when converting the transparent layer? I know I could just serve as PNG, but then the images are 10 times as large, and the site is already pretty bandwidth heavy.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >