plus

14

--- a/range.js
+++ b/range.js
@@ -56,7 +56,8 @@ function prefix (a, b) {
   return true
 }
 
-exports = module.exports = function (range, key) {
+exports = module.exports = function (range, key, _compare) {
+  _compare = _compare || compare
   //handle prefix specially,
   //check that everything up to the last item is equal
   //then check the last item starts with
@@ -64,10 +65,10 @@ exports = module.exports = function (range, key) {
 
 //  return ltgt.contains(range, key, compare)
 
-  if(range.lt  && compare(key, range.lt) >= 0) return false
-  if(range.lte && compare(key, range.lte) > 0) return false
-  if(range.gt  && compare(key, range.gt) <= 0) return false
-  if(range.gte && compare(key, range.gte) < 0) return false
+  if(range.lt  && _compare(key, range.lt) >= 0) return false
+  if(range.lte && _compare(key, range.lte) > 0) return false
+  if(range.gt  && _compare(key, range.gt) <= 0) return false
+  if(range.gte && _compare(key, range.gte) < 0) return false
 
   return true
 }
plus

8

--- a/viennacl/linalg/cuda/fft_operations.hpp
+++ b/viennacl/linalg/cuda/fft_operations.hpp
@@ -207,7 +207,7 @@ void direct(viennacl::vector<NumericT, AlignmentV> const & in,
                           static_cast<unsigned int>(stride),
                           static_cast<unsigned int>(batch_num),
                           sign,
-                          bool(data_order == viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::ROW_MAJOR));
+                          bool(data_order != viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::ROW_MAJOR));
   VIENNACL_CUDA_LAST_ERROR_CHECK("fft_direct");
 }
 
@@ -232,7 +232,7 @@ void direct(viennacl::matrix<NumericT, viennacl::row_major, AlignmentV> const &
                           static_cast<unsigned int>(stride),
                           static_cast<unsigned int>(batch_num),
                           sign,
-                          bool(data_order == viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::ROW_MAJOR));
+                          bool(data_order != viennacl::linalg::host_based::detail::fft::FFT_DATA_ORDER::ROW_MAJOR));
   VIENNACL_CUDA_LAST_ERROR_CHECK("fft_direct");
 }
 
plus

6

--- a/core/classes/Config.php
+++ b/core/classes/Config.php
@@ -15,6 +15,10 @@
  *  System/Config/routing_replace
  *  ['rc'	=> <i>&$rc</i>]		//Reference to string with current route, this string can be changed
  *
+ *  System/Config/before_init
+ *
+ *  System/Config/after_init
+ *
  * @property mixed[] $core			Property with most general configuration properties
  * @property mixed[] $db			Property, that stores configuration of databases, except the main database, parameters of which are written in configuration file
  * @property mixed[] $storage		Property, that stores configuration of storages, except the main storage, parameters of which are written in configuration file
@@ -78,10 +82,12 @@ function construct () {
 			}
 			unset($part, $value);
 		}
+		Trigger::instance()->run('System/Config/before_init');
 		/**
 		 * System initialization with current configuration
 		 */
 		$this->init();
