Make a board for a character name, and switch to it.
495811
def new_board(self, name):
        """"""
        char = self.engine.character[name]
        board = Board(character=char)
        self.mainscreen.boards[name] = board
        self.character = char
759016
public static String makePropertyName(String name) {
    char[] buf = new char[name.length() + 3];
    int pos = 0;
    buf[pos++] = 's';
    buf[pos++] = 'e';
    buf[pos++] = 't';

    for (int ix = 0; ix < name.length(); ix++) {
      char ch = name.charAt(ix);
      if (ix == 0)
        ch = Character.toUpperCase(ch);
      else if (ch == '-') {
        ix++;
        if (ix == name.length())
          break;
        ch = Character.toUpperCase(name.charAt(ix));
      }

      buf[pos++] = ch;
    }

    return new String(buf, 0, pos);
  }
67022
def make(name):
    """"""
    __all__.append(name)
    return type(name if py3k else name.encode("utf8"), (Token,), {})
570224
def make_id(name):
    
    name = re.sub(r'[^a-zA-Z0-9]', '', name)
    r = get_rand_string(12)
    if len(name) > 22:
        name = name[:22]
    return name + "-" + r
1046460
function(d, name){
		var key = this.boardtype[name][1], puzzle = this.puzzle, ope;
		if(key & this.TURNFLIP){ ope = new puzzle.klass.BoardFlipOperation(d, name);}
		else                   { ope = new puzzle.klass.BoardAdjustOperation(name);}
		puzzle.opemgr.add(ope);
	}
376014
def shorten_name(name, char_limit, side='right'):
    
    # TODO: A more elegant way to do this?
    if char_limit is not None and len(name) > char_limit:
        info = get_fileinfo(name)
        if info.numhdu is not None:
            i = name.rindex('[')
            s = (name[:i], name[i:])
            len_sfx = len(s[1])
            len_pfx = char_limit - len_sfx - 4 + 1
            if len_pfx > 0:
                if side == 'right':
                    name = '{0}...{1}'.format(s[0][:len_pfx], s[1])
                elif side == 'left':
                    name = '...{0}{1}'.format(s[0][-len_pfx:], s[1])
            else:
                name = '...{0}'.format(s[1])
        else:
            len1 = char_limit - 3 + 1
            if side == 'right':
                name = '{0}...'.format(name[:len1])
            elif side == 'left':
                name = '...{0}'.format(name[-len1:])

    return name
905888
function(name){
		if(!this.boardtype[name]){ return;}

		var puzzle = this.puzzle, bd = this.board;
		if(name.indexOf("reduce")===0){
			if(name==="reduceup"||name==="reducedn"){
				if(bd.rows<=1){ return;}
			}
			else if(name==="reducelt"||name==="reducert"){
				if(bd.cols<=1){ return;}
			}
		}

		puzzle.opemgr.newOperation();

		puzzle.painter.suspendAll();

		// undo/redo時はexecadjust_mainを直接呼びます
		var d = {x1:0, y1:0, x2:2*bd.cols, y2:2*bd.rows}; // TURNFLIPには範囲が必要
		this.execadjust_main(this.boardtype[name][1],d);
		this.addOpe(d, name);

		bd.setminmax();
		bd.rebuildInfo();

		// Canvasを更新する
		puzzle.painter.resizeCanvas();
		puzzle.emit('adjust');
		puzzle.painter.unsuspend();
	}
803744
def shorten_go_name_ptbl1(self, name):
        """"""
        if self._keep_this(name):
            return name
        name = name.replace("negative", "neg.")
        name = name.replace("positive", "pos.")
        name = name.replace("response", "rsp.")
        name = name.replace("regulation", "reg.")
        name = name.replace("antigen processing and presentation", "app.")
        return name
679938
def press_keys(self,characters=[]):
        """"""
        for character in characters:
            self.press_key(character)
        for character in characters:
            self.release_key(character)
1194875
function getBoardWhereCanIGo(board, from) {
    var positions = getPositionsWhereCanIGo(board, from);
    return mapBoard(board, function (position) {
        return Position.setICanGoHere(positions, position);
    });
}
288717
def print_boards(hwpack='arduino', verbose=False):
    """"""
    if verbose:
        pp(boards(hwpack))
    else:
        print('\n'.join(board_names(hwpack)))
153503
def message(self, text):
        """"""
        line = 0
        # Iterate through each character.
        for char in text:
            # Advance to next line if character is a new line.
            if char == '\n':
                line += 1
                # Move to left or right side depending on text direction.
                col = 0 if self.displaymode & LCD_ENTRYLEFT > 0 else self._cols-1
                self.set_cursor(col, line)
            # Write the character to the display.
            else:
                self.write8(ord(char), True)
