plus

7

--- a/core/flow/Warehouse.php
+++ b/core/flow/Warehouse.php
@@ -287,8 +287,6 @@ public function loader ( $workflow = false ) {
 			case 'bestselling': $is_bestselling = true; break;
 		}
 
-
-
 		if ( $is_inventory ) $per_page = 50;
 		$pagenum = absint( $paged );
 		$start = ( $per_page * ( $pagenum - 1 ) );
plus

789

--- a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp
+++ b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp
@@ -163,15 +163,7 @@ namespace cocostudio
         label->setFontSize(fontSize);
         
         std::string fontName = options.has_fontname() ? options.fontname() : "";
-        
-        std::string fontFilePath = protocolBuffersPath.append(fontName);
-		if (FileUtils::getInstance()->isFileExist(fontFilePath))
-		{
-			label->setFontName(fontFilePath);
-		}
-		else{
-			label->setFontName(fontName);
-		}
+        label->setFontName(fontName);        
         
         bool aw = options.has_areawidth();
         bool ah = options.has_areaheight();
plus

4

--- a/src/api/java/baubles/api/package-info.java
+++ b/src/api/java/baubles/api/package-info.java
@@ -1,4 +1,4 @@
-@API(owner = "Baubles", apiVersion = baubles.common.Baubles.VERSION, provides = "Baubles|API")
+@API(owner = "Baubles", apiVersion = "1.0.1.8", provides = "Baubles|API")
 package baubles.api;
 
 import cpw.mods.fml.common.API;
plus

64

--- a/handlers/notification/mailer.rb
+++ b/handlers/notification/mailer.rb
@@ -74,6 +74,7 @@ def handle
     admin_gui = settings[json_config]['admin_gui'] || 'http://localhost:8080/'
     mail_to = build_mail_to_list
     mail_from =  settings[json_config]['mail_from']
+    reply_to = settings[json_config]['reply_to'] || mail_from
 
     delivery_method = settings[json_config]['delivery_method'] || 'smtp'
     smtp_address = settings[json_config]['smtp_address'] || 'localhost'
@@ -128,10 +129,11 @@ def handle
     begin
       timeout 10 do
         Mail.deliver do
-          to      mail_to
-          from    mail_from
-          subject subject
-          body    body
+          to       mail_to
+          from     mail_from
+          reply_to reply_to
+          subject  subject
+          body     body
         end
 
         puts 'mail -- sent alert for ' + short_name + ' to ' + mail_to.to_s
plus

3

