2015년 1월 10일 토요일

[AngularJS] AngularJS 1.3 Performance Improvements - Why are they not enabled by default?

As far as I understand there are two major performance improvements in AngularJS 1.3:

$compileProvider.debugInfoEnabled(false);(https://docs.angularjs.org/guide/production#disabling-debug-data)

and

$httpProvider.useApplyAsync(true);

Since these features are not enabled by default, I'm asking myself if there are any reasons not to use them...
Especially $httpProvider.useApplyAsync(true), are there any drawbacks with this?



I'm sure they are not enabled by default so that there's no risk of breaking currently working applications that may rely on some undocumented behaviour, like debug data or any other.


2015년 1월 8일 목요일

This Week's Node News - Issue 68

This week's Node news
Read this e-mail on the Web
node weekly
January 8, 2015  #68
IO.JS
One benefit of io.js’ (the new Node fork) policy of staying up to date with the Google V8 JavaScript engine is newly implemented ECMAScript 6 features can be used in your code sooner. Numerous features already work with io.js by default with no runtime flag required.

JAKE VERBATEN
A look at what it takes to take a Node-based app or service to production, including some tooling Uber has developed itself.

FRONTEND MASTERS   SPONSORED
Learn the core aspects of React and dive into real-world use cases for React. Taught by Ryan Florence, creator of the React Router. Join us online or in-person February 13th!
Frontend Masters

DAVID WELLS
A tutorial, video (15 minutes), and demo of running the same code server and client side for rendering.

UEI RICHO
Provides the ability to run JavaScript on (almost) any web server using a Node.js binary over CGI (in a similar style to PHP over CGI). It has its limitations but is an interesting proof of concept nonetheless.

MARCELL SPIES
Supports Jenkins, Travis CI, Visual Studio Online, Team Foundation Server, and TeamCity.

GARETH MARLAND
Install on a server and you get a web-based way to manage and run scripts on that server remotely.

Jobs
In brief

2015년 1월 7일 수요일

Re: [visualization-api] Hiding few Zoom buttons in Annotation Chart

Can you please post your full script?

I can't figure out how to inject code Zoombuttons.


It worked :) Thank you so much.

On Tuesday, August 19, 2014 6:35:49 PM UTC+5:30, Daniel LaLiberte wrote:
There is a new feature coming out in the next release that will let you configure the zoom buttons.  You can use this now if you load version '1.1'.

Here is a summary of how to use it.  There are two options, 'zoomButtons' and 'zoomButtonsOrder'.  The zoomButtonsOrder value is just an array of strings that defaults to this:

  zoomButtonsOrder: [
    '1-hour', '1-day', '5-days', '1-week',
    '1-month', '3-months', '6-months', '1-year', 'max'
  ]

Each string is the name of a zoom button corresponding to a button configuration.  The buttons are configured with the zoomButtons option, which is an object with this default value:

 zoomButtons: {
  '1-second': { 'label': '1s', 'offset': [0, 0, 1] },
  '5-seconds': { 'label': '5s', 'offset': [0, 0, 5] },
  '10-seconds': { 'label': '10s', 'offset': [0, 0, 10] },
  '15-seconds': { 'label': '15s', 'offset': [0, 0, 15] },
  '1-minute': { 'label': '1min', 'offset': [0, 1, 0] },
  '5-minutes': { 'label': '5min', 'offset': [0, 5, 0] },
  '10-minutes': { 'label': '10min', 'offset': [0, 10, 0] },
  '15-minutes': { 'label': '15min', 'offset': [0, 15, 0] },
  '1-hour': { 'label': '1h', 'offset': [1, 0, 0] },
  '6-hours': { 'label': '6h', 'offset': [6, 0, 0] },
  '1-day': { 'label': '1d', 'offset': [1, 0, 0, 0, 0]},
  '5-days': { 'label': '5d', 'offset': [5, 0, 0, 0, 0] },
  '1-week': { 'label': '1w', 'offset': [7, 0, 0, 0, 0] },
  '1-month': { 'label': '1m', 'offset': [1, 0, 0, 0, 0, 0] },
  '3-months': { 'label': '3m', 'offset': [3, 0, 0, 0, 0, 0] },
  '6-months': { 'label': '6m', 'offset': [6, 0, 0, 0, 0, 0] },
  '1-year': { 'label': '1y', 'offset': [1, 0, 0, 0, 0, 0, 0] },
  'max': {
    'label': 'max',
    'range': {
      'start': null,
      'end': null
    }
  }
}

