bibiki 18 Posting Whiz

Seems like the issue was a Laravel framework specific one.
I had to invoke the toArray() method on my collection of objects before putting it on my return array.

The proper way to do it is:

public function getMembers(){
    $members = Members:all()->toArray();
    $rez = array();
    $rez['aaData'] = $members;
    return $rez;
}

I'm putting the solution up lest someone needs it in the future.

bibiki 18 Posting Whiz

Hi there,
I am having difficulties with integrating datatables. Somehow, my data is being lost/weirdly modified when putting it in my response variable.

foreach($aaData as $aData)
    echo "-".$aData."<br>";
foreach($aaData as $aData)
    $response['aaData'][] = $aData;

My first foreach loop outputs data, and what I see is what I expect.
However, when viewing my data in response, it does not contain the rows of data I expect. It does contain the same number of rows, but only one of my columns, and an additional four fields that I think describe my database table.
In the following, the first is my actual r,ow in database and what I see from my first loop. The second is what my json seems to contain.

-{"id":42,"emri":"Bibiki","mbiemri":"Bibiki","datelindja":"27\/03\/1981","num_personal":"1036","grupi_gjakut":"0","adresa":"","gjinia":"","profesioni":"","telefoni":"","dega":"","nendega":"","statusi_martesor":"0","e_mail":"","data_anetaresimit":"2014-03-12 00:00:00","kombesia":"Shqiptar","admini":1,"vendi_punes":""}

[{"timestamps":false,"gjinia":"Femer","incrementing":true,"exists":true}]

Anyone, please help.
Kind regards

bibiki 18 Posting Whiz

hi guys,
gabrielcastillo's idea sounds good for consistency... this way, on resubmition, my filter will receive the same input as in the first submition, so my app won't behave differently.
so, consistency issues in app behavior are out of the way now. thanks... I did not think of that :)

bibiki 18 Posting Whiz

