w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
How do you set up Webstorm 6.0 to breakpoint debug a nodejs application?
I use webstorm and it's great. Having looked at that documentation, I agree. If you're just starting out, you don't need all the remote and attach to existing processes options. The easiest option would be to rightclick on your main js file and choose debug. Setting breakpoints is the same as in most editors these days, just click left of the line. If you don't get the debug option when you right click then you need to make a run/debug configuration which sounds worse than it is. Select "Run" -> "Edit configurations". Click the plus sign. Choose "Node.js" Click on the browse ... button on the Path to Node App js file and choose the file you want to debug Click Ok. Click on the bug!

Categories : Node Js

WebStorm and PHPStorm debug php and js at same time
Solution: As LazyOne suggested I should use "zero configuration" option inside PhpStorm, complete instructions at jetbrains/... Below is a description of the steps: Install Xdebug (sudo apt-get install php5-xdebug) Add inside /etc/php5/apache2/php.ini the lines: [Xdebug] zend_extension=/usr/lib/php5/20100525+lfs/xdebug.so xdebug.remote_enable=1 xdebug.remote_host=localhost xdebug.remote_port=9000 restart apache: "service apache2 restart" check Xdebug is enabled "php --version" should show "with xDebug vx.x" Toggle the “Listen debugger connections” button., this will listen for incoming connections to the test.php script Set a breakpoint in the test.php source code Activate the xdebug debugger, to do this we need to set a special GET/POST or COOKIE paramete

Categories : PHP

WebStorm debug mode doesn't hit breakpoints
I have the same situation as yours, except that I'm building my app using Backbone.js and RequireJs and the app is running on localhost. My app can run in debug mode in Chrome but the breakpoints cannot be hit. I solve the problem by mapping the Remote URL and my local directory. You can define this in your JavaScript debug configuration profile in the Run->Edit Configurations. You can refer to this wonderful tutorial: Debugging your JavaScript app using WebStorm. Happy debugging!

Categories : Google Chrome

Getting angularJS autcomplete in Webstorm/PHPStorm
If you don't already have angular set up, go to Preferences > Project Settings > Javascript > Libraries and add your version of angular. As for autocomplete in html strings, I don't think that's going to happen with the current version of PHPStorm, but in most other places, it should do the trick.

Categories : Angularjs

Deploying AngularJS Seed application in WebStorm
I use WebStorm 7, so there might be some discrepancy in comparison with version 6 that you're using, but the over-all functionality is the same. Quick solution: Open the file in the editor and right click in the code to access the context menu. Choose the "Debug" option, which should start a debug session pointing to the current page. Configuration solution: WebStorm supports configurations for setting up different debugging scenarios. From the "Run" menu, choose the "Configurations" option. Add a JavaScript debug configuration, and add the URL you want in the designated field within the dialog presented. Then, when you initialize a debugging session (a general one, not one for a specific page), you're presented a small dialog that allows you to choose a debug configuration. Maybe ther

Categories : Angularjs

Why nodejs test case with nodeunit keep loading in webstorm after successfully passed the test cases?
Are you calling done() at the end? For example exports.globalSetterTest = function(test){ var app = require('../helpers/globalsetter'); app.setData("abc"); var res = app.getData(); test.equal(res, "abc", "msg"); test.done(); }; I have the same setup as you and here are some sample tests I wrote. https://github.com/captainchung/webstormNodeUnitTests/blob/master/test/spec.js

Categories : Node Js

AngularJS CORS Issues
You may need to change your Web API a bit. I met the same kind of problem and wrote a post about how to fix this issue. I used Sinatra for the API, I don't know what language you are using for your webservices but I guess you can apply it. Basically, you need to configure your server to accept CORS calls by defining which origins and which HTTP methods are allowed. You said you already enable it on your server, but what did you do exactly ? See this post for more details : CORS with angular.js

Categories : Javascript

cookie disappeared in AngularJS app using Django and CORS
Ok so the answer to this issue is quite simple but not always very easy to notice since there are no error messages from the API, nor the client. The problem above is that I reside on domain.com in my browser, but my request is towards the API is to "www.domain.com:8000". Both www.domain.com and domain.com are allowed origins in my API. Conclusion here is that if I reside on domain.com then I need to make my API request towards domain.com:8000. But if reside on www.domain.com in my browser, then I need to make my API request towards www.domain.com:8000. Se a working example down bellow: Cookies now appear fine! I hope this helps anyone, saving a few hours of frustration :) Update: Enabling the following settings in the Django settings file will also solve the problem. Using them

Categories : Django

