I have made a javascript equivalent, compose your mazes and get them solved. P.S. don't try to put more than 3-4 cars! the algorithm is not optimized yet.
did u know that 34136029 is a prime number?!! well.. that's what i recently realized :) I thought of writing a piece of code for that purpose.. wondering how far i can get. The idea of the code is simple We know that 2 and 3 are prime numbers the code checks every following odd numbers to be prime or not. To verify a prime number, the number divisibility by the prime numbers generated so far is checked. (29 is a prime number.. because it id not divisible by 2, 3, 5, 7, 11, 13, 17, 19 nor 23) We only need to verify divisibility against the numbers smaller than or equal to the root of the number in hand. (We needn't check the divisibility of 33 with 11, as we already must have found out it is divisible by 3).. I did not want to go with the mathematical root evaluation as i am not sure about its load. I used bits handling instead. the root of a number uses at most half of the number of bits that the original number uses. i only made a naive java implementation so far. downloa
I couldn't find a clear quick intro on getting siege and bombard in action, so I'm writing one here. Siege is a load testing and benchmarking utility that has been available for quite a while, It allows you to hit your web application on a specific url (or a set of urls in a file) with specific concurrency and size settings. siege summarizes the measures of the test outcome including: Transaction rate (requests/sec) Actual concurrency (even if you hit with 200 concurrent connections, your server might be responding with just 80) Average, longest and shortest response time example: triggering 200 concurrent users, each hitting the url twice siege -c200 -r2 http://www.modsaid.com/ summary: Transactions: 400 hits Availability: 100.00 % Elapsed time: 38.44 secs Data transferred: 0.26 MB Response time: 10.09 secs Transaction rate: 10.41 trans/sec Throughput: 0.01 MB/sec Conc
In one of my Rails projects at eSpace , i had a Many to Many association between two models. this allowed me to look more deeply into the has_and_belongs_to_many association. When you say: class Question < ActiveRecord::Base has_and_belongs_to_many :surveys end class Survey < ActiveRecord::Base has_and_belongs_to_many :questions end Rails will assume there is a table questions_surveys that include foreign keys to the two entities. So this table should be created by the following migration create_table :questions_surveys,:id => false do |t| t.integer :question_id, :null => false t.integer :survey_id, :null => false end :id=>false will prevent the creation of the default primary key for that table.This is very important for has_and_belongs_to_many associations. as the API documentation say; other attributes in thatrelation will be loaded with the objects and will be read only, including the :id. So failing to disable the id generationfor that table w
Comments
http://code.google.com/p/mansheya-parking-lot/