hi cereal, thanks for your reply.
I am trying to take control of html purification in server side as I am building a whitelist of tags that I want to allow in. As is right now, the encoding of < and > actually prevents AntiSamy to do its job to remove html xss attacks. Any JS attacks are being thwarted allthough the first submition of data allows javascript tags in, but it wrapps their content in [[CDATA... upon the second resubmition, they are removed completely.

Now, letting code in via code tool of tinymce makes things work fine, but using the textarea that first appears to input html tags causes the issue you documented aboe.

I am trying to see what classes the code tool has different than the first textarea and fix the issue... or maybe, I could add an onSubmit listener to my form, to read the content from my first textarea instead of submitting the encoded content of the textarea (sounds confusing because it is).

what do you think?

bibiki 18 Posting Whiz

Hey cereal,
thanks for your reply. I looked in that link, but I am not sure that solves my issue.
What I am having difficulties with is preventin tinyMCE from encoding < and >. However, if you look here http://www.tinymce.com/wiki.php/Configuration:entities you'll see that < and > will ALWAYS be encoded... even if I use the entity_encoding : "raw" option http://www.tinymce.com/wiki.php/Configuration:entity_encoding

perhaps I will have to encode &gt; to > in some filter or something for my code to work. OR, use tinyMCE plugins/toolbars to insert html tags instead of typing them in.
what do you think?

bibiki 18 Posting Whiz

Hi guys,
I am using tinyMCE editor. In my textarea, I want to let user type some html like <table></table> and store that in db just like that, <table></table>.
However, what I am getting is:
&lt;table&gt;&lt;/table&gt;
Now, if I go to the edit form for the item that contains that html piece and I update it, what I get in my database is <table></table>.
Can someone please explain how I can store <table> as <table> in one single step?

bibiki 18 Posting Whiz

hey there,
your base case is more than selectedWith == 0. Like what if selectedWith is not zero, but your current author has no co authors? Then, why are you passing around scholarNeighborhood? Sounds like scholarNeighborhood will hold the result. You can certainly pass it around and be within the definition of a recursive method, but that is for the iterative form of recursion not the linear form (ignore this, unless you already know the difference). what you need is the the linear form recursion, I believe. for that, you need to remove the third input param in your method.
from my understanding, you need to fix your base case, remove your third parameter, and make sure you add ALL co authors of the author that selectedWidth allows for, and if selectedWith is not zero, add all coauthors of all coauthors... I hope you can make sense of what I am saying.

bibiki 18 Posting Whiz

hey masijade, thanks for your reply. I did mvn dependency:build-classpath and it downloaded some artifacts and output the apsolute path to my project's dependencies. But I am not sure that clarified things for me.

What I am trying to figure out is: when I type classpath:fileName in an xml file, where does it look for file fileName? Only src/main/resources in the current project, or in anyother location inside current project? as I described in my question above, context.xml in project A contains classpath:otherFile, but otherFile is not inside project A, it is inside project B which is made use of by A. this is confusing me.

bibiki 18 Posting Whiz

hey there,
I am looking at a maven project that makes use of another maven project. say project A and project B.

In context.xml in project A, I see these two lines

<value>classpath:oneFile</value>

<value>classpath:otherFile</value>

I have been trying to figure out what is the actual value of classpath, so what I did is looked for where inside project A oneFile is located and deduced that the rest of the path to oneFile is what classpath holds. However, that location, that is src/main/resources does not seem to hold the otherFile. Instead, the otherFile is in src/main/resources of project B. My guess right now is that <value>classpath:otherFile</value> is of no use in project A, so it can safely be removed. However, I am not so interested to move that line as I am interested to know what is the actual value of classpath, or is there any way I can find that out. perhaps .classpath file can make that clear for me. I will look at that, but someone with experience please elaborate.

Thanks in advance.

bibiki 18 Posting Whiz

I am not sure that I can help you much about reporting, but I think you should use Derby for database. It's easy to make use of, and as of Java, I think 7, it ships along with Java SDK. it is an embedded DB like sqlite, but is easier to work with. Last time I tried, I gave up on SQLite, and made use of Derby.

bibiki 18 Posting Whiz

sepp2k, thansk for your elaboration. I certainly agree with most of what you say and find interesting your explanations. I failed to declare all of my assumptions when I said "If ++ was a method, and num an object, the num = num++; would have behaved the way Tokamak and I would expect it to." and I see how that raised questions that your MyInt class answered. Anyways, thanks for your input.

bibiki 18 Posting Whiz

hey JamesCherrill, thanks for your patience. I really appreciate it. I understand that part

the value of the expression is the value before the new value is stored,

and am also aware that ++num increments num first, and then does the rest of operations.
Anyways, I'll look at JLS, although I think I got it clearer now.

kind regards.
P.S. Thanks for the protected-less protected topic. I now have something to research about.

bibiki 18 Posting Whiz

Hey JamesCherrill, I still am confused. rather than:

int valueOfExpression = num;
num = num + 1;

I thought, what actually happnes is:

    int num = 0;
    //when we write num = num++;, what I think happens is:
    int valueOfExpression = num;
    num = num;
    valueOfExpression = num + 1;
    //and this leaves num 0, instead of incrementing it to 1.

stultuske, you're right, there is no reason for any emotional reaction on my part for Java's contradiction to my expectations. And, one of the reasons I like being a programmer is that there is no room for arguing with the compiler. But there is nothing wrong with saying Java si wrong either man. Alright, take care.

bibiki 18 Posting Whiz

I have encountered this same issue once, and I happened to have access to someone that other people told me is a guru at the time. And I do take that guy for a guru, but this exact question puzzled him also, so all you much respected Java Forum helpers are a little wrong with your reactions to Tokamak, let me tell you straight forward.

Anyways, this is how the guy I mentioned went about the issue:
he used javap to see the assembly equivalent of the code (correct me if I am wrong with the interpretation of what he did), and tried to see what is actually going on.

Now, with all that specs referencing going on, what the conversation seems to have made necessary is to discuss how the specs are actually implemented.

I do agree with Tokamak that the c++ example he mentioned is closer to how my intuition expects the code to work than Java. I know that the question is solved, but I just wanted to put in my two cents.

AND, as someone that has been paid 12 salaries as a programmer (that is my experience), but is very interested to make sense of ins and outs of programming, here is how I'd speculate and try to make sense of this issue:

Java is very rigid in discerning between Objects and primitive types. If ++ was a method, and num an object, the num = num++; would have behaved the way Tokamak and …

bibiki 18 Posting Whiz

hey peter+budo, sorry for this late reply. note, I changed my artifactId here from the original one. otherwise, the pom is completely the as is in my project.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.mynew.app</groupId>
    <artifactId>MyNewApp</artifactId>
    <packaging>war</packaging>
    <version>0.9</version>
    <name>MyNewApp Maven Webapp</name>
    <url>http://maven.apache.org</url>

    <!-- Shared version number properties -->
    <properties>
        <org.springframework.version>3.2.3.RELEASE</org.springframework.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>4.2.3.Final</version>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.2.2</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.6</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
            <version>3.1.3.GA</version>
        </dependency>
        <dependency>
            <groupId>dom4j</groupId>
            <artifactId>dom4j</artifactId>
            <version>1.6.1</version>
        </dependency>
    </dependencies>
    <build>
        <finalName>MyNewApp</finalName>
    </build>
</project>
bibiki 18 Posting Whiz

hey there,
in a project I am involved, someone put a test class in main code. eclipse would not find the bug but mvn, not that in eclipse, would report a compile error, and we found the bug.

because of that, I wanted to build my new maven project without configuring it as a maven project in eclipse. I have been trying to run my skeleton app on tomcat two days and it refused to do so. only when I gave up and converted it to maven did I find that there was nothing wrong with my code, but Tomcat/Eclipse for some reason fails to run my app because it is not eclipse maven plugin enabled.

My question is how do I go about finding out what is happening? what is maven plugin doing? any suggestions are welcome. thanks in advance.

bibiki 18 Posting Whiz

hey JamesCherrill, thanks a lot for your code. I'll look at it closely. It is very much appreciated.

bibiki 18 Posting Whiz

thanks JamesCherrill. I am enthusiastically looking forward to it.

bibiki 18 Posting Whiz

...however, I would love to see the code JamesCherrill. Not only because it is code that I would like to make use of, but also to see your code as I am sure I'd learn something since I have been getting quite some help from you last 3 years. thanks in advance.

bibiki 18 Posting Whiz

yeah, thanks iamthwee. I have created jar files before, and it was quite straight forward. but this one puzzled me. I guess I'll try eclipse's utility for jar generation. thanks again.

bibiki 18 Posting Whiz

I have never used the IDE for this and it slipped my mind that it even is possible.

bibiki 18 Posting Whiz

Ok, I am trying to build a jar file and I cannot seem to find my way around. I have attached an image to this thread to show my directory structure.

Now, I am navigating to my MultiProjectManagement directory and creating my manifest.txt file with:

echo Main-Class: multi.project.management.panels.ProjectListPanel > manifest.txt

Then, I am doing this:
jar -cvfm MPManagement.jar manifest.txt bin multiProjectManagement lib

The jar file is being generated, but when I java -jar MPManagement.jar, I get an error saying:
could not find or load main class: multi.project.management.panels.ProjectListPanel

I understand that my main class is inside bin directory. Now, from what I found online, I hoped that navigating to bin and putting my database, that is multiProjectManagement, and lib folders in bin, and generating the jar file as above would solve the issue, but in that case I am getting a null pointer exception as my program can't find EmbeddedDriver class from derby.jar.

Can someone please guide my how I can create my jar file and make sure it finds my main class, or my EmbeddedDriver class from derby. 0f9c21b88c403301c00e1b0f748fd4ac

bibiki 18 Posting Whiz

hey there, I am working on this project where I need to retreive merchant objects and their corresponding number of failed transactions.

In pure SQL, I'd just write :

"select merchant_id , count(merchant_id) from Transactions where status = 'failed' group by merchant_id"

however, the only way I managed to write the query and have something returned for hql is:

select max(T.merchant), count(T.merchant) from Transaction  T where T.status = 'failed' group by T.merchant

now, max(T.merchant) is where I am afraid I could do better. but without it, I get a "not a group by statement" error. Although my query seems to work well, I am wondering if I can do this better. MAX(T.merchant) is not limiting the number of rows to 1, which is what I want, but contrary to my expectation for how MAX would work. Anyone?
Thanks in advance.

bibiki 18 Posting Whiz

hey Pobunjenik, I am not getting that exception. I complied your code and it compiled and ran with no exception arising. However, you may get that UnsupportedOperationException is for example you try invoking method add() on an array ([]), but you won't get that when you invoke add() on a list. seek for some method invokation in an object that does not support that method inside your code, although I doubt you'll find that in the code you have posted above.

bibiki 18 Posting Whiz

hey Pobunjenik, sta ima? Alright, I am not sure I understand exactly what it is you are having problems with, but I think I found another bug in your code. This method:

public Player addPlayer(String soldierName) {
    this.allPlayers = new ArrayList<>();
    Player P = new Player();
    P.setName(this.name + soldierName);
    allPlayers.add(P);
    return P;
}

initializes your allPlayers list everytime it is invoked. Therefore, at any time it only has one player - not more.

Pobunjenik commented: Evo ništa, vježbam kod malo. :D +2
bibiki 18 Posting Whiz

thank you guys very much. I now think I have a better idea of what Builder pattern is useful for. Thank you again.

bibiki 18 Posting Whiz

hey bguild,
no, build method is not a static one. I was just trying to indicate that it is inside Builder. Sorry for the confusion. thanks for your answer. My understanding is that you say that I use a Builder inner class so that I do not have to write setter methods in my User class, and thus make User immposible to change state? Correct? But then, is there any downside to returning User from its setter methods instead of void if I decide to use them (other than making User possible to change state)? My previous assumption was that I only use Builder pattern so that I make possible setter method chaining.

bibiki 18 Posting Whiz

hey jacksonbird03, please see the two topmost threads in this java forum for projects for java beginners and resources to start java, first and second threads correspondingly.

bibiki 18 Posting Whiz

Hey there, I have a question regarding the builder pattern that I need someone with more experience to clarify for me.

I have this User class that has an inner, public static Builder class that has the same fields as User as well as the corresponding setter methods. Now, the setter methods inside the Builder class return this (the builder instance), and after everything is set, the instance of the builder is passed to Builder.build(this) method that returns a User instance with the fields.

My question is that I can make User setter methods to return this (User object) and render the inner Builder class unnecessary. However, since it is there, I assume there might be some reason why it is so. Anybody any suggestion as to why is one way better than the other?

Thanks in advance.

bibiki 18 Posting Whiz

the computer it is working on has java version 1.7.0_09, the one it is not working on has java version 1.7.0_21 (and it had earlier _17 - not working also). One thing I find weired though is that robot instantiation via web was impossible in 2008 (judging by the dates of forum posts I read online) and it is possible with java version 1.7.0_09. that sounds like a security downgrade. I do not know what this exactly means. Anyways, hope someone has an answer.

bibiki 18 Posting Whiz

hey there,
I have created this simple app that makes use of a Robot instance. It is a network app that I control using telnet.

I have tried it in two different computers. It works fine. However, in one of my computers, I manage to start my robot app through web. I have a simple php file that makes use of exec() function to start the app. But, in the other computer I manage to start the app, but robot functionality is not available.

I read online that it is because JVM somehow detects that the app is being launched on network and it won't let it start due to security risks this poses. Based on what I read, I need to add a permission in security policy files of Java for my JVM to start the app from a network received request. I have played with policy files based on what oracle site and some other forums say but I have not managed to get the app running using my php file in one computer, but it works fine on the other (although I touched nothing on the computer that it works on).

So, I have two questions: why is it working on the computer I have not touched anything in, and why is it not working on the one I played with policy files in? My best guess is that this is due to some operating system configuration. I have Windows 7 on both machines, but different …

bibiki 18 Posting Whiz

hey there everyone. I hope you're all well.
Alright, I am working on testing a project using Selenium. I know that this is a Java forum and not a Selenium one, but I am used to using this one so I am starting here. Plus, I am very confident that the question is one that the Java experienced guys here must have come across and do have an answer.

I need to test a Login page. I am using the Page Object pattern. There are two possibilities: one, that the log in succeeds, and two, that the log in fails.

I have a LoginPage.logIn(String user, String password) method that would ideally return a DashboardPage upon successful log in. But in case of a failed log in, it should return a LoginPage. Now, I know I can make my LoginPage.logIn() method to return a supertype of both, and then in my test code I can use

assertEqual(returnedPage instanceof (one or the other), true);

What do you guys think? Should I go this way or do you have a better way?
Also, the application that I am testing is accessibale by different roles. Some roles see some dashboard links some do not. What is the best way to test for these. Should I write test methods dependent on users I pass in, and only assert the presence and absence of links relative to the users I am using in the test, or do you have someother way? Anybody …

bibiki 18 Posting Whiz

Hey pritaeas,
thank you very much for your help. sorry for late reply. That was helpful enought to get me through the block. thanks again.

bibiki 18 Posting Whiz

thanks for the help pritaeas,

this is what I am trying:

select name, count(name) frequency from (select name from person) order by frequency

and I am expeting:

someName|12
anOtName|7

but it is not working at all. hmm. can you please give some more hints?

bibiki 18 Posting Whiz

Hey there,
I need help with writing a query so I figured I'd ask here. Let me thank you in advance for your answer.

I need to see how often a value inside a certain column appears in a table. Say for example I have a table Person, that has a field name.

I want to know top five most frequently occuring names, along with the number indicating how often each appears.

Thank you.

bibiki 18 Posting Whiz

@stultuske,
it is easy to come off wrong when challenging someone, but please do not get me wrong.
I just checked online, and I think publshing a web service actually does make use of a main method.

The following is taken from the book:

public class TimeServerPublisher {
    public static void main(String[ ] args) {
      // 1st argument is the publication URL
      // 2nd argument is an SIB instance
      Endpoint.publish("http://127.0.0.1:9876/ts", new TimeServerImpl());
    }
}

I guess the op needs to java TimeServerPublisher in one cmd instance, and do the rest in another cmd or some other form, perhaps a web interface. Is there anything I am missing?

bibiki 18 Posting Whiz

:( as I was writing the message, I could see the OP frowning upon a little over asumptious message of mine, but I now see I was assuming a little more than I recognized initially. Otherwise, I have gone through the first chapters of the book and I remember I have published services, but I have to admit that I do not remember how the publishing goes.

bibiki 18 Posting Whiz

in cmd you navigate to whatever directory you have your .java files in.

to compile a specific file with name Name.java, in cmd you type the following (without quotes):

"javac Name.java"

to run the program, you type:

"java Name"

however, you need to have your environment variables set well so that your computer knows where javac.exe and java.exe may be found. ALSO, you CANNOT run a java class that does not contain a main method...

to do that, you navigate to ...program files/java/bin and copy that complete path into your "path" environment variable, without deleting its current content (lest you do that like a friend once did :) LOL). there are variations of this, but basically path variable needs to know where java.exe and javac.exe are.

this information is readily available if you search online.

let me know if you need more help.

bibiki 18 Posting Whiz

hey IIM, thank you very much. That worked perfectly fine. I have been trying to do this two days now but I couldn't figure out why it wouldn't work.

thanks again. I'm marking this thread as solved.

bibiki 18 Posting Whiz

hey IIM, thank you very much for your reply.
This is how I am filtering:

String builder hql = new StringBuilder().append("SELECT business FROM ").append(Customer.class.getName())
.append(" WHERE created >=:created");
Query tempQuery = getSessionFactory().getCurrentSession().createQuery(hql.toString()).setParameter("created", new Date(new Date().getTime() - lastDays*1000*3600*24l));
List<Business> businesses = (List<Business>)tempQuery.list();

The error I get is "invalid identifier CREATED". So, I am not using any filter named methods. What do you think?

bibiki 18 Posting Whiz

hey there,
I have two classes with a one-to-many relationship. For ilustration:

public class Customer
{
    Business business;
    Date created;
}

public class Business
{

}

Now, when I do the following:

new StringBuilder().append("SELECT business FROM ").append(Customer.class.getName())

it works perfectly fine. However, when I include filtering based on created field of Customer, the query fails. Although, (SELECT * FROM Customer) with the where clause included works well. Can someone please guide me on what to look for or what is it that I am doing wrong

Thanks in advance.

bibiki 18 Posting Whiz

hey yyzdslr, because you are lazy to copy paste your code and let us know what error you are getting, you gave us links to follow... but we too are lazy to follow the links and copy your code, with line numbers included, and compiling it. at least do that part, and someone will help you. do not transfer your work on to us. waiting for your code and compiler error or what ever it is that tells you that you have a problem, and I'll take a look.

bibiki 18 Posting Whiz

Hey s.o.s,
thank you very much for your response. It is weird how I missed the idea of throwing an exception to see where main is. Thank you for that. This question might not be something extremely practical but now that I know what you explained, I am more confident with experimenting.
Thanks again.

bibiki 18 Posting Whiz

Hello everyone,
I am puzzled... when I run a JUnit test, there is no main method in the class and it still runs. Alo, a java/maven web app does not have a main anywhere. My assumption is that it is hidden somewhere on some class I somehow extend or something. Can someone please explain is it there, and it yes, how to find out where it is?
Thank you in advance

~s.o.s~ commented: Good question +14
bibiki 18 Posting Whiz

rookie mistake. function test() is a javascript function. No wonder Java object out is not available there.

bibiki 18 Posting Whiz

Hey there,

I have a jsp page and a checkbox inside it:

<input type="checkbox" name="some" onchange="test()">Check me</input>

I also have this function:

    function test()
    {
        out.println("checkbox checked status changed");
    }

I want the function test to be invoked every time I check/uncheck my checkbox. It is not working. Since I am not so comfortable with jsp-s, I am not sure if I am using onchange correctly or not, so I do not know if I am actually invoking test() or not... because, if I am invoking test(), then out.println() must not be working.

Anyone please help.

bibiki 18 Posting Whiz

thank you both very much. I'm using pritaeas' code and certainly reading the info Lucaci andrew posted.

thanks again.

bibiki 18 Posting Whiz

Hey there, I need help with a query. The typical situation is like this:

I expect, say, 1000 rows out of a query that is based, say, on lastName column. One column is, say, firstName. I know I only have like twenty unique names that occur on multiple rows. I need to retrieve the five most frequent firstName-s in the 1000 row query result. can someone please guide me with this?

SELECT firstName FROM someTable WHERE lastName [meets some criteria] _______(what would allow me to retrieve the five most frequent firstName-s)

Any help greatly appreciated.

bibiki 18 Posting Whiz

you sound like you have problems accessing the files no matter where you place them, and not with where exactely to put them. I do not know about netbeans... but if you are having difficulties with accessing your files, first thing that comes to mind is that you have paths hard coded and that inside quotes, your backsalsh are very likely not correctly typed in.... they should be doubled... example:
"c:\mycomp\myfolder\myfile...." <-- see, double slashes :)

bibiki 18 Posting Whiz

alright, I have been aware of private, protected, and public access modifiers but just this week I discovered that there is also the default access modifier in Java. In case none of the three p-- modifiers is mentioned in a method header or field declaration, they seem to have the default access modifier. My idea is that one should be aware of it but that it is not very necessary to use. Rather, a coder should always specify one of the p- modifiers for every method/field. or am I wrong? If yes, could anyone give me some idea why one would want to use a default modifier?