similar to: Advice on Optimization, and where to put what?

Displaying 20 results from an estimated 2000 matches similar to: "Advice on Optimization, and where to put what?"

2006 Jan 27
2
User.already_friend_of(friend)?
I have a User model who HBTM Friends (class User). I would like to check for the existance of a user in the friends table before actually adding them (in case they were already added as a friend.) I have a method called already_friend_of?(friend) defined in my User model, but I am not sure how to define this method. I simply want to check to see if one user is already a friend of another user
2006 Jan 06
2
Re: Some advice on DB modeling
I have more or less the same problem. I''m trying to build a system where users can enter their friends. But the solutions seems not to work for me. I used same sql: CREATE TABLE `friends` ( `user_id` int(11) NOT NULL default ''0'', `friend_id` int(11) NOT NULL default ''0'', KEY `user_id` (`user_id`), KEY `friend_id` (`friend_id`),
2007 Jun 23
2
End of File Error on index optmize
I was optimizing a 650MB using ferret (0.11.3) and I received the following error. I''ve seen some people have similar issues but I haven''t seen any resolutions. The contents of the index directory follow the error. Has anyone seen anything like this and found a resolution? Many thanks. /mnt/apps/search/releases/20070622175637/script/../config/../vendor/
2006 May 28
7
Self-referential has_many :through relationship
Hi, I have a self-referential has_many :through relationship setup to track relationships between users. Basically relationships are modeled as a join table with an extra column ''relation''. create table relationships ( user_id integer unsigned not null, friend_id integer unsigned not null, relation char(1) not null, ) --- relations --- f = friend r = request to
2006 May 28
3
Association of table to itself
I''m curious what would be the best way to represent people and whether the person has someone marked as their friend. Here are my thoughts so far: People table - id - name Relationships table - person_id - friend_id Now my problem is I don''t know how to set up these associations (if this is even correct). Friend_id would be an id to someone else from the people table.
2006 Jan 28
1
Switchtower different svn repo urls from my local box and my shared hosting
I got problems running switchtower 0.10.0 when I try to run "rake deploy" from my local box (windows) to my shared hosting If I set the repository to (deploy.rb): set :repository, "file:///home/[my_user]/repo/[my_app]/trunk" My local box (windows) can''t reach the subversion repository located in site5 If I set the repository to: set :repository,
2010 Mar 11
1
Emails Disappearing -- Mystery
I got a case that I haven't been able to resolve. I hope somebody can give me some hints. One of our users is reporting emails disappearing in front of his eyes, (Right ... emails filters at the client side ....) Server does not have global sieve filter enabled (no file present), even though this configuration is present: sieve_global_path=/vmail/globalsieverc User does not have
2006 Jan 27
6
Switchtower deploy error
I''m trying to deploy a rails app with no success. I can execute: ''rake remote_exec ACTION=setup'' but when I try to execute : ''rake deploy'' I got this error: loading configuration c:/ruby/lib/ruby/gems/1.8/gems/switchtower-0.10.0 /lib/switchtower/recipes/standard.rb loading configuration ./config/deploy.rb executing task deploy transaction: start
2008 Apr 07
2
Simple active record issue. I must be missing something.
Here''s a seemingly simple ActiveRecord use case. I have Projects and Users. Each project has a single team leader as well as a review team that consists of several users. I would like to use the same User model for authentication and just reference these users in my Project model. I tried this but got an "unknown column" error (for User.project_id) class Project has_one
2013 Feb 03
1
dsync backup questions
Hi, I'm currently trying to setup remote backups of my emails but i'm running into issues (mdbox format, indexes and storage in the same folder hierarchy). Local backup command: dsync -u "my_user" backup /backups/my_user (1) Recently, I noticed that the local backup takes up twice the size as the original mail location (8gb vs. 4gb). I purged alot of emails from the original
2008 Mar 19
2
rsync fails to exclude... sometimes?
Hello List. I am using rsync to pull html files from a shared drive to 2 web server boxes to keep the files synchronized. However, I have a few files I do not want rsync to copy over because they contain information specific (IP address) to the box hosting them. Rsync seems to intermittently ignore the exclude statement and copies them from time to time. Is there a way to absolutely prevent
2004 Feb 04
2
Problem browsing my unix-client - session setup failed: NT_STATUS _CANT_ACCESS_DOMAIN_INFO
I installed samba 3.0015. I have a problem when I try to browse my machine from a windows client. In effect I am not able to "open" my unix-client. I checked nmbd and smbd and they are running. If I try from my unix-clinet: smbclient -L my_user -W my_domain -L my_PDC I can see shares. If I try from my unix client: smbclient -L my_user -W my_domain -L my_unix_client I get session setup
2005 Aug 09
6
Failed authentication to a mysql database (bug or PEBKAC?)
Hello, I'm trying to setup a mailserver running postfix and dovecot with mysql as database backend. Postfix is already running and delivers mails just fine. Unfortunately, dovecot has great problems connecting to the database (using username + password). If I disable the password, everthing works fine. But, thats harakiri, security wise ;-) I tried dovecot-1.0-stable and the latest
2006 Mar 31
6
Adding objects to a :through association
So I''m one of those nasty people building a self-referential habtm-like Association using the funky new :through stuff. This is about users having friends, so here''s my user.rb: class User < ActiveRecord::Base has_many :friendships, :foreign_key => ''user_id'' has_many :friends, :through => :friendships, :source => :friend end And here''s
2005 Dec 19
4
need some help designing my messaging system
I am trying to create a messaging system for my users but I''m having a hard time designing my db. This is what i have in mind, but I am not sure if its the best approach. user has_one inbox user has_one outbox inbox has_many messages outbox has_many messages inbox table user_id outbox table user_id messages table box_id (refers to either inbox or outbox - how?) from_id to_id
2006 Aug 15
2
How to access attribute in a self-referential many-to-many relationship
Hello List, I created a self-referential many-to-many relationship (as described in the book Rails recipe #18), where I have a model that has many-to-many relationships with itself. In this case, it''s person who can become friends. The join table looks like this: mysql> select * from friends_people; +-----------+-----------+-----------+ | person_id | friend_id | confirmed |
2007 Dec 04
7
REST bug with form_for
Hi all, I am running on Windows XP sp2 with ruby 1.8.6, and rails 1.2.3 I am using REST, and have this in my view <% form_for(:project, :url => project_path(:user_id => @project.my_user, :id => @project), :html => {:method => :put}) do |f| %> The browser correctly gives <form method="post" action="/users/2/projects/1">
2006 Apr 03
1
has_many :trough with 2x the same table
I have a site where Users can become Friends with other Users. I used to do this with a habtm, but of course I want to stay up-to-date and convert this to a has_many :trough. Unfortunately I can''t get it to work.. the documentation on this feature is a bit sparse at the moment. This is my old habtm: has_and_belongs_to_many :friends, :join_table => ''user_friends'',
2008 Jan 23
1
Self-referential HABTM SQL mal-formed when updating record
Guys, Anyone ever had this kind of problem with ActiveScaffold? Cheers, Sazima ------------------------------------------------------------------------------------------------ What steps will reproduce the problem? 1. Create self-referential HABTM application (like the common "user has friends" example) 2. Try to add more than 1 friend to a given user using ActiveScaffold. What is
2015 Aug 25
6
echo password into bash script
Hey guys, I'm trying to echo my password into some commands inside of a bash script. But I think I'm going about it incorrectly. Here's the top part of my script: #!/bin/bash pub="~/.ssh/id_rsa.pub" dps_pass="my_pass" ssh="/usr/bin/ssh" scp="/usr/bin/scp" for i in 10.10.10.2{5,6} do echo "xfring key up" echo $dps_pass | $scp $PUB