-
Gus Shortz
ruby sinatra route modular appfog
I have started writing my Sinatra apps using a modular style, suggested in this stackoverflow answer, and have successfully deployed it on Heroku, but when trying to deploy to AppFog (identical code except for datamapper mysql/postgres gems) I get “Not Found” errors for every route I have defined.== Sinatra/1.3.3 has taken the stage on 47195 for production with backup from Thin myIP, 127.0.0.1 – – [08/Dec/2012 21:28:53] “GET / HTTP/1.0” 404 18 0.0030 myIP, 127.0.0.1 – – [08/Dec/2012 21:28:54] “G
-
Auraomega
c++ windows modular
I think modular is the correct term; to give a basic example if I was to create an encryption application which you could type in like notepad, and then save encrypted, however under the save menu there are options to save for the encryption methods that you have plugins for like AES, Blowfish etc, and also allow new methods to be coded into a plugin and distributed without having to recompile the main application.I’ve found a couple of explanations online but I’m mostly struggling to get my hea
-
Martin
javascript oop instance modular
I have created the PHP side of a modular AJAX/PHP framework and now I am trying to implement the client side.From my previous experience with modular web applications I know that sometimes multiple instances of one particular module are needed. For example, a web based two player game with page parts for each user. On PHP side I have assigned a unque ID to each constructed instance of the module and I can pass this UID to the browser but I have no idea how to implement the Javascript side of thi
-
MartinStettner
codeigniter modular codeigniter-2
I’m trying to implement modular extensions into a codeigniter 2 setup but am having a few problems. I followed the installation instructions on the wiki and everything was working fine. Then I started to play around a bit and try and use it. All I did was create a new module called users with the required folders and added a model class called users_m. I then tried to load this from my welcome module controller. According to the wiki this should be very straightforward. I simply added this line$
-
Geparada
python function modular
I’m learning python and I would like to separate the different processes of my code into different functions. To do that I need to give variables of previous function as a parameter to an other function . I tried some thing like thisdef F1 (A):B=A+1 def F2 (B):C=B+1print C F1(1) F2()For exaple in this case I expect to get 3 as a final result.But It doesn’t work. Thanks for your help!
-
Wintermute
javascript jquery design-patterns modular
I’m trying to write ‘better’ javascript.Below is one pattern I’ve found, and am trying to adopt. However, I’m slightly confused about its use.Say, for example, I’ve got a page called “Jobs”. Any JS functionality on that page would be encapsulated in something like:window.jobs = (function(jobs, $, undefined){return {addNew: function(){// job-adding code}} })(window.jobs|| {}, jQuery);$(function(){$(‘.add_job’).on(‘click’, function(event){event.preventDefault();window.jobs.addNew();}); });As you c
-
Kiril Kirov
c++ c algorithm hash modular
Summary: Is there a way to do that? Here’s what I mean: suppose I have an unsigned int number. Then I multiply it several times(and there’s overflow, which is expected). Then is it possible to “revert” the original value back?In details:It’s all about Rabin-Karp rolling hash. What I need to do is: I have the hash of a long string – for example: “abcd”. Then I have the hash for a shorter substring – for example “cd”. How to calculate the “ab” hash with O(1), using the two given hashes?What I have
-
user1136228
sinatra modular
require ‘sinatra/base’class Foo < Sinatra::Baseget(‘/foo’) { ‘foo’ } endclass Bar < Sinatra::Baseget(‘/bar’) { ‘bar’ } endrun Rack::Cascade, [Foo, Bar]I just can’t guess what is wrong with this code. When I ran: ruby server.rb, it throws an error