|
I am trying to populate a nested field, product_name, it an Item.
In my Item model:
class Item < ActiveRecord::Base attr_writer :product_name belongs_to :order belongs_to :product def product_name #Product.find_by_id(self.product_id) #=> returns...
Started by doctororange on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Product.find_by_id(self.product_id).name #=> complains that 'name' is being called on nil.
|
|
I'm trying to execute this:
$ mysql --user=XXX --password=XXX --batch --skip-column-names \ -e "SELECT userid, displayname FROM Users" stackoverflowdb | \ split -l 50 -a 5 - "result."
but bash complains about ) 'unexpected' character (i have this character...
Started by Phil on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Of course, if you require unattended access to the script, that's not a very useful answer... .
Just use -p instead of --password=XXX.
That might solve your error.
If you don't give the password on the command line, it will bring up an interactive prompt .
|
|
Dear All,
I have a program that uses XSL-FO (org.apache.fop.apps.Driver) to generate a PDF print out from an XML file.
I'm working on the Stylesheets (xsl) & I'm trying to make the debugging easier. I have the XML & the XSL file, now I just want my editor...
Started by Vincent on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
What tool are you using? <ATTRVALUE attribute_id="92" attrname="Date Required" attr .
complain.
|
Ask your Facebook Friends
|
Hi,
I am trying to decompress some MMS messages sent to me zipped. The problem is that sometimes it works, and others not. And when it doesnt work, the python zipfile module complains and says that it is a bad zip file. But the zipfile decompresses fine...
Started by Espen Christensen on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
That is, you should use
zippedfile = open('%stemp/tempfile.zip' % settings.MEDIA_ROOT, 'wb+')
You might have to close and reopen the file, or maybe seek to the start... .
You should very probably open the file in binary mode, when writing zipped data into it .
|
|
I have a /domains directory in which I have entries such as
theawesomesite.com 0.2.v.theawesomesite.com 0.3.v.theawesomesite.com
And after testing 0.3, I'll set the main domain to alias the new version. Works really nice. Now, I want to be able to delete...
Started by ironfroggy on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at superuser):
Your suggestion made me think about it searching in the directories after deleting... .
EDIT by Asker: Or, the -prune flag, as I don't care about the contents at all .
Try adding the -depth flag, to process each directory's contents prior to the directory itself .
|
|
I have a nice interface, and I want to implement one member of it in a base class so the clients can derive from the base class and have less boiler-plate to write. However, even though declared abstract, the compiler complains that the class does not...
Started by Anteru on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
TaskDefinitionBase needs to include CreateTask - if you don't want to implement it, just mark the method... .
You must add an abstract stub of the method:
public abstract ITask CreateTask(TaskId id);
Inheritors can then override it to implement the interface .
|
|
I recently moved my Eclipse workspace directory and now Subclipse complains every time I open a file, dumping to the console something like:
Path is not a working copy directory
svn: ' [original (pre-move) directory path] ' is not a working copy
No such...
Started by David Moles on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Alternatively, you may try deleting the .metadata directory and....
Did you move the whole workspace or just the content?
Also, you can try creating new workspace from scratch and check out the whole project again .
Hard to say without further information.
|
|
I'm using ubuntu 9.10 and I installed java and tomcat using the package manager. When I went to run startup.sh, it first complains about catalina.out not being there and not being writable. I fixed that and it doesn't complain about that (why isn't that...
Started by DJTripleThreat on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
It contains stuff like what port is the server going to listen at, where are the applications being deployed, and other related stuff... .
Try using server.xml located at:
/etc/tomcat6/server.xml
server.xml is the configuration file for the application server .
|
|
There are already some discussions here on stackoverflow about Java generics, but I am too stupid to solve this specific question. I have defined an interface in a project, and its implementation in another one. They are in different packages. Instead...
Started by wigy on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Maybe, the implementation gets HighlightingStyle from a different....
No solution yet, but a few tips and tests:
Clean all projects in the workspace, this helps sometimes with eclipse based problems Make sure, that you only have on classfile 'HighlightingStyle' .
|
|
Hi there!
Given the following code:
#include <boost/noncopyable.hpp> enum Error { ERR_OK=0 }; struct Filter : private boost::noncopyable { Filter() {} virtual ~Filter() {} virtual int filter(int* data) const = 0; }; struct SpecialFilter : public...
Started by Niels P. on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Problems like this are why I think solutions like boost::non_copyable are a bad idea - there are simpler ways of saying you don't want ... .
Firstly, remove the private derivation from SpecialFilter - it is not necessary, as Filter is already not copyable .
|