// shortcut for the most common case
161390
func setPostId(id uint64, params url.Values) url.Values {
	return setParamsUint(id, params, "id")
}
552938
func UpperCamelCase(str string) string {
	pieces := split(str)

	for index, s := range pieces {
		pieces[index] = fmt.Sprintf(`%v%v`, strings.ToUpper(string(s[0])), strings.ToLower(s[1:]))
	}

	return strings.Join(pieces, ``)
}
620532
func (d DoubleArray) CommonPrefixSearchCallback(input string, callback func(id, l int)) {
	var p, q int
	bufLen := len(d)
	for i := 0; i < len(input); i++ {
		if input[i] == terminator {
			return
		}
		p = q
		q = int(d[p].Base) + int(input[i])
		if q >= bufLen || int(d[q].Check) != p {
			break
		}
		ahead := int(d[q].Base) + int(terminator)
		if ahead < bufLen && int(d[ahead].Check) == q && int(d[ahead].Base) <= 0 {
			callback(int(-d[ahead].Base), i+1)
		}
	}
	return
}
1015891
func PrettyPrint(i interface{}) string {
	switch t := i.(type) {
	case nil:
		return "None"
	case string:
		return capitalizeFirst(t)
	default:
		return capitalizeFirst(fmt.Sprintf("%s", t))
	}
}
638723
func (g *Group) FindOptionByShortName(shortName rune) *Option {
	return g.findOption(func(option *Option) bool {
		return option.ShortName == shortName
	})
}
354212
func UnderscoreToCamelCase(s string) string {
	return strings.Replace(strings.Title(strings.Replace(strings.ToLower(s), "_", " ", -1)), " ", "", -1)
}
1218367
func (d DoubleArray) CommonPrefixSearch(input string) (ids, lens []int) {
	var p, q int
	bufLen := len(d)
	for i, size := 0, len(input); i < size; i++ {
		if input[i] == terminator {
			return
		}
		p = q
		q = int(d[p].Base) + int(input[i])
		if q >= bufLen || int(d[q].Check) != p {
			break
		}
		ahead := int(d[q].Base) + int(terminator)
		if ahead < bufLen && int(d[ahead].Check) == q && int(d[ahead].Base) <= 0 {
			ids = append(ids, int(-d[ahead].Base))
			lens = append(lens, i+1)
		}
	}
	return
}
316970
func LowercaseKey(handler cfg.Handler) cfg.Handler {
	return Apply(func(key string) (string, error) { return strings.ToLower(key), nil }, nil, handler)
}
910090
func toCamelInitCase(s string, initCase bool) string {
	s = addWordBoundariesToNumbers(s)
	s = strings.Trim(s, " ")
	n := ""
	capNext := initCase
	for _, v := range s {
		if v >= 'A' && v <= 'Z' {
			n += string(v)
		}
		if v >= '0' && v <= '9' {
			n += string(v)
		}
		if v >= 'a' && v <= 'z' {
			if capNext {
				n += strings.ToUpper(string(v))
			} else {
				n += string(v)
			}
		}
		if v == '_' || v == ' ' || v == '-' {
			capNext = true
		} else {
			capNext = false
		}
	}
	return n
}
1307666
func (t Term) Upcase(args ...interface{}) Term {
	return constructMethodTerm(t, "Upcase", p.Term_UPCASE, args, map[string]interface{}{})
}
551892
func (c *ConfigLookup) GetLowerString(key string) string {
	value, ok := c.Lookup(key)
	if !ok {
		return ""
	}
	return strings.ToLower(cast.ToString(value))
}
535743
func (f *sendReceiveFolder) shortcutFile(file, curFile protocol.FileInfo, dbUpdateChan chan<- dbUpdateJob) {
	l.Debugln(f, "taking shortcut on", file.Name)

	events.Default.Log(events.ItemStarted, map[string]string{
		"folder": f.folderID,
		"item":   file.Name,
		"type":   "file",
		"action": "metadata",
	})

	var err error
	defer events.Default.Log(events.ItemFinished, map[string]interface{}{
		"folder": f.folderID,
		"item":   file.Name,
		"error":  events.Error(err),
		"type":   "file",
		"action": "metadata",
	})

	f.queue.Done(file.Name)

	if !f.IgnorePerms && !file.NoPermissions {
		if err = f.fs.Chmod(file.Name, fs.FileMode(file.Permissions&0777)); err != nil {
			f.newPullError(file.Name, err)
			return
		}
	}

	f.fs.Chtimes(file.Name, file.ModTime(), file.ModTime()) // never fails

	// This may have been a conflict. We should merge the version vectors so
	// that our clock doesn't move backwards.
	file.Version = file.Version.Merge(curFile.Version)

	dbUpdateChan <- dbUpdateJob{file, dbUpdateShortcutFile}
}
1373159
func capitalizeFirst(s string) string {
	switch l := len(s); l {
	case 0:
		return s
	case 1:
		return strings.ToLower(s)
	default:
		return strings.ToUpper(string(s[0])) + strings.ToLower(s[1:])
	}
}
1307510
func casesz(ctxt *liblink.Link, p *liblink.Prog) int {
	var jt int = 0
	var n int = 0
	var o []Optab
	for ; p != nil; p = p.Link {
		if p.As == ABCASE {
			jt = 1
		} else if jt != 0 {
			break
		}
		o = oplook(ctxt, p)
		n += o[0].size
	}
	return n
}
1021940
func (f Features) ConciseString() string {
	noneEmptyPos := []bool{f.EnableTrace, f.Latency != 0, f.Kbps != 0, f.Mtu != 0, true, true, true, f.ModeCompressor != "off", f.EnableChannelz, f.EnablePreloader}
	return PartialPrintString(noneEmptyPos, f, false)
}
98366
func (s *Server) HandleGetShortcut(c web.C, w http.ResponseWriter, r *http.Request) {
	shortcut := Shortcut{}
	err := s.Store.Get(fmt.Sprintf("/shortcuts/%s", c.URLParams["id"]), &shortcut)
	if err != nil {
		http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
		return
	}
	json.NewEncoder(w).Encode(shortcut)
}
428876
func NewShowcaseFileViewDetails(EventUuid string) *ShowcaseFileViewDetails {
	s := new(ShowcaseFileViewDetails)
	s.EventUuid = EventUuid
	return s
}