require

SWIG: Ruby overloading problems

风流意气都作罢 提交于 2019-12-25 02:48:07
问题 I have a sinatra web application and a C++ library that I can 'require' in sinatra (ruby) using bindings created by swig. I also have a second -very similar- library, in which the function names are partially the same as in the first one. When I require them both, the one that is loaded first 'wins', i.e. calls to the ambiguous function names are always mapped to this library. The reason is that 'require' does only load stuff that is not already loaded, whereas 'load' reloads no matter what.

Include does nothing

柔情痞子 提交于 2019-12-25 00:34:41
问题 I want to chceck files before I'll connect domain on my server. I've added them in direct admin, I've uploaded files - but I don't know how to get to them. I have 4 domains connected, but i have acces only to one. I saw that it's possible to include file from higher level include('../../panele-podlogowe.eu/adm/img/edit.gif') That gave me correct image. But when I've done: include('../../panele-podlogowe.eu/index.php'); Nothing happens (I've turned Error reporting on). When I did something

What does require really do in php

谁说我不能喝 提交于 2019-12-24 15:56:16
问题 I'm new to PHP and facing a problem when I use require. 'Config.php' is in the parent folder Model contains test, in which 'LaptopModel.php' is. Controller contains the file 'LaptopController.php' in Config.php: <?php $host = "localhost"; $username = "admin"; in LaptopModel.php: <?php require '../../Config.php'; in LaptopController.php: <?php require '../Model/test/LaptopModel.php'; the question is what the code really is in LaptopController.php when the server process this file? I think

Loading ruby source from a zip archive?

泪湿孤枕 提交于 2019-12-24 08:46:12
问题 I have a mod_rails server where disk space, oddly enough, is at a premium. Is there a way for me to compress my application's source, like Python's zipimport? There are obvious disadvantages to this, so I should probably just break down and spend a nickel on disk space, but I figured it'd be worth a shot. 回答1: Oh, this is neat. Check out the rubyzip gem: rubyzip also features the zip/ziprequire.rb module (source) which allows ruby to load ruby modules from zip archives. ( Update : The

PHP require realpath - Failed opening required

你离开我真会死。 提交于 2019-12-24 06:02:42
问题 I am trying to require / include a file by relative path. The paths exist and all rights are checked. The script to be included is readable and can be accessed via URL in browser... However, I am receiving errors/warnings that it failed to open. Both the calling script and the file to be included are on the same server. Caller relative: /devel/phi/dev/appcenter-head/appcenter/application/nm/index.php Caller location: /home/devel/wwwroot/phi/dev/appcenter-head/appcenter/application/nm Require

PHP require realpath - Failed opening required

强颜欢笑 提交于 2019-12-24 06:02:30
问题 I am trying to require / include a file by relative path. The paths exist and all rights are checked. The script to be included is readable and can be accessed via URL in browser... However, I am receiving errors/warnings that it failed to open. Both the calling script and the file to be included are on the same server. Caller relative: /devel/phi/dev/appcenter-head/appcenter/application/nm/index.php Caller location: /home/devel/wwwroot/phi/dev/appcenter-head/appcenter/application/nm Require

PHP: include inside included file

老子叫甜甜 提交于 2019-12-24 05:11:35
问题 I've gotta solve this once and for all. I'm currently working on a 4 years old project, written in PHP and that is run on Apache server. We are a team of about 40 folks and each of us uses the prefered OS, so we have Windows, Macs and Linuxes running this code. I'm among those who prefer Ubuntu. Anyway, everytime I clone this project, I have to modify some portions of code so it'll work in my machine, because of the following old include / require issue: So suppose I have the following files

vue中assets文件夹与static文件夹的区别

£可爱£侵袭症+ 提交于 2019-12-24 03:28:09
1、如果这些产品图片文件“万年不变”,放在 /static 目录里,(不需要使用require将这些图片作为模块来引用) var products = [{ img: '/static/img/products/1.png', name: 'Product 1' }, { img: '/static/img/products/2.png', name: 'Product 2' }, { img: '/static/img/products/3.png', name: 'Product 3' }, { img: '/static/img/products/4.png', name: 'Product 4' }] 2、Vue实例数据的数组中只会保存图片文件路径,通过webpack打包不会将图片拷贝到dist目录中,所以本着模块化的思想下,应该用require来引用 var products = [{ img: require('@/assets/products/1.png'), name: 'Product 1' }, { img: require('@/assets/products/2.png'), name: 'Product 2' }, { img: require('@/assets/products/3.png'), name: 'Product 3' }, { img:

Relative paths in PHP not working on server [closed]

走远了吗. 提交于 2019-12-24 00:59:59
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 months ago . Background info: I've been developing a self hosted Facebook app on my own server (localhost) and have everything all working. Recently, I uploaded my files to my shared hosting online server (hostgator) and an odd bug popped up. My require_once() functions seem to ignore relative paths on the hostgator server.

Using inline require

牧云@^-^@ 提交于 2019-12-24 00:34:03
问题 If I use an inline require, like this: function something(...paths) { return require('path').join(...paths); } something('etc', 'etc'); Would the engine require in every call? Example: let i = 10; while (--i) something(i, 'etc'); Thank you. 回答1: The system will call require() each time through your loop, but modules loaded with require() are cached and the module loading code is only run the first time the module is loaded. So, while there is a slight bit of extra overhead calling require(