Skip to content

Instantly share code, notes, and snippets.

@hgaiser
hgaiser / ogre.patch
Created November 6, 2013 23:33
Patch to fix Ogre 1.7.4 on OSX 10.9
diff --git a/RenderSystems/GL/src/OSX/OgreOSXCocoaWindow.mm b/RenderSystems/GL/src/OSX/OgreOSXCocoaWindow.mm
index 00803e7..f55a213 100644
--- a/RenderSystems/GL/src/OSX/OgreOSXCocoaWindow.mm
+++ b/RenderSystems/GL/src/OSX/OgreOSXCocoaWindow.mm
@@ -100,7 +100,7 @@ namespace Ogre {
NSString *windowTitle = [NSString stringWithCString:name.c_str() encoding:NSUTF8StringEncoding];
int winx = 0, winy = 0;
int depth = 32;
- NameValuePairList::const_iterator opt(NULL);
+ NameValuePairList::const_iterator opt;
diff --git a/RenderSystems/GL/src/OSX/OgreOSXCocoaWindow.mm b/RenderSystems/GL/src/OSX/OgreOSXCocoaWindow.mm
index 3956f21..47e41f0 100644
--- a/RenderSystems/GL/src/OSX/OgreOSXCocoaWindow.mm
+++ b/RenderSystems/GL/src/OSX/OgreOSXCocoaWindow.mm
@@ -290,6 +290,7 @@ namespace Ogre {
}
mWindow = [mView window];
+ [mWindow retain];
@hgaiser
hgaiser / rviz_moc.diff
Created January 22, 2015 10:49
rviz moc
diff --git a/src/image_view/image_view.h b/src/image_view/image_view.h
index 36a621f..411b2e1 100644
--- a/src/image_view/image_view.h
+++ b/src/image_view/image_view.h
@@ -27,27 +27,26 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829
+# include "rviz/ogre_helpers/qt_ogre_render_window.h"
@hgaiser
hgaiser / tautological_null.patch
Last active September 29, 2015 12:31
Removes tautological null checks in mongodb.
diff --git a/src/mongo/client/dbclientcursor.h b/src/mongo/client/dbclientcursor.h
index 785734d..11b6349 100644
--- a/src/mongo/client/dbclientcursor.h
+++ b/src/mongo/client/dbclientcursor.h
@@ -116,7 +116,7 @@ namespace mongo {
'dead' may be preset yet some data still queued and locally
available from the dbclientcursor.
*/
- bool isDead() const { return !this || cursorId == 0; }
+ bool isDead() const { return cursorId == 0; }
@hgaiser
hgaiser / mongo_abs.patch
Last active September 30, 2015 11:08
Modifes abs of mongodb to use std::abs
diff --git a/src/third_party/s2/util/math/mathutil.h b/src/third_party/s2/util/math/mathutil.h
index 0515912..8750b57 100755
--- a/src/third_party/s2/util/math/mathutil.h
+++ b/src/third_party/s2/util/math/mathutil.h
@@ -150,8 +150,8 @@ class MathUtil {
// Discriminants below kTolerance in absolute value are considered zero
// because changing the final bit of one of the inputs can change the
// sign of the discriminant.
- const double kTolerance = epsilon * max(fabs(2 * b * b), fabs(4 * a * c));
- return (fabs(discriminant) <= kTolerance);
diff --git a/src/third_party/s2/util/endian/endian.h b/src/third_party/s2/util/endian/endian.h
index 9def73f..5b90e0a 100755
--- a/src/third_party/s2/util/endian/endian.h
+++ b/src/third_party/s2/util/endian/endian.h
@@ -178,14 +178,10 @@ class LittleEndian {
};
-// This one is safe to take as it's an extension
-#define htonll(x) ghtonll(x)
diff --git a/src/third_party/s2/s2regioncoverer.cc b/src/third_party/s2/s2regioncoverer.cc
index fb1cb2a..e6eb797 100644
--- a/src/third_party/s2/s2regioncoverer.cc
+++ b/src/third_party/s2/s2regioncoverer.cc
@@ -113,7 +113,7 @@ S2RegionCoverer::Candidate* S2RegionCoverer::NewCandidate(S2Cell const& cell) {
size += sizeof(Candidate*) << max_children_shift();
}
Candidate* candidate = static_cast<Candidate*>(malloc(size));
- memset(candidate, 0, size);
+ memset((void *)candidate, 0, size);
diff --git a/src/mongo/shell/linenoise_utf8.h b/src/mongo/shell/linenoise_utf8.h
index cb41822..29ecfff 100644
--- a/src/mongo/shell/linenoise_utf8.h
+++ b/src/mongo/shell/linenoise_utf8.h
@@ -17,6 +17,7 @@
#include <boost/smart_ptr/scoped_array.hpp>
#include <string.h>
+#include <algorithm>
name: "ResNet-101"
layer {
name: 'input-data'
type: 'Python'
top: 'data'
top: 'im_info'
top: 'gt_boxes'
python_param {
module: 'roi_data_layer.layer'
name: "ResNet-18"
layer {
name: 'input-data'
type: 'Python'
top: 'data'
top: 'im_info'
top: 'gt_boxes'
python_param {
module: 'roi_data_layer.layer'