plus

11

--- a/testing/testing-imap_smtp.php
+++ b/testing/testing-imap_smtp.php
@@ -20,9 +20,9 @@
 //          "debug"         - Whether to enable SMTP debug mode or not. Default is FALSE.
 //          "persist"       - Indicates whether or not the SMTP connection should persist over multiple calls to the send() method.
 //          "pipelining"    - Indicates whether or not the SMTP commands pipelining should be used.
-$imap_smtp_params = array('host' => 'smtp.domain.testing', 'port' => 25, 'auth' => true, "username" => "fmbiete", "password" => "secret_password", "debug" => true, "pipelining" => true);
-$toaddr = "fmbiete@domain.testing";
-$headers = array('Subject' => 'Testing SMTP', 'From' => 'fmbiete@domain.testing', 'Return-Path' => 'fmbiete@domain.testing', 'To' => 'fmbiete@domain.testing');
+$imap_smtp_params = array('host' => 'smtp.zpush.org', 'port' => 25, 'auth' => true, "username" => "fmbiete", "password" => "password_account", "debug" => true, "pipelining" => true);
+$toaddr = "fmbiete@zpush.org";
+$headers = array('Subject' => 'Testing SMTP', 'From' => 'fmbiete@zpush.org', 'Return-Path' => 'fmbiete@zpush.org', 'To' => 'fmbiete@zpush.org', 'Cc' => 'fmbiete@zpush.org,fmbiete@zpush.net');
 $body = "This is a test";
 
 
plus

102

--- a/lib/deliver/app.rb
+++ b/lib/deliver/app.rb
@@ -28,14 +28,10 @@ module AppStatus
       # INVALID_BINARY = "Invalid Binary"
     end
 
-    # @param options
-    #   @param apple_id The Apple ID of the app you want to modify or update. This ID has usually 9 digits
-    #   @param app_identifier If you don't pass this, it will automatically be fetched from the Apple API
-    #     which means it takes longer. If you **can** pass the app_identifier (e.g. com.facebook.Facebook) do it
-    def initialize(options = {})
-      apple_id = options.fetch(:apple_id, nil)
-      app_identifier = options.fetch(:app_identifier, nil)
-      
+    # @param apple_id The Apple ID of the app you want to modify or update. This ID has usually 9 digits
+    # @param app_identifier If you don't pass this, it will automatically be fetched from the Apple API
+    #   which means it takes longer. If you **can** pass the app_identifier (e.g. com.facebook.Facebook) do it
+    def initialize(apple_id: nil, app_identifier: nil)
       self.apple_id = (apple_id || '').to_s.gsub('id', '').to_i
       self.app_identifier = app_identifier
       
plus

667

