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
import time | |
import datetime | |
import RPi.GPIO as GPIO | |
def calculateSpeed(): | |
global start | |
done = time.time() | |
elapsed = done - start | |
elaspesedMinute = elapsed*0.01666668 | |
rpm = 1/elaspesedMinute |
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
namespace Sitecore.BulkOperations | |
{ | |
public class AddSection : WebEditCommand | |
{ | |
public override void Execute(CommandContext context) | |
{ | |
if (context.Items.Length <= 0) | |
return; | |
Item obj = context.Items[0]; | |
NameValueCollection parameters = new NameValueCollection(); |
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
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<commands> | |
<command name="bucket:addSection" type="Sitecore.BulkOperations.AddSection, Sitecore.BulkOperations"/> | |
</commands> | |
</sitecore> | |
</configuration> |
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
<!-- WEB INDEX configuration --> | |
<index id="sitecore_web_index" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider"> | |
<param desc="name">$(id)</param> | |
<param desc="core">itembuckets_web</param> | |
<param desc="propertyStore" ref="contentSearch/databasePropertyStore" param1="$(id)" /> | |
<configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" /> | |
<strategies hint="list:AddStrategy"> | |
<strategy ref="contentSearch/indexUpdateStrategies/onPublishEndAsync" /> | |
</strategies> | |
<locations hint="list:AddCrawler"> |
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
<!-- Custom Index --> | |
<index id="sitecore_custom_index" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider"> | |
<param desc="name">$(id)</param> | |
<param desc="core">itembuckets_custom</param> <!-- Created a new core for this custom index. Using the same core cause a few issues like one index disappearing when this index is updated --> | |
<param desc="propertyStore" ref="contentSearch/databasePropertyStore" param1="$(id)" /> | |
<configuration ref="contentSearch/indexConfigurations/customIndexConfiguration" /><!-- You can point this to a new custom index config or an existing one. I created a new config as my custom index only needs to index very few fields --> | |
<strategies hint="list:AddStrategy"> | |
<strategy ref="contentSearch/indexUpdateStrategies/onPublishEndAsync" /> | |
</strategies> | |
<locations hint="list:AddCrawler"> |
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
<field fieldName="region_cname" storageType="YES" indexType="UNTOKENIZED" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider"> | |
<Analyzer type="Sitecore.ContentSearch.LuceneProvider.Analyzers.LowerCaseKeywordAnalyzer, Sitecore.ContentSearch.LuceneProvider" /> | |
</field> |
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
<field fieldName="region_cname" storageType="yes" indexType="UNTOKENIZED">Sitecore7.Extensions.ComputedFields.CustomComputedField, Sitecore7.Extensions</field>` |
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
public class CustomComputedField : IComputedIndexField | |
{ | |
public object ComputeFieldValue(IIndexable indexable) | |
{ | |
Item item = indexable as SitecoreIndexableItem; | |
if (item == null) | |
{ | |
return null; | |
} |