I've created an sqlite3 database from the command line and inserted several records. My app retrieves all of them and shows them just fine. I then go back and insert a few more records via the sqlite3 cli, erase the db file out of the simulator's documents directory so that it will be recopied from the main bundle, and the run the app ...
Hey guys,
This is my two model relationship.
team has_many groups
group belongs_to team
I have a sweeper that runs in my group model.
In my Team controller I have this in the after_create callback.
def after_create
self.groups.create(:name => DEFAULT_GROUP, :active => true, :description => "Parent group")
end
I am getting error...
I am currently using memcached with my java app, and overall it's working great.
The features of memcached that are most important to me are:
it's fast, since reads and writes are in-memory and don't touch the disk
it's just a key/value store (since that's all my app needs)
it's distributed
it uses memory efficiently by having each ob...
I am writing a fairly complex PHP applications where a single user action can trigger changes in many other sub-systems, and I'm contemplating using an observer pattern. However, I am wondering if I have to re-create all the objects involved.
Is it possible to while serializing objects to store their relationships? For example
$equipm...
I am working on a project in which we need to define agencies in other cities. We have the same application but separate database schema for each agency. I used one session factory. For each request we get the person's username and therefore we can recognize which agency they belongs to. We change the PostgreSQL search_path for that....
Hello there,
I am using memcached in production on a high traffic website and have only just switched to using Rails.
I am using Rails 2.3.2.
My question is: Is caching of of queries done automatically with this version of Rails? Or do I have to explicitly cache these queries?
I have seen conflicting documentation on this issue, and...
From Wikipedia:
The main disadvantages are greater
overall space usage and slower
indexing, both of which become more
severe as the tree structure becomes
larger and deeper. However, many
practical applications of indexing
involve only iteration over the
string, which remains fast as long as
the leaf nodes are large e...
Hi all,
What does VaryByParam do on an asp.net directive? I have tried looking on the web, but can't actually understand what it does.
Thanks
...
i'm searching for a good java script in-memory cache lib to cache client side calculation results.
My requirements:
works in Internet Explorer, FireFox, Safari, Opera, Chrome, others a plus
stable
mature
small
fast
cache strategies should be configurable
several caches in one page, each with different eviciton strategy
LFU, LRU a plus...
I'm writing a routine to flush the PowerPC750 data cache before turning it off when using write back mode.
I've found the IBM application note on programming the caches which includes a flush routine, but I am confused by the example code. I think it might be a mistake in the example but thought I'd check. In Listing 2 there are two loo...
Is there a plugin or method for performing selective caching in firefox? I can disable caching entirely, but I'd like to be able to still cache some large javascript libraries (extjs) which take several seconds to load.
...
Im doing a database class in PHP and I want to make cache of the result of the querys in a associative array, My idea is to use the sql statment as the index of the cache array, its could be a good idea? or should I use a md5 from the sql?
class DB{
const HOST = 'localhost'; //Your Database Host!
const USER = 'user'; //Your Database Use...
I would like to clear my frontend application's cache from an action in my backend application.
How can I achieve this?
...
I'm tinkering with adding a model layer to an iPhone application so that I can serialize/prioritize HTTP requests and selectively cache responses. Thanks to UIWebViewDelegate, the following method makes this fairly straight forward (in theory):
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navi...
I'm experiencing an issue where the ASP.NET Cache objects are cleared out every minute or so. The proper behavior is that the cache objects should last 24 hours. This issue started recently when our public web servers were recently upgraded from IIS 5 to IIS 6. The site in question gets about 15,000 page views/hour during peak times. Th...
I'm very new to multi-threading and for some reason this class is giving me more trouble than it should.
I am setting up a dictionary in the ASP.net cache - It will be frequently queried for individual objects, enumerated occasionally, and written extremely infrequently. I'll note that the dictionary data is almost never changed, I'm pl...
For some reason, the "Create content" menu item was displaying for Anon, even though there was nothing in that tree or at that path. (Anon can only create a certain type of content, but that has been moved to its own top-level navigation item.)
To solve this, I used hook_menu_alter():
/**
* Remove "create content" from the menu if the...
I am currently getting images from the 'Documents' directory (using -imageWithContentsOfFile:) with no problems except that I cannot get the images to display immediately (for example as soon as touchesEnded was called). I am assuming that this has to do with image caching and that image objects created in the above way are not cached? S...
Below I call the same methods in author and w5 model objects. But one of them raises an error:
>>> author = models.Author('ali')
>>> author.article_set.count()
---------------------------------------------
ValueError: invalid literal for int() with base 10: 'ali'
>>> w5 = models.Author(name='w5')
>>> w5.article_set.count()
0
Actually...
I've written an application that logs trace data from an embedded system via UDP. Currently I receive datagrams and parse out the variable length records and store them in a list. The front end can access the list and present the data (graphs and text lists etc).
The problem I'm running into is that sometimes I need to log an exceptiona...