For each button configuration, the 'offset' property is a timeofday value, extended to allow 1 to 7 array elements.  The 'range' property value is an object with 'start' and 'end' properties which are either null or Dates.  A null value means extend to the start or end of the data range.  I haven't tested the range option much so you might find problems.  (Now that I think about it, the start and end values should allow a timeofday value that specify a distance from the start or end of the data range, so you could, for example, configure a 'last minute' button with range: { start: [0, 1, 0] }.)

You can override just the properties you want, or you can define new buttons by adding new properties to this object.  So you could define a 10-years button like so:

zoomButtons: {
  '10-years': { 'label': '10y', 'offset': [10, 0, 0, 0, 0, 0, 0] }
}


Can we hide few zoom buttons in Annotation Chart? In case where data contains only date and no time then there would be no use of zoom buttons- 1hour, 1day.
Also can we add zoom buttons like for 2 years, 10 years..as per need??




[AngularJS] Asigning the href (i.e., route name and route param name) in template based on the value from scope

I'm new to AngularJs and still learning the things, I'm creating a menu with items that are clickable. When someone clicks on the item it will redirect to a view using the route name provided in the href, the catch here is that my menu will be generates out of the scope from the controller using the ng-repeat. I want to change my href value based on the item value, so that the corresponding view will be loaded based on route, here is my mark up and the controller that populates the scope. Can someone help me what is the best way to do this.

My href values (which points to the route) here in the below code '#Categories', should be changing based on the c.name. Example: ifc.name is 'ABC' i should route the user to 'root1/ABC/:123' else ifc.name is 'DEF' i should route the user to 'root2/DEF'


Any help on this is highly appreciated.

<a data-ng-repeat="c in vm.List | orderBy: 'order'" href="#Categories/{{c.category}}/{{c.name}}" data-ng-show="c.count >0">


function getHomeConfigsCtrl($http, iService, $routeParams) {
    var vm = this;
    vm.List = [];
    var promise =
        iService.getConfig(ID);
    promise.then(
       function (result) {
           angular.forEach(result.data.menu, function (value, key) {
               vm.List.push(value);
           });
       },
       function (errorPayload) {
           $log.error('failure loading home page config', errorPayload);
       });
};


[coffeescript] Omitting wrapper on a per-file basis, or, returning from global scope

Firstly, season's greetings to you! Hope you had/are having a great holiday.

I'm writing some CoffeeScript to be executed in a MongoDB server environment, and MongoDB requires returns values to be returned from the global scope. ie, a very simple file would be:

return args.str.toUpperCase()

I can't seem to do that in CoffeeScript though. I know about --bare, but I'm using Gulp and I'd rather not mess with that setup.

Is there any way to either omit the wrapper on a per-file basis, or alternatively return from the global scope?



 I know about --bare, but I'm using Gulp and I'd rather not mess with that setup.

I think you are stuck with that as the only option.


[coffeescript] Coffeescript Mimetype

Coffeescript now has an officially registered mimetype with the IANA. The details can be seen here (http://dcjtech.info/topic/coffeescript-mimetype/) and here (http://www.iana.org/assignments/media-types/media-types.xhtml).


[AngularJS] SVG anchor xlink with Angular

I need to create anchor elements, inside SVG, with AngularJS. The xlink:href attributes stop working when I add ng-app. I tried ng-attr-xlink:href, but it doesn't work. What should I do?