CORS file upload for angularjs with IE8 support
angular-file-upload has a solution for old broswers(such as ie8,9), just put those code before "angular-file-upload-shim.js" <script> //optional need to be loaded before angular-file-upload-shim(.min).js FileAPI = { jsPath: '/js/FileAPI.min.js/folder/', staticPath: '/flash/FileAPI.flash.swf/folder/' } </script> you can visit this page on github for more detail.

Categories : Angularjs

How to debug client side dart code in Dart editor without CORS
My understanding is that you can debug, but the real problem is that you don't get the expected data back from the server due to missing cookies. Standard CORS requests do not send or set any cookies by default. In order to include cookies as a part of the request, besides setting up the server, you need to specify withCredentials property, e.g.: HttpRequest.getString(url, withCredentials:true)... You will also need to setup server to provide Access-Control-Allow-Credentials header. EDIT: it seems that additional issue is that you don't want to have 2 servers, each serving different part of app. In that case, you can configure DartEditor to launch the URL, instead of files. Go to Run > Manage Launches and add create a new Dartium or Dart2JS launch with specified URL and source di

Categories : Dart

Why do I fail to debug a nodejs app in Intellij IDEA 11?
I've been noticing that IntelliJ's node.js debugger kinda sucks. It's death by 1000 cuts. I love IntelliJ to death, its such a nice IDE. But for node, the debugger has a million different scenarios where breakpoints don't work properly, and another million where it doesn't properly give you access to the in-scope variable values, and another million where it doesn't step properly... I'm gonna hafta try looking for another tool.. UPDATE 2014-01-13: I've been using IntelliJ's debugger for a while now (having found no other good tool). It seems some of the problems with it are problems with node or v8 itself. Most of the problems I was having have either actually been solved by newer versions of IntelliJ, or by using this workaround: 1. create a file called proxyDebug.js 2. put the follow

Categories : Javascript

AngularJS + Django Rest Framework + CORS ( CSRF Cookie not showing up in client )
Directly from the docs https://docs.djangoproject.com/en/1.7/ref/contrib/csrf/#ajax If your view is not rendering a template containing the csrf_token template tag, Django might not set the CSRF token cookie. This is common in cases where forms are dynamically added to the page. To address this case, Django provides a view decorator which forces setting of the cookie: ensure_csrf_cookie(). Since your application is a single-page application, you can add ensure_csrf_cookie() to the view that is responsible for the initial page load.

Categories : Django

nodejs debug served static content /socket.io on Windows 7/8 32 and 64bit and cloud9
You need to use http.createServer instead of express.createServer var express = require("express"); var http = require("http"); var app = express(); var server = http.createServer(app); var io = require("socket.io").listen(server); server.listen(3000, function () { console.log("listening on port 3000"); });

Categories : Node Js

System.Web.Http.Cors: How to disable CORS request for a Web Api method
For a simple HTTP requests (basically GET and POST with form-url-encoded) the request still executes on the server, but the client is not allowed access to the results. CORS (in this scenario) only indicates back to the browser if the client is allowed to consume the results.

Categories : Asp Net Web Api

