Hello. I have read some info about DSL. But what is it good for? What are situations, where using of DSL is better than another approaches?
And how widespread is using of DSL?
Hi gurus
how can I get Collection of specific Class?
I use inheriance: On Planet live Human. Humans are dividing to Men and Women.
class Planet{
String name
static hasMany = [ humans : Human ]
}
class Human{
String name
static belongsTo = [Planet]
}
class Man extends Human{
int countOfCar
}
class Woman extends Human{
int coutOfChildren
}
now a neet to get only Collection of Man or Collection of Woman:
get all humans on planet is simple
all = Planet.get(1).humans
but what can I get only woman or men?
womenLivedOnMars = Planet.get(1).getOnlyWoman
menLivedOnJupiter = Planet.get(2).getOnlyMan
Thanks for your help
Tom
Hi all,
Context:
Considering below defined Engine class being parameter of some webservice method. As we have both server and client in java we may have some benefits (???) in sharing Engine class between server and client ( i.e we may put in a common jar file to be added to both client and server classpath )
Some benefits would be :
we keep specific operations like 'brushEngine' in same place
build is faster as we do not need in our case to generate java code for client classes but to use them from the server build)
if we later change server implementation for 'brushEngine' this is reflected automatically in client .
Questions:
How to share below detailed Engine class using java 6 tools ( i.e wsimport , wsgen etc )?
Is there other tools for java that can achieve this sharing ?
Is sharing a case that java 6 web services support is missing ?
Can this case be reduced to other web service usage patterns?
Thanks.
Code:
public class Engine {
private String engineData;
public String getData(){
return data;
}
public setData(String value){
this.data = value;
}
public void brushEngine(){
engineData = "BrushedEngine"+engineData;
}
}
There is a bug in Grails preventing me from using removeFrom* when the node I'm trying to remove is extending the collection type. Removing the node directly from the association won't update the second level cache.
A hasMany B
Is there any way to manually invalidate or force a reload on an association cache? Invoking refresh() on the many side didn't do the trick.
I rented some server space from a new host and have a static IP address and a domain name that I previously purchased, but I do not know how to register the domain name to point to my server.
My previous host did this for me, but my new host only offers hardware, i.e. they won't do it for me.
How can I register a domain name I own to point to my server's IP address?
I've seen various Grails plugins which allow easier handling of file uploads, however these tend only to support a single file per form-submit.
I'd like a multi-attach form where as soon as you pick one file, an extra field and button is added using JS (various sites do it like this).
Do you know of any good plugins which provide elegant uploading of multiple files without excessive coding? A progress bar either per-file of for the whole process would also be very nice.
I don't know to what extent I can allow GORM to handle a java.io.File field (or in this case a Collection<File>).
Hi All
I've been searching all over the internet for days.
Does anybody have, or know of, and can share sample Feature Driven Development documents? I keep coming across gazillions of "samples" with absolutely no useful information whatsoever.
Thank you
jt
I have multiple swimlanes on the surface, Is it possible to have expand / collapse functionality to these swimlanes?. My swimlanes are going to contain different shapes (Image Shapes), Geometry shape etc.
I have tried the nesting of a geometry shpes but it only contains the geometry shapes not image shapes i.e. I have already created a Geometry shape with it's type as a RectangleD and by writing its partial class I have overridden the Expand() and Collapse() methods but to no avail because this particular Shape (Container) going to contain only Geometry shapes and not the Image shapes.
Now I am trying to expand / collapse the swimlanes itself. Please let me know if anyone has done this before.
I am trying to build a CMS using ERB. Is there a way you can give ERB code read-only access to your models? For instance, I want to be able to load any information on my models (Model.all, Model.find_by_slug, Model.find_by_name, Model.other_model.name, etc...), but I don't want to be able to change this data. Can you disable ERB from executing commands that would make database changes (Model.save, Model.update, Model.delete, Model.destroy, etc.)???
I'm reviewing some apache logs, specifically with respect to downloaded files. I'm interested in knowing, if possible, which domain is responsible for the download, given an IP address.
I've given nslookup a try and it seems to (mostly) get the job done but it returns all sorts of extraneous information. Ideally, I pass in an IP and receive a domain back.
Before I write a shell script to parse the output of nslookup to capture the domain, I'd like to know if this is the best way of approaching this problem, or if there is a more tried-and-true method of doing this.
Specifically, I'd like to know if an address resolves to an amazonaws.com domain. I understand that this might be difficult because EC2 machines are dynamically created and destroyed - I'd like to know if the IP addresses for AWS/EC2/EMR machines fit any sort of addressing pattern.
I would like to check that I get not more than 3 relations set on a manytomanyfield.
I tried on the clean method to do this :
if self.tags.count()>3:
raise ValidationError(_(u'You cannot add more than 3 tags'))
But self.tags returns not the current updates... only saved objects.
Do you have an idea to access to them ?
Thanks
One of my django models has a large TextField which I often don't need to use. Is there a way to tell django to "lazy-load" this field? i.e. not to bother pulling it from the database unless I explicitly ask for it. I'm wasting a lot of memory and bandwidth pulling this TextField into python every time I refer to these objects.
The alternative would be to create a new table for the contents of this field, but I'd rather avoid that complexity if I can.
Hi,
I am integrating Paypal into my application for in-app purchase.
I am using Paypal Mobile Checkout for this purpose.
I will like to know whether Android Market will approve this kind of application which uses a payment gateway other than Google Checkout.
Can anyone let me know where I can find information related to this?
Thanks & Regards
Sunil
Is there a way to obtain the stored value, that is, the one in the database once the instance has been modified?
The problem I'm trying to solve is get the stored slug of an object that failed to save to be able to regenerate the URL.
Hey there.
I am very unfamiliar with nginx, as a forewarning, and also can't find any actual references on the regex system they use. So right now it's a black box to me.
All I want to do is redirect a user trying to go to www.mydomain.com/mydirectory/X to www.myotherdomain.com/X .
Seems like I should be using the rewrite command but the syntax of the regex is eluding me.
Thanks in advance.
If I'm right, each request for http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.js
use something like 3 kb of microsoft.com cookies. I don't understand something and it doesn't matter or microsoft do it wrong?
I'm a little new to rails sorry if this seems basic
Alright so here's the deal I'm creating an application that will have many users and all the users have many songs. However when I try to create a song I get the following error:No action responded to 1. Actions: create and new and my browser is at the url: http://0.0.0.0:3000/users/1/songs which is not the correct route it should have redirected to songs/create
Here is my controller code:
class SongsController < ApplicationController
def index
@user = current_user
@songs = @user.songs
end
def new
@user = current_user
@song = @user.songs.build
end
def create
@user = current_user
@song = @user.songs.build(params[:song])
if @song.save
redirect_to user_song_url(@user, @song)
else
render :action => "new"
end
end
end
If anyone can help I would greatly appreciate it.
Greetings
On all my controllers I recycle the same code that wraps my models and to accesses the service layer -- and I'm tired for copy / pasting it into each controller:
private IProjectService _service;
public New()
{
_service = new ProjectService(new ModelValidation(this.ModelState));
}
public New(IProjectService service)
{
_service = service;
}
Is there someplace where I can place this where all my controllers access it?
Is it possible to rewrite somehow www.mysite.com/Pictures to point to test.mysite.com/Pictures
or even more broadly www.someothersite.com/Pictures ?
Note: www.mysite.com and test.mysite.com are on separate machines and built with different technologies (one is ASP.NET and the other is PHP) but I have access to both of them.
I want that when I reference a picture like www.mysite.com/Pictures/pic12345.png the picture to display correctly, even though there is not /Pictures folder on that server and the pictures has to be retrieved by going to test.mysite.com/Picture/pic12345.png
Ideally I want to do this in IIS6 to test it. However I am interested if it possible to do in any webserver (Apache, IIS7)
Is there a way to disable the PHP setting safe_mode in a client or domain template in Plesk 8.6? Or, to disable it for new domain creation in some other Plesk setting/configuration?
I've Googled, and people seem to think no
I've asked our hosting provider, and they don't think so
I've looked in both the domain and client templates in Plesk and don't see it
Has anyone been able to do this Plesk 8.6 for new domains?
I am getting a lot of incoming requests with this structure:
//domain_name/cache/22092e9b25c40809dfb94b6179166b26.
I am running a .NET 4.0 website served from IIS 7.5. A lot of these URLs have no referrer URLs and come in randomly with a different 32 digit alphanumeric key. And I do not have any resource like '.../cache/...' on my website.
I just want to eliminate such requests and want to understand where these are coming from at all. Any help would be appreciated.
Hello!
Is there a source, which I could use to learn some of the most used and popular practices regarding Actor-/Agent-oriented programming. My primary concern is about parallelism and distribution limited to the mentioned scheme - Actors, message passing.
Should I begin with Erlang documentation or maybe there is any kind of book that describes the most important building blocks when programming Actor-oriented?
Thank you!
(Most useful examples would be in Scala or F#)
Hi there,
I have a schema.yml containing something similiar to the following:
Character:
tableName: characters
actAs: { Timestampable: ~ }
columns:
id: { type: integer(4), primary: true, autoincrement: true }
name: { type: string(255), notnull: true, notblank: true, minlength: 3 }
I define the minlength of the column name to be 3. I created a unit test to test the minlength validation, and I found out that the validation is not working.
$character = new Character();
$character->set('name', 'Dw');
$t->ok(! $character->isValid()); # This test failed
Can someone tell me what might be the problem here?
Thanks,
Andree
I have two models : User,Project
public class Project{
private int id;
@NotEmpty(message="Project Name can not be empty")
private String name;
private User manager;
private User operator;
//getter/setter omitted
}
public class User{
private int id;
private String name;
//omit other properties and getter/setter
}
Now, when I create a new Project, I will submit the following parameters to ProjectController:
projects?name=jhon&manager.id=1&operator.id=2...
Then I will create a new Project object and insert it to db.
However I have to validate the id of the manager and operator is valid,that's to say I will validate that if there is matched id in the user table.
So I want to know how to implement this kind of validation?