263167
function getBoard() {
    var game = $.cookie("game");
    var board_margin = 5;

    $.getJSON("/games/" + enc(game) + "/dimensions", function (data) {
        var dimensions = data;
        // add 5 for each side since players can add up to 5 pieces per turn
        var top = dimensions.top - board_margin;
        var bottom = dimensions.bottom + board_margin;
        var left = dimensions.left - board_margin;
        var right = dimensions.right + board_margin;

        $(BOARD).empty();

        var rows = bottom - top + 1;
        var cols = right - left + 1;
        for (var i = 0; i < rows; i++) {
            for (var j = 0; j < cols; j++) {
                $(BOARD).append('<div class="grid"></div>');
                $(GRIDCLS+":last-child").data(
                    "col", (j+left)).data("row", (top+i));
            }
        }

        // if ($(BOARD).width() < $(BOARD).height()) {
        //     $(BOARD).height($(BOARD).width());
        // } else {
        //     $(BOARD).width($(BOARD).height());
        // }

        $(GRIDCLS).css("width", (100/cols)+"%");
        $(GRIDCLS).css("height", (100/rows)+"%");
        var fontsize = Math.min($(GRIDCLS).height(), $(GRIDCLS).width());
        $(GRIDCLS).css("font-size", fontsize);

        //$(BOARD).css("width", (($(GRIDCLS).width()) * 10))
        //$(BOARD).css("height", (($(GRIDCLS).height()) * 10))

        $.getJSON("/games/" + enc(game) + "/board", function (data) {
            var i, idx;
            // place pieces on board
            if (data.length > 0) {
                for (i in data) {
                    var piece = data[i].piece;
                    var row = data[i].row;
                    var col = data[i].column;
                    var drow = row - dimensions.top + board_margin;
                    var dcol = col - dimensions.left + board_margin;
                    idx = drow*cols + dcol + 1;
                    $(GRIDCLS+":nth-child("+idx+")").addClass("boardpiece");
                    $(GRIDCLS+":nth-child("+idx+")").css("color",
                                                      pastels[piece.color]);
                    $(GRIDCLS+":nth-child("+idx+")").html(ushapes[piece.shape]);
                }
                $(".boardpiece").css("line-height", fontsize+"px");
            } else {  // place marker in center if board is empty
                idx = parseInt(($(GRIDCLS).length + 1) / 2, 10);
                $(GRIDCLS+":nth-child("+idx+")").addClass('snapgrid');
            }

            // iterate through board and mark spots adjacent to pieces
            if (data.length > 0) {
                var offsets = [1, -1, cols, -cols];
                for (i = 1; i <= $(GRIDCLS).length; i++) {
                    var cur = $(GRIDCLS+":nth-child("+i+")");
                    for (var j in offsets) {
                        var next = $(GRIDCLS+":nth-child("+(i+offsets[j])+")");
                        if (!cur.hasClass("boardpiece") &&
                            next.hasClass("boardpiece"))
                            cur.addClass("snapgrid");
                    }
                }
            }

            $(SNAPGRIDCLS).droppable({
                accept: PIECECLS,
                activate: function (event, ui) {
                    $(SNAPGRIDCLS).html("&middot;");
                    $(BOARD).addClass("activate");
                },
                deactivate: function (event, ui) {
                    $(SNAPGRIDCLS).html("");
                    $(BOARD).removeClass("activate");
                },
                drop: onPieceDrop
            });
        });
    });
}
1286205
def switch(self, idx, u):
        """"""
        self.u[self.uid[idx]] = u
        self.rebuild = True
        self.system.dae.factorize = True
        logger.debug('<Line> Status switch to {} on idx {}.'.format(u, idx))
439051
function(names, newval){
		var name = names.name;
		var item = this.list[name];
		switch(typeof item.defval){
			case "boolean": newval = !!newval;  break;
			case "number":  newval = +newval;   break;
			case "string":  newval = ""+newval; break;
		}
		if(!item.option || (item.option.indexOf(newval)>=0)){
			if(!!item.variety){
				item.variety[names.pid!==void 0 ? names.pid : this.puzzle.pid] = newval;
			}
			else{ item.val = newval;}
		}
		return item.val;
	}
1297749
def from_board(cls, board):
        '''
        
        '''
        if len(board):
            left = board.left_end()
            right = board.right_end()
        else:
            left = None
            right = None

        return cls(left, right, len(board))
751084
def cli_char(name, tibiadata, json):
    """"""
    name = " ".join(name)
    char = _fetch_and_parse(Character.get_url, Character.from_content,
                            Character.get_url_tibiadata, Character.from_tibiadata,
                            tibiadata, name)
    if json and char:
        print(char.to_json(indent=2))
        return
    print(get_character_string(char))