Walt Disney Imagineering

No Brain Left Behind

In the digital economy, knowledge is the most important thing. This simple fact is the reason why accessibility is important to business. All knowledge, no matter who from is useful, and the more diverse the group of Knowledgeers you have, more commercially viable your organisation, because the more flexible it will ‘think’. There is a reason why…

Search Gear Notes

Search Gear #20 Cleaning Up

Cleaning up those nasty files func (tw *twitter) cleanUp(entity string) (string, error) { if entity == “” { entity = “myHome” } cleanTime := time.Now().AddDate(0, 0, -2) fileName := strings.Join([]string{entity, “_”, cleanTime.Format(“2006-01-02″), “.json”}, “”) if err := os.Remove(fileName); err != nil { log.Println(“Failed to”, err) } return fileName, nil }   So why not have…

Search Gear Notes

Search Gear #19 Regular Expressions

func getItem(entries toml.Value) func() (string, error) { i := -1 return func() (string, error) { rExpression := regexp.MustCompile(“(-([A-Z]+|[A-Z]+[1-9])-)”) i += 1 if i < len(entries.AsArray()) { if rExpression.FindString(entries.AsArray()[i].AsString()) != "" { foundString := rExpression.FindString(entries.AsArray()[i].AsString()) switch foundString { case "-YY-": replaceWith := strconv.Itoa(time.Now().Year()) entity := rExpression.ReplaceAllLiteralString(entries.AsArray()[i].AsString(), replaceWith[2:4]) return entity, nil case "-YY1-": replaceWith := strconv.Itoa(time.Now().Year() +…