w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Installing the correct environment for Angular with Compass and all other Node dependencies
The error is quite clear, a grunt-plugin require that file... /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb Anyway ruby components are needed usually if you plan to use compass, if not, you can comment the "compass" sub-task in the "server" task in Gruntfile.js

Categories : Ruby

Installing setuptools prior to installing python dependencies on Mac
You command attempts to install files into system directories. You must execute the command as root or with sudo: sudo sh setuptools-0.6c11-py2.7.egg You can see this error with the: [Errno 13] Permission denied Edit: If you don't have permissions, you can try installing into your user's Library folder, or look at virtualenv. (See the part about using locally from source.)

Categories : Python

Node js avoid pyramid of doom and memory increases at the same time
Option 1. You can use the cluster module and gracefully kill your workers from time to time (make sure you disconnect() first). You can check process.memoryUsage().rss > 130000000 in the master and kill the workers when they exceed 130MB, for example :) Option 2. NodeJS has the habit of using memory and rarely doing rigorous cleanups. As V8 reaches the maximum memory limit, GC calls are more aggressive. So you could lower the maximum memory a node process can take up by running node --max-stack-size <amount>. I do this when running node on embedded devices (often with less than 64 MB of ram available). Option 3. If you really want to keep the memory low, use weak references where it is possible (anywhere except in long-running calls) https://github.com/TooTallNate/node-weak . This

Categories : Node Js

Override dependencies in a maven plugin (one plugin, different modules and different dependencies)
You can create property for your plugin version, e.g xdoclet.version and use it to override parent version. <properites> <xdoclet.version>1.5-SNAPSHOT</xdoclet.version> </properties> ... <plugin>enter code here <groupId>org.codehaus.mojo</groupId> <artifactId>xdoclet-maven-plugin</artifactId> <version>1.0</version> <dependencies> <dependency> <groupId>xdoclet</groupId> <artifactId>xjavadoc</artifactId> <version>${xdoclet.version}</version> </dependency> </dependencies> ...

Categories : Maven

Sharing dependencies between maven modules
Scope 'import' is for dependencyManagement, that only gives you the versions and default scopes of modules, when you actually use them. If you want to get the dependencies, you don't need to wrap them in dependencyManagement, and just use transitive dependency mechanism. So common/pom.xml should be <project> <modelVersion>4.0.0</modelVersion> <groupId>com.mycompany.app</groupId> <artifactId>common</artifactId> <packaging>pom</packaging> <version>1.0-SNAPSHOT</version> <name>mod1</name> <url>http://maven.apache.org</url> <parent> <groupId>com.mycompany.app</groupId> <artifactId>main</artifactId> <version>1.

Categories : Java

Injecting Dependencies in config() modules - AngularJS
You should use constant for that, because it's the only thing you can inject in the config phase other than providers. angular.module("yourModule").constant("paths", { base: function(){ ... } });

Categories : Javascript

Installing and Importing PHP Modules
You are looking for something like this ... // autoloader function autoloader($class) { $filename = BASE_PATH . '/inc/' . str_replace('\', '/', $class) . '.php'; include_once($filename); } spl_autoload_register('autoloader');

Categories : PHP

Python modules not installing correctly
You are using two different versions of Python? If you are on a Linux machine and probably using new Linux distributions the default python is 2.7.3. Thus, the pip you installed from sudo apt-get install python-pip is for that default python. For your issue, there are two possible solutions: Solution 1: Manually copy packages into site-packages The site-packages are on this directory: /usr/lib/local/python2.7/site-packages Manually copy the module in that directory. Solution 2: Two pips for different python versions Here's a tutorial: How to organize Python modules for PyPI to support 2.x and 3.x

Categories : Python

Installing Basic Python Modules
In Python 3.3, setuptools replaces distribute. Download and install setuptools and you should be good to go. You might also want to consider installing pip after installing setuptools. Follow the directions for setuptools and pip in pypi.

Categories : Python

