modifier

What does the "static" modifier after "import" mean?

like this: import static com.showboy.Myclass; public class Anotherclass{} And what's the difference between "import static com.showboy.Myclass" and "import com.showboy.Myclass"? ...

What is the point of "static new" modifier for a function?

Today, I found something in legacy code. It has "static new" for one function. It looks like this. class Foo { public static void Do() { Console.WriteLine("Foo.Do"); } } class Bar: Foo { public static new void Do() { Console.WriteLine("Bar.Do"); } } I don't understand the static new modifier fo...

php global variable modifier not working

I'm using the basic php example for the global modifier, and it doesn't work for me :-| $a = 1; $b = 2; function Sum() { global $a, $b; $b = $a + $b; } Sum(); echo "***: ".$b; Here is the result... $ ***: 2 Is there any parameter on the php.ini that might effect this? ...

[SWT] Modifier Key state

Hi all, I have a tiny (rikiki) problem in SWT ... I am making a small class extending org.eclipse.swt.widgets.Composite and which is supposed to be nested in an RCP app ... In this small class I have widgets which are supposed to react to mouse or keyboard event BUT I need to use modifier keys (Shift/Ctrl/Alt/...) to alter my copone...

Why preg_replace throws me a "Unknown modifier" error ?

I keep getting this error: Warning: preg_match() [function.preg-match]: Unknown modifier 't' in D:\xampp\htdocs\administrator\components\com_smms\functions\plugin.php on line 235 on: $PageContent = preg_replace($result->module_pregmatch, '', $PageContent); I do a var_dump on the $result->module_pregmatch and I get the fo...

based on what logical reasons, virtual and new modifiers have diffrent results in inheritance and polymorphism issues?

Hi ... I know that when we have a virtual function in our own base class, then by overriding it in a derived class and considering casting when variable declaration, we have different result with comparison to using new modifier in the derived class. but why? Is there any logical reason for that or we have to learn it without any reason?...

Practical usage of new (modifier) functions?

Hi... What's the Practical usage of new (modifier) functions? ...

default values/modifiers in postgres?

I've problem with default modifiers on postgres 8.4. (I think version is its not important) I've debian ubuntu. When Im creating migrations on rails AR: class CreateUserMails < ActiveRecord::Migration def self.up create_table :user_mails do |t| t.string :title, :limit=> 128, :default=> '' t.string :place, :limit=> ...

MenuKey functionality in OSX 10.5 and 10.6?

I have an OLD mac C/C++ program that I'm maintaining. It's still based on rsrc files and OS 9 system calls. (Yes, yes, I know. I'm TRYING to drag my company into the 21st century, but the other engineer is still using OSX10.3.9! please pity me) I'm trying to get modifier shortcut functionality. Cmd-S works, for example. However, Opt-Cmd...

new modifier in C#

MSDN says: When used as a modifier, the new keyword explicitly hides a member inherited from a base class. When you hide an inherited member, the derived version of the member replaces the base-class version. Although you can hide members without the use of the new modifier, the result is a warning. If you use new to ...

How to change modifier of a control to Static in Visual Studio

hi, when i create a control by drag and drop VS automatically generate code like this: public System.Windows.Forms.Label label1; When i want to change modifier of that control to Static, i go to Form1.Designer.cs and edit to: public static System.Windows.Forms.Label label1; It's ok. But when i modify every control, VS automatically...

Why i can not acces the protected properties in my web application

Hi i have a web application which has a Base class in which i define all the properties common to the web pages. The base class extends System.Web.UI.Page Furthermore i have a Base User control class where are defined all the properties common to the user controls. the Base User Control extends System.Web.UI.UserControl all the proper...

Java Design Questions - Class, Function, Access Modifiers

I am newbie to Java. I have some design questions. Say I have a crawler application, that does the following: 1. Crawls a url and gets its content 2. Parses the contents 3. Displays the contents How do you decide between implementing a function or a class? -- Should the parser be a function of the crawler class, or should it be a clas...

Set a project default for VB.NET projects so that the default Modifiers property for controls is Private

Is it possible to set a project default for VB.NET winforms projects so that the default Modifier for controls added to winforms is Private (not Friend)? I know there's a "modifiers" property in the properties window so I can set it for each individual control... however I would like to change the project so from now on myself and other...

How to use a variable as modifier in a substitution

Is there a way to use a variable as modifier in a substitution? my $search = 'looking'; my $replace = '"find: $1 ="'; my $modifier = 'ee'; s/$search/$replace/$modifier; I need to use an array of hashes to make bulk search-replace with different modifiers. ...

i modifier doesn't work with foreign languages?

My string is in foreign language, i use the following expression $str = 'մի քանի Բառ ձեր մասին'; $word = 'բառ'; $cont = preg_match_all("/.{0,80}[^\s]*?".preg_quote($word)."[^\s]*?.{0,80}/si",$str,$matched); print_r($matched);//returns Array ( [0] => Array ( ) ) .. . but if i set $word = "Բառ";//returns Array ( [0] => Array ( [0] =...

OOP, protected vs public. When to use?

Im trying to understand the benefits of making a class variable private, versus public. I understand getters / setters to access / modify the private / protected data, but is its sole purpose is to 'keep me from mangling my data'? Example : I dont get how saying $person->age = x;//bad? has different potential for havoc than $person-...

C# return non-modifiable list

I have a class which contains a List<Item> I have a getter on the class that returns this. Is there some thing I can do to ensure the user who calls cannot modify the returned List? (Since it's a reference type - I believe changes to the returned reference would affect the list stored in the source object) ...