w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Reference, Include, Library, Source paths based on active solution configuration
You must use project configurations for that purpose, not solution configurations. Every project configuration can have different project properties, either set via .props files or in the project file itself.

Categories : C#

Avoid duplication of "paths" configuration in RequireJS main file and r.js build file?
If you want to use same configuration from your runtime code to find the location of your libraries, you can use the mainConfigFile option: ...if you prefer the "main" JS file configuration to be read for the build so that you do not have to duplicate the values in a separate configuration, set this property to the location of that main JS file. The first requirejs({}), require({}), requirejs.config({}), or require.config({}) call found in that file will be used. Something like this: ({ baseUrl: "bower_components", mainConfigFile: '/some/path/main.js', // adjust path as needed name: "./almond/almond", include: "./../public/main", out: "build/main.js", preserveLicenseComments: false })

Categories : Javascript

Using jQuery, relative paths within a div are updated to absolute paths but having trouble rewriting it to be more dynamic
var foo = { '/catalog.php':'http://www.mydomain.com', '/upgrade':'http://www.mydomain2.com' }; $.each(foo,function (search,prefix) { $('#landing-page').find('a[href^="' + search + '"]').each(function(element, index){ $(this).attr('href',prefix + $(this).attr('href')); }); }); http://jsfiddle.net/U9RXL/1/

Categories : Jquery

Converting remote relative paths to absolute paths
I think you would need to use regular expressions on the href path to make sure that it is consistent. You can also get an accurate base url from parse_url(): <?php $href = '../images/sunflower.png'; $href = preg_replace('~^.{0,2}/~', '', $href); ?> Here we strip the periods and the slashes from the beginning of the string. And then prepend the base url: <?php $url = 'http://www.example.com/home/index.html'; $url = parse_url($url); $abspath = $url['scheme'] . '://' . $url['host'] . '/' . $href; echo $abspath; ?> Should output what you want: http://www.example.com/images/sunflower.png UPDATE If you want the first directory from the base url, then use explode on the parsed url's path key: $first_directory = ''; if (isset($url['path'])) { $patharray = explode('/',

Categories : PHP

Local paths for the files are different from the paths on the server
When you're writing an asp.net application, the most important path you need to be aware of is the following one: ~/ This will always return the root of the current application, whether you pass it to Response.Redirect(), Page.ResolveUrl() or use it as part of your hyperlink in an <asp:hyperlink /> tag. For example: <link href='<%= Page.ResolveUrl("~/somepath/file.css") %>' rel='stylesheet' /> Note that this only works within code handled by .net itself; for other files, you need to ensure that you always use relative paths. So for example if you have the following structure for your images and css: / /images logo.gif /css main.css then you reference the logo using the style: { background-image: url(../images/logo.gif); }

Categories : Asp Net

Set Enviroment Variable that contains two paths interelated paths
I think an alias is more appropriate for all kinds like this (you may consider a more suitable name for the alias) alias var="/usr/bin/python2.7 /home/user/file" If you want to stick with your version you have to tell your shell to evaluate the content of VAR. For this you just have to invoke eval ${VAR} By the way, why do you append the string "/usr/bin/python2.7 /home/user/file" to VAR instead of overwriting the content of VAR?

Categories : Linux

Visual Studio: Differences between image paths set from the project window and programmatically set image paths
In first instance images are stored as a resouce file and are saved in the resources. Whereas in the second instance you specify the path where the image resides. Yes you can add image in resources progamatically if you are working in .net 4 or above. See this for details.

Categories : C#

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

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

EF Code First Configuration of shared Base Class --> Single Configuration File
Try it like below but I didnt test it .However if I were you, I wouldnt design Audit tables this way class AuditableModelBaseMap : EntityTypeConfiguration<AuditableModelBase> { public AuditableModelBaseMap () { this.HasRequired(amb => amb.CreatedByUserProfile).WithMany().HasForeignKey(amb => amb.CreatedByUserId).WillCascadeOnDelete(false); this.HasRequired(amb => amb.UpdatedByUserProfile).WithMany().HasForeignKey(amb => amb.UpdatedByUserId).WillCascadeOnDelete(false); } } THIS IS MY WAY OF Doing AUDITING public interface IEntity { int Id { get; set; } } public interface IAuditable : IEntity { string UpdatedBy { get; set; }

Categories : C#

Is there a way to obtain a Configuration object from a configuration file in the isolated storage?
Why can't you get the absolute path to the files in Isolated Storage? Take a look at the Can I get a path for a IsolatedStorage file and read it from external applications? post to find out how you can do this. If that doesn't work for you, take a look at the IsolatedStorageFile Class page at MSDN which features examples of manipulating files in IsolatedStorage.

Categories : Wpf

static library builds in debug configuration but not in release configuration
For your project target Build Settings, look for "Search Paths->Header Search Path". Compare your Release and Debug settings here. Also look into the "Build Location" for the library project for Release and Debug.

Categories : IOS

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

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

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

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

what is active solution configuration in vs 2012 configuration manager?
my understanding is it should use the QA web.config file. am i wrong? Actually you are wrong. web.QA.config will be used only when you publish your application but not while running it in Visual Studio where the standard web.config is always used.

Categories : Visual Studio 2010

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

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

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

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

Backbone.Marionette - Grunt Browserify - "require is not defined"
Well for starters, the src attribute in your grunt file doesn't need to reference all of the files in your application. It only needs an entry point. So normally I have something similar to your anonymous self executing function in an index.js file, and set my src configuration option to ["./index.js"]. When browserify looks at that file, it will check for calls to require and grab all of the required dependencies. That said, browserify will generate a file with an internal definition of require. The require function is not globally available on the page, nor are the dependencies that you include with require. You can use them in your application, but that doesn't make them available in the page. So if you are getting a Backbone is not defined error, the first thing I would check is that

Categories : Backbone Js

log4j.properties configuration issues along with ant configuration
for ant i added: <path id="properties"> <dirset dir="${config.dir}"/> </path> where ${config.dir} is the path to the /src/config folder where the log4j.properties exists. Still working on getting eclipse to work, it shouldnt be too different with classpaths in eclipse. Thanks!

Categories : Java

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

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

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

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

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

Closure Compiler annotations in WebStorm 6, how to use Record Types?
The first example the annotation is incorrectly applying to socket.on, not to the callback function. In addition, the annotation is formatted incorrectly. An @param tag describes exactly one parameter and it's type. You are attempting to describe two. Also, record types only need one set of braces surrounding them. Here's one way that might look: /** * @param {string} eventName, * @param {function({ pageId: string })} callback */ socket.on = function(eventName, callback) {}; socket.on('page:getSource', function (data) { //data = { pageId: id } console.log(data.pageId) }); Your second example seems correct - but since the socket.on definition wasn't provided I can't verify. Here's a similar test case that does work: // ==ClosureCompiler== // @compilation_level ADVANCED_OPTI

Categories : Javascript

pipe child process stdout & stdin to browser in node.js & browserify
You should look into hyperwatch, which pipes the server side stdout/stderr to the browser and renders it exactly like it would appear in your terminal (including colors). If it doesn't exactly solve your problem, reading through the code should at least help you. It uses hypernal under the hood in order to convert terminal output to html.

Categories : Node Js

Browserify to load dependencies from global scope's require instead of expecting them to be bundled up together
Two ways of looking at it : Think of B like jquery-ui and A as jquery. It's upto the users to include the jquery into the DOM, if they wish to use jquery-ui. So while building B do not require A at all. Document the fact that B has A built into it. The users who use B should simply not include A at all. In this scenario - you obviously need to require A and bundle up B with A together. In general if you have 2 browserified bundles, with common parts, that are being imported in the SAME page then you have already fallen into the problem of bundle organization/dependency, what components go in what etc. Something in the basics of that needs to be reviewed/changed

Categories : Javascript

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



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