django installing dependencies from git
Python modules you can install directly from git. For example: pip install -e git+git://github.com/jschrewe/django-genericadmin.git For frontend modules you can use tools like bower. For installing Twitter Bootstrap: bower install bootstrap Both tools has config files, which can be used to track dependencies.

Categories : Python

How do you manage large C++ dependencies in a team environment?
I remember while working for a security company, the team had a script that usually copies all dependencies for you as soon as you hit compile, to a specific folder for you. its in build properties, for an MFC project, however, it was confusing to me at the time. the reference seemed very helpful thank you

Categories : C++

Installing modules on Active Perl 5.6 on Windows
The nice folks at ActiveState give free access to their PPM repositories for folks using their 2 latest releases of perl. Access to their legacy repositories is available for a price. As such your choices seem to be: install nmake & use cpan (may also require a c compiler for some modules) install a relatively modern copy of perl (i.e. free support) shell out cash for an 'enterprise' subscription of ActivePerl and get your stuff via ppm. (Of course even the Activestate folks my not choose to support any software versions that old.) do without any of the above, manually parse the make file & type in the commands yourself.

Categories : Perl

mvn install not installing/embedding dependencies
Maven dependencies are downloaded to the local maven repository, it is usually .m2 directory in your user home directory. Packaging JAR doesn't include any other JARs into the result. If you want to make a web application, use packaging WAR (or EAR). In the WAR file there are your JARs inc. all dependencies included.

Categories : Eclipse

Install Perl modules with lots of dependencies on a machine without CPAN network access
The most efficient way by far is to make a minicpan, install cpanm on the linux machine and alias localcpanmsomething like this: alias localcpanm='cpanm --mirror file:///Users/Shared/cpan/ --mirror-only' I have used this technique on long train journeys with patchy network access with great success.

Categories : Perl

After installing Flask + gunicorn pip has unexpected dependencies
it looks like those are Flask dependencies, (or dependencies of the flask dependencies) pip install --no-install --verbose Flask I was hoping pypi had a list of dependencies for each project, but I didn't see them...

Categories : Python

Setuptools setup.py installing when dependencies not satisfied
The default install command for Distutils setup doesn't know anything about dependencies. If you are running that, you're right that dependencies will not be checked. Just going by what you've show in the setup.py, though, you are using Setuptools for the setup function. The Setuptools install command is declared to run easy_install, which in turn does check and download dependencies. It is possible you are explicitly invoking the Distutils install, by specifying install --single-version-externally-managed.

Categories : Python

Why isn't npm installing dependencies when I have an item inside devDependencies?
dependencies and devDependencies are not arrays; they are maps. https://npmjs.org/doc/json.html#dependencies

Categories : Node Js

How To Require Node Module In Node REPL Without Installing Globally?
Printing undefined is normal behavior for both the browser console and the node repl. Try typing: express. (tab key) - you should get something like this: > var express = require('express'); undefined > express. express.__defineGetter__ express.__defineSetter__ express.__lookupGetter__ express.__lookupSetter__ express.constructor express.hasOwnProperty express.isPrototypeOf express.propertyIsEnumerable express.toLocaleString express.toString express.valueOf express.apply express.arguments express.bind express.call express.caller express.constructor express.length express.name express.toString

Categories : Node Js

Composer not installing laravel 4 dependencies but working for other for eg twig
Perhaps try installing Laravel through Composer instead. composer create-project laravel/laravel This will do everything you need to get a new Laravel project up and running in one line, which I wrote about as a fast install for Laravel 4.

Categories : PHP

Experiment trying to avoid Python circular dependencies
It only "works" with the print statements removed because you're not actually doing anything that depends on the imports. It's still a broken circular import. Either run this in the debugger, or add a print statement after each line, and you'll see what happens: testing.py: from a.m_a import A a.m_a: import b.m_b b.m_b: import a.m_a b.m_b: print a.m_a It's clearly trying to access a.m_a before the module finished importing. (In fact, you can see the rest of a.m_a on the stack in your backtrace.) If you dump out sys.modules at this point, you'll find two partial modules named a and a.m_a, but if you dir(a), there's no m_a there yet. As far as I can tell, the fact that m_a doesn't get added to a until m_a.py finishes evaluating is not documented anywhere in the Python 2.7 documentatio

