plus

31

--- a/rest-core/src/Rest/Resource.hs
+++ b/rest-core/src/Rest/Resource.hs
@@ -10,7 +10,7 @@
   , NamedFieldPuns
   #-}
 -- | A 'Resource' type for representing a REST resource, as well as
--- smart constructors for empty resources which can them be filled in
+-- smart constructors for empty resources which can then be filled in
 -- using record updates.
 module Rest.Resource where
 
@@ -85,7 +85,7 @@ mkResourceReader :: (Applicative m, Monad m) => Resource m (ReaderT sid m) sid V
 mkResourceReader = mkResourceReaderWith id
 
 -- | Make a resource that provides the single resource identifier to
--- its subresources, by giving a convertion function to a 'ReaderT'.
+-- its subresources, by giving a conversion function to a 'ReaderT'.
 -- If @s@ is a newtype around 'ReaderT', for example, the function
 -- should unwrap the newtype.
 
plus

27

--- a/src/Command/PullRequest/PullRequestMergeCommand.php
+++ b/src/Command/PullRequest/PullRequestMergeCommand.php
@@ -88,6 +88,7 @@ protected function configure()
 <comment>This will only merge the commits that are in the source branch but not in the original target branch!</comment>
 
     <info>$ gush %command.name% --switch=development 12</info>
+
 EOF
             )
         ;
plus

57

--- a/src/playsingle_controller.cpp
+++ b/src/playsingle_controller.cpp
@@ -393,10 +393,6 @@ possible_end_play_signal playsingle_controller::play_scenario_init(end_level_dat
 	return boost::none;
 }
 
-#ifdef _MSC_VER
-#pragma warning (push)
-#pragma warning (disable:4702)
-#endif
 possible_end_play_signal playsingle_controller::play_scenario_main_loop(end_level_data & end_level, bool & /*past_prestart*/) {
 	LOG_NG << "starting main loop\n" << (SDL_GetTicks() - ticks_) << "\n";
 
@@ -431,11 +427,7 @@ possible_end_play_signal playsingle_controller::play_scenario_main_loop(end_leve
 		PROPOGATE_END_PLAY_SIGNAL( play_turn() );
 		do_autosaves_ = true;
 	} //end for loop
-	return boost::none;
 }
-#ifdef _MSC_VER
-#pragma warning (pop)
-#endif
 
 LEVEL_RESULT playsingle_controller::play_scenario(
 	const config::const_child_itors &story,
plus

34

--- a/trunk/src/rtmp/srs_protocol_handshake.cpp
+++ b/trunk/src/rtmp/srs_protocol_handshake.cpp
@@ -532,7 +532,11 @@ namespace _srs_internal
             srs_error("calc s1 key failed. ret=%d", ret);
             return ret;
         }
-        srs_assert(pkey_size == 128);
+
+        // altough the public key is always 128bytes, but the share key maybe not.
+        // we just ignore the actual key size, but if need to use the key, must use the actual size.
+        // TODO: FIXME: use the actual key size.
+        //srs_assert(pkey_size == 128);
         srs_verbose("calc s1 key success.");
             
         char* s1_digest = NULL;
plus

8

--- a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java
+++ b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java
@@ -384,7 +384,7 @@ final void put(Bytes entry) {
     }
 
     static abstract class ReadValueToBytes implements ReadValue<Bytes> {
-        private SizeMarshaller valueSizeMarshaller;
+        SizeMarshaller valueSizeMarshaller;
 
         abstract Bytes bytes(long valueSize);
 
@@ -398,6 +398,7 @@ public Bytes readValue(@NotNull ThreadLocalCopies copies, Bytes entry, Bytes usi
             usingBytes = bytes(valueSize);
             valueSizeMarshaller.writeSize(usingBytes, valueSize);
             usingBytes.write(entry, entry.position(), valueSize);
+            entry.skip(valueSize);
             return usingBytes;
         }
     }