--- a/Assets/Resources/Scripts/PlayerSpell.js
+++ b/Assets/Resources/Scripts/PlayerSpell.js
@@ -169,6 +169,7 @@ function hit(other : GameObject){
 
 //All of the basic attack status buffs
 function applyStatus(target : GameObject){
+	target.GetComponent(EnemyMove).runAway = true;
 	target.GetComponent(EnemyStatus).takeDamage(10, false);
 	if(ice){
 		target.GetComponent(EnemyMove).iceTimer = 5;							//Apply ice if arrow is iced
plus

3

--- a/touchandgo/stream_server.py
+++ b/touchandgo/stream_server.py
@@ -9,6 +9,7 @@
 from BaseHTTPServer import HTTPServer
 from SimpleHTTPServer import SimpleHTTPRequestHandler
 
+from json import dumps
 from os import fstat
 from time import sleep
 
@@ -32,14 +33,29 @@ def handle_one_request(self, *args, **kwargs):
         except:
             pass
 
+    def status(self):
+        log.debug("returning 200 code")
+        self.send_response(200)
+        self.send_header("Content-Type", "application/json")
+        self.end_headers()
+
+        dict_ = {"stats": self.manager.stats()}
+        data = dumps(dict_)
+        self.wfile.write(data)
+
+
     def do_GET(self):
-        f = self.send_head()
-        if f:
-            if self.range_from is not None and self.range_to is not None:
-                self.copy_chunk(f, self.wfile)
-            else:
-                self.copyfile(f, self.wfile)
-            f.close()
+
+        if self.path == "/status":
+            self.status()
+        else:
+            f = self.send_head()
+            if f:
+                if self.range_from is not None and self.range_to is not None:
+                    self.copy_chunk(f, self.wfile)
+                else:
+                    self.copyfile(f, self.wfile)
+                f.close()
 
     def copy_chunk(self, in_file, out_file):
         def get_piece_length():
@@ -63,7 +79,6 @@ def is_block_available(block_number):
 
         bytes_copied = 0
         blocks = get_blocks_for_range(self.range_from, self.range_to)
-        #print "getting blocks", blocks
         for block_number in range(blocks[0], blocks[1]+1):
             if not is_block_available(block_number):
                 log.debug("requesting block %s" % block_number)
@@ -72,8 +87,6 @@ def is_block_available(block_number):
 
             while not is_block_available(block_number):
                 sleep(WAIT_FOR_IT)
-            #print "returning block", block_number
-            #log.debug("returning block %s" % block_number)
             self.manager.block_served(block_number)
             read_buf = in_file.read(length)
             if len(read_buf) == 0:
plus

14

--- a/gdal/apps/gdaltransform.cpp
+++ b/gdal/apps/gdaltransform.cpp
@@ -299,7 +299,7 @@ int main( int argc, char ** argv )
                             &dfX, &dfY, &dfZ, &bSuccess )
             && bSuccess )
         {
-            printf( "%.15g %.15g %.15g\n", dfX, dfY, dfZ );
+            CPLprintf( "%.15g %.15g %.15g\n", dfX, dfY, dfZ );
         }
         else
         {
plus

11

--- a/arc.c
+++ b/arc.c
@@ -888,7 +888,7 @@ error builtin_mod(atom args, atom *result) {
 	atom dividend = car(args);
 	atom divisor = car(cdr(args));
 	double r = fmod(dividend.value.number, divisor.value.number);
-	if (dividend.value.number * divisor.value.number < 0) r += divisor.value.number;
+	if (dividend.value.number * divisor.value.number < 0 && r != 0) r += divisor.value.number;
 	*result = make_number(r);
 	return ERROR_OK;
 }
plus

3

--- a/server.c
+++ b/server.c
@@ -238,11 +238,14 @@ on_shutdown(uv_shutdown_t* req, int status) {
 */
 
 static int
-find_header(http_request* request, const char* name) {
+content_length(http_request* request) {
   int i;
+  char buf[16];
   for (i = 0; i < request->num_headers; i++)
-    if (!strncasecmp(request->headers[i].name, name, request->headers[i].name_len))
-      return i;
+    if (!strncasecmp(request->headers[i].name, "content-length", request->headers[i].name_len)) {
+      strncpy(buf, request->headers[i].value, request->headers[i].value_len);
+      return atol(buf);
+    }
   return -1;
 }
 
@@ -302,41 +305,48 @@ on_read(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) {
     return;
   }
 
-#define END_WITH(p,l) (l>=4 && ((*(p+l-4)=='\r' && *(p+l-3)=='\n' && *(p+l-2)=='\r' && *(p+l-1)=='\n')||(l>=2 && *(p+l-2)=='\n' && *(p+l-1)=='\n')))
-  if (END_WITH(buf->base, nread)) {
-    http_request* request = calloc(1, sizeof(http_request));
-    if (request == NULL) {
-      free(buf->base);
-      fprintf(stderr, "Allocate error: %s\n", strerror(errno));
-      uv_close((uv_handle_t*) stream, on_close);
-      return;
-    }
-    stream->data = request;
-
-    request->handle = (uv_handle_t*) stream;
-
-    request->num_headers = sizeof(request->headers) / sizeof(request->headers[0]);
-    int nparsed = phr_parse_request(
-            buf->base,
-            buf->len,
-            &request->method,
-            &request->method_len,
-            &request->path,
-            &request->path_len,
-            &request->minor_version,
-            request->headers,
-            &request->num_headers,
-            nread);
-    if (nparsed < nread) {
-      free(request);
-      free(buf->base);
-      fprintf(stderr, "Invalid request\n");
-      uv_close((uv_handle_t*) stream, on_close);
-      return;
-    } else {
-      request_complete(request);
-    }
+  http_request* request = calloc(1, sizeof(http_request));
+  if (request == NULL) {
+    free(buf->base);
+    fprintf(stderr, "Allocate error: %s\n", strerror(errno));
+    uv_close((uv_handle_t*) stream, on_close);
+    return;
+  }
+  stream->data = request;
+
+  request->handle = (uv_handle_t*) stream;
+
+  request->num_headers = sizeof(request->headers) / sizeof(request->headers[0]);
+  int nparsed = phr_parse_request(
+          buf->base,
+          buf->len,
+          &request->method,
+          &request->method_len,
+          &request->path,
+          &request->path_len,
+          &request->minor_version,
+          request->headers,
+          &request->num_headers,
+          0);
+  if (nparsed < 0) {
+    free(request);
+    free(buf->base);
+    fprintf(stderr, "Invalid request\n");
+    uv_close((uv_handle_t*) stream, on_close);
+    return;
+  }
+  /*
+  int cl = content_length(request);
+  if (cl >= 0 && cl < buf->len - nparsed) {
+    free(request);
+    free(buf->base);
+    return;
   }
+  */
+  /* TODO: handle reading whole payload */
+  request->payload = buf->base + nparsed;
+  request->payload_len = buf->len - nparsed;
+  request_complete(request);
   free(buf->base);
 }
 
plus

1806

--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -1109,29 +1109,49 @@ def check_related_objects(self, field, value, opts):
                     self.check_query_object_type(v, opts)
 
     def build_lookup(self, lookups, lhs, rhs):
+        """
+        Tries to extract transforms and lookup from given lhs.
+
+        The lhs value is something that works like SQLExpression.
+        The rhs value is what the lookup is going to compare against.
+        The lookups is a list of names to extract using get_lookup()
+        and get_transform().
+        """
         lookups = lookups[:]
         bilaterals = []
         while lookups:
-            lookup = lookups[0]
+            name = lookups[0]
+            # If there is just one part left, try first get_lookup() so
+            # that if the lhs supports both transform and lookup for the
+            # name, then lookup will be picked.
             if len(lookups) == 1:
-                final_lookup = lhs.get_lookup(lookup)
-                if final_lookup:
-                    return final_lookup(lhs, rhs, bilaterals)
-                # We didn't find a lookup, so we are going to try get_transform
-                # + get_lookup('exact').
-                lookups.append('exact')
-            next = lhs.get_transform(lookup)
-            if next:
-                lhs = next(lhs, lookups)
-                if getattr(next, 'bilateral', False):
-                    bilaterals.append((next, lookups))
-            else:
-                raise FieldError(
-                    "Unsupported lookup '%s' for %s or join on the field not "
-                    "permitted." %
-                    (lookup, lhs.output_field.__class__.__name__))
+                final_lookup = lhs.get_lookup(name)
+                if not final_lookup:
+                    # We didn't find a lookup. We are going to interpret
+                    # the name as transform, and do an Exact lookup against
+                    # it.
+                    lhs = self.try_transform(lhs, name, lookups, bilaterals)
+                    final_lookup = lhs.get_lookup('exact')
+                return final_lookup(lhs, rhs, bilaterals)
+            lhs = self.try_transform(lhs, name, lookups, bilaterals)
             lookups = lookups[1:]
 
+    def try_transform(self, lhs, name, rest_of_lookups, bilaterals):
+        """
+        Helper method for build_lookup. Tries to fetch and initialize
+        a transform for name parameter from lhs.
+        """
+        next = lhs.get_transform(name)
+        if next:
+            if getattr(next, 'bilateral', False):
+                bilaterals.append((next, rest_of_lookups))
+            return next(lhs, rest_of_lookups)
+        else:
+            raise FieldError(
+                "Unsupported lookup '%s' for %s or join on the field not "
+                "permitted." %
+                (name, lhs.output_field.__class__.__name__))
+
     def build_filter(self, filter_expr, branch_negated=False, current_negated=False,
                      can_reuse=None, connector=AND):
         """
plus

5

--- a/pages/mobile/details.py
+++ b/pages/mobile/details.py
@@ -23,9 +23,18 @@ class Details(Base):
     _more_less_locator = (By.CLASS_NAME, 'show-toggle')
     _rating_count_locator = (By.CSS_SELECTOR, '.average-rating > span:nth-child(1)')
     _reviews_locator = (By.CSS_SELECTOR, '.reviews > .ratings-placeholder-inner > li')
-    _support_section_buttons_locator = (By.CSS_SELECTOR, '.infobox.support li')
     _app_not_rated_yet_locator = (By.CLASS_NAME, 'not-rated')
 
+    # Support buttons
+    _support_email_locator = (By.CSS_SELECTOR, '.support-email > a')
+    _support_site_locator = (By.CSS_SELECTOR, '.support-url > a')
+    _homepage_locator = (By.CSS_SELECTOR, '.homepage > a')
+    _privacy_policy_locator = (By.CSS_SELECTOR, '.privacy-policy > a')
+    _report_abuse_locator = (By.CSS_SELECTOR, '.abuse > a')
+
+    support_buttons_list = [_support_email_locator, _support_site_locator,
+                            _homepage_locator, _privacy_policy_locator, _report_abuse_locator]
+
     @property
     def _page_title(self):
         return '%s | Firefox Marketplace' % self.title
@@ -99,12 +108,8 @@ def is_app_rated(self):
     def app_not_rated_text(self):
         return self.selenium.find_element(*self._app_not_rated_yet_locator).text
 
-    @property
-    def support_buttons(self):
-        return [self.SupportButton(self.testsetup, web_element)
-                for web_element in self.selenium.find_elements(*self._support_section_buttons_locator)]
-
     class Review(PageRegion):
+
         _name_locator = (By.CSS_SELECTOR, 'strong')
 
         @property
@@ -119,13 +124,3 @@ def is_visible(self):
         def review_id(self):
             return self._root_element.get_attribute('data-report-uri').split('/')[5]
 
-    class SupportButton(PageRegion):
-        _name_locator = (By.CSS_SELECTOR, 'a')
-
-        @property
-        def name(self):
-            return self.find_element(*self._name_locator).text
-
-        @property
-        def is_visible(self):
-            return self.find_element(*self._name_locator).is_displayed()
plus

3

--- a/backend/tomato/api/dumpmanager.py
+++ b/backend/tomato/api/dumpmanager.py
@@ -70,8 +70,8 @@ def errordump_remove(source, dump_id):
     Parameter *dump_id*: 
       The unique identifier of the dump to be removed.
     """
-    from ..dumpmanager import remove_dump
-    remove_dump(source, dump_id)
+    from ..dumpmanager import api_errordump_remove
+    api_errordump_remove(source, dump_id)
 
 def errorgroup_info(group_id, include_dumps=False):
     """
@@ -120,5 +120,5 @@ def errorgroup_remove(group_id):
     Parameter *dump_id*: 
       The unique identifier of the group to be removed.
     """
-    from ..dumpmanager import remove_group
-    remove_group(group_id)
\ No newline at end of file
+    from ..dumpmanager import api_errorgroup_remove
+    api_errorgroup_remove(group_id)
\ No newline at end of file
plus

4

index 0000000..e5234cc
--- /dev/null
+++ b/server/src/main/java/com/zhishy/bridge/server/BridgeServer.java
@@ -0,0 +1,7 @@
+package com.zhishy.bridge.server;
+
+/**
+ * Created by William on 2014/11/11.
+ */
+public class BridgeServer {
+}
plus

36

--- a/lib/Element.js
+++ b/lib/Element.js
@@ -49,11 +49,14 @@ var Element = React.createClass({
     }
   },
 
-  shouldComponentUpdate({value}) {
-    var shouldComponentUpdate = (
-      value.node.props.get('forceUpdate') ||
-      !is(value, this.props.value)
-    );
+  shouldComponentUpdate(props) {
+    var shouldComponentUpdate = false;
+    for (var name in props) {
+      if (!is(props[name], this.props[name])) {
+        shouldComponentUpdate = true;
+        break;
+      }
+    }
     return shouldComponentUpdate;
   }
 });
plus

34

index 0000000..42e6737
--- /dev/null
+++ b/test/integration/csrf_test.rb
@@ -0,0 +1,43 @@
+require 'test_helper'
+
+class CsrfTest < ActionController::TestCase
+  class TestAdminController < Admin::BaseController
+    def create
+      render text: 'OK'
+    end
+  end
+  tests TestAdminController
+
+  setup do
+    ActionController::Base.allow_forgery_protection = true
+    login_as_admin
+  end
+
+  teardown do
+    ActionController::Base.allow_forgery_protection = false
+  end
+
+  test "raises an InvalidAuthenticityToken exception without a valid CSRF token" do
+    with_test_routes do
+      assert_raises ActionController::InvalidAuthenticityToken do
+        post :create
+      end
+    end
+  end
+
+  test "does not raise an exception with a valid CSRF token" do
+    with_test_routes do
+      session["_csrf_token"] = SecureRandom.base64(32)
+      post :create, authenticity_token: session["_csrf_token"]
+    end
+  end
+
+  def with_test_routes(&block)
+    with_routing do |map|
+      map.draw do
+        post '/post_csrf', to: 'csrf_test/test_admin#create'
+      end
+      yield block
+    end
+  end
+end
plus

6

--- a/framework/core/subsystems/expString.php
+++ b/framework/core/subsystems/expString.php
@@ -242,7 +242,7 @@ public static function sanitize(&$data) {
         $data = str_replace(array('\r', '\n'), array("\r", "\n"), $data);
 
         // remove old tag fragments
-        $data = str_replace(array('\">','\"/>'), '', $data);
+//        $data = str_replace(array('\">','\"/>'), '', $data);
         return $data;
     }
 
@@ -257,7 +257,15 @@ public static function sanitize_array(array &$data)
     {
         if (is_string($data)) return self::sanitize($data);
 
+        // code snippets must be allowed to pass <script> tags
+        $saved_params = array();
+        if (!empty($data['controller']) && $data['controller'] == 'snippet') {
+            $saved_params['body'] = $data['body'];
+        }
         array_walk_recursive($data, array('self','sanitize'));
+        if (!empty($saved_params)) {
+            $data = array_merge($data, $saved_params);
+        }
         return $data;
     }
 
plus

20

--- a/src/com/almalence/opencam/ui/SelfTimerAndPhotoTimeLapse.java
+++ b/src/com/almalence/opencam/ui/SelfTimerAndPhotoTimeLapse.java
@@ -198,6 +198,15 @@ public void onScrollStateChange(NumberPicker numberPicker, int scrollState)
 				sw.setChecked(true);
 			}
 		});