--- a/modules/videoio/src/cap_openni2.cpp
+++ b/modules/videoio/src/cap_openni2.cpp
@@ -646,7 +646,7 @@ bool CvCapture_OpenNI2::setImageGeneratorProperty(int propIdx, double propValue)
         {
         case CV_CAP_PROP_OPENNI_OUTPUT_MODE :
         {
-            openni::VideoMode mode;
+            openni::VideoMode mode = color.getVideoMode();
 
             switch( cvRound(propValue) )
             {
plus

37

--- a/wicket-core/src/main/java/org/apache/wicket/model/PropertyModel.java
+++ b/wicket-core/src/main/java/org/apache/wicket/model/PropertyModel.java
@@ -64,9 +64,9 @@
  * 
  * </p>
  * <p>
- * Note that the property resolver by default provides access to private members and methods. If
+ * <strong>Note that the property resolver by default provides access to private members and methods. If
  * guaranteeing encapsulation of the target objects is a big concern, you should consider using an
- * alternative implementation.
+ * alternative implementation.</strong>
  * </p>
  * 
  * @see PropertyResolver
@@ -137,4 +137,4 @@ protected String propertyExpression()
 	{
 		return new PropertyModel<Z>(parent, property);
 	}
-}
\ No newline at end of file
+}
plus

4

--- a/Model/Trip.cs
+++ b/Model/Trip.cs
@@ -8,13 +8,9 @@ public class Trip
     {
         [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
         public Guid Identifier { get; set; }
-
         public DateTime StartDate { get; set; }
-
         public DateTime EndDate { get; set; }
-
         public decimal CostUSD { get; set; }
-
         [Timestamp]
         public byte[] RowVersion { get; set; }
     }
plus

3

index 0000000..8ad5937
--- /dev/null
+++ b/test/util/TestSorter.java
@@ -0,0 +1,63 @@
+package util;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+import static util.SimpleIO.*;
+
+public class TestSorter {
+
+	@Test
+	public void testBasic() {
+		char[] c="qazxswedcvfrtgb".toCharArray();
+		int size=c.length;
+		Character[] a=new Character[c.length],b;
+		for(int i=0;i<c.length;i++){
+			a[i]=c[i];
+		}
+		b=(Character[]) Sorter.bubbleSort(a);
+		for(int i=0;i<size;i++){
+			print(a[i]+" ");
+		}
+		println(" ");
+		for(int i=0;i<size;i++){
+			print(b[i]+" ");
+		}
+		println(" ");
+	}
+
+	@Test
+	public void testMethod(){
+		char[] c="qazxswedcvfrtgb".toCharArray();
+		int size=c.length;
+		Character[] a=new Character[c.length],b;
+		for(int i=0;i<c.length;i++){
+			a[i]=c[i];
+		}
+		b=(Character[]) Sorter.bubbleSort(a,new charMethod());
+		for(int i=0;i<size;i++){
+			print(a[i]+" ");
+		}
+		println(" ");
+		for(int i=0;i<size;i++){
+			print(b[i]+" ");
+		}
+		println(" ");
+	}
+	
+	
+}
+class charMethod implements CompareMethod<Character>{
+
+	@Override
+	public int compare(Character a, Character b) {
+		// TODO 
+		int res=a.compareTo(b);
+		if(res>0)
+			return -1;
+		else if(res<0)
+			return 1;
+		else
+			return 0;
+	}}
\ No newline at end of file
plus

5

--- a/src/Validator/CardNumberValidator.php
+++ b/src/Validator/CardNumberValidator.php
@@ -2,6 +2,9 @@
 
 namespace Sokil\Mongo\Validator;
 
+/**
+ * Credit card number validator based on Luhn algorithm
+ */
 class CardNumberValidator extends \Sokil\Mongo\Validator
 {
     private function getMod($cardNumber)
plus

22

--- a/app/controllers/devise_token_auth/registrations_controller.rb
+++ b/app/controllers/devise_token_auth/registrations_controller.rb
@@ -21,7 +21,7 @@ def create
 
       begin
         # override email confirmation, must be sent manually from ctrl
-        User.skip_callback("create", :after, :send_on_create_confirmation_instructions)
+        resource_class.skip_callback("create", :after, :send_on_create_confirmation_instructions)
         if @resource.save
 
           unless @resource.confirmed?
plus

14

--- a/engine/src/foundation-legacy.cpp
+++ b/engine/src/foundation-legacy.cpp
@@ -694,9 +694,11 @@ bool MCValueConvertToStringForSave(MCValueRef self, MCStringRef& r_string)
 
 bool MCValueIsEmpty(MCValueRef p_value)
 {
+    // AL-2014-10-31: [[ Bug 13890 ]] An empty array is not necessarily equal to kMCEmptyArray,
+    //  so we need to use MCArrayIsEmpty instead.
     return p_value == kMCNull ||
             p_value == kMCEmptyName ||
-            p_value == kMCEmptyArray ||
+            (MCValueGetTypeCode(p_value) == kMCValueTypeCodeArray && MCArrayIsEmpty((MCArrayRef)p_value)) ||
             (MCValueGetTypeCode(p_value) == kMCValueTypeCodeString && MCStringIsEmpty((MCStringRef)p_value)) ||
             (MCValueGetTypeCode(p_value) == kMCValueTypeCodeName && MCNameIsEmpty((MCNameRef)p_value)) ||
             (MCValueGetTypeCode(p_value) == kMCValueTypeCodeData && MCDataIsEmpty((MCDataRef)p_value)) ||
plus

3

--- a/src/test/java/org/elasticsearch/river/solr/SolrRiverIntegrationTest.java
+++ b/src/test/java/org/elasticsearch/river/solr/SolrRiverIntegrationTest.java
@@ -86,7 +86,7 @@ protected Settings nodeSettings(int nodeOrdinal) {
     }
 
     @BeforeClass
-    public static void beforeClass() throws Exception {
+    public static void init() throws Exception {
         documentGenerator = new DocumentGenerator(randomLong());
         //starts Solr server
         File solrHome = new File(Thread.currentThread().getContextClassLoader().getResource("solr/").toURI());
@@ -97,7 +97,7 @@ public static void beforeClass() throws Exception {
     }
 
     @AfterClass
-    public static void afterClass() throws Exception {
+    public static void close() throws Exception {
         jettySolrRunner.stop();
         FileUtils.deleteDirectory(DATA_DIR);
     }
plus

3

--- a/test/integration/smtpclient-test.js
+++ b/test/integration/smtpclient-test.js
@@ -445,4 +445,59 @@ describe('smtpclient STARTTLS tests', function() {
             };
         });
     });
+
+    describe('no STARTTLS because no EHLO, only HELO', function() {
+        before(function(done) {
+            // start smtp test server
+            var options = {
+                debug: false,
+                disableDNSValidation: true,
+                port: port,
+                enableAuthentication: true,
+                secureConnection: false,
+                disableEHLO: true,
+                ignoreTLS: true,
+                authMethods: ["PLAIN", "LOGIN", "XOAUTH2"],
+                disableSTARTTLS: true
+            };
+
+            server = simplesmtp.createServer(options);
+            server.on('startData', function( /*connection*/ ) {});
+            server.on('data', function( /*connection, chunk*/ ) {});
+            server.on('dataReady', function(connection, callback) {
+                callback(null, 'foo');
+            });
+            server.on('authorizeUser', function(connection, username, password, callback) {
+                callback(null, username === 'abc' && password === 'def');
+            });
+            server.listen(options.port, done);
+        });
+
+        after(function(done) {
+            // close smtp test server
+            server.end(done);
+        });
+
+        it('should fail connecting to insecure server', function(done) {
+            var smtp = new SmtpClient('127.0.0.1', port, {
+                useSecureTransport: false,
+                auth: {
+                    user: 'abc',
+                    pass: 'def'
+                },
+                requireTLS: true
+            });
+            expect(smtp).to.exist;
+
+            smtp.connect();
+
+            smtp.onerror = function(err) {
+                expect(err).to.exist;
+                expect(err.message).to.equal('STARTTLS not supported without EHLO');
+                expect(smtp._secureMode).to.be.false;
+                smtp.onclose = done;
+                smtp.quit();
+            };
+        });
+    });
 });
\ No newline at end of file
plus

3

--- a/src/test/java/com/joragupra/blog/crm/CustomerTest.java
+++ b/src/test/java/com/joragupra/blog/crm/CustomerTest.java
@@ -5,6 +5,7 @@
 import java.time.LocalDateTime;
 import java.time.ZoneId;
 import java.util.Date;
+import java.util.Iterator;
 import java.util.function.Predicate;
 
 import static org.hamcrest.MatcherAssert.*;
@@ -54,7 +55,7 @@ public void testBuy() {
     }
 
     @Test
-    public void testIsSpecialOffersEligible_SeniorsUsersAreEligible() {
+    public void testIsSpecialOffersEligible_SeniorsUsersWithRecentPurchasesAreEligible() {
         Date moreThanOneYearAgo = Date.from(
                 LocalDateTime.now().minusDays(366).atZone(ZoneId.systemDefault()).toInstant()
         );
@@ -68,6 +69,31 @@ public void testIsSpecialOffersEligible_SeniorsUsersAreEligible() {
     }
 
     @Test
+    public void testIsSpecialOffersEligible_SeniorsUsersWithNoRecentPurchaseAreNotEligible() {
+        Date moreThanOneYearAgo = Date.from(
+                LocalDateTime.now().minusDays(366).atZone(ZoneId.systemDefault()).toInstant()
+        );
+        Customer oldCustomer = new Customer("00001", moreThanOneYearAgo);
+        String aProductCode = "00001";
+        String anotherProductCode = "00002";
+        oldCustomer.buy(aProductCode);
+        oldCustomer.buy(anotherProductCode);
+        Iterator<Product> boughtProducts = oldCustomer.boughtProducts().iterator();
+        boughtProducts.next().setPurchasedAt(
+                Date.from(
+                        LocalDateTime.now().minusDays(40).atZone(ZoneId.systemDefault()).toInstant()
+                )
+        );
+        boughtProducts.next().setPurchasedAt(
+                Date.from(
+                        LocalDateTime.now().minusDays(35).atZone(ZoneId.systemDefault()).toInstant()
+                )
+        );
+
+        assertThat(oldCustomer.isSpecialOffersEligible(), is(false));
+    }
+
+    @Test
     public void testIsSpecialOffersEligible_NewUsersNotEligible() {
         Customer newCustomer = new Customer("00001", new Date());
         String aProductCode = "00001";
plus

11

--- a/library/WT/Controller/Page.php
+++ b/library/WT/Controller/Page.php
@@ -148,10 +148,6 @@ public function pageHeader() {
 			$title .= ' - ' . $META_TITLE;
 		}
 
-		// This javascript needs to be loaded in the header, *before* the CSS.
-		// All other javascript should be defered until the end of the page
-		$javascript = '<script src="' . WT_MODERNIZR_URL . '"></script>';
-
 		// Give Javascript access to some PHP constants
 		$this->addInlineJavascript('
 			var WT_STATIC_URL  = "' . WT_Filter::escapeJs(WT_STATIC_URL) . '";
@@ -176,7 +172,11 @@ public function pageHeader() {
 		header('Content-Type: text/html; charset=UTF-8');
 		echo $WT_THEME->doctype();
 		echo $WT_THEME->htmlTag();
-		echo '<head>', $WT_THEME->head($this), $javascript, '</head>';
+		echo '<head>';
+		echo $WT_THEME->head($this);
+		// Modernizr needs to be loaded before the <body> to avoid FOUC in IE8
+		echo '<!--[if IE]><script src="' . WT_MODERNIZR_URL . '"></script><![endif]-->';
+		echo '</head>';
 		echo '<body>';
 
 		require WT_ROOT . $headerfile;
@@ -211,7 +211,6 @@ protected function pageFooter() {
 			'</body>' .
 			'</html>' . PHP_EOL .
 			'<!-- webtrees: ' .  WT_VERSION . ' -->' .
-			'<!-- PHP: ' .  PHP_VERSION . ' -->' .
 			'<!-- Execution time: ' .  WT_I18N::number(microtime(true) - $start_time, 3) . ' seconds -->' .
 			'<!-- Memory: ' .  WT_I18N::number(memory_get_peak_usage(true)/1024) . ' KB -->' .
 			'<!-- SQL queries: ' .  WT_I18N::number(WT_DB::getQueryCount()) . ' -->';
plus

11

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

41

index 0000000..665e122
--- /dev/null
+++ b/scratch-child/functions.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Theme functions file
+ */
+
+/**
+ * Enqueue parent theme styles first
+ * Replaces previous method using @import
+ * <http://codex.wordpress.org/Child_Themes>
+ */
+
+add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style', 99 );
+
+function enqueue_parent_theme_style() {
+	wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
+}
+
+/**
+ * Add your custom functions below
+ */
plus

3

--- a/src/eval.c
+++ b/src/eval.c
@@ -276,6 +276,10 @@ static tree_t eval_fcall_int(tree_t t, ident_t builtin, int64_t *args, int n)
          r = MAX(r, args[i]);
       return get_int_lit(t, r);
    }
+   else if (icmp(builtin, "mod"))
+      return get_int_lit(t, llabs(args[0]) % llabs(args[1]));
+   else if (icmp(builtin, "rem"))
+      return get_int_lit(t, args[0] % args[1]);
    else
       return t;
 }
plus

667

--- a/modules/calib3d/src/solvepnp.cpp
+++ b/modules/calib3d/src/solvepnp.cpp
@@ -160,7 +160,7 @@ class PnPRansacCallback : public PointSetRegistrator::Callback
 
         Mat opoints = _m1.getMat(), ipoints = _m2.getMat(), model = _model.getMat();
 
-        int i, count = opoints.cols;
+        int i, count = opoints.checkVector(3);
         Mat _rvec = model.col(0);
         Mat _tvec = model.col(1);
 
@@ -251,14 +251,10 @@ bool cv::solvePnPRansac(InputArray _opoints, InputArray _ipoints,
     if(_inliers.needed())
     {
         Mat _local_inliers;
-        int count = 0;
-        for (int i = 0; i < _mask_local_inliers.rows; ++i)
+        for (int i = 0; i < npoints; ++i)
         {
-            if((int)_mask_local_inliers.at<uchar>(i) == 1) // inliers mask
-            {
-                _local_inliers.push_back(count);    // output inliers vector
-                count++;
-            }
+            if((int)_mask_local_inliers.at<uchar>(i) != 0) // inliers mask
+                _local_inliers.push_back(i);    // output inliers vector
         }
         _local_inliers.copyTo(_inliers);
     }
plus

43

--- a/mustermann/lib/mustermann/pattern.rb
+++ b/mustermann/lib/mustermann/pattern.rb
@@ -196,10 +196,10 @@ def params(string = nil, captures: nil, offset: 0)
     #     warn "does not support expanding"
     #   end
     #
-    # Expanding is supported by {Mustermann::Sinatra}, {Mustermann::Rails} and
-    # {Mustermann::Template} patterns. Union {Mustermann::Composite} patterns (with
-    # the | operator) support expanding if all patterns they are composed of also
-    # support expanding.
+    # Template generation is supported by almost all patterns (notable execptions are
+    # {Mustermann::Shell}, {Mustermann::Identity}, {Mustermann::Regular} and {Mustermann::Simple}).
+    # Union {Mustermann::Composite} patterns (with the | operator) support template generation
+    # if all patterns they are composed of also support it.
     #
     # @param (see Mustermann::Expander#expand)
     # @return [String] expanded string
@@ -232,10 +232,10 @@ def expand(behavior = nil, **values)
     #   pattern |= Mustermann.new('/example/*nested')
     #   pattern.to_templates # => ["/{name}", "/example/{+nested}"]
     #
-    # Template generation is supported by {Mustermann::Sinatra}, {Mustermann::Rails},
-    # {Mustermann::Template} and {Mustermann::Identity} patterns.  Union {Mustermann::Composite}
-    # patterns (with the | operator) support template generation if all patterns they are composed
-    # of also support it.
+    # Template generation is supported by almost all patterns (notable execptions are
+    # {Mustermann::Shell}, {Mustermann::Regular} and {Mustermann::Simple}).
+    # Union {Mustermann::Composite} patterns (with the | operator) support template generation
+    # if all patterns they are composed of also support it.
     #
     # @example Checking if a pattern supports expanding
     #   if pattern.respond_to? :to_templates
plus

3

--- a/src/org/spicydog/Population.java
+++ b/src/org/spicydog/Population.java
@@ -31,11 +31,13 @@ public Individual getIndividual(int index) {
         return individuals[index];
     }
 
+    // Get the best individual
     public Individual getFittest() {
         int[] sortedIndexes = getSortedFitnessIndex();
         return individuals[sortedIndexes[0]];
     }
 
+    // Sort fitness index
     public int[] getSortedFitnessIndex() {
 
         int[] sortedIndexes = new int[size()];
@@ -60,7 +62,6 @@ public Individual getFittest() {
         return sortedIndexes;
     }
 
-    /* Public methods */
     // Get population size
     public int size() {
         return individuals.length;
plus

5

--- a/src/buildpack.sh
+++ b/src/buildpack.sh
@@ -35,6 +35,10 @@ buildpack_compile () {
 	if (( success )); then
 		copy_dir_into "${install_dir}/app" "${build_dir}" || return 1
 
+		if (( BUILDPACK_KEEP_ENV )); then
+			copy_dir_over "${cache_dir}" "${build_dir}/.buildpack/buildpack-cache" || return 1
+		fi
+
 		if [[ ! -f "${build_dir}/Procfile" ]]; then
 			local app_executable
 			if app_executable=$( detect_app_executable "${build_dir}" ); then
@@ -48,6 +52,8 @@ buildpack_compile () {
 
 		help_deploy_succeeded
 	else
+		copy_dir_over "${cache_dir}" "${build_dir}/.buildpack/buildpack-cache" || return 1
+
 		help_deploy_failed
 	fi
 
@@ -82,7 +88,7 @@ buildpack_build () {
 	HALCYON_INTERNAL_NO_ANNOUNCE_DEPLOY=1 \
 		halcyon_main deploy "$@" \
 			--halcyon-dir='/app/.halcyon' \
-			--no-cache \
+			--cache-dir='/app/.buildpack/buildpack-cache' \
 			"${source_dir}" || return 1
 
 	help_build_succeeded
@@ -113,9 +119,9 @@ buildpack_restore () {
 	HALCYON_INTERNAL_NO_ANNOUNCE_DEPLOY=1 \
 		halcyon_main deploy "$@" \
 			--halcyon-dir='/app/.halcyon' \
+			--cache=dir='/app/.buildpack/buildpack-cache' \
 			--no-build-dependencies \
 			--no-archive \
-			--no-cache \
 			--force-restore-all \
 			"${source_dir}" || return 1