Was wondering what kind of software and hardware component cant fail in a rmi program?
so for example in a client server model when a client invokes an object in the server?
thanks
I'm trying to have rails send the contents of my database to an external textfile.
I wanted this done everytime a new user is created.
However, when i try to do the following in my user.rb model file,
before_save :write_data
def write_data()
File.open("data.txt", "w") do |myfile|
myfile.write(User.all)
end
end
It doesn't write the actual contents of the database, instead, it displays something like this
User:0x109858540
Can anyone help? Thanks.
I have a problem with Minitab (a statistics program). When I enter my general model and want to see the results, the program warns me: too few arguments or space missing. Everything seems true, and I can't determine where the problem is. Could anyone help me on this subject?
Hi all!
I need to know the ID of the current user in a model:
def after_save
desc, points=nil, nil
if answer_index == daily_question.correct_answer_index
desc = I18n.t('daily_question.point_log.description.correct')
points=daily_question.points
else
desc = I18n.t('daily_question.point_log.description.incorrect')
end
current_user.give_points(:description => desc,
:points => points
)
end
But I guess that is not how it is done?
Regards,
Jacob
Hi .. I intend to extend the constructors of some of the entities in my Entity Framework (4).
However how do I ensure that my constructor is run after the model has run its.
i.e. I want to ensure that the the object holds the data from the database before I work on it in my constructor.
Is there some way to access the value of a msbuild property from a custom task? I know I can send them all in, but it would be nice not to :) Trying to do this from a tfs build.
Or is there som way to access the "build script" currently running? Maybe like an object model and from there get what I need?
I have the following code:
// Form the continuities list
string[] continuities = new string[] { "10s", "20s", "30s" };
Model.Continuities = new SelectList(continuities, 2 );
I expect "20s" to be selected
How can I do that without creating a new class?
i see after installing the asp.net membership tables, they use the data type "uniqueidentifier" for all of the primary key fields.
I have been using "int" data type and doing increment by one on inserts.
Is there any particular benefits to using the uniqueIdentifier data type compared to my current model of using int and auto increments on new inserts ?
I've seen quite a few examples of MVVM. I can see that the View should reference the ViewModel. I've seen recently an example of a ViewModel referencing a View, which seems wrong to me, as it would result in tighter coupling. Given that ViewModel is often described as an intermediary between the View and the Model, is there more to the ViewModel than a facade to domain objects? I hope I used the term "facade" correctly here.
Am pretty new to ROR. Need help in Rails form validation.
Am using rails 2.3.5
I have a basic validates_presence_of for the fields in the form.
Now when i don't enter field details, i do get an error, but the error is displayed as:
{{count}} errors prohibited this {{model}} from being saved
There were problems with the following fields:
{{attribute}} {{message}}
{{attribute}} {{message}}
Any help will be highly appreciated.
I'm building a RESTful API using Ruby on Rails. My models have a lot of validation happening in them. I'm wondering what is the most "RESTful" way to respond to a user in the event that they make a request that fails on the model layer.
Sending a 4xx HTTP response is the first step. What's the best practice for embedding the error messages inside of XML builder?
I am very new in cake php, i want to know how to create form in cake php,please describe,when we go to create a form then what i have to do,like create model and controller everything
I've a collection in viewmodel binded to listbox. I want to hide a particular type from the collection.
Here is the code:
public ObservableCollection [YZModeModelView] YZModeModelView
{
return this.XModelVIew.YZModelViewCollection;
}
I want to a particular type of model view's from YZModelViewCollection. eg. ModelView's with property abc set to null.
Any suggestions ...
Is it possible to implement the Model-View-Controller pattern in Java for Android? Or is it already implemented through Activities? Or is there a better way to implement the MVC pattern for Android?
I want to use cursor keys or cursor keys with a modifier like
Ctrl to switch between screen buffers (e.g. C-a
[arrow] or C-a C-[arrow]). So far I have tried
settings like the ones below with no success.
bind \224\115 prev
bind \224\116 next
bindkey -d ^[[1;5D prev
bindkey -d ^[[1;5C next
They are either ignored or behave unexpectedly (the second one). I am
also not sure how to specify the keys. To get the characters, I either
used C-v to quote them in bash, or tried to look-up on the
Internet (e.g. http://ascii-table.com/ansi-escape-sequences.php).
Any idea how I can achieve this key binding?
How do you get each item in the ForeignKey field in a list, for example:
class Delegate(models.Model):
excursion = models.ForeignKey(Excursion, limit_choices_to = {'is_activity': False}, related_name='excursion', null=True, blank=True)
Template:
{% for object in formset.excursion_set.all %}
{{ object.lable }}
etc
{% endfor %}
My reason is that I don't want the options to display as a dropdown, but in a custom way that I will style etc.
I'm designing a website and want a good reputation system like they built into StackOverflow.
When I started to design my reputation system, I realized the SO Q/A model doesn't quite fit into my app (since mine is not Q/A), and that perhaps I should do some research first.
So my question is; What should I consider when designing a community rep system?
Is it possible to override methids for db.Model in Google App Engine?
I want to declare beforeSave, afterSave methods, etc.. to create automatic tagging system.
I know there are hooks, but it seems to me a wrong way to solve this issue :)
Thanks!
I'm using ASp.Net MVC and EF 4.3.1.
Using POCO t4 template I'm able to create the POCO classes for my model but not validation.
At the moment I'm using Partial Classes with MetaData for adding the annotation (leaving intact the POCO auto generated).
My question: Could you point me out a tutorial, or show me an example of code or a link to a T4 template the also include automatic VALIDATION for my POCO?
THanks
I'm looking for a good way to disable a JPanel. I'm using a MVC design for a Java Swing GUI. I want the JPanel to be disabled while the model is processing stuff. I've tried setEnabled(false). That disables user input on the JPanel, but I'd like it to be grayed out to add a more visual effect.
Thanks in advance!
I need to write a daemon that supposed to have one TCP socket and one named pipe. Usually if I need to implement a multi IO server with "pure" sockets, the select based multi-IO model is always the one I will choose. so does anyone of you have ever used named pipe in select or you
can just tell me it is impossible. thanks in advance.
Fatal error: Call to a member function result() on a non-object in C:\wamp\www\system\application\models\users_model.php on line 8
<?php
class Users_model extends Model {
function get_records()
{
$query = $this->db->get('users');
return $query->result();
}
}
?>
Am pretty new to ROR. Need help in Rails form validation.
Hey, am using rails 2.3.5
I have a basic validates_presence_of for the fields in the form.
Now when i don't enter field details, i do get an error, but the error is displayed as:
{{count}} errors prohibited this {{model}} from being saved
There were problems with the following fields:
{{attribute}} {{message}}
{{attribute}} {{message}}
Any help will be highly appreciated.
Hi,
On this site I found a lot of cool examples of PHP OOP.
Maybe you know where to find complete examples?
Guest books, registration forms, blog...
When I look at the full model is much easier to understand OOP PHP.
As different classes interacting with each other, exchange data
How to use the generic class for sending data to the database
Thanks
Hi,
is there an easy approach to store my model, which I use with EclipseLink, in XML files?
I want to implement an export functionality in my program and I was wondering if this can be done with eclipselink or with any other framework.
Thanks