+		
+		npTimeLapseMeasurment.setOnScrollListener(new NumberPicker.OnScrollListener()
+		{
+			@Override
+			public void onScrollStateChange(NumberPicker numberPicker, int scrollState)
+			{
+				sw.setChecked(true);
+			}
+		});
 
 		// disable control in dialog by default
 		if (swTimeLapseChecked)
plus

41

--- a/src/packages/default/CoreWM/main.js
+++ b/src/packages/default/CoreWM/main.js
@@ -732,7 +732,7 @@
 
     var cn = document.body.className;
     var nc = 'Wallpaper' + className + ' ';
-    document.body.className             = cn.replace(/(Wallpaper(.*)\s?)?/, nc);
+    document.body.className = cn.replace(/(Wallpaper(.*)\s?)?/, nc);
 
     if ( back !== 'none' ) {
       VFS.url(back, function(error, result) {
plus

6

index 0000000..c169e27
--- /dev/null
+++ b/utils/sort_by_id.py
@@ -0,0 +1,33 @@
+#!/usr/bin/env python
+"""
+Sort tweets by ID.
+
+Twitter IDs are generated in chronologically ascending order,
+so this is the same as sorting by date.
+
+The output of `twarc --scrape` isn't necessarily in strict (reverse)
+chronological order.
+
+Example usage:
+utils/sort_by_id.py tweets.json > sorted.json
+"""
+from __future__ import print_function
+
+import sys
+import json
+from operator import itemgetter
+import fileinput
+import dateutil.parser
+
+
+tweets = []
+for line in fileinput.input():
+    tweet = json.loads(line)
+    tweets.append(tweet)
+
+tweets = sorted(tweets, key=itemgetter('id'))
+
+for tweet in tweets:
+    print(json.dumps(tweet))
+
+# End of file
plus

139

--- a/PHPDaemon/Servers/FastCGI/Pool.php
+++ b/PHPDaemon/Servers/FastCGI/Pool.php
@@ -23,18 +23,15 @@ class Pool extends \PHPDaemon\Network\Server {
 	 */
 	protected function getConfigDefaults() {
 		return [
-			/* [boolean] Expose PHPDaemon version by X-Powered-By Header */
-			'expose'                  => 1,
-
-			/* [boolean] Read request body from the file given in REQUEST_BODY_FILE parameter */
-			'auto-read-body-file'     => 1,
-
 			/* [string|array] Listen addresses */
 			'listen'                  => 'tcp://127.0.0.1,unix:///tmp/phpdaemon.fcgi.sock',
 
 			/* [integer] Listen port */
 			'port'                    => 9000,
 
+			/* [boolean] Read request body from the file given in REQUEST_BODY_FILE parameter */
+			'auto-read-body-file'     => 1,
+
 			/* [string] Allowed clients ip list */
 			'allowed-clients'         => '127.0.0.1',
 
@@ -50,6 +47,9 @@ protected function getConfigDefaults() {
 			/* [boolean] Use X-Sendfile only if server['USE_SENDFILE'] provided. */
 			'send-file-onlybycommand' => 0,
 
+			/* [boolean] Expose PHPDaemon version by X-Powered-By Header */
+			'expose'                  => 1,
+
 			/* [Time] Keepalive time */
 			'keepalive'               => new Time('0s'),