w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How do I provide source-level debugging for a language like VS does for TypeScript?
This is admittedly a bad answer, but I figure its better than nothing. If I were in your shoes, here is what I would do: Now its obviously possible to communicate from the browser to the IDE using some kind of plugin, but I don't like that for at least 2 reasons: I don't enjoy coding in strongly-typed languages, and any code I produce will be inherently browser-specific. Although its not the lightest weight solution, XHR in blocking mode can get the job done. The IDE would host a http server that sends the CORS header. The compiled source would contain something like this: var ___, __INTERRUPT_SIGNAL = {}; (function() { var oXhr = new XMLHttpRequest(); oXhr.open('POST', 'http://localhost/debugging_port', false); // Force XHR to work synchronously ___ = function(nLineNumber) {

Categories : Javascript

typescript 0.9.1 source maps not working anymore
They changed the format of the source map reference at the bottom of your *.js file. Change: //# sourceMappingURL=[filename].js.map to //@ sourceMappingURL=[filename].js.map See https://typescript.codeplex.com/workitem/1445 for more. It looks like newer versions of Chrome will support this new format.

Categories : Typescript

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 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

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 + typescript "unresolved variable" after adding reference path
Modify it to "export interface IBaseClass" and on the other side you need to require it. At runtime you might get an error loading a js file not there. If so make an empty js file. My recommendation : do not have a file just with interfaces when using requirejs/commonjs

Categories : Typescript

Webstorm: how to exclude javascript from code completion in typescript project
Right click on the folder that contains your compiled javascript and select "Mark Directory As" then "Excluded". WebStorm will hide the directory from the project view, stop indexing it for searches and code completion, and not include it in code refactoring tracing. I tend to mark all build output as ignored and ensure that WebStorm is only worrying itself with the source.

Categories : Typescript

Typescript, google.maps.d.ts and type enforcement
You haven't typed your mapOptions variable, and there is no way for the compiler to infer it. Try var mapOptions:google.maps.MapOptions = { (etc). The interface definition of zoom?:number looks good in the d.ts that you reference. Type inference would work if you created the options as part of the map constructor call: map = new google.maps.Map(document.getElementById('map-canvas'), {zoom: 'this-should-fail'}); ... because here the compiler knows the signature of the constructor and can infer the type. In your sample, mapOptions is just an untyped object. UPDATE In VS2012, with WebEssentials 2012 2.7, and TS 0.8.3.1, I get the following: ...and on hover or in the WebEssentials output panel the error output from TSC is: Compile Error. See error list for details D:/PR

Categories : Typescript

Why Chrome doesn't update Typescript source files on change?
If you are serving from IIS, We have manually disabled cache in our web.config file : <system.webServer> <httpProtocol> <!--TODO: Remove this block for production (//TODO: Remove this block for production) --> <customHeaders> <!--DISABLE CACHE--> <add name="Cache-Control" value="no-cache, no-store, must-revalidate" /> <add name="Pragma" value="no-cache" /> <add name="Expires" value="0" /> </customHeaders> </httpProtocol> </system.webServer>

Categories : Google Chrome

Debugging using Java source code
Eclipse have built-in support for what you wanna do. All you have to do is set breakpoint and execute application in debugging mode. You can use these icons in Eclipse debugging perspective. Follow along Eclipse Debugging Tutorial for details.

Categories : Java

Debugging an exception, source information missing
The most likely cause of a GL crash like this is improper buffer handling. You wouldn't see this surface with glGetError() - the driver would simply crash upon accessing the bad vertex/index buffers. You might have luck debugging it with gDEBugger

Categories : C++

Debugging in Eclipse (using JRebel): Source not found
The "JRebel Eclipse Debugger Plug-In" causes this behaviour when a breakpoint is set to a line declaring a method. Solution: Set your breakpoints to a line inside the method.

Categories : Eclipse

Android Native C++ Debugging: Stepping causes "no source available"
We haven't seen that exact issue, but we've fixed similar problems in the Apportable fork of gdb available in binary form in the Apportable SDK and in source on github. Debugging cocos2d is a common use case for our users and that stepping problem has not come up. It may take a bit of finagling to work with a pure NDK app, but it shouldn't be too bad.

Categories : Android

How do you make the Qt source code available when debugging an application in Qt Creator?
I meet the similar problem when using Emacs+gdb. The problem was that path to source code compiled in library was something like src/core/qobject.cpp or even core/qobject.cpp. So debuger can not find suitable source file when I walk up and down through call stack. I solve the problem just configure gdb's search path. In qt creator you can try fix it by finding option to configure "gdb" parameters and add "-d path/to/qt/source/code" to gdb command line arguments.

Categories : C++

How do I step into JDK source code when debugging remotely in Eclipse
Check the following: ensure that the Source Lookup Path contains the rt.jar using Edit Source Lookup dialog during the debug session. the line number attributes are included the compiled classes which you are remote debugging, check this if you compiled them with eclipse. ensure that the remote application which you are debugging uses a JDK instead of a JRE, since JREs doesn't include debugging information

Categories : Java

Call a method and initiate debugging from the rails console without editing the source code?
mhm this sound a bit like metaprogramming for me, you may inject a debugging method at runtime in your model, which will add the debugging statement just before the method call so you can inspect the call as needed, like: m = MyModel.last m.class.send(:define_method, :debug_my_method){debugger; my_method} m.debug_my_method this should do on the irb (just tested it on may rails console)

Categories : Ruby On Rails

Eclipse Java Debugging Error "Source not found." when adding items to Android spinner
Spinner is a class from the Android SDK. You will need to download the Android SDK source code, and attach it to the project spurces, so you can debug this class (and other Android SDK classes) --- UPDATE 1 --- Please have a look at this blog post to attach your andriod sources and debug them.

Categories : Java

Tracking ChangeEvent source in collaborative maps
I'm not sure what exactly you are trying to model here. Are you actually adding arbitrary elements to these maps? Otherwise, you might look at using custom objects, where you could have a field for the key and other fields for the other objects you are storing. (See https://developers.google.com/drive/realtime/build-model#lifecycle_of_a_custom_collaborative_data_object) If you really just want to have access to that value in the function, you can do that with a standard javascript, e.g closure, or a bind function.

Categories : Javascript

CoffeeScript / JavaScript - Making promises compatible with Source Maps?
Source maps aren't really very suited to this, but with the V8 JavaScript engine (used in Google Chrome and node.js) it is possible to mutate the stack trace using the JavaScript API. Q will do this if you enable long stack traces. You should not use it in production though as it comes with an enormous performance hit: https://github.com/kriskowal/q#long-stack-traces

Categories : Javascript

Automapper maps source to destination but dest values are always null
expression.ForAllMembers(opt => opt.Ignore()); You're telling AutoMapper to ignore all properties, so nothing gets mapped. If you just want to ignore non-matching properties, see this answer for one way, otherwise you're going to have to explicitly map each property between the objects.

Categories : Entity Framework

Error message in typescript saying that function parameters don't match @TypeScript 0.9.1
When you want to use the lexically escaped value of this (which refers to the class) as well we as the context value of this (e.g the this inside a jquery callback which refers to the element that raised the event etc). You cannot use fat arrow / lambdas ()=>{}. You use function, and store this for the class variable yourself. However in your code I see that you only want to use this which refers to the class so a lambda ()=>{} is sufficient for your case. Your code compiles fine: Check it online.

Categories : Javascript

Add a TypeScript file to a non-TypeScript project in Visual Studio 2012?
My experience has been that I can add .ts files and .d.ts files to web c# projects and they compile. I have not found 'add typescript' file on the add context menu but I have found you can add a text file .ts or .d.ts and it is recognised. You may have to amend the compile action to 'TypescriptCompile'. Apart from that and some debugging funnies I have found TypeScript to be one of the cleverest things around...awesome in fact

Categories : Typescript

How can i Zoom to source Point while showing Directions in Google Maps in Android.
I use the following code to zoom to a particular point on mapview In your MapActivity call zoomToMyLocation() and in that function you can specify the latitude and longitude of source point .Here we use getController to setzoom(); private void zoomToMyLocation() { GeoPoint myLocationGeoPoint = getgetPoint(29.0167, 77.3833); if (myLocationGeoPoint != null) { mapView.getController().animateTo(myLocationGeoPoint); mapView.getController().setZoom(10); } else { Toast.makeText(this, "Cannot determine location", Toast.LENGTH_SHORT).show(); } } private GeoPoint getPoint(double lat, double lon) { return (new GeoPoint((int) (lat * 1000000.0),

Categories : Android

D3, Typescript, and GraphNodes (Optional fields in a typescript interface)
All of them are not required but perhaps some are and the interface definition does not reflect that as of yet. Perhaps you can mark which ones are optional for community support. In any case. When you want to enforce strict behavior on others but want the flexibility to break out your self you can use any. e.g. : var data:GraphData = <any>{ "nodes": [{ "group": 0, "id": 0 }, { "group": 0, "id": 1 }, { "group": 0, "id": 2 }], "links": [{ "source": 0, "target": 2, "value": 1 }, { "source": 0, "target": 0, "value": 1 }, { "source": 2, "target": 1, "value": 1 }, { "source": 2, "target": 1, "value": 1 }] }

Categories : Javascript

Is there a good open-source Google maps style image component out there?
I have heard good things about: http://www.openlayers.org/ and have seen the results of it being used (Intranet project, nothing public - sorry). However, I have not used it myself.

Categories : HTML

Stop Debugging (Shift+F5) causing debugging to restart
I too have this happen to me sometimes, and I too have disabled StickyKeys. I even see this sometimes when I have locked my computer. When this happens and I try to type in my password, the computer acts like I am pressing down control. My only suggestion is to use the menus to stop Debugging, and then gently tap the Control key twice, and then try again. It always stops when I do this. In the back of my mind, I wonder if it is due to conflicts of third-party utilities that intercept key combos for their triggers. SnagIt, Freesnap, AutoHotKey are three that I use, but when the problem is so intermittent, you can't really disable them and say, "yup, my problem went away."

Categories : Visual Studio

What makes a typescript module, a typescript module? Toastr example
the following declare definition would create a module you can import via amd/commonjs: declare module "jquery"{ export var jQuery: JQueryStatic; } Then you can do: import jquery = require("jquery"); You can see such definitions in this underscore definition: https://github.com/borisyankov/DefinitelyTyped/blob/master/underscore/underscore.d.ts#L2853 or node.d.ts : https://github.com/borisyankov/DefinitelyTyped/blob/master/node/node.d.ts#L203 However not all files on DT have this definition. As it is simple enough to add on your own and you are free to name these modules whatever you want (in your AMD configuration http://www.youtube.com/watch?v=4AGQpv0MKsA )

Categories : Node Js

Backbone app with CommonJS and Browserify
The very obvious thing you're missing is that you can create globals in Node.js, and in the Browserify environment just the same. Either do it explicitly by using global.Backbone = require('/backbone'), or less explicit by just doing Backbone = require('/backbone') (without var in front). Note that in the browser, the global object is in fact the window object. However, attaching to the window object would mean you lose compatibility with Node.js, because that typically doesn't have a global variable window defined.

Categories : Backbone Js

How do you add browserify to a yeoman project?
Here's what I did: npm install grunt-browserify --save-dev npm install coffeeify --save-dev Add grunt-browserify step in Gruntfile.js: browserify: { basic: { src: ['<%= yeoman.app %>/scripts/**/*.js', '<%= yeoman.app %>/scripts/**/*.coffee'], options: { transform: ['coffeeify'] }, dest: '.tmp/scripts/application.js' } } Add step to concurrent/watch steps, e.g.: concurrent: { server: [ '...', 'browserify' ], dist: [ '...', 'browserify' ] } watch: { coffee: { files: ['<%= yeoman.app %>/scripts/{,*/}*.coffee'], tasks: ['...', 'browserify'] } } Modify default app/index.html template, so usemin will concatenate and minify, from this: <!-- build

Categories : Javascript

How to "require" text files with browserify?
require() is really best for just javascript code and json files to maintain parity with node and to improve readability of your code to outsiders who expect require() to work the way it does in node. Instead of using require() to load text files, consider using the brfs transform. With brfs, you maintain parity with node by calling fs.readFileSync() but instead of doing synchronous IO as in node, brfs will inline the file contents into the bundle in-place so var src = fs.readFileSync(__dirname + '/file.txt'); becomes var src = "beep boop "; in the bundle output. Just compile with -t brfs: browserify -t brfs main.js > bundle.js More discussion about why overloading require() too much is a bad idea: http://mattdesl.svbtle.com/browserify-vs-webpack

Categories : Node Js

How to make Zepto compatible with Browserify?
You can manually add module.exports = window.$ to the bottom of the zepto file or use browserify-shim in order to get your modules adapted for browserify on the fly. I would recommend the latter option since editing 3rd party modules is problematic especially if you plan to upgrade them later. browserify-shim was tested to work with zepto in particular. Take a moment to study the readme and examples to learn how to properly set things up. You can then of course shim pretty much any library that attaches a variable to the global context, i.e. jquery. On another note, the errors you got where due to a bug in browserify that has been fixed in the meantime.

Categories : Javascript

How to ignore libraries in browserify programmatic api
As you can see from here the --noparse option provided on the command line is passed to the browserify({ }) call. So in order to tell browserify to not parse jquery and three.js you have to pass the full path to your jquery and three.js files. Example: browserify({ noParse: [ require.resolve('./vendor/jquery'), require.resolve('./vendor/three') ] }) .require(require.resolve('./entry.js'), { entry: true }) .bundle();

Categories : Node Js

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

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

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

Categories : Debugging

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

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

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

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



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