Categories : Python

installing tomcat and setting environment variables
Go to file --> New --> Other. In that windows, there is an option like Show all wizards. Check that box and then try to find Dynamic web project under Web menu.

Categories : Java

can't setup ruby environment - installing fii gem error
Make sure that you have installed Apple Xcode and Command Line Tools (look at this screenshot): https://developer.apple.com/technologies/tools/ After that, don't forget to install libffi. 1) if you are using homebrew brew install libffi 2) if you are using macport sudo port install libffi

Categories : Ruby

Laravel 4.0 - Php Artisan Serve function not working after installing three public modules
Hi i found solution on this url. http://forums.laravel.io/viewtopic.php?pid=38246#p38246 delete scripts from your composer.json

Categories : PHP

CPU Usage Avoid 100% With Environment.ProcessorCount?
Take a look at SO Question How to get the CPU Usage in C#?. You may also set the priority of the threads as mentioned in SO How to restrict the CPU usage a C# program takes? You may want to review CPU Usage with graphical indication using C# .NET too.

Categories : C#

Spring Data JPA and MySQL: How to avoid "duplicate entry" error in multithreaded environment?
duplicate entry error would occur when two records of the same entity are attempted to be inserted . things to check would be : is the same JPA/Hibernate session shared across the threads doing the updating at time of the error . how is the unique record id generated ? ( myqsl auto-increment ; id generator code . etc ) and if there's an id column does it differ from the actual Primary Key ( the constraint ) of the table .

Categories : Mysql

ECMAScript 6 modules in Node.JS
You can use Continuum, which is an ES6 virtual machine written in (current) JavaScript.

Categories : Javascript

How do I use customized node modules?
Well you can host them @ the npm repository itself. In fact, anyone can and the best thing about it, is that you can just download your own package through npm install <your package name>. To get started, you need to do this like so: Go to your package directory, I see you've already made a package.json file there, so thats good, but its a part of the process. Since you've already made it, I won't elaborate Run this command npm init Fill out the data it wants. One interesting part is the point of entry parameter, make sure you think about it before you put something down. After that, make sure that you have a npm username, if not run npm adduser and go through the process Then you simply npm publish You should not be able to search for your module using the module you named it.

Categories : Javascript

Sandboxing Node.js modules - can it be done?
Okay, so I thought about it some more today, and I think I have a basic strategy: var require = function(module) { throw "Uh-oh, untrusted code tried to load module '" + module + "'"; } var module = null; // use similar strategy for anything else susceptible var loadUntrusted = function() { eval(code); } Essentially, we just use variables in a local scope to hide the Node API from eval'ed code, and run the code. Another point of vulnerability would be objects from the Node API that are passed into untrusted code. If e.g. a buffer was passed to an untrusted object/function, that object/function could work its way up the prototype chain, and replace a key buffer function with its own malicious version. That would make all buffers used for e.g. File IO, or piping system command

Categories : Javascript

Mock node.js modules
I've used mockery with great success, although it can get really tedious depending on what you want to mock. However, your setup seems kinda wacky. If you want to unit test layer 1, you should only need to mock layer 2, and there shouldn't be any (direct) connection between layer 1 and layer 3.

Categories : Javascript

How to avoid uninstalling previously installed ExePackage (redistributables) while installing a WiX Bundle?
Are you using the ExePackage element to install the redist? If so, there is a "Permanent" element that you can set to prevent it from being uninstalled when the bundle is removed.

Categories : Wix

Parallel Flow in Node Modules
async is the de facto module for these kind of tasks, go with it. No, it is not mandatory for those function to be asynchronous. I belive all your questions could be answered with this: http://blog.mixu.net/2011/02/01/understanding-the-node-js-event-loop/, where the following is the important point: Node.js keeps a single thread for your code however, everything runs in parallel except your code.