using AngularJS html5mode with nodeJS and Express
Your initial fix (declaring static middleware handlers for specific prefixes) should work just fine, but you need to make sure they are declared before any other routes (and app.router, although you don't need to explicitly use it): // these need to go first: app.use("/js", express.static(__dirname + "/../app/js")); app.use("/img", express.static(__dirname + "/../app/img")); app.use("/css", express.static(__dirname + "/../app/css")); app.use("/partials", express.static(__dirname + "/../app/partials")); // any other routes: app.all("/*", ...); Also, you need to make sure that the prefixed static handlers are actually declared okay (correct path), otherwise they won't be able to find any requested files and the requests will pass down the middleware chain and ultimately be handled by the

Categories : Javascript

AngularJS and nodeJs Express: routes and refresh
Try use the specify the templateUrl with the absolute path from the root of the views. For example, suppose you have configured and views is in the public folder app.set('views', __dirname + '/public'); then change the path to the template to /public/page/home.html

Categories : Javascript

Angularjs and Javascript Debug Settings Pattern
Since I don't know the details of your problem, there are 2 possible answers : the easy one and the hard one. Easy : Don't bother the domain. In your service, just declare the suffix of the URI you are trying to reach, and AngularJS will correctly call the service on the domain you're currently running : var URI = "/rest/chapter/"; (...) $http.get(URI).success(...) Hard : If the domain you are trying to reach is not the current one, then you're on the hard path. The problem you are trying to solve is about "dev-ops", the link between developers and "operational" people, often solved on the dev side by rearing what is called "environment variable". There is no straightforward answer for AngularJS, but server-side templating is not a very good option. So if you google around for "en

Categories : Javascript

Authentication mechanisms for a AngularJS/NodeJS/RESTEasy+JBoss/LDAP stack
I suppose you can generate an auth token for a given section in JBoss, the token is: put in a data store accessible to the node server (could be MongoDB, CouchDB, you name it) stored in client's cookie to the node server The node server can then use the token to cross verify if the client has been properly authenticated and protects pages (other then the login page).

Categories : Javascript

cross domain issue with angularjs form post (file upload using ngUpload) and nodejs server
You could use CORS if your browser supports it. Since you want to post data you can't send it as JSONP (which only supports GET requests), but there are some other workarounds you could use instead.

Categories : Javascript

Cannot Debug I/DEBUG(187): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000004
A random position of the crash often happens when the stack is corrupted, so you should look carefully for your local variables. For example, overwriting an array of length N with M or something like this.

Categories : Android

Run nodejs command line module to output in nodejs web server?
you could have 2 node instances. One the http server and the second instance the command line instance to run jasmine. The http server instance would spawn the command line instance. Then you could register a GET route on the http server such as someexample.com/runtests which would call the tests and wait for the tests to finish and respond with the console output. This is sort of unorthodox, but there wouldn't be a direct way to run command line applications through the browser without modifying their source.

Categories : Node Js

Nodejs cron plugin vs running nodejs script from crontab
The main difference between the two methods in my opinion would be the level at which you want to schedule job. When using crontab your jobs are scheduled by the cron daemon that runs on the system. node-cron on the other hand is a pure JavaScript implementation of cron. So system is not responsible for running jobs but your V8 engine which executes it. Jobs will be run as long as your js application runs. So why would you use one or other ? That depends on the purpose of your job, where is it best tethered . If job is a maintenance job for system run it via crontab. If you want to run a function in node.js periodically use node-cron. If you want to run a bash script you would want to use crontab. So how you want to do it via system (bash) or JavaScript is upto you.

Categories : Node Js

Linking Libraries in VxWorks Debug and non Debug Modes
I have the same problem and I solved using a local variable thats generate the vxworks at the makefile called MODE_DIR, that will be replace with "Debug" or "NonDebug" So go to the properties of your RTP >> Build Porperties >> Libraries and then at the path of your librariy, in this case "Example" -L/Lib_output_path/Example/Example/$(MODE_DIR) -lExample

Categories : Debugging

nodejs conflicts with node (re installing nodejs)
You may be able to use my pre-built packages which are available here: https://launchpad.net/~chris-lea/+archive/node.js They install a /usr/bin/nodejs binary and then create a symlink from that to /usr/bin/node. If you are going to use these, be sure to remove any vestiges of any previous installs so that the system is using the correct binaries.

Categories : Javascript

Should python debug statements etc be wrapped by if debug?
There is no need for additional checks. Just configure your logging level: >>> import logging >>> root = logging.getLogger() >>> root.setLevel(logging.INFO) >>> root.addHandler(logging.StreamHandler()) >>> logging.error("test") test >>> logging.debug("test") >>> Again, there is no need for additional checks (the source code taken from logging/__init__.py): class Logger(Filterer): ... def debug(self, msg, *args, **kwargs): """ Log 'msg % args' with severity 'DEBUG'. To pass exception information, use the keyword argument exc_info with a true value, e.g. logger.debug("Houston, we have a %s", "thorny problem", exc_info=1) """ if self.isEnabledFor(DEBUG):

Categories : Java

Grunt debugging from Webstorm
You have to run grunt-cli as a Node application: Create a new Node.js Run/Debug configuration: Run->Edit configurations... In Path to Node choose your node binary, ie: /Users/someuser/nvm/v0.10.5/bin/node In Working Directory, choose your Gruntfile.js directory, ie /Projects/someproject In Path to Node App JS File, choose your Grunt CLI path (you can choose the grunt-cli symlink created on your node bin directory, WebStorm will use the symlink target), ie: /Users/someuser/nvm/v0.10.5/lib/node_modules/grunt-cli/bin/grunt (C:UserssomeuserAppDataRoaming pm ode_modulesgrunt-cliingrunt on Windows 7) In Application parameters enter the Grunt task to run, ie test Click on Run or Debug and you are done :)

Categories : Node Js

WebStorm - Node.JS project
it's not currently supported - please vote for WEB-1173 and WEB-8333

Categories : Debugging

cannot open file '%f' webstorm
This is something I have no idea why it was showing that message. But upon research,, I found in the menu properties there is the extra "%f" at the end. Remove that, voila. It works with no annoying error.

Categories : Misc

