Focus at the first file or directory of which name starts with the given String.
518621
def find(str)
      index = items.index {|i| i.index > current_row && i.name.start_with?(str)} || items.index {|i| i.name.start_with? str}
      move_cursor index if index
    end
249725
private static int findStart( char[] buffer, int start, int end )
    {
        int pos, cp;
        for ( pos = start; pos < end && isWhitespace( cp = codePointAt( buffer, pos ) ); pos += charCount( cp ) )
        {
            if ( cp == '\n' )
            {
                start = pos + 1;
            }
        }
        return pos >= end ? end : start;
    }
512394
def find_first(self, name=None, ns_uri=None):
        
        return self.find(name=name, ns_uri=ns_uri, first_only=True)
1241484
public static Prop useFirstFound(String... fileNames) {
		for (String fn : fileNames) {
			try {
				return use(fn, Const.DEFAULT_ENCODING);
			} catch (Exception e) {
				continue ;
			}
		}
		
		throw new IllegalArgumentException("没有配置文件可被使用");
	}
1029252
private static boolean isStartWith(String testString, String[] targetStrings) {
        for (String s : targetStrings) {
            if (testString.startsWith(s)) {
                return true;
            }
        }

        return false;
    }
581158
public String getStringEnclosedInFirst(String srcStr, String startToken, String endToken) {
        return getStringEnclosedInFirstWithDetails(srcStr, startToken, endToken).str;
    }
1220147
public static int findFirstOf(String string, String chars, int start, int end) {
        for (int i = start; i < end; i++) {
            char c = string.charAt(i);
            if (chars.indexOf(c) != -1) {
                return i;
            }
        }
        return end;
    }
927228
function beginsWith(haystack, needles) {
    let needle;
    for (let i = 0, u = needles.length; i < u; ++i) {
        needle = needles[i];
        if (haystack.substr(0, needle.length) === needle) {
            return true;
        }
    }
    return false;
}
541387
def select(files, start, stop):
    
    if start or stop:
        if start is None:
            start = 0
        if stop is None:
            stop = len(files)
        files = files[start:stop]
    return files
738205
public long findFirstSet(long start, byte[] temp) throws IOException {
        long pos = start >> 3;
        try {
            lock().acquireReadLock();
            while (true) {
                int amt = mFile.read(pos, temp, 0, temp.length);
                if (amt <= 0) {
                    return -1;
                }
                for (int i=0; i<amt; i++, pos++) {
                    byte val;
                    if ((val = temp[i]) != 0) {
                        long index = pos << 3;
                        if (index < start) {
                            // Clear the upper bits to skip check.
                            val &= (0x000000ff >>> (start - index));
                            if (val == 0) {
                                // False alarm.
                                continue;
                            }
                        }
                        return index + findSubIndex(val);
                    }
                }
            }
        }
        catch (InterruptedException e) {
            throw new InterruptedIOException();
        }
        finally {
            lock().releaseLock();
        }
    }
360615
def set_current_filename(self, filename, focus=True):
        """"""
        index = self.has_filename(filename)
        if index is not None:
            if focus:
                self.set_stack_index(index)
            editor = self.data[index].editor
            if focus:
                editor.setFocus()
            else:
                self.stack_history.remove_and_append(index)

            return editor
224889
def main(args):
    """"""
    filename = args[0]
    marker = args[1]
    for line in fileinput.input(filename, inplace=1):
        print(line.rstrip())
        if line.startswith(marker):
            break
452347
public void startSearch() {

        stopSearch();

        stop = false;

        MiscUtils.getExecutor().execute(new Runnable() {
            @Override
            public void run() {
                isSearching = true;
                try {
                    if (finder != null) {
                        finder.start();
                    }

                    for (String aSrPath : srPath) {
                        getFile(new File(aSrPath));
                    }

                    if (!stop && finder != null) {
                        finder.finished();
                    }

                } finally {
                    isSearching = false;
                }

            }
        });
    }
517802
def clicked(self):
        """"""
        fnames = self.get_selected_filenames()
        for fname in fnames:
            if osp.isdir(fname):
                self.directory_clicked(fname)
            else:
                self.open([fname])
325043
def find_file(name, directory):
    """"""
    path_bits = directory.split(os.sep)
    for i in range(0, len(path_bits) - 1):
        check_path = path_bits[0:len(path_bits) - i]
        check_file = "%s%s%s" % (os.sep.join(check_path), os.sep, name)
        if os.path.exists(check_file):
            return abspath(check_file)

    return None
756453
private boolean startsWithAFilteredPAttern(String string)
    {
        Iterator<String> iterator = filteredFrames.iterator();
        while (iterator.hasNext())
        {
            if (string.trim().startsWith(iterator.next()))
            {
                return true;
            }
        }
        return false;
    }
610946
private static synchronized String getFile(String name) {
        if(Objects.isNullOrEmpty(baseDirectory)){
            baseDirectory = Options.getStorage().getSystem("numberSequence.home", System.getProperty("user.home") + File.separator + ".s1-sequences");
        }
        File dir = new File(baseDirectory);
        if(!dir.exists())
            dir.mkdirs();
        if(!dir.isDirectory())
            throw new S1SystemError("Directory error: "+baseDirectory);
        return dir.getAbsolutePath()+File.separator+name;
    }