@@ -434,6 +435,7 @@ public Bytes readNull() {
 
         @Override
         Bytes bytes(long valueSize) {
+            valueSize = valueSizeMarshaller.sizeEncodingSize(valueSize) + valueSize;
             if (lazyBytes != null) {
                 if (lazyBytes.capacity() < valueSize) {
                     DirectStore store = (DirectStore) lazyBytes.store();
plus

11

--- a/syncplay/messages.py
+++ b/syncplay/messages.py
@@ -926,7 +926,7 @@
       "play-tooltip" : u"Fortsetzen",
       "pause-tooltip" : u"Pausieren",
       "undoseek-tooltip" : u"Den letzten Spulvorgang rckgngig machen.",
-      "joinroom-tooltip" : u"Den aktuellen Raum verlassen und stattdessen den angegebenen betreten."
+      "joinroom-tooltip" : u"Den aktuellen Raum verlassen und stattdessen den angegebenen betreten.",
       "seektime-tooltip" : u"Springe zur angegebenen Zeit (in Sekunden oder min:sek).  Verwende +/- zum relativen Springen.",
 
       # In-userlist notes (GUI)
plus

90

--- a/src/Main/Base/Project/Util/NativeMethods.cs
+++ b/src/Main/Base/Project/Util/NativeMethods.cs
@@ -17,6 +17,7 @@
 // DEALINGS IN THE SOFTWARE.
 
 using System;
+using System.ComponentModel;
 using System.IO;
 using System.Runtime.InteropServices;
 using System.Security;
@@ -122,6 +123,39 @@ public static void DeleteToRecycleBin(string fileName)
 		}
 		#endregion
 		
+		
+		#region SetFileTime
+		[StructLayout(LayoutKind.Sequential)]
+		struct FILETIME
+		{
+			internal uint ftTimeLow;
+			internal uint ftTimeHigh;
+
+			public FILETIME(long fileTime)
+			{
+				unchecked {
+    				this.ftTimeLow = (uint)fileTime;
+    				this.ftTimeHigh = (uint)(fileTime >> 32);
+				}
+			}
+		}
+		
+		[DllImport("kernel32.dll", SetLastError = true)]
+		[return: MarshalAs(UnmanagedType.Bool)]
+		unsafe static extern bool SetFileTime(SafeFileHandle hFile, FILETIME* creationTime, FILETIME* lastAccessTime, FILETIME* lastWriteTime);
+		
+		/// <summary>
+		/// Update the file times on the given file handle.
+		/// </summary>
+		public unsafe static void SetFileCreationTime(SafeFileHandle hFile, DateTime creationTime)
+		{
+		    FILETIME fileCreationTime = new FILETIME(creationTime.ToFileTimeUtc());
+			if (!SetFileTime(hFile, &fileCreationTime, null, null)) {
+				throw new Win32Exception(Marshal.GetLastWin32Error());
+			}
+		}
+		#endregion
+		
 		#region Get OEM Encoding
 		[DllImport("kernel32.dll")]
 		static extern int GetOEMCP();
plus

109

--- a/config/src/main/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.java
+++ b/config/src/main/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.java
@@ -74,7 +74,7 @@
     private ClassLoader beanClassLoader;
 
     @Bean
-    public DelegatingApplicationListener delegatingApplicationListener() {
+    public static DelegatingApplicationListener delegatingApplicationListener() {
         return new DelegatingApplicationListener();
     }
 
plus

50

--- a/src/Generating/DungeonRoomsFinisher.cpp
+++ b/src/Generating/DungeonRoomsFinisher.cpp
@@ -265,7 +265,7 @@ class cDungeonRoom :
 		)
 		{
 			a_ChunkDesc.SetBlockTypeMeta(CenterX, b, CenterZ, E_BLOCK_MOB_SPAWNER, 0);
-			cMobSpawnerEntity * MobSpawner = (cMobSpawnerEntity *)a_ChunkDesc.GetBlockEntity(CenterX, b, CenterZ);
+			cMobSpawnerEntity * MobSpawner = static_cast<cMobSpawnerEntity *>(a_ChunkDesc.GetBlockEntity(CenterX, b, CenterZ));
 			ASSERT((MobSpawner != nullptr) && (MobSpawner->GetBlockType() == E_BLOCK_MOB_SPAWNER));
 			MobSpawner->SetEntity(m_MonsterType);
 		}
plus

39

--- a/recipes/server.rb
+++ b/recipes/server.rb
@@ -79,8 +79,9 @@
 bash "assign-postgres-password" do
   user 'postgres'
   code <<-EOH
-echo "ALTER ROLE postgres ENCRYPTED PASSWORD '#{node['postgresql']['password']['postgres']}';" | psql -p #{node['postgresql']['config']['port']}
+  echo "ALTER ROLE postgres ENCRYPTED PASSWORD '#{node['postgresql']['password']['postgres']}';" | psql -p #{node['postgresql']['config']['port']}
   EOH
   action :run
+  not_if "ls #{node['postgresql']['config']['data_directory']}/recovery.conf"
   only_if { node['postgresql']['assign_postgres_password'] }
 end
plus

898

--- a/src/mongo/db/repl/sync_source_feedback.cpp
+++ b/src/mongo/db/repl/sync_source_feedback.cpp
@@ -136,7 +136,7 @@ namespace mongo {
                     if (!_connection->runCommand("admin", slaveCmd.obj(), slaveRes)) {
                         if (slaveRes["errmsg"].str().find("node could not be found ")
                                     != std::string::npos) {
-                            if (theReplSet->getMutableMember(itr->second->id())) {
+                            if (!theReplSet->getMutableMember(itr->second->id())) {
                                 log() << "sync source does not have member " << itr->second->id()
                                       << " in its config and neither do we, removing member from"
                                          " tracking";
@@ -344,6 +344,9 @@ namespace mongo {
                 }
                 if (_positionChanged) {
                     if (!updateUpstream()) {
+                        // no need to set _handshakeNeeded to true as a failed updateUpstream() call
+                        // will call resetConnection() and when the new connection is established
+                        // the handshake process will be run
                         _positionChanged = true;
                         continue;
                     }
plus

18

--- a/providers/deployment.rb
+++ b/providers/deployment.rb
@@ -12,13 +12,15 @@ def whyrun_supported?
 end
 
 action :notify do
+  key = new_resource.key
+
   # @todo take out deprecated api_key logic
   unless new_resource.api_key.nil?
     Chef::Log.warn "The 'api_key'-attribute has been deprecated. Please make use of the key and key_type attributes instead."
-    new_resource.key = new_resource.api_key
+    key = new_resource.api_key
   end
 
-  if new_resource.key.nil?
+  if key.nil?
     Chef::Log.fatal "The #{key_type} is required to notify New Relic of a deployment."
   end
 
@@ -28,9 +30,9 @@ def whyrun_supported?
     data = Array.new
 
     if new_resource.key_type == 'license_key'
-      data << '"x-license-key:' + new_resource.key + '"'
+      data << '"x-license-key:' + key + '"'
     else
-      data << '"x-api-key:' + new_resource.key + '"'
+      data << '"x-api-key:' + key + '"'
     end
 
     unless new_resource.app_name.nil?
plus

3

--- a/rflint/parser/tables.py
+++ b/rflint/parser/tables.py
@@ -49,15 +49,16 @@ def dump(self):
     def append(self, row):
         ''' 
         The idea is, we recognize when we have a new testcase by 
-        checking the first cell. If it's not empty, we have a new
-        test case.
+        checking the first cell. If it's not empty and not a comment, 
+        we have a new test case.
 
         '''
         if len(row) == 0:
             # blank line. Should we throw it away, or append a BlankLine object?
             return
 
-        if row[0] != "":
+        if (row[0] != "" and 
+            (not row[0].lstrip().startswith("#"))):
             # we have a new child table
             self._children.append(self._childClass(self.parent, row.linenumber, row[0]))
             if len(row.cells) > 1:
plus

3

--- a/GhostHunter17/src/edu/virginia/cs2110/ghosthunter17/Player.java
+++ b/GhostHunter17/src/edu/virginia/cs2110/ghosthunter17/Player.java
@@ -96,7 +96,7 @@ public int getNumBombs(){
 	public void useBomb(){
 		if (numBombs > 0){
 			numBombs--;
-			
+			world.dropBomb(pos);
 		}
 		else{
 			Log.d("WORLD", "No bombs left");
plus

7

--- a/corehq/apps/accounting/models.py
+++ b/corehq/apps/accounting/models.py
@@ -1835,7 +1835,7 @@ def create_record(cls, payment_method, transaction_id, amount):
 
 class CreditAdjustment(models.Model):
     """
-    A record of any addition (positive amounts) s or deductions (negative amounts) that contributed to the
+    A record of any additions (positive amounts) or deductions (negative amounts) that contributed to the
     current balance of the associated CreditLine.
     """
     credit_line = models.ForeignKey(CreditLine, on_delete=models.PROTECT)
plus

3

--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -46,7 +46,7 @@
 import android.os.UpdateLock;
 import android.os.UserHandle;
 import android.preference.PreferenceManager;
-import android.provider.Settings.System;
+import android.provider.Settings.Global;
 import android.telephony.ServiceState;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
@@ -808,8 +808,8 @@ public void onReceive(Context context, Intent intent) {
                     SubscriptionManager.getDefaultSubId());
             String action = intent.getAction();
             if (action.equals(Intent.ACTION_AIRPLANE_MODE_CHANGED)) {
-                boolean enabled = System.getInt(getContentResolver(),
-                        System.AIRPLANE_MODE_ON, 0) == 0;
+                boolean enabled = Global.getInt(getContentResolver(),
+                        Global.AIRPLANE_MODE_ON, 0) == 0;
                 for (Phone ph : mPhones) {
                     ph.setRadioPower(enabled);
                 }
plus

169

--- a/deps/parson/parson.c
+++ b/deps/parson/parson.c
@@ -168,7 +168,7 @@ static size_t parson_strlen(const char *string) {
     size_t result = 0;
     size_t i = 0, len = strlen(string);
     for (i = 0; i < len; i++) {
-        if (strchr("\"\\/\b\f\n\r\t", string[i])) /* must be escaped */
+        if (strchr("\"\\\b\f\n\r\t", string[i])) /* must be escaped */
             result += 2;
         else
             result += 1;
@@ -735,7 +735,6 @@ static char * json_serialize_string(const char *string, char *buf) {
         switch (c) {
             case '\"': PRINT_AND_SKIP(buf, "\\\"");   break;
             case '\\': PRINT_AND_SKIP(buf, "\\\\");   break;
-            case '/':  PRINT_AND_SKIP(buf, "\\/");    break;
             case '\b': PRINT_AND_SKIP(buf, "\\b");    break;
             case '\f': PRINT_AND_SKIP(buf, "\\f");    break;
             case '\n': PRINT_AND_SKIP(buf, "\\n");    break;
plus

3

--- a/src/java/SergeantCohort/CohortManager.java
+++ b/src/java/SergeantCohort/CohortManager.java
@@ -131,19 +131,17 @@ public CohortManager(
         
         this.local_cohort_id = local_cohort_id;
         election_context = new ElectionContext(local_cohort_id);
-        start_elect_self_thread(0);
     }
 
     /**
        Actually start connections to other cohort nodes.
+       Should be called before any other methods
      */
     public void start_manager()
     {
         for (ICohortConnection connection : cohort_connections)
             connection.start_service();
-
-        // FIXME: fill in stub.  Still need to send leader messages;
-        Util.force_assert("Must fill in start_manager method");
+        start_elect_self_thread(0);
     }
 
     /**
@@ -310,8 +308,8 @@ public void handle_connection_timeout(ICohortConnection cohort_connection)
     @Override
     public void handle_connection_up(ICohortConnection cohort_connection)
     {
-        // FIXME: Fill in stub
-        Util.force_assert("Must fill in handle_connection_up stub");
+        // can ignore connection up messages: other node will contact
+        // us if wants to reelect itself.
     }
 
 
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;
             }