Setup Jade With webstorm on MAC
The EISDIR error is caused when a Node application expects a file, but gets a directory. This particular instance of that error was thrown by this block of code: fs.writeFile(path, output, function(err){ if (err) throw err; console.log(' 33[90mrendered 33[36m%s33[0m', path); }); You can tell because it's not error number 156, but the line number of the relevant code. Do you, by any chance have a directory named main.html in /Applications/MAMP/htdocs/HTMLCodes/Sports/public_html? Also, you should be able to just execute the command, jade main.jade without the second argument. That would seem to make your life easier. Though if your dead set on using Webstorm on a Mac, this configuration should work equally well, or to keep it really simple, just put $File

Categories : Osx

How to run build.dart in WebStorm?
OK, thanks to LazyOne's hint I was able to dig a bit deeper. The solution to this is to create a File Watcher in WebStorm with the following options: Scope: Project Files Program: [your path to]dart-sdkindart.exe Arguments: build.dart Working Directory: $ProjectFileDir$ This will run the build.dart every time a file in your project changes, pretty much exactly like the Dart Editor.

Categories : Dart

How to set up instant code completion in WebStorm 7 EAP?
It can just be slow. If explicit Ctrl+Space is as slow, I'd suggest you to file a performance problem request to http://youtrack.jetbrains.com/ with a CPU snapshot attached (http://devnet.jetbrains.com/docs/DOC-1253).

Categories : Intellij Idea

webstorm: typescript bool vs. boolean
Webstorm language service currently only works with 0.8.x, The typescript language service inside WebStrom does not understand the changes made in 0.9.x, and since the TypeScript language service api changed (for the better imho) from 0.8 to 0.9 its not a drop in replacement. A new version of WebStorm with these features is on the way though (should be soon).

Categories : Javascript

WebStorm Linking to a .js file in HTML
No idea what 'Webstorm' is, but your HTML contains no reference to the jQuery library. This is where $ is defined. At the following above your existing <script> tag: <script type="text/javascript" src="[ PATH TO JQUERY ]"></script>

Categories : Javascript

Multi-select Jetbrains Webstorm
Well, you cannot. I think you're talking about the multiple cursors that are present in Sublime Text 2. But, if your text is aligned, then you can change it using the ALT + CLICK and dragging that. You can vote for this feature as lena mentions. UPDATE This feature is now supported in Webstorm 8. If you press the ALT key and click on a different location, you will get a separate cursor there. Before, you could only drag and create cursors in the same line, however, now you can place your cursor wherever you want to. Please take a look at this video to learn more.

Categories : Misc

Webstorm don't recognize node.js third party modules
It seems that the '..params' module is exporting a constructor function that constructs an object which has kioskParams as an attribute. And the constructor itself doesn't have an attribute called kioskParams. It can be easier understood if you write it like this: var SyParams = require('../params'); // The module exports a constructor ... var syParams = new SyParams(); // You construct the actual object syParams.kioskParams; //Then you access its members

Categories : Node Js

Shortcut to quickly run a project from a Javascript in WebStorm?
To have the application opened in a specific browser of your choice, choose View | Web preview on the main menu or press Alt+F2. Then select the desired browser from the pop-up menu.

Categories : Javascript

webstorm typescript display compile error
Based on Meta Discussion Update (25/8/2013) This issue has been fixed in typescript 0.9.1 Update (7/8/2013) Looks like this issue is already on the radar, please vote for it to make it a BIG blip.

Categories : Typescript

what is this perl expression "$DEBUG>=3 && DEBUG("OK=$ok");"?
$DEBUG must be at 3 or more and the return Value from the sub DEBUG must be true as well. True means, that its not undef 0 "" "0" Any blessed objects that overload conversion to boolean to return false Empty arrays and empty hashes Boolean parts with subs will be executed as well. So that if your expression is inside an if clause, the return value will be the part of that expression. Eg. sub test { return 1; } if ( $abc >2 && test() ) { ... }

Categories : Perl

Is ext-all-debug.js equivalent to ext-all.js plus debug statements?
The ext-all.js is the minified version of the ext-all-debug.js. The ext-all.js version gain is that it greatly reduces the files size so that clients have to download less on the non-debug version. The ext-all-debug.js is provided so that you can debug through the extjs code. So they don't have any diference, such as added console.log's

Categories : Extjs

how to align text to specific character in phpstorm or webstorm?
Cmd+Alt+L (in Mac) or Ctrl+Alt+L (Win) and PHP Storm will format code depends of your Code style in Settings. TO set this code style go: File -> Settings -> Code style -> PHP(choose here your language) -> Other -> Align key-value pair - mark as checked. And then press Reformat code (Ctrl+Alt+L) and voila. You will get code, styled you write above.

Categories : PHP



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