Categories : Node Js

How to handle modules in an asynchronous app in node.js
var declarations are not scoped to loops, and should be made at the top of file/function var syncer = require('dropsite_server/dbox_sync') , client , websites_to_sync = [] //what is this used for? for (var i = 0; i < users.length; ++i) { if (users[i].access_token !== undefined) { client = dboxApp.client(users[i].access_token) syncer.doSync(client, users[i].website, users[i].access_token.uid); } } The reason the last item gets processed twice is that the doSync function sets module level variables that get overwritten each time you call it. The way to fix this is to pass the variables to the function instead exports.doSync = function (client, website_domain, uid) { sync_data_path = sync_data_path + "_" + uid remote_sync_dirs = website_domain async.series([

Categories : Javascript

Node objects/modules information
GLOBAL is the keyword for global variables. So in your case you can do something like GLOBAL.rooms = rooms; After this is done, in any other parts of the app, you can access the rooms like this var rooms = GLOBAL.rooms;

Categories : Node Js

In node, why do some modules export functions?
One consideration may be the Module module's caching feature. From the docs; my emphasis: Modules are cached after the first time they are loaded. This means (among other things) that every call to require('foo') will get exactly the same object returned, if it would resolve to the same file. Multiple calls to require('foo') may not cause the module code to be executed multiple times. This is an important feature. With it, "partially done" objects can be returned, thus allowing transitive dependencies to be loaded even when they would cause cycles. If you want to have a module execute code multiple times, then export a function, and call that function.

Categories : Node Js

Install node modules error
Umm, it's npm install not node install. node is used to execute a JavaScript file. npm is used to run tasks related to package/module management.

Categories : Javascript

Importing node-modules with TypeScript
TypeScript needs to know that http is present. Follows these two steps Download the node.d.ts file from here : https://github.com/borisyankov/DefinitelyTyped/tree/master/node At the top of your file add: /// <reference path="node.d.ts" /> PS: See a sample test file : https://github.com/borisyankov/DefinitelyTyped/blob/master/node/node-tests.ts

Categories : Node Js

Creating Callbacks for required modules in node.js
Yes, you can have a callback from your module. It's as simple as function funcWithCallback(args, callback){ //do stuff callback(); } While I don't know what you are trying to accomplish, the while loop looks suspicious. You probably should invest in the async package from npm. async on github EDIT: I felt the need to clarify something. While the above function does in fact intend the callback is used instead of the return value, it's not exactly async. The true async approach is to do something like this: function funcWithCallback(args, callback){ process.nextTick(function() { //do stuff callback(); }); } This allows the called function to exit and defers the execution of the logic of that function until the next tick.

Categories : Javascript

Node.js make initialized object available in all modules
The solution, as you suggest is to add the object as a property to the global object. However, I would recommend against doing this and placing the object in its own module that is required from every other module that needs it. You will gain benefits later on in several ways. For one, it is always explicit where this object comes from and where it is initialized. You will never have a situation where you try to use the object before it is initialized (assuming that the module that defines it also initializes it). Also, this will help make your code more testable,

Categories : Javascript

Is there a good way to globally require node modules?
Yes, globals are bad and the programming community at large has embraced avoidance of global variables as a sound practice. If you do this, everyone who ever looks at your code is going to do a massive facepalm immediately. But yes, you can create globals just by omitting the var keyword as your example indicates. Don't Repeat Yourself is about code, not about dependency declaration.

Categories : Node Js

Understanding npm and Node.js install location for modules
I think that the "best practice" here is to keep the dependencies within the project folder. Almostly all Node projects I've seen so far (I'm a Node developer has about 8 months now) do that. You don't need to version control the dependencies. That's how I manage my Node projects: Keep the versions locked in the package.json file, so everyone gets the same working version, or use the npm shrinkwrap command in your project root. Add the node_modules folder to your VCS ignore file (I use git, so mine is .gitignore) Be happy, you're done!

Categories : Node Js



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.