Search Results

Search found 2068 results on 83 pages for 'refer'.

Page 24/83 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • PHP 5.3: Late static binding doesn't work for properties when defined in parent class while missing in child class

    - by DavidPesta
    Take a look at this example, and notice the outputs indicated. <?php class Mommy { protected static $_data = "Mommy Data"; public static function init( $data ) { static::$_data = $data; } public static function showData() { echo static::$_data . "<br>"; } } class Brother extends Mommy { } class Sister extends Mommy { } Brother::init( "Brother Data" ); Sister::init( "Sister Data" ); Brother::showData(); // Outputs: Sister Data Sister::showData(); // Outputs: Sister Data ?> My understanding was that using the static keyword would refer to the child class, but apparently it magically applies to the parent class whenever it is missing from the child class. (This is kind of a dangerous behavior for PHP, more on that explained below.) I have the following two things in mind for why I want to do this: I don't want the redundancy of defining all of the properties in all of the child classes. I want properties to be defined as defaults in the parent class and I want the child class definition to be able to override these properties wherever needed. The child class needs to exclude properties whenever the defaults are intended, which is why I don't define the properties in the child classes in the above example. However, if we are wanting to override a property at runtime (via the init method), it will override it for the parent class! From that point forward, child classes initialized earlier (as in the case of Brother) unexpectedly change on you. Apparently this is a result of child classes not having their own copy of the static property whenever it isn't explicitly defined inside of the child class--but instead of throwing an error it switches behavior of static to access the parent. Therefore, is there some way that the parent class could dynamically create a property that belongs to the child class without it appearing inside of the child class definition? That way the child class could have its own copy of the static property and the static keyword can refer to it properly, and it can be written to take into account parent property defaults. Or is there some other solution, good, bad, or ugly?

    Read the article

  • Absolute UriSource of a Resource image

    - by Louis Rhys
    I have a WPF project. If I store image in {ProjectRoot}\Images\image.png, and compile it as Resource then I can access it from a xaml (this xaml is located at Root) as BitmapImage by BitmapImage UriSource="Images/image.png". But if I move the xaml to another folder, say {ProjectRoot}\Xamls, now I have to use BitmapImage UriSource="../Images/image.png". Is there a way to specify an absolute project path, so that I can refer to them with the same path regardless of the location of the xaml?

    Read the article

  • Is is possible to have grouped GridView without using CollectionViewSource?

    - by Sergey Aldoukhov
    It is just seems to be a little awkward design to tie a feature to a class instead of interface. Has anybody managed to group GridView without CollectionViewSource? Also a bonus question here: why you have to refer to the CollectionViewSource resource through binding: <GridView ItemsSource="{Binding Source={StaticResource groupedData}}" > instead of <GridView ItemsSource="{StaticResource groupedData}" > ??

    Read the article

  • KDevelop has no build menu.

    - by Brian Hooper
    I have just installed KDevelop on my Ubuntu machine (KDevelop 3.9.95 on Ubuntu 9.10) with sudo apt-get install kdevelop I created a new project with the "Hello World" program in it, but there doesn't appear to be any way to compile anything. The manuals refer to the build menu but there isn't one, all all compile options on the other menus are greyed out. Does anyone know what I have done wrong?

    Read the article

  • one id for more than one widget android

    - by Labeeb P
    Hi, Is there any way to refer more than one widget (ui controls) by a single id For example i have many ImageView with same android:id="myimageview" And in my activity myimageview = (ImageView)findViewById(R.id.myimageview); So if i set an image using myimageview.setImageBitmap(somebitmap); i need that image in all of my Imageview with id myimageview But when i tried this only one of imageview got this change. Any idea to do this. Thank you.

    Read the article

  • How to use sound and images in a Java applet?

    - by Click Upvote
    Question 1: How should I structure my project so the sound and images files can be loaded most easily? Right now, I have the folder: C:\java\pacman with the sub-directory C:\java\pacman\src containing all the code, and C:\java\pacman\assets containing the images and .wav files. Is this the best structure or should I put the assets somewhere else? Question 2: What's the best way to refer to the images/sounds without using the full path e.g C:\java\pacman\assets\something.png to them? If I use the getCodeBase() function it seems to refer to the C:\java\pacman\bin instead of C:\java\pacman\. I want to use such a function/class which would work automatically when i compile the applet in a jar as well as right now when I test the applet through eclipse. Question 3: How should I load the images/sounds? This is what I'm using now: 1) For general images: import java.awt.Image; public Image getImg(String file) { //imgDir in this case is a hardcoded string containing //"C:\\java\\pacman\\assets\\" file=imgDir + file; return new ImageIcon(file).getImage(); } The images returned from this function are used in the drawImage method of the Graphics class in the paint method of the applet. 2) For a buffered image, which is used to get subImages and load sprites from a sprite sheet: public BufferedImage getSheet() throws IOException { return ImageIO.read(new File(img.getPath("pacman-sprites.png"))); } Later: public void loadSprites() { BufferedImage sheet; try { sheet=getSheet(); redGhost.setNormalImg(sheet.getSubimage(0, 60, 20, 20)); redGhost.setUpImg(sheet.getSubimage(0, 60, 20, 20)); redGhost.setDownImg(sheet.getSubimage(30, 60, 20, 20)); redGhost.setLeftImg(sheet.getSubimage(30, 60, 20, 20)); redGhost.setRightImg(sheet.getSubimage(60, 60, 20, 20)); } catch (IOException e) { System.out.println("Couldnt open file!"); System.out.println(e.getLocalizedMessage()); } } 3) For sound files: import sun.audio.*; import java.io.*; public synchronized void play() { try { InputStream in = new FileInputStream(filename); AudioStream as = new AudioStream(in); AudioPlayer.player.start(as); } catch (IOException e) { e.printStackTrace(); } }

    Read the article

  • How to jar java source files from different (sub-)directories?

    - by Holger
    Consider the following directory structure: ./source/com/mypackage/../A.java ./extensions/extension1/source/com/mypackage/../T.java ./extensions/extension2/source/com/mypackage/../U.java ... ./extensions/extensionN/source/com/mypackage/../Z.java I want to produce a source jar with the following contents: com/mypackage/../A.java com/mypackage/../T.java com/mypackage/../U.java ... com/mypackage/../Z.java I know I could use a fileset for each source directory. But is there an easy solution using ANT without having to refer to all extensions explicitly?

    Read the article

  • compilation of image stitching code in matlab

    - by chee
    i am facing lots of problems while running code for image stitching given at this link http://se.cs.ait.ac.th/cvwiki/matlab:tutorial:image_stitching_from_high-view_images_using_homography may i get help regarding this type of problems here. EDIT: Image stitching code fails with the following message: ??? Undefined function or variable 'x2'. Error in ==compute_direct_homography at 26 amplified_x2=x2.*repmat([diagonal_ratio(x1,x2) diagonal_ratio(x1,x2) 1]',1,size(x2,2)); %assumption 1degree of lat and long =110,000 meters refer wiki Error in == project at 3 compute_direct_homography;

    Read the article

  • Unwanted horizontal scroll bar in IE7

    - by fmz
    I have a site that is working fine, except in IE7 there is a massive horizontal scroll bar. I would have to paste the entire html code and css code so I will refer you to the page source. You can see the site here. Any assistance would be greatly appreciated. Thanks.

    Read the article

  • how wordpress can un-slug a title

    - by Mac Taylor
    i still , don't understand , how wordpress can understand what is this url refer to : www.mysite.com/about-me/ they are using no identifier if they using slug functions so how they can retain story information or in other word , how they change back the slugged title to select from database

    Read the article

  • C++ STL containers

    - by cambr
    Different STL containers like vector, stack, set, queue, etc support different access methods on them. If you are coding for example in Notepad++ or vim, you have to continuously refer to the documentation to see what all methods are available, atleast I have to. Is there some good way of remembering which container supports which methods??

    Read the article

  • text from a file turned into a variable?

    - by b3y4z1d
    If I made a program that stores strings on a text file using the "list"-function(#include ), and then I want to copy all of the text from that file and call it something(so I can tell the program to type in all of the text I copied somewhere by using that one variable to refer to the text), do I use a string,double,int or what do I declare that chunk of text as? I'm making the program using c++ in a simple console application.

    Read the article

  • How can I stop user from navigating to the previous page

    - by ryanlancer
    Hi, I am developing a simple email portal as my college assignment and I refer gmail for various features.Now when we sign into a gmail account and then if we hit the back button of the browser we somehow still remain on the inbox page.In my case after login if I press back button I comeback to the login page.Please suggest how can I achieve this.Also I am a newbie to ASP.NET so keep it detailed

    Read the article

  • how to set different views for admin and user

    - by alienavatar
    Hi I am little new to SharePoint. Here is my question How can we make different views for administrator VS logged in user. For instance I need to display the quicklaunch only to admin and not for user. And user should not see site actions tab. How can we set this. Please can anyone come up with solution or any blog that we can refer? Thanks in advance.

    Read the article

  • Show NSSegmentedControl menu when segment clicked, despite having set action

    - by enchilada
    My question is based on another question. Instead of repeating a bunch of stuff, I hope it's okay that I refer you to that other question instead: http://stackoverflow.com/questions/1203698/show-nssegmentedcontrol-menu-when-segment-clicked-despite-having-set-action/ My question is: How would the code within [self showGearMenu] look like, i.e. how would one actually use the popUpContextMenu:withEvent:forView method to accomplish what the poster of the other question wants? I ask because it seems that the question was resolved for the poster, but he never shared with us how he actually popped up the menu :)

    Read the article

  • Good resources for learning WPF

    - by user185040
    I am very new to WPF and I am interested in learning it. I have gone through some tutorials, but I am looking for a website or book containing projects/assignments along with solutions so that you can code and learn. As I work through a project, I'd like to be able to refer to a solution in case I get stuck somewhere. Can someone please share any links/material if you have which can give me some WPF Projects/assignments to work on along with solution. Thanks.

    Read the article

  • Java, let CookieHandler work on only one instance.

    - by user435657
    Hi all, I don't know how CookieHandler works system wide, I did view the source of CookieHandler but found no more information except the get/set methods. Where do TCP/HTTP connections use instance of CookieHandler, which I set by CookieHandler.setDefault(...) Which source file I should refer to? URLConnection & HttpURLConnection don't seem have things to do with it. Help, thanks in advance.

    Read the article

  • Selecting id of TextArea (despite RichEditableText)

    - by duder
    I'm trying to select the id of a textArea when it's focused in <s:TextArea id="textarea1" focusIn="selectId(event)" /> selectId(event){ event.target.id; } Problem is TextArea is made up of RichEditableText so target doesn't actually refer to TextArea. I've tried event.target.parent.id but still not getting there. Anyone knows how to get to the bottom of this?

    Read the article

  • Oracle Cursor and JDBC ODBC

    - by BeginnerAmongBeginners
    I have some procedures to execute in the database that has an OUT REFCURSOR parameter. When I am connecting with the JDBC thin client, everything works fine. However, if I were to change the connection string to refer to the ODBC data source pointing to the same database, those procedures will fail. The procedures that do not use an OUT REFCURSOR will still work fine though. Is this situation the result of an error on my part or expected?

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >