plus

3

--- a/src/net/FromBaidu.java
+++ b/src/net/FromBaidu.java
@@ -73,7 +73,7 @@ protected Word analyze(String text_HTML){//annalyze the word from html text
 	@Override
 	protected URL getURL(String word) throws MalformedURLException {
 		// TODO Auto-generated method stub
-		return new URL(url_prefix + word.replaceAll(" ", "%20"));//URL
+		return new URL(url_prefix + word.replaceAll(" ", "%20"));//URL
 	}
 	public static void main(String[] args){
 		WordEngine baidu = new FromBaidu();
plus

3

--- a/src/corelib/tools/qringbuffer_p.h
+++ b/src/corelib/tools/qringbuffer_p.h
@@ -91,11 +91,20 @@ class QRingBuffer
             int blockSize = buffers.first().size() - head;
 
             if (tailBuffer == 0 || blockSize > bytes) {
-                bufferSize -= bytes;
-                if (bufferSize <= 0)
-                    clear(); // try to minify/squeeze us
-                else
+                // keep a single block around if it does not exceed
+                // the basic block size, to avoid repeated allocations
+                // between uses of the buffer
+                if (bufferSize <= bytes) {
+                    if (buffers.first().size() <= basicBlockSize) {
+                        bufferSize = 0;
+                        head = tail = 0;
+                    } else {
+                        clear(); // try to minify/squeeze us
+                    }
+                } else {
                     head += bytes;
+                    bufferSize -= bytes;
+                }
                 return;
             }
 
@@ -139,11 +148,20 @@ class QRingBuffer
     inline void chop(int bytes) {
         while (bytes > 0) {
             if (tailBuffer == 0 || tail > bytes) {
-                bufferSize -= bytes;
-                if (bufferSize <= 0)
-                    clear(); // try to minify/squeeze us
-                else
+                // keep a single block around if it does not exceed
+                // the basic block size, to avoid repeated allocations
+                // between uses of the buffer
+                if (bufferSize <= bytes) {
+                    if (buffers.first().size() <= basicBlockSize) {
+                        bufferSize = 0;
+                        head = tail = 0;
+                    } else {
+                        clear(); // try to minify/squeeze us
+                    }
+                } else {
                     tail -= bytes;
+                    bufferSize -= bytes;
+                }
                 return;
             }
 
plus

60

--- a/lib/mincer/server.js
+++ b/lib/mincer/server.js
@@ -131,7 +131,7 @@ function log_event(req, code, message, elapsed) {
 
 
 function serve_asset(self, asset, req, res, timer) {
-  var buffer, length;//, parsed_url, source_map_url;
+  var buffer, length;
 
   // OK
   self.log('info', log_event(req, 200, 'OK', timer.stop()));
@@ -161,24 +161,6 @@ function serve_asset(self, asset, req, res, timer) {
     res.setHeader('Content-Encoding', 'gzip');
   }
 
-  /*if (asset.sourceMap) {
-    // req.originalUrl is a full (original) URL of request before it was
-    // modified by connect/express router, which strips out mount point
-    // of a middleware:
-    //
-    //   app.use("/assets", new Mincer.Server(environment));
-    //
-    //   GET /assets/app.js
-    //
-    //   req.url          # => /app.js
-    //   res.originalUrl  # => /assets/app.js
-    //
-    // http://expressjs.com/api.html#req.originalUrl
-    parsed_url = url.parse(req.originalUrl || req.url);
-    parsed_url.pathname += '.map';
-    source_map_url = url.format(parsed_url);
-  }*/
-
   //
   // Set content type and length headers
   // Force charset for text assets, to avoid problems with JS loaders
plus

4

--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -874,6 +874,12 @@ bool OpenGLContext::ImplInit()
     else
     {
         WindowPix = ChoosePixelFormat(m_aGLWin.hDC, &PixelFormatFront);
+#if 1
+        PIXELFORMATDESCRIPTOR pfd;
+        DescribePixelFormat(m_aGLWin.hDC, WindowPix, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
+        SAL_WARN("vcl.opengl", "Render Target: Window: " << (int) ((pfd.dwFlags & PFD_DRAW_TO_WINDOW) != 0) << ", Bitmap: " << (int) ((pfd.dwFlags & PFD_DRAW_TO_BITMAP) != 0));
+        SAL_WARN("vcl.opengl", "Supports OpenGL: " << (int) ((pfd.dwFlags & PFD_SUPPORT_OPENGL) != 0));
+#endif
     }
 
     if (WindowPix == 0)
plus

3

--- a/app/helpers/passport/actions.js
+++ b/app/helpers/passport/actions.js
@@ -6,9 +6,6 @@ var passport = require('passport')
   , bcrypt = require('bcrypt');
 
 var SUPPORTED_SERVICES = [
-      'twitter'
-    , 'facebook'
-    , 'yammer'
     ];
 
 SUPPORTED_SERVICES.forEach(function (item) {
plus

557

--- a/app/models/CocoModel.coffee
+++ b/app/models/CocoModel.coffee
@@ -122,6 +122,7 @@ class CocoModel extends Backbone.Model
     success = options.success
     error = options.error
     options.success = (model, res) =>
+      @retries = 0
       @trigger 'save:success', @
       success(@, res) if success
       @markToRevert() if @_revertAttributes
@@ -130,9 +131,16 @@ class CocoModel extends Backbone.Model
       options.success = options.error = null  # So the callbacks can be garbage-collected.
     options.error = (model, res) =>
       if res.status is 0
-        msg = $.i18n.t 'loading_error.connection_failure', defaultValue: 'Connection failed.'
-        noty text: msg, layout: 'center', type: 'error', killer: true, timeout: 3000
-        return _.delay((f = => @save(attrs, originalOptions)), 3000)
+        @retries ?= 0
+        @retries += 1
+        if @retries > 20
+          msg = 'Your computer or our servers appear to be offline. Please try refreshing.'
+          noty text: msg, layout: 'center', type: 'error', killer: true
+          return
+        else
+          msg = $.i18n.t 'loading_error.connection_failure', defaultValue: 'Connection failed.'
+          noty text: msg, layout: 'center', type: 'error', killer: true, timeout: 3000
+          return _.delay((f = => @save(attrs, originalOptions)), 3000)
       error(@, res) if error
       return unless @notyErrors
       errorMessage = "Error saving #{@get('name') ? @type()}"
plus

17

--- a/tinkergraph-gremlin/src/main/java/com/tinkerpop/gremlin/tinkergraph/structure/TinkerElement.java
+++ b/tinkergraph-gremlin/src/main/java/com/tinkerpop/gremlin/tinkergraph/structure/TinkerElement.java
@@ -86,7 +86,7 @@ public boolean equals(final Object object) {
     public <V> Iterator<? extends Property<V>> propertyIterator(final String... propertyKeys) {
         return (Iterator) (TinkerHelper.inComputerMode(this.graph) ?
                 this.graph.graphView.getProperties(TinkerElement.this).stream().filter(p -> ElementHelper.keyExists(p.key(), propertyKeys)).iterator() :
-                this.properties.values().stream().flatMap(list -> list.stream()).filter(p -> ElementHelper.keyExists(p.key(), propertyKeys)).collect(Collectors.toList()).iterator());
+                this.properties.entrySet().stream().filter(entry -> ElementHelper.keyExists(entry.getKey(),propertyKeys)).flatMap(entry -> entry.getValue().stream()).collect(Collectors.toList()).iterator());
     }
 
 
plus

18

--- a/tinkergraph-gremlin/src/main/java/com/tinkerpop/gremlin/tinkergraph/structure/TinkerElement.java
+++ b/tinkergraph-gremlin/src/main/java/com/tinkerpop/gremlin/tinkergraph/structure/TinkerElement.java
@@ -86,7 +86,7 @@ public boolean equals(final Object object) {
     public <V> Iterator<? extends Property<V>> propertyIterator(final String... propertyKeys) {
         return (Iterator) (TinkerHelper.inComputerMode(this.graph) ?
                 this.graph.graphView.getProperties(TinkerElement.this).stream().filter(p -> ElementHelper.keyExists(p.key(), propertyKeys)).iterator() :
-                this.properties.values().stream().flatMap(list -> list.stream()).filter(p -> ElementHelper.keyExists(p.key(), propertyKeys)).collect(Collectors.toList()).iterator());
+                this.properties.entrySet().stream().filter(entry -> ElementHelper.keyExists(entry.getKey(),propertyKeys)).flatMap(entry -> entry.getValue().stream()).collect(Collectors.toList()).iterator());
     }
 
 
plus

26

--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -643,7 +643,7 @@ print_help (void)
 	printf (UT_IPv46);
 
 	printf (" %s\n", "-E, --escape");
-  printf ("    %s\n", _("Can use \\n, \\r, \\t or \\ in send or quit string. Must come before send or quit option"));
+  printf ("    %s\n", _("Can use \\n, \\r, \\t or \\\\ in send or quit string. Must come before send or quit option"));
   printf ("    %s\n", _("Default: nothing added to send, \\r\\n added to end of quit"));
   printf (" %s\n", "-s, --send=STRING");
   printf ("    %s\n", _("String to send to the server"));
plus

115

--- a/hikaricp-common/src/main/java/com/zaxxer/hikari/HikariDataSource.java
+++ b/hikaricp-common/src/main/java/com/zaxxer/hikari/HikariDataSource.java
@@ -178,7 +178,7 @@ public int getLoginTimeout() throws SQLException
    @SuppressWarnings("unchecked")
    public <T> T unwrap(Class<T> iface) throws SQLException
    {
-      if (iface == this.getClass()) {
+      if (iface.isInstance(this)) {
          return (T) this;
       }
       else if (pool != null) {
@@ -197,7 +197,7 @@ else if (pool.getDataSource() instanceof Wrapper) {
    @Override
    public boolean isWrapperFor(Class<?> iface) throws SQLException
    {
-      if (iface == this.getClass()) {
+      if (iface.isInstance(this)) {
          return true;
       }
       else if (pool != null) {
plus

4

--- a/rmgpy/molecule/molecule.py
+++ b/rmgpy/molecule/molecule.py
@@ -1070,10 +1070,39 @@ def findSubgraphIsomorphisms(self, other, initialMap=None):
         The `other` parameter must be a :class:`Group` object, or a
         :class:`TypeError` is raised.
         """
+        cython.declare(group=Group, atom=Atom)
+        cython.declare(carbonCount=cython.short, nitrogenCount=cython.short, oxygenCount=cython.short, sulfurCount=cython.short, radicalCount=cython.short)
+
         # It only makes sense to compare a Molecule to a Group for subgraph
         # isomorphism, so raise an exception if this is not what was requested
         if not isinstance(other, Group):
             raise TypeError('Got a {0} object for parameter "other", when a Group object is required.'.format(other.__class__))
+        group = other
+                # Count the number of carbons, oxygens, and radicals in the molecule
+        carbonCount = 0; nitrogenCount = 0; oxygenCount = 0; sulfurCount = 0; radicalCount = 0
+        for atom in self.vertices:
+            if atom.element.symbol == 'C':
+                carbonCount += 1
+            elif atom.element.symbol == 'N':
+                nitrogenCount += 1
+            elif atom.element.symbol == 'O':
+                oxygenCount += 1
+            elif atom.element.symbol == 'S':
+                sulfurCount += 1
+            radicalCount += atom.radicalElectrons
+        
+        
+        if group.multiplicity:
+            if self.multiplicity not in group.multiplicity: return []
+        # If the molecule has fewer of any of these things than the functional
+        # group does, then we know the subgraph isomorphism fails without
+        # needing to perform the full isomorphism check
+        if (radicalCount < group.radicalCount or
+            carbonCount < group.carbonCount or
+            nitrogenCount < group.nitrogenCount or
+            oxygenCount < group.oxygenCount or
+            sulfurCount < group.sulfurCount):
+            return []
         # Do the isomorphism comparison
         result = Graph.findSubgraphIsomorphisms(self, other, initialMap)
         return result
plus

14

--- a/oak-run/src/main/java/org/apache/jackrabbit/oak/explorer/NodeStoreTree.java
+++ b/oak-run/src/main/java/org/apache/jackrabbit/oak/explorer/NodeStoreTree.java
@@ -308,9 +308,9 @@ private String toString(PropertyState ps, int index, String tarFile) {
             Blob b = ps.getValue(Type.BINARY, index);
             String info = "<";
             info += b.getClass().getSimpleName() + ";";
-            info += "ref:" + b.getReference() + ";";
+            info += "ref:" + safeGetReference(b) + ";";
             info += "id:" + b.getContentIdentity() + ";";
-            info += FileUtils.byteCountToDisplaySize(b.length()) + ">";
+            info += safeGetLength(b) + ">";
             for (SegmentId sid : SegmentBlob.getBulkSegmentIds(b)) {
                 info += newline + "        Bulk Segment Id " + sid;
                 String f = getFile(sid);
@@ -335,6 +335,24 @@ private String toString(PropertyState ps, int index, String tarFile) {
         }
     }
 
+    private String safeGetReference(Blob b) {
+        try {
+            return b.getReference();
+        } catch (IllegalStateException e) {
+            // missing BlobStore probably
+        }
+        return "[BlobStore not available]";
+    }
+
+    private String safeGetLength(Blob b) {
+        try {
+            return FileUtils.byteCountToDisplaySize(b.length());
+        } catch (IllegalStateException e) {
+            // missing BlobStore probably
+        }
+        return "[BlobStore not available]";
+    }
+
     private String getFile(RecordId id) {
         return getFile(id.getSegmentId());
     }
@@ -426,6 +444,13 @@ public void printDependenciesToSegment(String sid) {
         StringBuilder sb = new StringBuilder();
         sb.append("SegmentNodeState references to " + id);
         sb.append(newline);
+        for (Entry<String, Set<UUID>> e : store.getTarReaderIndex().entrySet()) {
+            if (e.getValue().contains(id)) {
+                sb.append("Tar file: " + e.getKey());
+                sb.append(newline);
+                break;
+            }
+        }
 
         List<String> paths = newArrayList();
         filterNodeStates(newHashSet(id), paths, store.getHead(), "/");
@@ -729,7 +754,16 @@ public int compareTo(NamePathModel o) {
         }
         for (PropertyState ps : ns.getProperties()) {
             for (int j = 0; j < ps.count(); j++) {
-                s[0] = s[0] + ps.size(j);
+                if (ps.getType().tag() == Type.BINARY.tag()) {
+                    Blob b = ps.getValue(Type.BINARY, j);
+                    boolean skip = b instanceof SegmentBlob
+                            && ((SegmentBlob) b).isExternal();
+                    if (!skip) {
+                        s[0] = s[0] + b.length();
+                    }
+                } else {
+                    s[0] = s[0] + ps.size(j);
+                }
             }
         }
         sizeCache.put(key, s);
plus

3

--- a/test/test_parser.js
+++ b/test/test_parser.js
@@ -7,6 +7,12 @@ var parser  = require('../command_parser.js');
 
 
 console.log( parser.parse_command("LOOK DOOR") );
-console.log( parser.parse_command("LOOK AT DOOR") );
+console.log( parser.parse_command("LOOK AT DOOR") ); // At should be removed
 console.log( parser.parse_command("OPEN DOOR") );
 console.log( parser.parse_command("GO NORTH") );
+console.log( parser.parse_command("TAKE CIGARETTE PACK") );
+console.log( parser.parse_command("TAKE PACK OF CIGARETTES") );
+
+// Test synonym parsing.  Pack of cigarettes should bet replaced with cigarette pack
+console.log( parser.parse_command("TAKE PACK OF CIGARETTES", 
+             { "pack of cigarettes": "cigarette pack"} ) );
plus

3

--- a/test/unit-tests/TestModularInputs.cs
+++ b/test/unit-tests/TestModularInputs.cs
@@ -511,12 +511,12 @@ public void SerializeEventWithDone()
 
             Task<EventWrittenProgressReport> t = progress.AwaitProgressAsync();
 
-#pragma warning disable 4014
+            #pragma warning disable 4014
             //// Because this call is not awaited, execution of the current 
             //// method continues before the call is completed. Consider 
             //// applying the 'await' operator to the result of the call.
             eventWriter.CompleteAsync();
-#pragma warning restore 4014
+            #pragma warning restore 4014
 
             EventWrittenProgressReport r = await t;
 
plus

3

--- a/spec/lib/geoblacklight/references_spec.rb
+++ b/spec/lib/geoblacklight/references_spec.rb
@@ -86,13 +86,13 @@
     it 'should return available downloads by format' do
       types = complex_shapefile.download_types
       expect(types.first[1]).to eq wfs: 'http://hgl.harvard.edu:8080/geoserver/wfs'
-      expect(types.count).to eq 2
+      expect(types.count).to eq 3
       expect(direct_download_only.download_types).to be_nil
     end
     it 'should only return available downloads if no direct is present' do
       types = typical_ogp_shapefile.download_types
       expect(types.first[1]).to eq wfs: "http://hgl.harvard.edu:8080/geoserver/wfs"
-      expect(types.count).to eq 2
+      expect(types.count).to eq 3
     end
   end
 end
plus

10

--- a/kuyruk/config.py
+++ b/kuyruk/config.py
@@ -12,7 +12,7 @@
 
 class Config(object):
     """Kuyruk configuration object. Default values are defined as
-    class attributes.
+    class attributes. Additional attributes may be added by extensions.
 
     """
     # Connection Options
plus

210

--- a/GPU/GLES/VertexShaderGenerator.cpp
+++ b/GPU/GLES/VertexShaderGenerator.cpp
@@ -52,7 +52,7 @@ void ComputeVertexShaderID(VertexShaderID *id, u32 vertType, int prim, bool useH
 	bool doTexture = gstate.isTextureMapEnabled() && !gstate.isModeClear();
 	bool doTextureProjection = gstate.getUVGenMode() == GE_TEXMAP_TEXTURE_MATRIX;
 	bool doShadeMapping = gstate.getUVGenMode() == GE_TEXMAP_ENVIRONMENT_MAP;
-	bool doFlatShading = gstate.getShadeMode() == GE_SHADE_FLAT;
+	bool doFlatShading = gstate.getShadeMode() == GE_SHADE_FLAT && !gstate.isModeClear();
 
 	bool hasColor = (vertType & GE_VTYPE_COL_MASK) != 0;
 	bool hasNormal = (vertType & GE_VTYPE_NRM_MASK) != 0;
@@ -215,6 +215,7 @@ void GenerateVertexShader(int prim, u32 vertType, char *buffer, bool useHWTransf
 	bool doTexture = gstate.isTextureMapEnabled() && !gstate.isModeClear();
 	bool doTextureProjection = gstate.getUVGenMode() == GE_TEXMAP_TEXTURE_MATRIX;
 	bool doShadeMapping = gstate.getUVGenMode() == GE_TEXMAP_ENVIRONMENT_MAP;
+	bool doFlatShading = gstate.getShadeMode() == GE_SHADE_FLAT && !gstate.isModeClear();
 
 	bool hasColor = (vertType & GE_VTYPE_COL_MASK) != 0 || !useHWTransform;
 	bool hasNormal = (vertType & GE_VTYPE_NRM_MASK) != 0 && useHWTransform;
@@ -226,7 +227,7 @@ void GenerateVertexShader(int prim, u32 vertType, char *buffer, bool useHWTransf
 
 	const char *shading = "";
 	if (glslES30)
-		shading = gstate.getShadeMode() == GE_SHADE_FLAT ? "flat" : "";
+		shading = doFlatShading ? "flat" : "";
 
 	DoLightComputation doLight[4] = {LIGHT_OFF, LIGHT_OFF, LIGHT_OFF, LIGHT_OFF};
 	if (useHWTransform) {
plus

893

--- a/frontend/spec/helpers/frontend_helper_spec.rb
+++ b/frontend/spec/helpers/frontend_helper_spec.rb
@@ -4,31 +4,31 @@ module Spree
   describe FrontendHelper, type: :helper do
     # Regression test for #2034
     context "flash_message" do
-      let(:flash) { {"notice" => "ok", "foo" => "foo", "bar" => "bar"} }
+      let(:flash) { { "notice" => "ok", "foo" => "foo", "bar" => "bar" } }
 
       it "should output all flash content" do
         flash_messages
         html = Nokogiri::HTML(helper.output_buffer)
-        expect(html.css(".notice").text).to eq("ok")
-        expect(html.css(".foo").text).to eq("foo")
-        expect(html.css(".bar").text).to eq("bar")
+        expect(html.css(".alert-notice").text).to eq("ok")
+        expect(html.css(".alert-foo").text).to eq("foo")
+        expect(html.css(".alert-bar").text).to eq("bar")
       end
 
       it "should output flash content except one key" do
         flash_messages(ignore_types: :bar)
         html = Nokogiri::HTML(helper.output_buffer)
-        expect(html.css(".notice").text).to eq("ok")
-        expect(html.css(".foo").text).to eq("foo")
-        expect(html.css(".bar").text).to be_empty
+        expect(html.css(".alert-notice").text).to eq("ok")
+        expect(html.css(".alert-foo").text).to eq("foo")
+        expect(html.css(".alert-bar").text).to be_empty
       end
 
       it "should output flash content except some keys" do
         flash_messages(ignore_types: [:foo, :bar])
         html = Nokogiri::HTML(helper.output_buffer)
-        expect(html.css(".notice").text).to eq("ok")
-        expect(html.css(".foo").text).to be_empty
-        expect(html.css(".bar").text).to be_empty
-        expect(helper.output_buffer).to eq("<div class=\"flash notice\">ok</div>")
+        expect(html.css(".alert-notice").text).to eq("ok")
+        expect(html.css(".alert-foo").text).to be_empty
+        expect(html.css(".alert-bar").text).to be_empty
+        expect(helper.output_buffer).to eq("<div class=\"alert alert-notice\">ok</div>")
       end
     end
 
plus

284

--- a/modules/cpr/src/main/java/org/atmosphere/cpr/DefaultAnnotationProcessor.java
+++ b/modules/cpr/src/main/java/org/atmosphere/cpr/DefaultAnnotationProcessor.java
@@ -126,7 +126,7 @@ public AnnotationProcessor configure(final AtmosphereFramework framework) {
         ServletContext sc = framework.getServletContext();
 
         Map<Class<? extends Annotation>, Set<Class<?>>>  annotations= (Map<Class<? extends Annotation>, Set<Class<?>>>) sc.getAttribute(ANNOTATION_ATTRIBUTE);
-        //sc.removeAttribute(ANNOTATION_ATTRIBUTE);
+        sc.removeAttribute(ANNOTATION_ATTRIBUTE);
 
         boolean scanForAtmosphereAnnotation = false;
         if (annotations == null || annotations.isEmpty()) {
plus

284

--- a/modules/cpr/src/main/java/org/atmosphere/cpr/DefaultAnnotationProcessor.java
+++ b/modules/cpr/src/main/java/org/atmosphere/cpr/DefaultAnnotationProcessor.java
@@ -122,7 +122,7 @@ public AnnotationProcessor configure(final AtmosphereFramework framework) {
         ServletContext sc = framework.getServletContext();
 
         Map<Class<? extends Annotation>, Set<Class<?>>>  annotations= (Map<Class<? extends Annotation>, Set<Class<?>>>) sc.getAttribute(ANNOTATION_ATTRIBUTE);
-        //sc.removeAttribute(ANNOTATION_ATTRIBUTE);
+        sc.removeAttribute(ANNOTATION_ATTRIBUTE);
 
         boolean scanForAtmosphereAnnotation = false;
         if (annotations == null || annotations.isEmpty()) {