Skip to content

Instantly share code, notes, and snippets.

View estebanroblesluna's full-sized avatar

Esteban Robles Luna estebanroblesluna

View GitHub Profile
<Response>
<Say voice="alice">Check Please smile</Say>
</Response>
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D BUILD_NEW_PYTHON_SUPPORT=ON \
-D WITH_CUDA=ON \
-D ENABLE_FAST_MATH=1 \
-D WITH_FFMPEG=ON \
-D CUDA_FAST_MATH=1 \
-D WITH_CUBLAS=1 \
-D BUILD_opencv_python3=yes \
-D CMAKE_INSTALL_PREFIX=$(python3 -c "import sys; print(sys.prefix)") \
- (void) drawRect:(CGRect)rect on: (id)context
{
CGContextSetFillColor(context, [self backgroundColor]);
CGContextFillRect(context, [self bounds]);
CGContextSetLineWidth(context, 0.5);
CGContextSetStrokeColor(context, [self foregroundColor]);
CGContextStrokeRect(context, [self bounds]);
}
- (id) initWithFrame: (CGRect) aFrame
{
[super initWithFrame: aFrame];
[self backgroundColor: [CPColor whiteColor]];
[self foregroundColor: [CPColor blackColor]];
[handles addObject: [Handle target: self selector: @"topLeft"]];
[handles addObject: [Handle target: self selector: @"topRight"]];
[handles addObject: [Handle target: self selector: @"bottomLeft"]];
[basicToolbox
addTool: [SimpleRectangleTool drawing: _drawing]
withTitle: @"Create rectangle"
image: @"Resources/Rectangle.png"];
- (void) createFigureAt: (id) aPoint on: (id) aDrawing
{
var frame = CGRectMake(aPoint.x, aPoint.y, 100, 50);
var newFigure = [SimpleRectangleFigure frame: frame];
[aDrawing addFigure: newFigure];
[self activateSelectionTool];
}
- (id) initWithFrame: (CGRect) aFrame
{
[super initWithFrame: aFrame];
[self backgroundColor: [CPColor whiteColor]];
[self foregroundColor: [CPColor blackColor]];
return self;
}
- (void) drawRect: (CGRect) rect on: (id) context
{
CGContextSetFillColor(context, [self backgroundColor]);
CGContextFillRect(context, [self bounds]);
CGContextSetLineWidth(context, 0.5);
CGContextSetStrokeColor(context, [self foregroundColor]);
CGContextStrokeRect(context, [self bounds]);
}
import org.apache.commons.lang.StringUtils;
private String computeMD5(String string) throws NoSuchAlgorithmException {
byte[] stringBytes = string.getBytes();
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
messageDigest.update(stringBytes, 0, stringBytes.length);
String md5 = new BigInteger(1, messageDigest.digest()).toString(16);
md5 = StringUtils.leftPad(md5, 32, '0');
<spring:bean id="hibernateSessionAdvice" class="org.mule.hibernate.extensions.HibernateSessionAdvice">
<spring:constructor-arg index="0" ref="sessionFactory" />
</spring:bean>
<custom-processor name="openSessionMP" class="org.mule.hibernate.extensions.OpenHibernateSessionMP">
<spring:property name="advice" ref="hibernateSessionAdvice" />
</custom-processor>
<custom-processor name="closeSessionMP" class="org.mule.hibernate.extensions.CloseHibernateSessionMP">
<spring:property name="advice" ref="hibernateSessionAdvice" />