+		Trigger::instance()->run('System/Config/after_init');
 		if (!file_exists(MODULES.'/'.$this->core['default_module'])) {
 			$this->core['default_module']	= 'System';
 			$this->save();
plus

898

--- a/model/lib/models/spree/cart.rb
+++ b/model/lib/models/spree/cart.rb
@@ -30,7 +30,7 @@ def initialize(attributes = {})
     # the line item (tried passing a LineItem here instead but didn't feel right
     # either)
     def add_item(variant, quantity = 1, options = {})
-      if item = self.items.find { |i| i.variant_id == variant.id }
+      if item = find_item_by_variant(variant.id)
         item.quantity += quantity.to_i
       else
         item = LineItem.new(variant_id: variant.id, price: variant.price, quantity: quantity)
@@ -42,7 +42,7 @@ def add_item(variant, quantity = 1, options = {})
     end
 
     def remove_item(variant, quantity = 1)
-      item = self.items.find { |l| l.variant_id == variant.id }
+      item = find_item_by_variant(variant.id)
 
       self.items.delete line_item
       self.items
@@ -75,5 +75,9 @@ def persisted?
       self.created_at || false
     end
 
+    def find_item_by_variant(variant_id)
+      self.items.find { |i| i.variant_id == variant_id }
+    end
+
   end
 end
plus

4

--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -1545,8 +1545,7 @@ class CodeGenFunction : public CodeGenTypeCache {
   /// EmitExprAsInit - Emits the code necessary to initialize a
   /// location in memory with the given initializer.
   void EmitExprAsInit(const Expr *init, const ValueDecl *D, LValue lvalue,
-                      bool capturedByInit,
-                      SourceLocation DbgLoc = SourceLocation());
+                      bool capturedByInit, SourceLocation DbgLoc);
 
   /// hasVolatileMember - returns true if aggregate type has a volatile
   /// member.
plus

37

--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -634,6 +634,7 @@ static int dash_write_header(AVFormatContext *s)
             ffurl_close(os->out);
             os->out = NULL;
         }
+        av_log(s, AV_LOG_VERBOSE, "Representation %d init segment written to: %s\n", i, filename);
 
         s->streams[i]->time_base = st->time_base;
         // If the muxer wants to shift timestamps, request to have them shifted
@@ -655,6 +656,8 @@ static int dash_write_header(AVFormatContext *s)
         ret = AVERROR(EINVAL);
     }
     ret = write_manifest(s, 0);
+    if (!ret)
+        av_log(s, AV_LOG_VERBOSE, "Manifest written to: %s\n", s->filename);
 
 fail:
     if (ret)
@@ -702,16 +705,13 @@ static void write_styp(AVIOContext *pb)
     ffio_wfourcc(pb, "msix");
 }
 
-static void find_index_range(AVFormatContext *s, const char *dirname,
-                             const char *filename, int64_t pos,
-                             int *index_length)
+static void find_index_range(AVFormatContext *s, const char *full_path,
+                             int64_t pos, int *index_length)
 {
-    char full_path[1024];
     uint8_t buf[8];
     URLContext *fd;
     int ret;
 
-    snprintf(full_path, sizeof(full_path), "%s%s", dirname, filename);
     ret = ffurl_open(&fd, full_path, AVIO_FLAG_READ, &s->interrupt_callback, NULL);
     if (ret < 0)
         return;
@@ -765,14 +765,17 @@ static int dash_flush(AVFormatContext *s, int final, int stream)
             if (ret < 0)
                 break;
             write_styp(os->ctx->pb);
+        } else {
+            snprintf(full_path, sizeof(full_path), "%s%s", c->dirname, os->initfile);
         }
+
         av_write_frame(os->ctx, NULL);
         avio_flush(os->ctx->pb);
         os->packets_written = 0;
 
         range_length = avio_tell(os->ctx->pb) - start_pos;
         if (c->single_file) {
-            find_index_range(s, c->dirname, os->initfile, start_pos, &index_length);
+            find_index_range(s, full_path, start_pos, &index_length);
         } else {
             ffurl_close(os->out);
             os->out = NULL;
@@ -781,6 +784,7 @@ static int dash_flush(AVFormatContext *s, int final, int stream)
                 break;
         }
         add_segment(os, filename, os->start_dts, os->end_dts - os->start_dts, start_pos, range_length, index_length);
