Code that loads code at runtime for execution

learn more… | top users | synonyms

4
votes
3answers
517 views

Eval is evil: Dynamic method calls from named regex groups in Python 3

I'm working on a simple dice roller for a Python IRC bot. The particular game this roller is for uses six different kinds of dice, which I've defined using a simple base class, and created six ...
1
vote
0answers
24 views

Slim 3 - loading middlewares dynamically

Recently I started playing a bit with Slim and what is making me confused is a necessity of container and middlewares hard coding. As because I am a staunch supporter of a dynamic loading I decided to ...
3
votes
1answer
45 views

Autoloader class for PHP

I created a class that I plan on using to autoload my project classes (20-30 classes) maximum. I wonder if there is anything, anything at all, that I can improve on this class to improve it any ...
3
votes
1answer
59 views

Reverse Polish notation calculator similar to dc on Unix/Linux systems using dynamic libraries

This problem is using dynamic libraries so that additional calculator functions can be added by dropping a library into a specific directory. What I'd like to get out of this code review is: What ...
3
votes
2answers
403 views

Python exception handler to recommend package

Consider this python 3 snippet, where when an import exception is raised, a string 'e' is created that says: "No module named ' packageName'". The goal is to simply say on exit, that the import error ...
8
votes
1answer
67 views

Implementing Multi-File Programs in Vitsy

I'm the proud owner of the Vitsy programming language, which I've been working on for some time (except recently, because high school). It's only been used in PPCG so far, but I hope to expand it to ...
5
votes
1answer
61 views

Loading DLLs to produce reports

My application relies on an unknown number of DLLs that each produce a report. The only thing that is known in advance is the location of the files and the classes that each will contain, including ...
3
votes
1answer
76 views

JavaScript Script/CSS Loader Plugin

I wrote a basic JavaScript plugin that allows you to specify what specific JavaScript files and CSS files to be loaded in, and in addition specify attributes for each file. To specify where to load ...
4
votes
1answer
35 views

Memory mapped classpath HttpServlet

I have a single page application where the resources sit on the classpath. Any request for a resource that doesn't exist should redirect to the index.html page. ...
0
votes
0answers
89 views

PHP autoload class design for a framework

I'm developing a php framework called Stack. I just created the autoload.php as follows. ...
3
votes
1answer
81 views

Simple Python plugin loader

I have written a simple system to load plugins from files in Python 2.7, and I'd like to see if any of it can be improved upon. vedo.py ...
10
votes
4answers
231 views

ASCII art generator in C

I have written an ASCII art generator library. I was practicing data abstraction and code abstraction and I wanted to know if there is something that can be improved. File tree: ...
3
votes
1answer
3k views

HTML and JS to dynamically load, refresh, and execute JavaScript from external file

The following code is designed to load and refresh JavaScript code from an external file sandbox.js and allow it to be refreshed dynamically and executed without ...
3
votes
1answer
81 views

Filter, Validate, and Generate Redbean models programmatically

A while ago, I wrote my first Composer Package. The purpose is to completely avoid the tedious work of filtering and validating user input then constructing the model. I have questions about multiple ...
2
votes
2answers
377 views

MVC controller / PHP request dispatcher

After getting the requested controller from the URI request, it checks whether this exists and whether the requested method (default index) exists within that controller, then calls them. My ...
2
votes
1answer
126 views

PHP include page index.php?page=GET safety preg_replace

I found a lot of working codes to include page in page on Internet but I could not find a safe code. So I decided to create one myself. The pages will be only stored in folder /pages/ and whitelist ...
11
votes
2answers
126 views

Test runner for Scala problems

I'm learning Scala and could use another set of eyes on the code below. I'm creating a test runner for the 99 scala problems set. I figure between actually solving the problems and working through the ...
3
votes
2answers
2k views

List all classes in a package directory

I have a package directory pkg with several classes that I would like to build into a convenient dict property. The structure ...
6
votes
3answers
524 views

I command thee: do SOMETHING

I am currenly contributing to a Chat-Bot to be used across the whole SE-Network's chat which is implemented in Java 8. This bot is supposed to have commands. These commands again are supposed to be ...
2
votes
3answers
188 views

Just require a file, or check if_readable first?

I'm writing a simple front controller, index.php is the main file. In my index.php, first thing loaded is ...
5
votes
2answers
438 views

Function autoloading in bash

I'm wondering if anyone can code review my code below. That's the core code of my little framework for bash in GitHub. ...
2
votes
1answer
3k views

JavaScript modules loading with eval()

I recently asked to use eval() for a module function. Now I ended up doing a very weird function which does what I want. I like the idea I made it but I'm not so ...
2
votes
1answer
234 views

Generated code proxy

In my library Transfuse I use a code generator to build a handful of classes that look up resources. Each of these look up classes are proxied by a static utility class so they may be referenced ...
5
votes
1answer
5k views

Loading JavaScript files asynchronously

I need to get some scripts from the different social networking site and cache them. I want the function to be asynchronous, and non-blocking. I have settled with a script, but I am not really sure ...