Questions tagged [dynamic-loading]

Code that loads code at runtime for execution

Filter by
Sorted by
Tagged with
4
votes
0answers
28 views

Python automatic import and install script

In the following script, I am trying to infer if the modules are managed by a conda environment or not and based on that, I am trying to auto install and import the modules. [I skipped around 5 to 6 ...
9
votes
4answers
1k views

Skipping over failed imports until they are needed (if ever)

We have a program with many dependencies. Because the user may not want to use all of them, the program should skip over failed imports and only raise an error if absolutely necessary. e.g. if the ...
6
votes
3answers
237 views

Dynamically loading CSS files based on URL or URI in PHP

I have written out the following code in the head section of my document, which should load 3 separate style sheets for each page based on the URL/URI that the user is visiting. It is working as ...
1
vote
1answer
94 views

Importing modules for private use in Python [closed]

There's something I completely dislike when importing a module in an interactive Python shell, typing the name of the module, hitting tab and getting the automatic completion cluttered with other ...
4
votes
1answer
91 views

Making a graph of the import structure of a program

When I read other people's code, it's sometimes difficult to understand the import structure. I thought making a graph of the import structure of a given python program would be a fun programming task,...
2
votes
0answers
61 views

Parse Mach-O binding info

I wrote this C program to open a Mach-O executable/framework and parse the external symbols along with their respective framework/library. A few things I would like to get better at: Memory ...
3
votes
2answers
544 views

PHP Autoloader - For classes, traits and interfaces

Please review my Autoloader, which is the first file included in index.php Note that there is no resource with the same name for trait, interface and class. Each resource has it's own name. And even ...
2
votes
1answer
70 views

Move debug functions to two DLL's

When programming debug functions I am left with 2 options, either put them all within preprocessor blocks so that they don't exist at release runtime, or put them within an if block with a debug flag ...
3
votes
2answers
995 views

C++ DLL Injector

I made a DLL Injector in C++. It provides multiple functionalities. What could be added or improved in the code? It works well as far as I've used it. ...
1
vote
1answer
816 views

Script to load other .js scripts

I made a simple script to load other scripts into the page without worrying about caching. It's meant to be used by a considerable amount of people, so I would like it to be as clean as possible, and ...
10
votes
0answers
211 views

Code to fill PE import address table

I wrote a program to test AV engines against encryption. When it runs, it will compute some key, decrypt an executable it has in its data section and copy it to the locations where the executable ...
0
votes
2answers
165 views

Dynamic loading of Javascript dependency graph

I have JavaScript module for loading dynamically script files by dependency graph: ...
3
votes
1answer
129 views

Google Guice module that loads two kinds of views

The code of my Guice Module looks like this: ...
3
votes
1answer
439 views

Managing dynamic loading of dependent JavaScript files with automatic versioning

I have written a solution for managing dynamic loading of dependent JavaScript files (or executing JS functions) coupled with automatic versioning to refresh browser cache. The goal was to be able to ...
3
votes
1answer
403 views

SAFEARRAY export from a C++ DLL to VBA

My code is not very elegant, but I'm a total newbie in c++ and I consider it already a major achievement that I managed to write something that actually works. As background, I'm defining in VBA the ...
6
votes
4answers
2k views

Importing multiple worksheets

I use the following code to import multiple worksheets from another workbook and do some processing. The importing time is too long. Can anyone suggest a more efficient way to import? Should I be ...
8
votes
0answers
204 views

.NET DLL Injector in C++

I built a DLL Injector with User-Interface. The program lists all processes, the user chooses one of them and a DLL, and inject it. It's my first project in C++, and I know it's not exactly C++ ...
2
votes
1answer
1k views

Recursive autoloader to find PHP files

I created a small working autoloader based on some of the answers and ideas found on Stack Exchange (I lost the reference). However, I don't know much about PHP (I mainly know C, a bit C++ and Java). ...
2
votes
1answer
172 views

Auto loading code

I'm new to PHP and I didn't know there is something called coding style standards. Now I'm trying to stick to PSR coding style standards and after reading PSR-4, which is about autoloading standards. ...
3
votes
1answer
395 views
4
votes
1answer
302 views

“import translate” in a way that works with Python 2 and 3

I'm trying to make my script cross-Python (Python 2 and 3 compatible), and to solve an import problem I did this: __init__.py file ...
1
vote
1answer
208 views

Decoupled chain of responsibility in Python

I've started to learn Python today. I'm trying to write decoupled middleware or chain of responsibility pattern. In my app I have some two classes: abstract class or interface named Processable ...
3
votes
1answer
101 views

Simple import system for a large shell program

I am writing a large shell program comprised of several source files. I was looking for a basic import system that accomplishes three goals. Avoid sourcing entire files for access to just a few ...
3
votes
3answers
120 views

Loading modifications at runtime

I'm working on a game engine among other things in Java, and would like to know how to optimise my code, as it is ridiculously ugly and bloated. I'm terrible with operating the ...
3
votes
1answer
65 views

Method injection into TestClass local namespace for automatic generation of Python unittest “test_xxx” methods

I am writing a series of unit tests in Python 3.5 unittest, which run the exact same test methods on different datasets. The purpose is to validate proper behavior ...
5
votes
3answers
1k 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
125 views

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 ...
3
votes
1answer
89 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
323 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 do ...
3
votes
2answers
438 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
77 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
87 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
188 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
46 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. ...
1
vote
0answers
775 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
611 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
3k 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: ...
4
votes
1answer
47k 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
246 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 ...
5
votes
1answer
1k views

VBA Text import and sort Excel

I have routine tasks which require pulling data from an obsolete SPC package and putting it into Excel. The SPC software will only export into a text file. I have put pieced together a script to ...
3
votes
2answers
2k 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
220 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
156 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 ...
6
votes
2answers
20k 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
531 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
1k 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 ...
6
votes
2answers
2k 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. ...
1
vote
1answer
547 views

Django models: different methods on each instance? [closed]

Imagine I have code like this in (it's about the concept; this is example code): ...
4
votes
1answer
2k views

Dynamically importing Python source modules from a given directory

I'm working on an open-source test framework which needs to dynamically import Python source modules from a given directory. I can't just use ...