+        av_log(s, AV_LOG_VERBOSE, "Representation %d media segment %d written to: %s\n", i, os->segment_index, full_path);
     }
 
     if (c->window_size || (final && c->remove_at_exit)) {
plus

4

--- a/object.h
+++ b/object.h
@@ -23,7 +23,7 @@ namespace bazinga {
 
     Object();
     Object(Path);
-    Object(BjObject*);
+    Object(BjObject*, int);
     ~Object();
 
     void update();
plus

3

--- a/main.cpp
+++ b/main.cpp
@@ -32,8 +32,8 @@ int main() {
 
     g.generateSmallWorldSocialGraph(1500, 15, 3, 15);
     
-    //g.socialNetworkStatistics.calculateStatistics();
-    //g.socialNetworkStatistics.printStatistics();
+    g.socialNetworkStatistics.calculateStatistics();
+    g.socialNetworkStatistics.printStatistics();
     
 
     algorithms.makeMove(0.1, 4, 2);
@@ -41,16 +41,16 @@ int main() {
     algorithms.makeMove(0.1, 4, 2);
     algorithms.makeMove(0.1, 4, 2);
     algorithms.makeMove(0.1, 4, 2);
-//    g.socialNetworkStatistics.calculateStatistics();
-//    g.socialNetworkStatistics.printStatistics();
+   g.socialNetworkStatistics.calculateStatistics();
+    g.socialNetworkStatistics.printStatistics();
     
     algorithms.makeMove(0.1, 4, 2);
     algorithms.makeMove(0.1, 4, 2);
     algorithms.makeMove(0.1, 4, 2);
     algorithms.makeMove(0.1, 2, 2);
     algorithms.makeMove(0.1, 2, 2);
-//    g.socialNetworkStatistics.calculateStatistics();
-//    g.socialNetworkStatistics.printStatistics();
+    g.socialNetworkStatistics.calculateStatistics();
+    g.socialNetworkStatistics.printStatistics();
     
     //SocialNetworkAlgorithm::NetworkVisitor mVisitor(4);
     //boost::depth_first_visit(g.mGraph,g.idToVdMap[g.getRandomId()] , boost::visitor(mVisitor),boost::default_color_type());
plus

420

--- a/apps/user_ldap/lib/jobs/cleanup.php
+++ b/apps/user_ldap/lib/jobs/cleanup.php
@@ -121,7 +121,7 @@ public function isOffsetResetNecessary($resultCount) {
 
 	/**
 	 * checks whether cleaning up LDAP users is allowed
-	 * @return true
+	 * @return bool
 	 */
 	public function isCleanUpAllowed() {
 		try {
plus

6

--- a/st2api/st2api/controllers/v1/webhooks.py
+++ b/st2api/st2api/controllers/v1/webhooks.py
@@ -52,10 +52,6 @@ def post(self, *args, **kwargs):
         hook = '/'.join(args)  # TODO: There must be a better way to do this.
         LOG.info('POST /webhooks/ with hook=%s', hook)
 
-        if not self._is_valid_hook(hook):
-            msg = 'Webhook %s not registered with st2' % hook
-            return pecan.abort(http_client.NOT_FOUND, msg)
-
         body = pecan.request.body
         try:
             body = json.loads(body)
@@ -63,6 +59,13 @@ def post(self, *args, **kwargs):
             msg = 'Invalid JSON body: %s' % (body)
             return pecan.abort(http_client.BAD_REQUEST, msg)
 
+        if hook == 'st2' or hook == 'st2/':
+            return self._handle_st2_webhook(body)
+
+        if not self._is_valid_hook(hook):
+            msg = 'Webhook %s not registered with st2' % hook
+            return pecan.abort(http_client.NOT_FOUND, msg)
+
         trigger = self._get_trigger_for_hook(hook)
         payload = {}
         payload['headers'] = self._get_headers_as_dict(pecan.request.headers)
@@ -71,6 +74,16 @@ def post(self, *args, **kwargs):
 
         return body
 
+    def _handle_st2_webhook(self, body):
+        trigger = body.get('trigger', None)
+        payload = body.get('payload', None)
+        if not trigger:
+            msg = 'Trigger not specified.'
+            return pecan.abort(http_client.BAD_REQUEST, msg)
+        self._trigger_dispatcher.dispatch(trigger, payload=payload)
+
+        return body
+
     def _is_valid_hook(self, hook):
         # TODO: Validate hook payload with payload_schema.
         return hook in self._hooks
plus

31

--- a/src/git/GitCli.js
+++ b/src/git/GitCli.js
@@ -54,6 +54,16 @@ define(function (require, exports) {
         _gitPath = path;
     }
 
+    function fixCygwinPath(path) {
+        if (typeof path === "string" && brackets.platform === "win" && path.indexOf("/cygdrive/") === 0) {
+            path = path.substring("/cygdrive/".length)
+                       .replace(/^([a-z]+)\//, function (a, b) {
+                           return b.toUpperCase() + ":/";
+                       });
+        }
+        return path;
+    }
+
     function _processQueue() {
         // do nothing if the queue is busy
         if (_gitQueueBusy) {
@@ -877,6 +887,7 @@ define(function (require, exports) {
                 cwd: Utils.getProjectRoot()
             })
             .then(function (root) {
+                root = fixCygwinPath(root);
                 // directory should end with a slash
                 return root + "/";
             })
plus

58

--- a/java/org/apache/tomcat/websocket/WsFrameBase.java
+++ b/java/org/apache/tomcat/websocket/WsFrameBase.java
@@ -646,10 +646,10 @@ private boolean usePartial() {
         if (Util.isControl(opCode)) {
             return false;
         } else if (textMessage) {
-            return textMsgHandler instanceof MessageHandler.Partial<?>;
+            return textMsgHandler instanceof MessageHandler.Partial;
         } else {
             // Must be binary
-            return binaryMsgHandler instanceof MessageHandler.Partial<?>;
+            return binaryMsgHandler instanceof MessageHandler.Partial;
         }
     }
 
plus

3

--- a/src/game/MyButton.java
+++ b/src/game/MyButton.java
@@ -1,6 +1,8 @@
 package game;
 
 import java.awt.Color;
+import java.awt.Font;
+import java.awt.FontMetrics;
 import java.awt.Graphics;
 import java.awt.event.MouseEvent;
 
@@ -16,20 +18,23 @@
 	
     private void init()
     {
-    	setBackgroundColor(Color.LIGHT_GRAY);
+    	super.selectedColor = Color.LIGHT_GRAY;
 		this.flagActivated = true;
-		this.disabledColor = Color.darkGray;
+		this.disabledColor = Color.DARK_GRAY;
     }
 	public MyButton() 
 	{
 		super();
 		init();
+		this.setBackgroundSelectedColor(Color.DARK_GRAY);
 	}
 	
 	public MyButton(int x, int y,String txt)
 	{
 		super(txt, x, y);
 		init();
+		
+		
 	}
 	
 	public boolean isActivated() 
@@ -53,6 +58,12 @@ public void setDisabledColor(Color disabledColor)
 	
 	public void paint(Graphics g)
 	{
+		FontMetrics fm = g.getFontMetrics();
+		int max = (fm.stringWidth(this.getTxt()));
+		this.setWidth(max);
+		this.setHeight(fm.getDescent()+20);
+		
+		
 		if (!isActivated())
 		{
 			Color old = this.getBackgroundColor();
plus

3

--- a/src/main/java/monasca/api/app/command/CreateNotificationMethodCommand.java
+++ b/src/main/java/monasca/api/app/command/CreateNotificationMethodCommand.java
@@ -67,7 +67,7 @@ public boolean equals(Object obj) {
   public void validate() {
     switch (type) {
       case EMAIL : {
-        if (!EmailValidator.getInstance().isValid(address))
+        if (!EmailValidator.getInstance(true).isValid(address))
           throw Exceptions.unprocessableEntity("Address %s is not of correct format", address);
       }; break;
       case WEBHOOK : {
plus

3

--- a/start-services.sh
+++ b/start-services.sh
@@ -1,15 +1,19 @@
-BASE_DIR=~
+#!/usr/bin/env bash
+
+BASE_DIR=${BASE_DIR:-~}
 
 pm2 delete all
 
 # run all services as daemons
-NODE_ENV=production pm2 start ${BASE_DIR}/platform-ui/dist/server/app.js --name "UI"
-NODE_ENV=production pm2 start ${BASE_DIR}/discovery-service/server.js --name "Discovery"
-NODE_ENV=production pm2 start ${BASE_DIR}/notification-service/server.js --name "Notifications"
+NODE_ENV=production pm2 start ${BASE_DIR}/platform-ui/dist/server/app.js --name "ui"
+NODE_ENV=production pm2 start ${BASE_DIR}/discovery-service/server.js --name "discovery"
+NODE_ENV=production pm2 start ${BASE_DIR}/notification-service/server.js --name "notifications"
 
 # web interface
 pm2 web
 
 # start on startup
-sudo env PATH=$PATH:/usr/bin pm2 startup ubuntu -u ria
-pm2 save
\ No newline at end of file
+if [[ "$OSTYPE" == "linux-gnu" ]]; then
+	sudo env PATH=$PATH:/usr/bin pm2 startup ubuntu -u ria
+	pm2 save
+fi
\ No newline at end of file
plus

3

--- a/app/views/login.js
+++ b/app/views/login.js
@@ -65,6 +65,24 @@ YUI.add('juju-view-login', function(Y) {
     },
 
     /**
+     * Check the version of juju-core to see if the username should be
+     * locked to admin.
+     *
+     * @method _shouldLockAdmin
+     * @return {Boolean} Whether the username should be locked to admin.
+     */
+    _shouldLockAdmin: function() {
+      if (window.juju_config && window.juju_config.jujuCoreVersion) {
+        var version = parseFloat(window.juju_config.jujuCoreVersion.split(
+            '.').slice(0, 2).join('.'));
+        if (version < 1.21) {
+          return true;
+        }
+      }
+      return false;
+    },
+
+    /**
      * Render the page.
      *
      * Reveal the mask element, and show the login form.
@@ -110,6 +128,7 @@ YUI.add('juju-view-login', function(Y) {
         environment_name: environment_name,
         error_text: error_text,
         user: user,
+        lockAdmin: this._shouldLockAdmin(),
         help_text: this.get('help_text')
       }));
       return this;
plus

6

--- a/st2api/st2api/controllers/v1/webhooks.py
+++ b/st2api/st2api/controllers/v1/webhooks.py
@@ -52,10 +52,6 @@ def post(self, *args, **kwargs):
         hook = '/'.join(args)  # TODO: There must be a better way to do this.
         LOG.info('POST /webhooks/ with hook=%s', hook)
 
-        if not self._is_valid_hook(hook):
-            msg = 'Webhook %s not registered with st2' % hook
-            return pecan.abort(http_client.NOT_FOUND, msg)
-
         body = pecan.request.body
         try:
             body = json.loads(body)
@@ -63,6 +59,13 @@ def post(self, *args, **kwargs):
             msg = 'Invalid JSON body: %s' % (body)
             return pecan.abort(http_client.BAD_REQUEST, msg)
 
+        if hook == 'st2' or hook == 'st2/':
+            return self._handle_st2_webhook(body)
+
+        if not self._is_valid_hook(hook):
+            msg = 'Webhook %s not registered with st2' % hook
+            return pecan.abort(http_client.NOT_FOUND, msg)
+
         trigger = self._get_trigger_for_hook(hook)
         payload = {}
         payload['headers'] = self._get_headers_as_dict(pecan.request.headers)
@@ -71,6 +74,16 @@ def post(self, *args, **kwargs):
 
         return body
 
+    def _handle_st2_webhook(self, body):
+        trigger = body.get('trigger', None)
+        payload = body.get('payload', None)
+        if not trigger:
+            msg = 'Trigger not specified.'
+            return pecan.abort(http_client.BAD_REQUEST, msg)
+        self._trigger_dispatcher.dispatch(trigger, payload=payload)
+
+        return body
+
     def _is_valid_hook(self, hook):
         # TODO: Validate hook payload with payload_schema.
         return hook in self._hooks
plus

8

--- a/openapps/cstorm/cstorm.c
+++ b/openapps/cstorm/cstorm.c
@@ -52,7 +52,7 @@ void cstorm_init(void) {
    /*
    //start a periodic timer
    //comment : not running by default
-   cstorm_vars.period           = 65534; 
+   cstorm_vars.period           = 6553; 
    
    cstorm_vars.timerId                    = opentimers_start(
       cstorm_vars.period,
@@ -191,12 +191,12 @@ void cstorm_task_cb() {
    //TODO: This is not conform with RFC7252, but yes with current dissector WS v1.10.6
    numOptions = 0;
    
-   //Biggers Options last in message, first in the code (as it is in reverse order) 
+   //Bigger Options last in message, first in the code (as it is in reverse order) 
    //Deltas are calculated between too consecutive lengthes.
    
    // content-type option
    packetfunctions_reserveHeaderSize(pkt,2);
-   pkt->payload[0] = (COAP_OPTION_NUM_CONTENTFORMAT-COAP_OPTION_NUM_URIPATH) << 4 | sizeof(cstorm_payload)-1; 
+   pkt->payload[0] = (COAP_OPTION_NUM_CONTENTFORMAT-COAP_OPTION_NUM_URIPATH) << 4 | 1; 
    pkt->payload[1] = COAP_MEDTYPE_APPOCTETSTREAM;
    numOptions++;
    
plus

14

--- a/src/bin/cli/program.js
+++ b/src/bin/cli/program.js
@@ -10,19 +10,21 @@ program
     .version(version);
 
 program
-    .command('init')
+    .command('init [path]')
     .description('Init your static website')
-    .action((path) => {
+     // [BUG] https://github.com/jshint/jshint/issues/1849 - can't use arrow function
+    .action(function(path = '.') {
         console.log(logo);
-        init(typeof path === 'string' ? path : './');
+        init(path);
     });
 
 program
-    .command('config')
+    .command('config [path]')
     .description('Config your static website')
-    .action(() => {
+     // [BUG] https://github.com/jshint/jshint/issues/1849 - can't use arrow function
+    .action(function(path = '.') {
         console.log(logo);
-        config();
+        config(path);
     });
 
 program
@@ -50,7 +52,8 @@ program
 program
     .command('run [port]')
     .description('Run you static site locally. Port is optional')
-    .action(function(port = 9356) { // We're not using arrow function here due to an jshint issue
+     // [BUG] https://github.com/jshint/jshint/issues/1849 - can't use arrow function
+    .action(function(port = 9356) {
         let core = require('../core'),
             build = core.init();
         if (build) {
plus

23

--- a/src/mess/video/apple2.c
+++ b/src/mess/video/apple2.c
@@ -1201,7 +1201,15 @@ void a2_video_device::hgr_update(screen_device &screen, bitmap_ind16 &bitmap, co
 			switch (mon_type)
 			{
 				case 0:
-					artifact_map_ptr = &m_hires_artifact_map[((vram_row[col+1] & 0x80) >> 7) * 16];
+					// verified on h/w: setting dhires w/o 80col emulates a rev. 0 Apple ][ with no orange/blue
+					if (m_dhires)
+					{
+						artifact_map_ptr = m_hires_artifact_map;
+					}
+					else
+					{
+						artifact_map_ptr = &m_hires_artifact_map[((vram_row[col + 1] & 0x80) >> 7) * 16]; 
+					}
 					for (b = 0; b < 7; b++)
 					{
 						v = artifact_map_ptr[((w >> (b + 7-1)) & 0x07) | (((b ^ col) & 0x01) << 3)];