This file contains hidden or 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
=REPLACE(A1,1,LOOKUP(2^15,FIND("/",A1,ROW(INDIRECT("1:"&LEN(A1))))),"") |
This file contains hidden or 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
Sub Macro1() | |
findArray = Array("/01/", "/02/", "/03/", "/04/", "/05/", "/06/", "/07/", "/08/", "/09/", "/10/", "/11/", "/12/") | |
replArray = Array("/Jan/", "/Feb/", "/Mar/", "/Apr/", "/May/", "/Jun/", "/Jul/", "/Aug/", "/Sep/", "/Oct/", "/Nov/", "/Dec/") | |
For i = 0 To UBound(findArray) | |
Selection.EntireColumn.Select | |
Selection.Replace What:=findArray(i), Replacement:=replArray(i), LookAt:=xlPart, _ | |
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ | |
ReplaceFormat:=False |
This file contains hidden or 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
issues.each do |y| | |
y["created_at"] = DateTime.strptime(y["created_at"], '%Y-%m-%dT%H:%M:%S%z').to_time.utc | |
y["updated_at"] = DateTime.strptime(y["updated_at"], '%Y-%m-%dT%H:%M:%S%z').to_time.utc | |
if y["closed_at"] != nil | |
y["closed_at"] = DateTime.strptime(y["closed_at"], '%Y-%m-%dT%H:%M:%S%z').to_time.utc | |
end | |
end |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<?xml-stylesheet type="text/xsl" href="/templates/xslt/inspections/inspections_details_en.xsl"?> | |
<response> | |
<result numFound="1" start="0"> | |
<doc> | |
<str name="app_id">fsi</str> | |
<str name="fs_fa_en">Ottawa West</str> | |
<str name="fs_fa_fr">Ottawa Ouest</str> | |
<str name="fs_facd">OTW</str> | |
<str name="fs_faid">9DC7C571-6145-47B1-B837-85E1F6A26244</str> |
This file contains hidden or 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
[{"numFound"=>"1", | |
"start"=>"0", | |
"doc"=> | |
[{"str"=> | |
{"app_id"=>"fsi", | |
"fs_fa_en"=>"Ottawa West", | |
"fs_fa_fr"=>"Ottawa Ouest", | |
"fs_facd"=>"OTW", | |
"fs_faid"=>"9DC7C571-6145-47B1-B837-85E1F6A26244", | |
"fs_fcr"=>"YES", |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<?xml-stylesheet type="text/xsl" href="/templates/xslt/inspections/inspections_details_en.xsl"?> | |
<response> | |
<result numFound="1" start="0"> | |
<doc> | |
<str name="app_id">fsi</str> | |
<str name="fs_fa_en">Ottawa West</str> | |
<str name="fs_fa_fr">Ottawa Ouest</str> | |
<str name="fs_facd">OTW</str> | |
<str name="fs_faid">9DC7C571-6145-47B1-B837-85E1F6A26244</str> |
This file contains hidden or 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
{"numFound"=>"1", | |
"start"=>"0", | |
"doc"=> | |
{"str"=> | |
{"app_id"=>"fsi", | |
"fs_fa_en"=>"Ottawa West", | |
"fs_fa_fr"=>"Ottawa Ouest", | |
"fs_facd"=>"OTW", | |
"fs_faid"=>"9DC7C571-6145-47B1-B837-85E1F6A26244", | |
"fs_fcr"=>"YES", |
This file contains hidden or 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
def convertDatesForMongo(parsedXML) | |
# Fixes Date Strings in Facility/Restarant information | |
# If statement is used to ensure that the date is not null otherway the strptime would throw a exception if it was null | |
# If Statement is only used because of data inconsistancies with Health Inspection Data | |
if parsedXML["doc"]["str"]["fs_fcr_date"] != nil | |
parsedXML["doc"]["str"]["fs_fcr_date"] = DateTime.strptime(parsedXML["doc"]["str"]["fs_fcr_date"][0..-5], '%Y-%m-%d %H:%M:%S').to_time.utc | |
end | |
if parsedXML["doc"]["str"]["fs_fefd"] != nil |
This file contains hidden or 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
def analyzeRestaurantNameCount | |
return restaurantNameCount = @coll.aggregate([ | |
{ "$project" => {doc:{str:{fs_fnm: 1}}}}, | |
{ "$group" => {_id: "$doc.str.fs_fnm", number: { "$sum" => 1 }}}, | |
{ "$sort" => {"_id" => 1 }} | |
]) | |
end | |
def analyzeRestaurantCategoryCount | |
restaurantCategoryCount = @coll.aggregate([ |
This file contains hidden or 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
require 'date' | |
require 'groupdate' | |
class DateManipulate | |
def initialize | |
@creationDateCount = [{"_id"=>{"year"=>2012, "month"=>10}, "number"=>53}, {"_id"=>{"year"=>2012, "month"=>12}, "number"=>58}, {"_id"=>{"year"=>2011, "month"=>8}, "number"=>8}, {"_id"=>{"year"=>2012, "month"=>11}, "number"=>75}, {"_id"=>{"year"=>2011, "month"=>9}, "number"=>58}, {"_id"=>{"year"=>2013, "month"=>9}, "number"=>67}, {"_id"=>{"year"=>2013, "month"=>6}, "number"=>561}, {"_id"=>{"year"=>2012, "month"=>9}, "number"=>102}, {"_id"=>{"year"=>2013, "month"=>5}, "number"=>609}, {"_id"=>{"year"=>2012, "month"=>7}, "number"=>84}, {"_id"=>{"year"=>2010, "month"=>12}, "number"=>1}, {"_id"=>{"year"=>2013, "month"=>7}, "number"=>595}, {"_id"=>{"year"=>2013, "month"=>3}, "number"=>253}, {"_id"=>{"year"=>2012, "month"=>6}, "number"=>129}, {"_id"=>{"year"=>2012, "month"=>2}, "number"=>95}, {"_id"=>{"year"=>2012, "month"=>4}, "number"=>50}, {"_id"=>{"year"=>2013, "month"=>8}, "number"=>736}, {"_id"=>{"year"=>2013, "month"=>1}, "number"=>242 |
OlderNewer