Search This Blog

Saturday, February 19, 2011

Limit MongoDB database size?

Programmer Question

We're interested in deploying MongoDB, but we need to know if we can limit database/table sizes?



For example:



db.user1.find()
db.user2.find()



As you can see from the above, each user will have their own database. We want to limit each user's database so we don't have any one user eating up all our hard drive space.



Is this possible with MongoDB?



Thanks.



Find the answer here

PHP: include() bug, or user error? (Passed filename in IF statement)

Programmer Question

Alright so I've already created a PHP bug about this but it was marked as bogus, but I can't help but to believe they didn't read it carefully...



Link to Bug #54042



The error is caused by using an include() statement in an IF statement, making the statement believe it's been passed an empty string.



Reviewing the bug will explain everything, including a test script.



Is it a bug, or am I missing something "feature"-wise? This is weird seeing as how assigning the output of include to a variable and then testing that value works just fine (which would be the workaround).



Any insight?



Find the answer here

Thursday, February 17, 2011

Sparse array support in HDF5

Programmer Question

Hi,



I need to store a 512^3 array on disk in some way and I'm currently using HDF5. Since the array is sparse a lot of disk space gets wasted.



Does HDF5 provide any support for sparse array ?



Find the answer here

Tuesday, February 15, 2011

Custom Post Types on Category Pages

Programmer Question

Hi!



I am using this bit of code to make custom post typess show on my category pages:





Is there a way I can modify this code to include it into functions.php instead of category.php and achieve the same effect?



Thanks!



Find the answer here

Sunday, February 13, 2011

Does PowerShell have something similar to the Perl abbrev() function

Programmer Question

So in Perl, there is a function call abbrev() that given a list of keywords, returns a hash mapping all the minimally abbreviations to their keyword:



@keywords = {"this", "and", "that"}
%AbbevList = abbrev(@keywords);


This would return a Hash like this:



thi => "this"
this => "this"
tha => "that"
that => "that"
a => "and"
an => "and"
and => "and"


In Perl, this allowed me to take user abbreviations for my keywords and easily map them correctly to the "real" keyword as long as the user's input was minimally unique.



Does PowerShell have anything similar?



Find the answer here

How to do this with routing in Rails?

Programmer Question

Say we have a simple resource called news:



resources :news


The generated paths are in this form /news/:id. I would like to provide a shortcut for this by dropping the /news/, so that /1/ goes to news#show with id 1 and the same for all the other resourceful actions of news.



I figured it's probably something along the lines of



match '/:id(/:action)', :controller => 'news'


but this isn't working.



Find the answer here

Saturday, February 12, 2011

Konntent.com codeigniter htaccess

Programmer Question

Please i need help with my application hosted at kontent.com that runs on Codeigniter. I get a No input file specified message and cant get it working



Find the answer here
Related Posts with Thumbnails