Search Results

Search found 6580 results on 264 pages for 'require'.

Page 1/264 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Ruby require fails

    - by Overdose
    I don't get it why. I have foo.rb and test.rb in the same folder. I tried require 'Foo' require 'foo' require 'foo.rb' in test.rb, but whatever it fails with "in `require': no such file to load -- Foo (LoadError)"

    Read the article

  • php require class call from inside method

    - by jera
    from my understanding, require pastes code into the calling php file. what if you were requiring from inside a method...it would paste the entire code/class inside the method, blocking the next statement in the method. eg. function test() { require 'pathtosomeclasscode'; somestatement; // any code after the require is blocked. } how do i get around this, to be able to require code where-ever, without it being pasted in that exact spot? Thanks in advance for your help.

    Read the article

  • PHP require/include only works once in script then fails

    - by Colin
    Hi everybody, this isn't a problem as such but it's bugging me and I would appreciate any help. It might be totally obvious but I can't see it. $root_path = $_SERVER['DOCUMENT_ROOT'] require($root_path .'template/header.php') require($root_path .'template/footer.php') The script will include one or the other but not both. It will run and include the header but not the footer, if I swap them round it will load the footer first but not the header. I've tried using include instead of require but get the same result. It gives the error allow_url_include = 0. I know turning this on will solve it but my question is why is it happening? Why will it include one file but not the other? Is there any way to get them to both run without turning allow_url_include on (I'm trying to be security conscious). I have PHP 5.3 and am running WAMP. Thanks in advance for your help!

    Read the article

  • require wp-load.php 3 directories back

    - by sman591
    I'm trying to include a file (/wp-load.php) at the beginning of the /html/ directory. I'm trying to include it from /wp-content/themes/pw-steel-orange/index-load.php, but I always get the error message Warning: require_once(../wp-load.php) [function.require-once]: failed to open stream: No such file or directory in /nfs/c07/h01/mnt/102799/domains/platyworld.com/html/wp-content/themes/pw-steel-orange/index-load.php on line 1 Fatal error: require_once() [function.require]: Failed opening required '../wp-load.php' (include_path='.:/usr/local/php-5.2.6-1/share/pear') in /nfs/c07/h01/mnt/102799/domains/platyworld.com/html/wp-content/themes/pw-steel-orange/index-load.php on line 1 Am I doing something wrong? I though ../ brings the includes to the beginning directory Sorry if this is a duplicate, I couldn't find something related to this in my searches...

    Read the article

  • PHP - Read number of dirs and then require for each a specified file name

    - by Max
    Hello, I want to make a little script but I'm rather n00b in php so please help me if you can :) What I want the script to do is: I have "index.php". I want "index.php" to read the sub-directories from a known folder, let's say "templates/" Each sub-directory will contain a file called "content.html". The index will then load the "content.html" with the require() function for each of the existing sub-directories. Thank you very much for your help!

    Read the article

  • RAILS_ROOT require?

    - by mportiz08
    I'm trying to access the RAILS_ROOT constant in a file residing in the /lib directory, but I'm not able to (uninitialized constant error). Is there something that I need to require to be able to do this? Sorry if this is a dumb question..

    Read the article

  • PHP: require_once library -> failed to open stream

    - by matt
    I might be a bit confused and may need your help with this. I'm inside inc/newsletter.php and want to include a library that is inside lib/mailchimp-api-class How do I refer to this class file? I thought it should be … require_once '../lib/mailchimp-api-class/MCAPI.class.php'; However, this doesn't work …  Warning: require_once(../lib/mailchimp-api-class/MCAPI.class.php) [function.require- once]: failed to open stream: No such file or directory in /Users/myname/htdocs/wr/ wp-content/themes/mytheme/inc/newsletter.php on line 6

    Read the article

  • php require and autoload

    - by dfilkovi
    I use __autoload to load classes, and I keep getting errors that no class is found but file get's loaded ok. Then if I change something in a file, just something like add a new line and save it, everything works fine and class is then found. But this is a great problem cause there are thousands of files in this project and I don't want to change them one by one. I'm using php 5.3.0 on windows. What could be the problem?

    Read the article

  • PHP include once.

    - by cpburns
    Is it more efficient to use PHP's include_once or require_once instead of using c-like include with a header guard? i.e, VERSUS //contents of init.php if (!defined('MY_INIT_PHP')) { define('MY_INIT_PHP', true); ... } ?

    Read the article

  • Sql Server Prevent Saving Changes That Require Table to be Re-created

    When working with SQL Server Management studio, if you use the Design view of a table and attempt to make a change that will require the table to be dropped and re-added, you may receive an error message like this one: Saving changes is not permitted.  The changes you have made require the following tables to be dropped and re-created.  You have either made changes to a table that cant be re-created or enabled the option Prevent saving changes that require the table to be re-created. In truth, its quite likely that you didnt enable such an option, despite the error dialogs accusations, as it is enabled by default when you install SQL Management Studio.  You can learn more about the issue in the KB article, Error message when you try to save a table in SQL Server 2008: Saving changes is not permitted. Warning: As the above article states, it is not recommended that you turn off this option (at least not permanently), as it will ensure that you do not accidentally change the schema of a table such that data is lost.  Do so at your peril. The simplest way to bypass this error is to go into Option Designers and uncheck the option Prevent saving changes that require table re-creation.  See the screenshot below. The main reason why you will see this error is if you attempted to do any of the following to the table whose design you are saving: Change the Allow Nulls setting for a column Reorder columns Change any columns data type Add a new column The recommended workaround is to script out the changes to a SQL file and execute them by hand, or to simply write out your own T-SQL to make the changes. Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Cleanest/One-liner way to require all files in directory in Ruby?

    - by viatropos
    When creating gems, I often have a directory structure like this: |--lib |-- helpers.rb `-- helpers |-- helper_a.rb `-- helper_b.rb Inside the helpers.rb, I'm just require-ing the files in the helpers directory. But I have to do things like this: $:.push(File.dirname(__FILE__) + '/helpers') require 'helper_a' require 'helper_b' Is there a way to make that one line so I never have to add to it? I just came up with this real quick: dir = File.join(File.dirname(__FILE__), "helpers") Dir.entries(dir)[2..-1].each { |file| require "#{dir}/#{file[0..-4]}" } But it's two lines and ugly. What's a slick one liner to solve this problem?

    Read the article

  • How do I temporarily change the require path in Ruby ($:)?

    - by John Feminella
    I'm doing some trickery with a bunch of Rake tasks for a complex project, gradually refactoring away some of the complexity in chunks at a time. This has exposed the bizarre web of dependencies left behind by the previous project maintainer. What I'd like to be able to do is to add a specific path in the project to require's list of paths to be searched, aka $:. However, I only want that path to be searched in the context of one particular method. Right now I'm doing something like this: def foo() # Look up old paths, add new special path. paths = $: $: << special_path # Do work ... bar() baz() quux() # Reset. $:.clear $: << paths end def bar() require '...' # If called from within foo(), will also search special_path. ... end This is clearly a monstrous hack. Is there a better way?

    Read the article

  • Require password to login to Nexus 7

    - by gnudoc
    The default behavior in the Nexus 7 Image is to log straight in to the default user's desktop, bypassing the lightdm greeter. This seems like an acceptable behavior for testing the core but it's clearly insecure. I've changed the default password and would like lightdm to actually require the password to be entered, rather than just having a button that says "login". I've turned automatic login on and off in System Settings ? User Accounts but this doesn't help. Any suggestions?

    Read the article

  • OpenSSL installed, but Ruby unable to require it

    - by uomoinverde
    I'm trying to setup github-pages on my Ubuntu laptop, and following the guide provided by Github I have to install the bundler package; giving the command ~$ gem install bundler returns me this error. ERROR: While executing gem ... (Gem::Exception) Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources Then I have installed OpenSSL, launched the command to update software and stuff and tried again to install bundler, but the error kept showing. How can I fix this? Is there any specific command to rebuild ruby making it aware about the fact that openSSL is now installed?

    Read the article

  • What types of programming require practical category theory?

    - by Alexander Gruber
    Category theory has applications in theoretical computer science and obviously is central to abstract mathematics. I have heard that it also has direct practical applications in programming and software development. What type of programming is practical category theory necessary for? What do programmers use category theory to accomplish? Please note my use of "necessary" and "require" in this post. I realize that in some sense most programmers will benefit from having experience in different types of theories, but I am looking for direct applications where the usage of category theory is essential, i.e. if you didn't know category theory, you probably couldn't do it. Also, I'd like to clarify that by "what type of programming," I am hoping less for a broad answer like "functional programming," and more for specific applications like "writing bank software" or "making operating systems."

    Read the article

  • Situations that require protecting files against tampering when stored on a users computer

    - by Joel
    I'm making a 'Pokémon Storage System' with a Client/Server model and as part of that I was thinking of storing an inventory file on the users computer which I do not wish to be edited except by my program. An alternative to this would be to instead to store the inventory file on the server and control it's editing by sending commands to the server but I was wondering if there are any situations which require files to be stored on a users computer where editing would be undesirable and if so how do you protect the files? I was thinking AES with some sort of checksum?

    Read the article

  • Security settings for this service require 'Basic' Authentication

    - by Jake Rutherford
    Had an issue calling WCF service today. The following exception was being thrown when service was called:WebHost failed to process a request. Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/35320229 Exception: System.ServiceModel.ServiceActivationException: The service '/InteliChartVendorCommunication/VendorService.svc' cannot be activated due to an exception during compilation.  The exception message is: Security settings for this service require 'Basic' Authentication but it is not enabled for the IIS application that hosts this service..Ensured Basic authentication was indeed enabled in IIS before getting stumped on what actual issue could be. Turns out it was CustomErrors setting. Value was set to "off" vs "Off". Would have expected different exception from .NET (i.e. web.config parse exception) but it works now either way.

    Read the article

  • Can AdSense crawler view pages that require cookies?

    - by moomoochoo
    Details I require users to agree to terms and conditions before they can view several pages on my site. Once they have agreed a cookie is set and they can proceed to the webpage. If a user somehow manages to end up on the webpage without a cookie they will not be able to access the page's content. My question(s) Is the AdSense crawler able to set the cookie and visit these pages? If yes, how will it know to agree to the TOS? Is there some way to allow it access to the pages even if it couldn't use cookies?

    Read the article

  • Minimum percentage of free physical memory that Linux require for optimal performance

    - by csoto
    Recently, we have been getting questions about this percentage of free physical memory that OS require for optimal performance, mainly applicable to physical compute nodes. Under normal conditions you may see that at the nodes without any application running the OS take (for example) between 24 and 25 GB of memory. The Linux system reports the free memory in a different way, and most of those 25gbs (of the example) are available for user processes. IE: Mem: 99191652k total, 23785732k used, 75405920k free, 173320k buffers The MOS Doc Id. 233753.1 - "Analyzing Data Provided by '/proc/meminfo'" - explains it (section 4 - "Final Remarks"): Free Memory and Used Memory Estimating the resource usage, especially the memory consumption of processes is by far more complicated than it looks like at a first glance. The philosophy is an unused resource is a wasted resource.The kernel therefore will use as much RAM as it can to cache information from your local and remote filesystems/disks. This builds up over time as reads and writes are done on the system trying to keep the data stored in RAM as relevant as possible to the processes that have been running on your system. If there is free RAM available, more caching will be performed and thus more memory 'consumed'. However this doesn't really count as resource usage, since this cached memory is available in case some other process needs it. The cache is reclaimed, not at the time of process exit (you might start up another process soon that needs the same data), but upon demand. That said, focusing more specifically on the percentage question, apart from this memory that OS takes, how much should be the minimum free memory that must be available every node so that they operate normally? The answer is: As a rule of thumb 80% memory utilization is a good threshold, anything bigger than that should be investigated and remedied.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >