This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################### | |
# .gitignore file for Xcode4 / OS X Source projects | |
# | |
# Version 2.0 | |
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
# | |
# 2013 updates: | |
# - fixed the broken "save personal Schemes" | |
# | |
# NB: if you are storing "built" products, this WILL NOT WORK, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float offsetFinder(void){ | |
int i,j; | |
int offset_counter = 0; | |
int bottom_edge_counter = 0; | |
float sum = 0; | |
//Step 1: 从摄像头获取的赛道图像的下方,向上寻找黑色赛道边界。非边界点为-1 | |
//printf("\nedge_line:"); | |
for(j=0;j<HORIZONTAL_PIXEL_NUM;j++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$paypal_url='https://www.sandbox.paypal.com/cgi-bin/webscr'; // Test Paypal API URL | |
$paypal_id='[email protected]'; // Business email ID | |
?> | |
<h4>Welcome, Guest</h4> | |
<div class="product"> | |
<div class="image"> | |
<img src="http://www.phpgang.com/wp-content/uploads/gang.jpg" /> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset=utf-8> | |
<meta name="viewport" content="width=620"> | |
<title>HTML5 Demo: File API</title> | |
<link rel="stylesheet" href="css/html5demos.css"> | |
<script src="js/h5utils.js"></script></head> | |
<body> | |
<section id="wrapper"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('file',[]) | |
.directive('file', [function(){ | |
return { | |
scope: { | |
file: '=' | |
}, | |
link: function(scope, el, attrs){ | |
el.bind('change', function(event){ | |
var files = event.target.files; | |
var file = files[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.companiesLoaded = function(){ | |
angular.forEach($scope.selectedPackage.tenderers, function(tenderer, key){ | |
var matchedCompanies = $.grep($scope.companies, function(company){ return (company.id == tenderer.company_id); }); | |
if( matchedCompanies.length > 0){ | |
matchedCompanies[0].selected = true; | |
matchedCompanies[0].added = true; | |
} | |
}); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in English: return all companies that have a contact whose id is nil. | |
# why this will work is because the "includes" method will join the two tables( companies and contacts) into one table. | |
# for those companies who has no contacts, the record's contact is null. | |
Company.includes(:contacts).where(contacts: {id: nil}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. define a constructor function for the new object: | |
var objectConstructor = function(){ | |
this.objAttr = "objAttr"; | |
this.objMethod = function(){ | |
alert("obj method"); | |
} | |
} | |
// 2. decorate the prototype property of the constructor function | |
objectConstructor.prototype.protoAttr = "protoAttr"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# under Rails console: | |
ModelName.__elasticsearch__.create_index! force: true | |
# (optional) import your model index to Elasticsearch | |
ModelName.import |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts "valid? #{@company.valid?}. Errors: #{@company.errors.inspect}" |