PageRenderTime 277ms queryTime 70ms sortTime 5ms getByIdsTime 79ms findMatchingLines 51ms

100+ results results for 'startswith windows 9' (277 ms)

Not the results you expected?
utils.py https://github.com/slew/mne-python.git | Python | 345 lines
                    
6CUR_OS = _curos()
                    
7IS_WIN = CUR_OS in ['Windows', 'cli']
                    
8IS_NIX = (not IS_WIN) and any(
                    
8IS_NIX = (not IS_WIN) and any(
                    
9    CUR_OS.startswith(i) for i in
                    
10    ['CYGWIN', 'MSYS', 'Linux', 'Darwin', 'SunOS',
                    
239        try:
                    
240            return encoding.lower().startswith('utf-') or ('U8' == encoding)
                    
241        except:
                    
265    Return a function which gets width and height of console
                    
266    (linux,osx,windows,cygwin).
                    
267    """
                    
269    if IS_WIN:
                    
270        _environ_cols = _environ_cols_windows
                    
271        if _environ_cols is None:
                    
                
MoteFinder.java https://gitlab.com/rdeterre/contiki | Java | 226 lines
                    
54
                    
55  public static final String MOTELIST_WINDOWS = "./tools/motelist-windows.exe";
                    
56  public static final String MOTELIST_LINUX = "./tools/motelist-linux";
                    
59  private final Pattern motePattern;
                    
60  private final boolean isWindows;
                    
61  private final boolean isMacos;
                    
68    String osName = System.getProperty("os.name", "").toLowerCase();
                    
69    isWindows = osName.startsWith("win");
                    
70    isMacos = osName.startsWith("mac");
                    
90    String fullCommand;
                    
91    if (isWindows) {
                    
92      fullCommand = MOTELIST_WINDOWS;
                    
161  protected void parseIncomingLine(String line) {
                    
162    if (line.contains("No devices found") || line.startsWith("Reference")) {
                    
163      // No Sky connected or title before connected motes
                    
                
brailliantB.py https://bitbucket.org/mr_indoj/nvda_gwp.git | Python | 262 lines
                    
63		rootKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r"SYSTEM\CurrentControlSet\Enum\USB\Vid_1c71&Pid_c005")
                    
64	except WindowsError:
                    
65		# A display has never been connected via USB.
                    
71					keyName = _winreg.EnumKey(rootKey, index)
                    
72				except WindowsError:
                    
73					break
                    
76						yield "USB", _winreg.QueryValueEx(paramsKey, "PortName")[0]
                    
77				except WindowsError:
                    
78					continue
                    
85			continue
                    
86		if btName.startswith("Brailliant B") or btName == "Brailliant 80":
                    
87			yield "bluetooth", portInfo["port"]
                    
224			"kb:enter": ("br(brailliantB):dot8",),
                    
225			"kb:windows+d": ("br(brailliantB):c1+c4+c5",),
                    
226			"kb:windows": ("br(brailliantB):space+dot3+dot4",),
                    
                
FullMailcapCommandMap.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 454 lines
                    
226          // if you don't delete the .old file first, then the
                    
227          // rename fails under Windows.
                    
228          String oldSourceName = sourceFile.getAbsolutePath() + ".old";
                    
258      while (nextLine != null) {
                    
259        if (!(nextLine.startsWith("#")))
                    
260          map.addMailcapEntry(nextLine);
                    
435        return null;
                    
436      if (! command.startsWith("x-java-"))
                    
437        return new String[] {command, FullMailcapCommandMap.getExternalLauncher()};
                    
                
terminalwriter.py https://gitlab.com/phongphans61/machine-learning-tictactoe | Python | 423 lines
                    
54
                    
55    # XXX the windows getdimensions may be bogus, let's sanify a bit
                    
56    if width < 40:
                    
139           and os.environ.get('TERM') != 'dumb' \
                    
140           and not (sys.platform.startswith('java') and os._name == 'nt')
                    
141
                    
221        if sys.platform == "win32":
                    
222            # if we print in the last column on windows we are on a
                    
223            # new line but there is no way to verify/neutralize this
                    
341
                    
342    # ctypes access to the Windows console
                    
343    STD_OUTPUT_HANDLE = -11
                    
371                    ('srWindow', SMALL_RECT),
                    
372                    ('dwMaximumWindowSize', COORD)]
                    
373
                    
                
CommitInfo.cs https://github.com/eyalxjet/gitextensions.git | C# | 230 lines
                    
3using System.Text.RegularExpressions;
                    
4using System.Windows.Forms;
                    
5using GitCommands;
                    
150                    // This shouldn't be a big problem if we're only displaying information.
                    
151                    branchIsLocal = !branch.StartsWith(remotesPrefix);
                    
152                    if (!branchIsLocal)
                    
                
X11DesktopColors.cs https://github.com/sdether/mono.git | C# | 294 lines
                    
32
                    
33namespace System.Windows.Forms {
                    
34	internal class X11DesktopColors {
                    
169				} else
                    
170				if ( session.StartsWith("KDE") )
                    
171					desktop = Desktop.KDE;
                    
204				
                    
205				if (line.StartsWith( "background=")) {
                    
206					tmp_color = GetColorFromKDEString(line);
                    
212				} else
                    
213				if (line.StartsWith( "foreground=")) {
                    
214					tmp_color = GetColorFromKDEString(line);
                    
220				} else
                    
221				if (line.StartsWith("selectBackground")) {
                    
222					tmp_color = GetColorFromKDEString(line);
                    
                
ResolverConfig.java https://bitbucket.org/Trugath/xabber.git | Java | 540 lines
                    
19 *   <LI>On Unix, /etc/resolv.conf is parsed.
                    
20 *   <LI>On Windows, ipconfig/winipcfg is called and its output parsed.  This
                    
21 *       may fail for non-English versions on Windows.
                    
54		String vendor = System.getProperty("java.vendor");
                    
55		if (OS.indexOf("Windows") != -1) {
                    
56			if (OS.indexOf("95") != -1 ||
                    
233		while ((line = br.readLine()) != null) {
                    
234			if (line.startsWith("nameserver")) {
                    
235				StringTokenizer st = new StringTokenizer(line);
                    
238			}
                    
239			else if (line.startsWith("domain")) {
                    
240				StringTokenizer st = new StringTokenizer(line);
                    
246			}
                    
247			else if (line.startsWith("search")) {
                    
248				if (!lsearch.isEmpty())
                    
                
file.py https://github.com/jiffyclub/astropy.git | Python | 344 lines
                    
72                # Not writing file and file does not exist on local machine and
                    
73                # name does not begin with a drive letter (Windows), try to
                    
74                # get it over the web.
                    
121            ext = os.path.splitext(self.name)[1]
                    
122            if ext == '.gz' or magic.startswith(GZIP_MAGIC):
                    
123                # Handle gzip files
                    
129                self.compression = 'gzip'
                    
130            elif ext == '.zip' or magic.startswith(PKZIP_MAGIC):
                    
131                # Handle zip files
                    
                
Gen.java https://github.com/ikeji/openjdk7-langtools.git | Java | 384 lines
                    
87    static private final boolean isWindows =
                    
88        System.getProperty("os.name").startsWith("Windows");
                    
89
                    
269                    // Visual C++ supports the i64 suffix, not LL.
                    
270                    if (isWindows)
                    
271                        constString = value.toString() + "i64";
                    
                
runtests.py https://github.com/theosp/google_appengine.git | Python | 326 lines
                    
51    spatial_dbs = [name for name, db_dict in settings.DATABASES.items()
                    
52                   if db_dict['ENGINE'].startswith('django.contrib.gis')]
                    
53    return len(spatial_dbs) == len(settings.DATABASES)
                    
61        for f in os.listdir(dirpath):
                    
62            if (f.startswith('__init__') or
                    
63                f.startswith('.') or
                    
63                f.startswith('.') or
                    
64                f.startswith('sql') or
                    
65                os.path.basename(f) in REGRESSION_SUBDIRS_TO_SKIP):
                    
140    # so that it will successfully remove temp trees containing
                    
141    # non-ASCII filenames on Windows. (We're assuming the temp dir
                    
142    # name itself does not contain non-ASCII characters.)
                    
                
Path.java https://github.com/hyunjung/hadoop-common.git | Java | 350 lines
                    
44  static final boolean WINDOWS
                    
45    = System.getProperty("os.name").startsWith("Windows");
                    
46
                    
101    // add a slash in front of paths with Windows drive letters
                    
102    if (hasWindowsDrive(pathString, false))
                    
103      pathString = "/"+pathString;
                    
120    // parse uri authority, if any
                    
121    if (pathString.startsWith("//", start) &&
                    
122        (pathString.length()-start > 2)) {       // has authority
                    
163    // trim trailing slash from non-root path (ignoring windows drive)
                    
164    int minLength = hasWindowsDrive(path, true) ? 4 : 1;
                    
165    if (path.length() > minLength && path.endsWith("/")) {
                    
256      if (path.indexOf('/')==0 &&
                    
257          hasWindowsDrive(path, true) &&          // has windows drive
                    
258          uri.getScheme() == null &&              // but no scheme
                    
                
setup.py https://github.com/RoDaniel/featurehouse.git | Python | 201 lines
                    
49for line in file('lib/matplotlib/__init__.py').readlines():
                    
50    if (line.startswith('__version__')):
                    
51        exec(line.strip())
                    
57if sys.platform == 'win32':
                    
58    print_status('Windows version', sys.getwindowsversion())
                    
59print_raw("")
                    
                
test_mmap.py https://bitbucket.org/x893/sirflive.git | Python | 333 lines
                    
7def test_both():
                    
8    "Test mmap module on Unix systems and Windows"
                    
9
                    
205        except ValueError:
                    
206            # we do not expect a ValueError on Windows
                    
207            # CAUTION:  This also changes the size of the file on disk, and
                    
209            # repair that.
                    
210            if sys.platform.startswith('win'):
                    
211                verify(0, "Opening mmap with size+1 should work on Windows.")
                    
212        else:
                    
213            # we expect a ValueError on Unix, but not on Windows
                    
214            if not sys.platform.startswith('win'):
                    
217        f.close()
                    
218        if sys.platform.startswith('win'):
                    
219            # Repair damage from the resizing test.
                    
                
NativeLibraryLoader.java https://gitlab.com/taichu/netty | Java | 346 lines
                    
84            // This shouldn't happen, but just in case ..
                    
85            if (isWindows()) {
                    
86                f = toDirectory(System.getenv("TEMP"));
                    
117        // Last resort.
                    
118        if (isWindows()) {
                    
119            f = new File("C:\\Windows\\Temp");
                    
148    private static boolean isWindows() {
                    
149        return OSNAME.startsWith("windows");
                    
150    }
                    
152    private static boolean isOSX() {
                    
153        return OSNAME.startsWith("macosx") || OSNAME.startsWith("osx");
                    
154    }
                    
                
SarifDiagnostics.cpp https://gitlab.com/williamwp/riscv-rv32x-llvm | C++ | 349 lines
                    
76  StringRef Root = sys::path::root_name(Filename);
                    
77  if (Root.startswith("//")) {
                    
78    // There is an authority, so add it to the URI.
                    
89  std::for_each(++Iter, End, [&Ret](StringRef Component) {
                    
90    // For reasons unknown to me, we may get a backslash with Windows native
                    
91    // paths for the initial backslash following the drive component, which
                    
                
GetBatchTaskCommandTests.cs https://gitlab.com/jslee1/azure-powershell | C# | 271 lines
                    
18using Microsoft.Rest.Azure;
                    
19using Microsoft.WindowsAzure.Commands.ScenarioTest;
                    
20using Moq;
                    
155            cmdlet.Id = null;
                    
156            cmdlet.Filter = "startswith(id,'test')";
                    
157            cmdlet.Select = "id,state";
                    
                
ResourcesExtensions.cs https://gitlab.com/jslee1/azure-powershell | C# | 268 lines
                    
26using Microsoft.Azure.Management.Resources.Models;
                    
27using Microsoft.WindowsAzure.Commands.Utilities.Common;
                    
28using Newtonsoft.Json;
                    
158                    {
                    
159                        if (tagValuePair.Name.StartsWith(TagsClient.ExecludedTagPrefix))
                    
160                        {
                    
                
juce_PluginHostType.h https://github.com/plasm-language/pyplasm.git | C Header | 247 lines
                    
201
                    
202       #elif JUCE_WINDOWS
                    
203        if (hostFilename.containsIgnoreCase ("Live 6."))           return AbletonLive6;
                    
230        if (hostFilename.containsIgnoreCase ("rm-host"))           return MuseReceptorGeneric;
                    
231        if (hostFilename.startsWith         ("FL"))                return FruityLoops;
                    
232        if (hostFilename.contains           ("ilbridge."))         return FruityLoops;
                    
236        if (hostPath.containsIgnoreCase     ("Merging Technologies")) return MergingPyramix;
                    
237        if (hostFilename.startsWithIgnoreCase ("Sam"))             return MagixSamplitude;
                    
238
                    
                
MbrolaSynthesizer.java https://bitbucket.org/ftesser/marytts.git | Java | 284 lines
                    
81        String mbrolaCallerProperty;
                    
82        if (System.getProperty("os.name").startsWith("Windows") && false) { // let's try without this, use cygwin binary instead...
                    
83            mbrolaCallerProperty = "mbrolasynthesizer.mbrolacaller.class.win32"; 
                    
                
configuration.py https://github.com/changm/tessa.git | Python | 378 lines
                    
71def _configSub(ostest, cputest):
                    
72    if ostest.startswith('win') or ostest.startswith('cygwin'):
                    
73        os = 'windows'
                    
73        os = 'windows'
                    
74    elif ostest.startswith('darwin') or ostest.startswith('apple-darwin'):
                    
75        os = 'darwin'
                    
75        os = 'darwin'
                    
76    elif ostest.startswith('linux') or ostest.startswith('pc-linux'):
                    
77        os = 'linux'
                    
77        os = 'linux'
                    
78    elif ostest.startswith('sunos'):
                    
79        os = 'sunos'
                    
153
                    
154        if self._host[0] == 'windows':
                    
155            self._acvars['topsrcdir'] = toMSYSPath(self._topsrcdir)
                    
                
CGI.java https://github.com/dereke/browsermob-proxy.git | Java | 378 lines
                    
45 * commands passed to exec. This can be used on systems that need assistance
                    
46 * to execute a particular file type. For example on windows this can be set
                    
47 * to "perl" so that perl scripts are executed.
                    
126            String n= (String)e.nextElement();
                    
127            if (n != null && n.startsWith("ENV_"))
                    
128                _env.set(n.substring(4),getInitParameter(n));
                    
308                // See http://CGI-Spec.Golux.Com/draft-coar-cgi-v11-03-clean.html#7.2.1.2
                    
309                if (!redirect.startsWith("http:/")&&!redirect.startsWith("https:/"))
                    
310                    res.sendRedirect(redirect);
                    
                
MavenArtifactRepository.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 408 lines
                    
243            // special case: if omitted // on protocol, keep path as is
                    
244            if ( retValue.startsWith( "//" ) )
                    
245            {
                    
249                {
                    
250                    // special case: if there is a windows drive letter, then keep the original return value
                    
251                    retValue = retValue.charAt( 0 ) + ":" + retValue.substring( 2 );
                    
261
                    
262                    // special case: if there is a windows drive letter, then keep the original return value
                    
263                    if ( retValue.length() >= 2 && ( retValue.charAt( 1 ) == '|' || retValue.charAt( 1 ) == ':' ) )
                    
274
                    
275            // special case: if there is a windows drive letter using |, switch to :
                    
276            if ( retValue.length() >= 2 && retValue.charAt( 1 ) == '|' )
                    
                
OMERO-qa-upgrade.py https://github.com/ximenesuk/openmicroscopy.git | Python | 390 lines
                    
17###########################################################################
                    
18WINDOWS = platform.system() == "Windows"
                    
19p = subprocess.Popen(["hostname"], stdout=subprocess.PIPE)
                    
43
                    
44if WINDOWS:
                    
45    DEFINE("UNZIP", "C:\\Program Files (x86)\\7-Zip\\7z.exe")
                    
106
                    
107            if filename.startswith("OMERO.server"):
                    
108                self.server = base_url + artifact.find("relativePath").text
                    
108                self.server = base_url + artifact.find("relativePath").text
                    
109            elif filename.startswith('OMERO.source'):
                    
110                self.source = base_url + artifact.find("relativePath").text
                    
110                self.source = base_url + artifact.find("relativePath").text
                    
111            elif filename.startswith('OMERO.imagej') or\
                    
112                 filename.startswith('OMERO.java') or\
                    
                
Parser.cs https://github.com/paulcbetts/CaliburnMicro.git | C# | 271 lines
                    
7    using System.Text.RegularExpressions;
                    
8    using System.Windows;
                    
9    using System.Windows.Data;
                    
9    using System.Windows.Data;
                    
10    using EventTrigger = System.Windows.Interactivity.EventTrigger;
                    
11    using TriggerBase = System.Windows.Interactivity.TriggerBase;
                    
78        /// <returns>The created message.</returns>
                    
79        public static System.Windows.Interactivity.TriggerAction CreateMessage(DependencyObject target, string messageText) {
                    
80            var openingParenthesisIndex = messageText.IndexOf('(');
                    
105        /// </summary>
                    
106        public static Func<DependencyObject, string, System.Windows.Interactivity.TriggerAction> InterpretMessageText = (target, text) => {
                    
107            return new ActionMessage { MethodName = Regex.Replace(text, "^Action", string.Empty).Trim() };
                    
115
                    
116            if(parameterText.StartsWith("'") && parameterText.EndsWith("'"))
                    
117                actualParameter.Value = parameterText.Substring(1, parameterText.Length - 2);
                    
                
test_time.py https://github.com/atoun/empythoned.git | Python | 250 lines
                    
41        # Issue #10762: Guard against invalid/non-supported format string
                    
42        # so that Python don't crash (Windows crashes when the format string
                    
43        # input to [w]strftime is not kosher.
                    
43        # input to [w]strftime is not kosher.
                    
44        if sys.platform.startswith('win'):
                    
45            with self.assertRaises(ValueError):
                    
                
perf_device_trigger_unittest.py https://github.com/chromium/chromium.git | Python | 353 lines
                    
100            'os',
                    
101            'windows',
                    
102            '--',
                    
182            g = 'GTEST_SHARD_INDEX='
                    
183            shard = [int(r[len(g):]) for r in run if r.startswith(g)][0]
                    
184
                    
                
Screenshot.py https://gitlab.com/freedmpure/robotframework | Python | 328 lines
                    
16import os
                    
17if sys.platform.startswith('java'):
                    
18    from java.awt import Toolkit, Robot, Rectangle
                    
22    import clr
                    
23    clr.AddReference('System.Windows.Forms')
                    
24    clr.AddReference('System.Drawing')
                    
25    from System.Drawing import Bitmap, Graphics, Imaging
                    
26    from System.Windows.Forms import Screen
                    
27else:
                    
36    try:
                    
37        from PIL import ImageGrab  # apparently available only on Windows
                    
38    except ImportError:
                    
62    - Python Imaging Library (PIL) :: http://www.pythonware.com/products/pil ::
                    
63      This module can take screenshots only on Windows.
                    
64
                    
                
FileTree.scala https://bitbucket.org/effective/acumen-graveyard.git | Scala | 298 lines
                    
188    val p = path.getCanonicalFile.getAbsolutePath
                    
189    if (r != p && p.startsWith(r)) {
                    
190      val pathElems = p.substring(r.length).split("/").tail //FIXME Make sure this work on Windows
                    
                
history.py https://github.com/theosp/google_appengine.git | Python | 530 lines
                    
7  and Unix systems
                    
8- `pyreadline`_, which many people use on Windows systems
                    
9- A dummy fallback history implementation that does nothing, for when readline
                    
65    try:
                    
66        _have_pyreadline = readline.rl.__module__.startswith('pyreadline.')
                    
67    except AttributeError:
                    
                
identifier.js https://gitlab.com/nguyenthehiep3232/marius | JavaScript | 377 lines
                    
8
                    
9const WINDOWS_ABS_PATH_REGEXP = /^[a-zA-Z]:[\\/]/;
                    
10const SEGMENTS_SPLIT_REGEXP = /([|!])/;
                    
10const SEGMENTS_SPLIT_REGEXP = /([|!])/;
                    
11const WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g;
                    
12
                    
20	if (relativePath === "..") return "../.";
                    
21	if (relativePath.startsWith("../")) return relativePath;
                    
22	return `./${relativePath}`;
                    
51
                    
52	if (WINDOWS_ABS_PATH_REGEXP.test(maybeAbsolutePath)) {
                    
53		const querySplitPos = maybeAbsolutePath.indexOf("?");
                    
78const requestToAbsolute = (context, relativePath) => {
                    
79	if (relativePath.startsWith("./") || relativePath.startsWith("../"))
                    
80		return path.join(context, relativePath);
                    
                
test_mhlib.py https://bitbucket.org/x893/sirflive.git | Python | 348 lines
                    
14
                    
15if (sys.platform.startswith("win") or sys.platform=="riscos" or
                    
16      sys.platform.startswith("atheos")):
                    
18    # exists.  That causes a reasonable OS <wink> to complain in test_sequence
                    
19    # here, like the "OSError: [Errno 17] File exists" raised on Windows.
                    
20    # mhlib's listsubfolders() and listallfolders() do something with
                    
22    # an empty list from its call of listallfolders().
                    
23    # The other tests here pass on Windows.
                    
24    raise TestSkipped("skipped on %s -- " % sys.platform +
                    
                
template_verifier.py https://github.com/balp/NaCl-main.git | Python | 311 lines
                    
76    stderr separately(to get around "killed by signal 15" getting 
                    
77    included as part of the file).  Also, works on Windows."""
                    
78    (input, out, err) = os.popen3(command, 't')
                    
136def fetch(url):
                    
137    if url.startswith('file://'):
                    
138        # just open the file directly because urllib is dumb about these things
                    
175            # We can't rename atomically on top of an existing file on
                    
176            # Windows.  Unlinking the existing file will fail if the
                    
177            # file is being held open by a process, but there's only
                    
                
setup.py https://github.com/signalnine/cr48.git | Python | 391 lines
                    
79            # This will have to be changed if we ever have to check
                    
80            # for a function on Windows.
                    
81            devnull = open('/dev/null', 'w')
                    
128    err = [e for e in err.splitlines()
                    
129           if not e.startswith(b('Not trusting file')) \
                    
130              and not e.startswith(b('warning: Not importing'))]
                    
148        # Copy SystemRoot into the custom environment for Python 2.6
                    
149        # under Windows. Otherwise, the subprocess will fail with
                    
150        # error 0xc0150004. See: http://bugs.python.org/issue3440
                    
247            for ext in self.distribution.ext_modules:
                    
248                if ext.name.startswith("mercurial."):
                    
249                    self.py_modules.append("mercurial.pure.%s" % ext.name[10:])
                    
323
                    
324# disable osutil.c under windows + python 2.4 (issue1364)
                    
325if sys.platform == 'win32' and sys.version_info < (2, 5, 0, 'final'):
                    
                
TextureBundleXBT.cpp https://gitlab.com/sloshedpuppie/LetsGoRetro | C++ | 318 lines
                    
34
                    
35#ifdef TARGET_WINDOWS
                    
36#pragma comment(lib,"liblzo2.lib")
                    
126    std::string path = files[i].GetPath();
                    
127    if (StringUtils::StartsWithNoCase(path, testPath))
                    
128      textures.push_back(path);
                    
                
Platform.java https://github.com/akafugu/Xmegaduino.git | Java | 231 lines
                    
22
                    
23package processing.app.windows;
                    
24
                    
68
                    
69    CommandLine toDevicePath = CommandLine.parse("reg query \"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\" /v \"" + folderType + "\"");
                    
70    executor.execute(toDevicePath);
                    
74  /**
                    
75   * Remove extra quotes, slashes, and garbage from the Windows PATH.
                    
76   */
                    
82    for (String item : pieces) {
                    
83      if (item.startsWith("\"")) {
                    
84        item = item.substring(1);
                    
127    // after they're unpacked from the zip file. i don't know why,
                    
128    // and don't understand what this does in terms of windows
                    
129    // permissions. without the chmod, the command prompt says
                    
                
Win32PrintServiceLookup.java https://github.com/ikeji/openjdk7-jdk.git | Java | 343 lines
                    
90            // See "OpenPrinter" for more info.
                    
91            if (osName != null && osName.startsWith("Windows 98")) {
                    
92                return;
                    
119        if (printers == null) {
                    
120            // In Windows it is safe to assume no default if printers == null so we
                    
121            // don't get the default.
                    
279
                    
280        // Windows does not have notification for a change in default
                    
281        // so we always get the latest.
                    
                
GetBatchPoolCommandTests.cs https://gitlab.com/jslee1/azure-powershell | C# | 233 lines
                    
18using Microsoft.Rest.Azure;
                    
19using Microsoft.WindowsAzure.Commands.ScenarioTest;
                    
20using Moq;
                    
31{
                    
32    public class GetBatchPoolCommandTests : WindowsAzure.Commands.Test.Utilities.Common.RMTestBase
                    
33    {
                    
122            cmdlet.Id = null;
                    
123            cmdlet.Filter = "startswith(id,'test')";
                    
124            cmdlet.Select = "id,state";
                    
                
CompletionList.cs https://github.com/lumimies/ILSpy.git | C# | 377 lines
                    
7using System.Globalization;
                    
8using System.Windows;
                    
9using System.Windows.Controls;
                    
9using System.Windows.Controls;
                    
10using System.Windows.Controls.Primitives;
                    
11using System.Windows.Documents;
                    
11using System.Windows.Documents;
                    
12using System.Windows.Input;
                    
13using System.Linq;
                    
30		/// If true, the CompletionList is filtered to show only matching items. Also enables search by substring.
                    
31		/// If false, enables the old behavior: no filtering, search by string.StartsWith.
                    
32		/// </summary>
                    
224			var listToFilter = (this.currentList != null && (!string.IsNullOrEmpty(this.currentText)) && (!string.IsNullOrEmpty(query)) &&
                    
225			                    query.StartsWith(this.currentText, StringComparison.Ordinal)) ?
                    
226				this.currentList : this.completionData;
                    
                
FileUtil.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 468 lines
                    
355	 * understands. That is all elements are separated by a forward slash rather
                    
356	 * than back slashes as on Windows systems.
                    
357	 * 
                    
389		filename = this.javaFilename(filename) ;
                    
390		startedFromRoot = filename.startsWith( "/" ) ;
                    
391		nameElements = this.str().parts( filename, "/" ) ;
                    
                
connection.py https://github.com/vesnican/play.git | Python | 416 lines
                    
1#
                    
2# A higher level module for using sockets (or Windows named pipes)
                    
3#
                    
70        return 'AF_INET'
                    
71    elif type(address) is str and address.startswith('\\\\'):
                    
72        return 'AF_PIPE'
                    
86    This is a wrapper for a bound socket which is 'listening' for
                    
87    connections, or for a Windows named pipe.
                    
88    '''
                    
197            win32.ConnectNamedPipe(h1, win32.NULL)
                    
198        except WindowsError, e:
                    
199            if e.args[0] != win32.ERROR_PIPE_CONNECTED:
                    
308                win32.ConnectNamedPipe(handle, win32.NULL)
                    
309            except WindowsError, e:
                    
310                if e.args[0] != win32.ERROR_PIPE_CONNECTED:
                    
                
generate_stubs_unittest.py https://github.com/chromium/chromium.git | Python | 325 lines
                    
131
                    
132class WindowsLibUnittest(unittest.TestCase):
                    
133  def testWriteWindowsDefFile(self):
                    
136    outfile = StringIO.StringIO()
                    
137    gs.WriteWindowsDefFile(module_name, signatures, outfile)
                    
138    contents = outfile.getvalue()
                    
140    # Check that the file header is correct.
                    
141    self.assertTrue(contents.startswith("""LIBRARY %s
                    
142EXPORTS
                    
                
Strings.php https://bitbucket.org/iiic/iszp.git | PHP | 580 lines
                    
89	 */
                    
90	public static function startsWith($haystack, $needle)
                    
91	{
                    
174		if (ICONV_IMPL === 'glibc') {
                    
175			$s = @iconv('UTF-8', 'WINDOWS-1250//TRANSLIT', $s); // intentionally @
                    
176			$s = strtr($s, "\xa5\xa3\xbc\x8c\xa7\x8a\xaa\x8d\x8f\x8e\xaf\xb9\xb3\xbe\x9c\x9a\xba\x9d\x9f\x9e"
                    
                
main.cpp https://bitbucket.org/jpe/experimental-shiboken.git | C++ | 448 lines
                    
35
                    
36#ifdef _WINDOWS
                    
37    #define PATH_SPLITTER ";"
                    
185    foreach (const QString& arg, arguments) {
                    
186        if (arg.startsWith("--project-file")) {
                    
187            int split = arg.indexOf("=");
                    
226        arg = arg.trimmed();
                    
227        if (arg.startsWith("--")) {
                    
228            int split = arg.indexOf("=");
                    
232                args[arg.mid(2)] = QString();
                    
233        } else if (arg.startsWith("-")) {
                    
234            args[arg.mid(1)] = QString();
                    
                
site.py https://github.com/argodev/BiLab.git | Python | 430 lines
                    
16lib/python<version>/site-packages as well as lib/site-python.
                    
17On other platforms (such as Windows), it tries each of the
                    
18prefixes directly, as well as with lib/site-packages appended.  The
                    
68    dir = os.path.join(*paths)
                    
69    if dir == '__classpath__' or dir.startswith('__pyclasspath__'):
                    
70        return dir, dir
                    
140        for line in f:
                    
141            if line.startswith("#"):
                    
142                continue
                    
142                continue
                    
143            if line.startswith("import"):
                    
144                exec line
                    
357def aliasmbcs():
                    
358    """On Windows, some default encodings are not provided by Python,
                    
359    while they are always available as "mbcs" in each locale. Make
                    
                
func_inspect.py https://gitlab.com/sirarredondo/Plasmid_Assembly | Python | 303 lines
                    
48            line_no = 1
                    
49            if source_file.startswith('<doctest '):
                    
50                source_file, line_no = re.match(
                    
76def _clean_win_chars(string):
                    
77    """Windows cannot encode some characters in filename."""
                    
78    import urllib
                    
101            If true, substitute special characters using urllib.quote
                    
102            This is useful in Windows, as it cannot encode some filenames
                    
103    """
                    
124            parts = filename.split(os.sep)
                    
125            if parts[-1].startswith('<ipython-input'):
                    
126                # function is defined in an IPython session. The filename
                    
152    if os.name == 'nt' and win_characters:
                    
153        # Stupid windows can't encode certain characters in filenames
                    
154        name = _clean_win_chars(name)
                    
                
HippoPlatformImpl.cpp https://gitlab.com/manoj-makkuboy/magnetism | C++ | 385 lines
                    
5#include <HippoUtil.h>
                    
6#include <Windows.h>
                    
7#include <mshtml.h>
                    
108static bool
                    
109startsWith(WCHAR *str, WCHAR *prefix)
                    
110{
                    
196
                    
197        if (!startsWith(p, L"auth="))
                    
198            continue;
                    
245void
                    
246hippo_platform_impl_windows_migrate_cookie(const char *from_web_host,
                    
247                                           const char *to_web_host)
                    
                
juce_ApplicationBase.cpp https://gitlab.com/bill-auger/JUCE | C++ | 308 lines
                    
109
                    
110            if (message.startsWith (appName + "/"))
                    
111                app->anotherInstanceStarted (message.substring (appName.length() + 1));
                    
140
                    
141#if JUCE_WINDOWS && ! defined (_CONSOLE)
                    
142
                    
173
                    
174#if JUCE_WINDOWS
                    
175 const char* const* juce_argv = nullptr;
                    
259
                    
260   #if JUCE_WINDOWS && JUCE_STANDALONE_APPLICATION && (! defined (_CONSOLE)) && (! JUCE_MINGW)
                    
261    if (AttachConsole (ATTACH_PARENT_PROCESS) != 0)
                    
                
gitindex.h https://gitlab.com/zhaohaiyi/tortoisegit | C Header | 489 lines
                    
1// TortoiseGit - a Windows shell extension for easy version control
                    
2
                    
109		{
                    
110			if (CStringUtils::StartsWith((*it).first, thePath))
                    
111				toRemove.push_back((*it).first);
                    
245		{
                    
246			if (CStringUtils::StartsWith((*it).first, thePath))
                    
247				toRemove.push_back((*it).first);
                    
334	bool CheckAndUpdateCoreExcludefile(const CString &adminDir);
                    
335	const CString GetWindowsHome();
                    
336
                    
                
FormPull.cs https://github.com/jotux/gitextensions.git | C# | 389 lines
                    
4using System.IO;
                    
5using System.Windows.Forms;
                    
6using GitCommands;
                    
121                        if (!head.IsRemote ||
                    
122                            !head.Name.StartsWith(Remotes.Text, StringComparison.CurrentCultureIgnoreCase))
                    
123                            continue;
                    
                
NeuronEditor.cs https://gitlab.com/Tiger66639/neural_network_designer | C# | 301 lines
                    
2using System.ComponentModel;
                    
3using System.Windows;
                    
4using System.Windows.Threading;
                    
183            {
                    
184                if (Name.StartsWith(NamePrefix + ": ") == false)                              //if the name starts with Code: or similar, we need to strip the first part. If we don't, we get a stack overflow because this with the fData_PropertyChanged callback keep calling each other.
                    
185                    NeuronInfo.DisplayTitle = Name;
                    
237        /// </summary>
                    
238        /// <param name="managerType">The type of the <see cref="T:System.Windows.WeakEventManager"/> calling this method.</param>
                    
239        /// <param name="sender">Object that originated the event.</param>
                    
241        /// <returns>
                    
242        /// true if the listener handled the event. It is considered an error by the <see cref="T:System.Windows.WeakEventManager"/> handling in WPF to register a listener for an event that the listener does not handle. Regardless, the method should return false if it receives an event that it does not recognize or handle.
                    
243        /// </returns>
                    
294        {
                    
295            if (string.IsNullOrEmpty(Name) == false && Name.StartsWith(NamePrefix + ": ") == true && Name != fData.DisplayTitle)    //name != displayTitle cause when name is changed,sometimes displaytitle might also get
                    
296                Name = NamePrefix + ": " + fData.DisplayTitle;
                    
                
posixpath.py https://gitlab.com/nachee1325/todoprv | Python | 439 lines
                    
4this module as os.path.  The "os.path" name is an alias for this
                    
5module on Posix systems; on other systems (e.g. Mac, Windows),
                    
6os.path provides the same operations in a manner specific to that
                    
53    """Test whether a path is absolute"""
                    
54    return s.startswith('/')
                    
55
                    
67    for b in p:
                    
68        if b.startswith('/'):
                    
69            path = b
                    
101# Split a pathname into a drive specification and the rest of the
                    
102# path.  Useful on DOS/Windows/NT; on Unix, the drive is always empty.
                    
103
                    
338    if (initial_slashes and
                    
339        path.startswith('//') and not path.startswith('///')):
                    
340        initial_slashes = 2
                    
                
AppDomainSetup.cs https://github.com/iainlane/mono.git | C# | 397 lines
                    
138			int len = appBase.Length;
                    
139			if (len >= 8 && appBase.ToLower ().StartsWith ("file://")) {
                    
140				appBase = appBase.Substring (7);
                    
142					appBase = appBase.Replace ('/', Path.DirectorySeparatorChar);
                    
143				if (Environment.IsRunningOnWindows) {
                    
144					// Under Windows prepend "//" to indicate it's a local file
                    
                
Program.cs https://github.com/andrewdavey/ravendb.git | C# | 356 lines
                    
56            {
                    
57                // no try catch here, we want the exception to be logged by Windows
                    
58                ServiceBase.Run(new RavenService());
                    
136        {
                    
137            var principal = new WindowsPrincipal(WindowsIdentity.GetCurrent());
                    
138            if (principal.IsInRole(WindowsBuiltInRole.Administrator) == false)
                    
169                return "debug";
                    
170            if (args[0].StartsWith("/") == false)
                    
171                return "help";
                    
                
OutputWriter.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 296 lines
                    
113            String os = System.getProperty("os.name").toLowerCase();
                    
114            if (os.startsWith("windows") ||
                    
115                os.startsWith("mac os"))
                    
                
gestures.py https://bitbucket.org/beqa/nvdadependencyvirtualenvironment.git | Python | 310 lines
                    
7
                    
8#Released under the terms of the wxWindows License.
                    
9
                    
79#Add "Ends With":  AddGestureEndsWith(self, gesture, action, args)
                    
80#Add "Starts With":  AddGestuteStartsWith(self, gesture, action, args)
                    
81
                    
                
WinSerialStream.cs https://github.com/skolima/mono.git | C# | 577 lines
                    
20	{
                    
21		// Windows API Constants
                    
22		const uint GenericRead = 0x80000000;
                    
78		{
                    
79			handle = CreateFile (port_name != null && !port_name.StartsWith(@"\\.\")
                    
80					? @"\\.\" + port_name : port_name,
                    
555		{
                    
556			// FIXME: The windows api docs are not very clear about read timeouts,
                    
557			// and we have to simulate infinite with a big value (uint.MaxValue - 1)
                    
                
qevdevmousehandler.cpp https://bitbucket.org/cvp2ri/qt5-tlsauth.git | C++ | 239 lines
                    
48#include <QScreen>
                    
49#include <qpa/qwindowsysteminterface.h>
                    
50
                    
77            compression = false;
                    
78        else if (arg.startsWith(QLatin1String("dejitter=")))
                    
79            jitterLimit = arg.mid(9).toInt();
                    
                
RegistryUtil.cs https://gitlab.com/nerdymishka/kweh | C# | 320 lines
                    
21
                    
22                    return left.StartsWith(right);
                    
23                };
                    
26            {
                    
27                 @"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",
                    
28                 @"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall",
                    
28                 @"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall",
                    
29                 @"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",
                    
30                 @"HKCU:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall",
                    
30                 @"HKCU:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall",
                    
31                 $"HKU:\\{sid}\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall",
                    
32                 $"HKU:\\{sid}\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall",
                    
38            {
                    
39                if (subKeyName.StartsWith("HKU") && noSid)
                    
40                    continue;
                    
                
itkBase.py https://github.com/chrismullins/ITK.git | Python | 256 lines
                    
59            for k, v in this_module.__dict__.items():
                    
60                if not (k.startswith('_') or k == 'swig'):
                    
61                    namespace[k] = v
                    
86            try:
                    
87                # for a windows tree
                    
88                execfile(os.path.join(path, '..', 'Configuration', conf), data)
                    
134    for k, v in module.__dict__.items():
                    
135        if not k.startswith('__'):
                    
136            setattr(this_module.swig, k, v)
                    
136            setattr(this_module.swig, k, v)
                    
137        if namespace is not None and not k.startswith('__'):
                    
138            setattr(swig, k, v)
                    
                
CmsResourceMngImpl.java https://gitlab.com/MetadataDev/mcms | Java | 447 lines
                    
253			name = en.nextElement().getName();
                    
254			if (!name.startsWith(RES_EXP)) {
                    
255				solution = name.substring(0, name.indexOf("/"));
                    
268				// 模板还是资源
                    
269				if (name.startsWith(RES_EXP)) {
                    
270					filename = resRoot + "/" + solution
                    
                
ico_tools.py https://github.com/chromium/chromium.git | Python | 385 lines
                    
22  """Determines whether a sequence of bytes is a PNG."""
                    
23  return png_data.startswith(b'\x89PNG\r\n\x1a\n')
                    
24
                    
74def BytesPerRowBMP(width, bpp):
                    
75  """Computes the number of bytes per row in a Windows BMP image."""
                    
76  # width * bpp / 8, rounded up to the nearest multiple of 4.
                    
184  transparent. Pixels that violate this condition will show up as black in some
                    
185  contexts in Windows (http://crbug.com/526622). Also checks the inverse
                    
186  condition, that the mask is transparent wherever the alpha channel is fully
                    
203          # mask is transparent, alpha is partially or fully opaque. This pixel
                    
204          # can show up as black on Windows due to a rendering bug.
                    
205          return False
                    
217  GIMP (<=2.8.14) creates a bad AND mask on 32-bit icon images (pixels with <50%
                    
218  opacity are marked as transparent, which end up looking black on Windows).
                    
219  With rebuild == False, checks whether the mask is bad. With rebuild == True,
                    
                
PluginMain.cs https://bitbucket.org/kkszysiu/flashdevelop.git | C# | 361 lines
                    
3using System.Drawing;
                    
4using System.Windows.Forms;
                    
5using System.ComponentModel;
                    
129                    String cmd = de.Action;
                    
130                    if (!cmd.StartsWith("ProjectManager.")) return;
                    
131                    switch (cmd)
                    
                
TestInferiorAssert.py https://gitlab.com/jorjpimm/lldb | Python | 273 lines
                    
20    @expectedFailureDarwin("rdar://15367233")
                    
21    @expectedFailureWindows("llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
                    
22    def test_inferior_asserting_dwarf(self):
                    
32
                    
33    @expectedFailureWindows("llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
                    
34    def test_inferior_asserting_register_dwarf(self):
                    
41    @expectedFailureLinux("PC in __GI___assert_fail frame is just after the function (this is a no-return so there is no epilogue afterwards)")
                    
42    @expectedFailureWindows("llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
                    
43    def test_inferior_asserting_disassemble(self):
                    
48    @python_api_test
                    
49    @expectedFailureWindows("llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
                    
50    def test_inferior_asserting_python(self):
                    
63    @unittest2.expectedFailure("rdar://15367233")
                    
64    @expectedFailureWindows("llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
                    
65    def test_inferior_asserting_expr(self):
                    
                
PyInputHandler.java https://github.com/aparrish/processing.py.git | Java | 403 lines
                    
20
                    
21  // ctrl-alt on windows & linux, cmd-alt on os x
                    
22  private static int CTRL_ALT = ActionEvent.ALT_MASK
                    
204        candidate = new LineInfo(i);
                    
205        if (candidate.text.length() > 0 && !candidate.text.startsWith("#")) {
                    
206          break;
                    
                
FileSystemHelper.cs https://gitlab.com/jslee1/azure-powershell | C# | 321 lines
                    
17using System.IO;
                    
18using Microsoft.WindowsAzure.Commands.Common;
                    
19using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
                    
19using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
                    
20using Microsoft.WindowsAzure.Commands.Utilities.Common;
                    
21using Microsoft.Azure.Commands.Common.Authentication;
                    
24
                    
25namespace Microsoft.WindowsAzure.Commands.Test.Utilities.Common
                    
26{
                    
191            Debug.Assert(!string.IsNullOrEmpty(fullPath));
                    
192            Debug.Assert(fullPath.StartsWith(RootPath, StringComparison.OrdinalIgnoreCase));
                    
193            return fullPath.Substring(RootPath.Length, fullPath.Length - RootPath.Length);
                    
                
gtest_test_utils.py https://github.com/VoltDB/voltdb.git | Python | 313 lines
                    
36
                    
37IS_WINDOWS = os.name == 'nt'
                    
38IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0]
                    
101      prefix = '--' + flag + '='
                    
102      if argv[i].startswith(prefix):
                    
103        _flag_map[flag] = argv[i][len(prefix):]
                    
167                                      executable_name))
                    
168  if (IS_WINDOWS or IS_CYGWIN or IS_OS2) and not path.endswith('.exe'):
                    
169    path += '.exe'
                    
189  if os.name == 'nt':
                    
190    # On Windows, os.WEXITSTATUS() doesn't work and os.system() returns
                    
191    # the argument to exit() directly.
                    
228    # since it is available and behaves consistently on all platforms,
                    
229    # including Windows. But it is only available starting in python 2.4.
                    
230    # In earlier python versions, we revert to the popen2 module, which is
                    
                
_htmlparser.py https://bitbucket.org/bendikro/deluge-yarss-plugin.git | Python | 350 lines
                    
136        # http://bugs.python.org/issue13633
                    
137        if name.startswith('x'):
                    
138            real_name = int(name.lstrip('x'), 16)
                    
138            real_name = int(name.lstrip('x'), 16)
                    
139        elif name.startswith('X'):
                    
140            real_name = int(name.lstrip('X'), 16)
                    
147            # code points, but sometimes they reference code points in
                    
148            # some other encoding (ahem, Windows-1252). E.g. &#147;
                    
149            # instead of &#201; for LEFT DOUBLE QUOTATION MARK. This
                    
150            # code tries to detect this situation and compensate.
                    
151            for encoding in (self.soup.original_encoding, 'windows-1252'):
                    
152                if not encoding:
                    
185        self.soup.endData()
                    
186        if data.startswith("DOCTYPE "):
                    
187            data = data[len("DOCTYPE "):]
                    
                
4SerenityFeatureLivePlugin.cs https://gitlab.com/enesasillioglu/GitExtensions-SerenityFlow-Plugin | C# | 174 lines
                    
2using System.IO;
                    
3using System.Windows.Forms;
                    
4using GitCommands;
                    
83            if (mergeLines.Length < 3 || 
                    
84                !mergeLines[0].StartsWith("commit ", StringComparison.OrdinalIgnoreCase) ||
                    
85                !mergeLines[1].StartsWith("Merge: ", StringComparison.OrdinalIgnoreCase) ||
                    
85                !mergeLines[1].StartsWith("Merge: ", StringComparison.OrdinalIgnoreCase) ||
                    
86                !mergeLines[2].StartsWith("Author: ", StringComparison.OrdinalIgnoreCase) ||
                    
87                !mergeLines[4].Trim().StartsWith("Merge branch '", StringComparison.OrdinalIgnoreCase) ||
                    
102            if (lines.Length < 3 || 
                    
103                ((!lines[0].StartsWith("commit ", StringComparison.OrdinalIgnoreCase) || 
                    
104                  !lines[1].StartsWith("Author: ", StringComparison.OrdinalIgnoreCase)) &&
                    
104                  !lines[1].StartsWith("Author: ", StringComparison.OrdinalIgnoreCase)) &&
                    
105                 (!lines[0].StartsWith("commit ", StringComparison.OrdinalIgnoreCase) ||
                    
106                  !lines[1].StartsWith("Merge: ", StringComparison.OrdinalIgnoreCase) ||
                    
                
SetSavedDataPage.cpp https://gitlab.com/hussinhassan80/tortoisegit | C++ | 402 lines
                    
1// TortoiseGit - a Windows shell extension for easy version control
                    
2
                    
29#include "Git.h"
                    
30#include "WindowsCredentialsStore.h"
                    
31
                    
91		CString sHistName = loghistlist.GetNext(pos);
                    
92		if (CStringUtils::StartsWithI(sHistName, L"commit") || CStringUtils::StartsWithI(sHistName, L"merge"))
                    
93		{
                    
142	CStringList credStore;
                    
143	CWindowsCredentialsStore::ListCredentials(L"git:*", credStore);
                    
144	nSimple += static_cast<int>(credStore.GetCount());
                    
222		CString sHist = histlist.GetNext(pos);
                    
223		if (CStringUtils::StartsWithI(sHist, L"commit"))
                    
224		{
                    
254	CStringList credStore;
                    
255	CWindowsCredentialsStore::ListCredentials(L"git:*", credStore);
                    
256	for (POSITION pos = credStore.GetHeadPosition(); pos;)
                    
                
AdminWhitelistRule.java https://gitlab.com/CORP-RESELLER/jenkins | Java | 229 lines
                    
72                new File(jenkins.getRootDir(), "secrets/filepath-filters.d/30-default.conf"),
                    
73                transformForWindows(getClass().getResourceAsStream("filepath-filter.conf")));
                    
74
                    
106    /**
                    
107     * Transform path for Windows.
                    
108     */
                    
108     */
                    
109    private InputStream transformForWindows(InputStream src) throws IOException {
                    
110        BufferedReader r = new BufferedReader(new InputStreamReader(src));
                    
114        while ((line=r.readLine())!=null) {
                    
115            if (!line.startsWith("#") && Functions.isWindows())
                    
116                line = line.replace("/","\\\\");
                    
166            String name = (String) e.nextElement();
                    
167            if (name.startsWith("class:")) {
                    
168                whitelist += name.substring(6)+"\n";
                    
                
view.jsp https://github.com/l15k4/liferay-plugins.git | JavaServer Pages | 294 lines
                    
45
                    
46portletURL.setWindowState(WindowState.NORMAL);
                    
47%>
                    
84
                    
85							<c:if test="<%= !StringUtil.startsWith(user2.getLastName(), lastNameAnchor) %>">
                    
86
                    
95
                    
96							<liferay-portlet:renderURL windowState="<%= LiferayWindowState.EXCLUSIVE.toString() %>" var="viewSummaryURL">
                    
97								<portlet:param name="jspPage" value="/contacts_center/view_user.jsp" />
                    
                
SetupLiveEditingSceneOperator.py https://gitlab.com/sat-metalab/InSituImmersiveAuthoring | Python | 308 lines
                    
23    def set_camera_view(self):
                    
24        for window in bpy.context.window_manager.windows:
                    
25            screen = window.screen
                    
90        ) as (data_from, data_to):
                    
91            data_to.objects = [name for name in data_from.objects if name.startswith("Vive")]
                    
92        with bpy.data.libraries.load(
                    
95        ) as (data_from, data_to):
                    
96            data_to.meshes = [name for name in data_from.meshes if name.startswith("Vive")]
                    
97            data_to.materials = [name for name in data_from.materials if name.startswith("Vive")]
                    
97            data_to.materials = [name for name in data_from.materials if name.startswith("Vive")]
                    
98            data_to.textures = [name for name in data_from.textures if name.startswith("Vive")]
                    
99
                    
278        with bpy.data.libraries.load(filepath=current_file_path+"/../assets/materials.blend", link=True) as (data_from, data_to):
                    
279            data_to.materials = [name for name in data_from.materials if name.startswith("Mat_")]
                    
280
                    
                
exception.html https://github.com/oyvindkinsey/dotnetopenid.git | HTML | 316 lines
                    
5<title>NUnit - Exception</title>
                    
6<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
                    
7<meta http-equiv="Content-Language" content="en-US">
                    
89    /// Expect a message starting with the parameter string
                    
90    StartsWith
                    
91}</pre></div>
                    
                
plcfactory.py https://gitlab.com/gregor_ulm/plc_factory | Python | 416 lines
                    
133    for i in range(len(lines)):
                    
134        if lines[i].startswith(tag):
                    
135            tagPos = i
                    
176
                    
177# ensures that filenames are legal in Windows
                    
178# (OSX automatically replaces illegal characters)
                    
343            line = line.rstrip()
                    
344            if not line.startswith("#COUNTER") \
                    
345               and not line.startswith("#FILENAME"):
                    
                
glances_stats.py https://gitlab.com/132nd-etcher/glances | Python | 407 lines
                    
34                            '.*BSD.*': 'bsd',
                    
35                            '.*Windows.*': 'windows',
                    
36                            '.*Cisco.*': 'cisco',
                    
71        # Check if the attribute starts with 'get'
                    
72        if item.startswith('get'):
                    
73            # Get the plugin name
                    
90        for item in os.listdir(plugins_path):
                    
91            if (item.startswith(header) and
                    
92                    item.endswith(".py") and
                    
117            export_name = os.path.basename(item)[len(header):-3].lower()
                    
118            if (item.startswith(header) and
                    
119                    item.endswith(".py") and
                    
                
filebased.py https://gitlab.com/areema/myproject | Python | 154 lines
                    
68    def _delete(self, fname):
                    
69        if not fname.startswith(self._dir) or not os.path.exists(fname):
                    
70            return
                    
139        if exp is not None and exp < time.time():
                    
140            f.close()  # On Windows a file has to be closed before deleting
                    
141            self._delete(f.name)
                    
                
ping.py https://gitlab.com/rshipp/python-ping | Python | 364 lines
                    
7    Note that ICMP messages can only be send from processes running as root
                    
8    (in Windows, you must run this script as 'Administrator').
                    
9
                    
28
                    
29if sys.platform.startswith("win32"):
                    
30    # On Windows, the best timer is time.clock()
                    
166        if hasattr(signal, "SIGBREAK"):
                    
167            # Handle Ctrl-Break e.g. under Windows 
                    
168            signal.signal(signal.SIGBREAK, self.signal_handler)
                    
348
                    
349        # Inconsistent on Windows w/ ActivePython (Python 3.2 resolves correctly
                    
350        # to the local host, but 2.7 tries to resolve to the local *gateway*)
                    
                
NewAzureDeployment.cs https://gitlab.com/jslee1/azure-powershell | C# | 284 lines
                    
19using Microsoft.Azure.Commands.Common.Authentication.Models;
                    
20using Microsoft.WindowsAzure.Commands.Common;
                    
21using Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions;
                    
21using Microsoft.WindowsAzure.Commands.ServiceManagement.Extensions;
                    
22using Microsoft.WindowsAzure.Commands.ServiceManagement.Helpers;
                    
23using Microsoft.WindowsAzure.Commands.ServiceManagement.Properties;
                    
23using Microsoft.WindowsAzure.Commands.ServiceManagement.Properties;
                    
24using Microsoft.WindowsAzure.Commands.Utilities.Common;
                    
25using Microsoft.WindowsAzure.Management.Compute.Models;
                    
25using Microsoft.WindowsAzure.Management.Compute.Models;
                    
26using Microsoft.WindowsAzure.Management.Compute;
                    
27
                    
64        [Parameter(Position = 3, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Deployment slot [Staging | Production].")]
                    
65        [ValidateSet(Microsoft.WindowsAzure.Commands.ServiceManagement.Model.DeploymentSlotType.Staging, Microsoft.WindowsAzure.Commands.ServiceManagement.Model.DeploymentSlotType.Production, IgnoreCase = true)]
                    
66        public string Slot
                    
                
boot.py https://github.com/aruder77/applause.git | Python | 177 lines
                    
15    except ImportError:
                    
16        for k in [k for k in sys.modules if k.startswith('google')]:
                    
17            del sys.modules[k]
                    
122    # Also we add the compiler/parser module back and enable https connections
                    
123    # (seem to be broken on Windows because the _ssl module is disallowed).
                    
124    if not have_appserver:
                    
                
runUnitTests.py https://github.com/mogaal/editra.git | Python | 354 lines
                    
5## Copyright: (c) 2008 Cody Precord <staff@editra.org>                         #
                    
6## License: wxWindows License                                                  #
                    
7################################################################################
                    
47    for arg in args:
                    
48        if arg.startswith("-") and not arg.startswith("--"):
                    
49            # handle the case where opt and arg are conjoined
                    
89        for _name in [ n[:-3] for n in os.listdir(self.rootdir)
                    
90                    if n.startswith("test") and n.endswith(".py") ]:
                    
91            _module_names[ _name.lower() ] = _name
                    
150                    restriction = _mname[_mname.find('_wx')+3:-4]
                    
151                    if not _class.__name__.startswith(restriction):
                    
152                        #print "filtered: %s (class=%s)" % (mname,_class.__name__)
                    
166                    s = s[:-3]
                    
167                if s.startswith("wx."):
                    
168                    s = "test" + s[3:]
                    
                
gamma.py https://gitlab.com/braintech/psychopy-brain | Python | 356 lines
                    
34            carbon = ctypes.CDLL('/System/Library/Carbon.framework/Carbon')
                    
35elif sys.platform.startswith('linux'):
                    
36    # we need XF86VidMode
                    
96
                    
97    On windows the first attempt to set the ramp doesn't always work. The
                    
98    parameter nAttemps allows the user to determine how many attempts should
                    
139
                    
140    if sys.platform.startswith('linux') and not _TravisTesting:
                    
141        newRamp = (numpy.around(65535 * newRamp)).astype(numpy.uint16)
                    
203
                    
204    if sys.platform.startswith('linux') and not _TravisTesting:
                    
205        origramps = numpy.empty((3, rampSize), dtype=numpy.uint16)
                    
236    rampType 0 : an 8-bit CLUT ranging 0:1
                    
237        This is seems correct for most windows machines and older macOS systems
                    
238        Known to be used by:
                    
                
_MozillaCookieJar.py https://gitlab.com/dahbearz/CRYENGINE | Python | 149 lines
                    
20    the browser (in fact, Mozilla on unix will overwrite your saved cookies if
                    
21    you change them on disk while it's running; on Windows, you probably can't
                    
22    save at all while the browser is running).
                    
65                # skip comments and blank lines XXX what is $ for?
                    
66                if (line.strip().startswith(("#", "$")) or
                    
67                    line.strip() == ""):
                    
80
                    
81                initial_dot = domain.startswith(".")
                    
82                assert domain_specified == initial_dot
                    
128                else: secure = "FALSE"
                    
129                if cookie.domain.startswith("."): initial_dot = "TRUE"
                    
130                else: initial_dot = "FALSE"
                    
                
Helpers.cs https://gitlab.com/jslee1/azure-powershell | C# | 199 lines
                    
17using Microsoft.Azure.Management.Batch.Models;
                    
18using Microsoft.WindowsAzure.Commands.Utilities.Common;
                    
19using System;
                    
141                    {
                    
142                        if (tagValuePair.Name.StartsWith(ExcludedTagPrefix))
                    
143                        {
                    
                
test_mhlib.py https://github.com/DarioGT/OMS-PluginXML.git | Python | 353 lines
                    
16
                    
17if (underlying_system.startswith("win") or underlying_system=="riscos" or
                    
18      underlying_system.startswith("atheos")):
                    
20    # exists.  That causes a reasonable OS <wink> to complain in test_sequence
                    
21    # here, like the "OSError: [Errno 17] File exists" raised on Windows.
                    
22    # mhlib's listsubfolders() and listallfolders() do something with
                    
24    # an empty list from its call of listallfolders().
                    
25    # The other tests here pass on Windows.
                    
26    raise TestSkipped("skipped on %s -- " % underlying_system +
                    
183        #lisallfolders and listsubfolders to return empty lists.
                    
184        if not sys.platform.startswith("java"):
                    
185            folders = mh.listallfolders()
                    
                
linux_ip.py https://gitlab.com/ricardo.hernandez/salt | Python | 194 lines
                    
15    '''
                    
16    if salt.utils.is_windows():
                    
17        return (False, 'Module linux_ip: Windows systems are not supported.')
                    
67    for line in out.splitlines():
                    
68        if not line.startswith(' '):
                    
69            comps = line.split(':')
                    
78        else:
                    
79            if line.strip().startswith('link'):
                    
80                comps = iter(line.strip().split())
                    
81                ret[if_]['link_layer'] = dict(list(zip(comps, comps)))
                    
82            elif line.strip().startswith('inet'):
                    
83                comps = line.strip().split()
                    
141            continue
                    
142        if line.startswith('Iface'):
                    
143            continue
                    
                
base.py https://github.com/hradec/chemshapes.git | Python | 386 lines
                    
243    _workaround_checks = [
                    
244        # GDI Generic renderer on Windows does not implement
                    
245        # GL_UNPACK_ROW_LENGTH correctly.
                    
255        ('_workaround_vbo',
                    
256         lambda info: (info.get_renderer().startswith('ATI Radeon X')
                    
257                       or info.get_renderer() == 
                    
                
DebuggerCommands.cs https://github.com/josephcooney/ILSpy.git | C# | 409 lines
                    
6using System.Linq;
                    
7using System.Windows;
                    
8using System.Windows.Controls;
                    
8using System.Windows.Controls;
                    
9using System.Windows.Input;
                    
10using System.Windows.Interop;
                    
10using System.Windows.Interop;
                    
11using System.Windows.Media;
                    
12using System.Xml.Linq;
                    
143
                    
144                    if (header.StartsWith("Remove") || header.StartsWith("Show")) continue;
                    
145
                    
145
                    
146                    if (header.StartsWith("Attach") || header.StartsWith("Debug"))
                    
147                        item.IsEnabled = enable;
                    
                
SubmoduleUpdateDlg.cpp https://gitlab.com/Sajjad-dehghani/tortoisegit | C++ | 311 lines
                    
1// TortoiseGit - a Windows shell extension for easy version control
                    
2
                    
41{
                    
42	s_bSortLogical = !CRegDWORD(L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoStrCmpLogical", 0, false, HKEY_CURRENT_USER);
                    
43	if (s_bSortLogical)
                    
43	if (s_bSortLogical)
                    
44		s_bSortLogical = !CRegDWORD(L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\NoStrCmpLogical", 0, false, HKEY_LOCAL_MACHINE);
                    
45}
                    
84			CString prefix = prefixList->at(i) + _T("/");
                    
85			if (CStringUtils::StartsWith(path, prefix))
                    
86				list->push_back(path);
                    
                
juce_Application.cpp https://bitbucket.org/teamaxe/markingtool.git | C++ | 303 lines
                    
62
                    
63            if (message.startsWith (appName + "/"))
                    
64                app->anotherInstanceStarted (message.substring (appName.length() + 1));
                    
248
                    
249#if ! JUCE_WINDOWS
                    
250#if JUCE_IOS
                    
                
config.py https://gitlab.com/gupta.d.gaurav/paramiko | Python | 287 lines
                    
38    convenience to posix users (since the OpenSSH format is a de-facto
                    
39    standard on posix) but should work fine on Windows too.
                    
40
                    
62            line = line.strip()
                    
63            if not line or line.startswith('#'):
                    
64                continue
                    
81            else:
                    
82                if value.startswith('"') and value.endswith('"'):
                    
83                    value = value[1:-1]
                    
148        for host in hosts:
                    
149            if host.startswith('!') and fnmatch.fnmatch(hostname, host[1:]):
                    
150                return False
                    
                
PlateButtonDemo.py https://github.com/mogaal/editra.git | Python | 280 lines
                    
5# Copyright: (c) 2007 Cody Precord <staff@editra.org>                         #
                    
6# Licence: wxWindows Licence                                                  #
                    
7###############################################################################
                    
163                    for fname in os.listdir(wx.GetHomeDir()):
                    
164                        if not fname.startswith('.'):
                    
165                            menu.Append(wx.NewId(), fname)
                    
221            label = mitem.GetLabel()
                    
222            if label.startswith('http://'):
                    
223                webbrowser.open(label, True)
                    
                
fileutil.py https://bitbucket.org/beqa/nvdadependencyvirtualenvironment.git | Python | 297 lines
                    
5# Copyright: (c) 2009 Cody Precord <staff@editra.org>                         #
                    
6# Licence: wxWindows Licence                                                  #
                    
7###############################################################################
                    
32UNIX = WIN = False
                    
33if platform.system().lower() in ['windows', 'microsoft']:
                    
34    WIN = True
                    
85    @return: string
                    
86    @note: on windows if win32api is available short notation paths will be
                    
87           converted to the proper long name.
                    
90    rpath = os.path.abspath(path)
                    
91    # Resolve short path notation on Windows when possible
                    
92    if WIN and win32api is not None and u"~" in rpath:
                    
142    """
                    
143    if path.startswith(u"file:"):
                    
144        path = path.replace(u"file:", u"")
                    
                
PlugIn1.cs https://github.com/krazana/eXpand.git | C# | 205 lines
                    
9using System.Text.RegularExpressions;
                    
10using System.Windows.Forms;
                    
11using DevExpress.CodeRush.Core;
                    
63                stackTrace.Add(readline);
                    
64                if (readline.Trim().StartsWith("The error occured:") || readline.Trim().StartsWith("The error occurred:")) {
                    
65                    stackTrace.Reverse();
                    
68                        errorMessage += trace + Environment.NewLine;
                    
69                        if (trace.Trim().StartsWith("----------------------------------------------------"))
                    
70                            break;
                    
                
Runtime.cs https://github.com/jlangridge/monodevelop.git | C# | 319 lines
                    
103			foreach (AddinRepository rep in reps.GetRepositories ()) {
                    
104				if (rep.Url.StartsWith ("http://go-mono.com/md/") || 
                    
105					(rep.Url.StartsWith ("http://monodevelop.com/files/addins/")) ||
                    
105					(rep.Url.StartsWith ("http://monodevelop.com/files/addins/")) ||
                    
106					(rep.Url.StartsWith ("http://addins.monodevelop.com/") && !validUrls.Contains (rep.Url)))
                    
107					reps.RemoveRepository (rep.Url);
                    
119			string platform;
                    
120			if (PropertyService.IsWindows)
                    
121				platform = "Win32";
                    
                
SubStationAlphaProperties.cs https://gitlab.com/minaz922/subtitleedit | C# | 273 lines
                    
4using System.Text;
                    
5using System.Windows.Forms;
                    
6using Nikse.SubtitleEdit.Logic;
                    
62                    string s = line.ToLower().Trim();
                    
63                    if (s.StartsWith("title:"))
                    
64                    {
                    
66                    }
                    
67                    else if (s.StartsWith("original script:"))
                    
68                    {
                    
70                    }
                    
71                    else if (s.StartsWith("original translation:"))
                    
72                    {
                    
74                    }
                    
75                    else if (s.StartsWith("original editing:"))
                    
76                    {
                    
                
MorePaths.java https://gitlab.com/smartether/buck | Java | 304 lines
                    
55
                    
56  public static String pathWithWindowsSeparators(Path path) {
                    
57    return path.toString().replace('/', '\\');
                    
64  public static String pathWithPlatformSeparators(Path path) {
                    
65    if (Platform.detect() == Platform.WINDOWS) {
                    
66      return pathWithWindowsSeparators(path);
                    
122
                    
123    // On Windows, if path1 is "" then Path.relativize returns ../path2 instead of path2 or ./path2
                    
124    if (EMPTY_PATH.equals(path1)) {
                    
171          if (input.isAbsolute()) {
                    
172            return input.normalize().startsWith(normalizedRoot);
                    
173          } else {
                    
190  public static Path expandHomeDir(Path path) {
                    
191    if (!path.startsWith("~")) {
                    
192      return path;
                    
                
String.php https://github.com/jakubkinst/Course-Manager.git | PHP | 474 lines
                    
78	 */
                    
79	public static function startsWith($haystack, $needle)
                    
80	{
                    
133		if (ICONV_IMPL === 'glibc') {
                    
134			$s = @iconv('UTF-8', 'WINDOWS-1250//TRANSLIT', $s); // intentionally @
                    
135			$s = strtr($s, "\xa5\xa3\xbc\x8c\xa7\x8a\xaa\x8d\x8f\x8e\xaf\xb9\xb3\xbe\x9c\x9a\xba\x9d\x9f\x9e\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2"
                    
                
gtest_test_utils.py https://gitlab.com/brian0218/rk3288_r-box_android4.4.2_sdk | Python | 305 lines
                    
55
                    
56IS_WINDOWS = os.name == 'nt'
                    
57IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0]
                    
89      prefix = '--' + flag + '='
                    
90      if argv[i].startswith(prefix):
                    
91        _flag_map[flag] = argv[i][len(prefix):]
                    
157                                      executable_name))
                    
158  if (IS_WINDOWS or IS_CYGWIN) and not path.endswith('.exe'):
                    
159    path += '.exe'
                    
179  if os.name == 'nt':
                    
180    # On Windows, os.WEXITSTATUS() doesn't work and os.system() returns
                    
181    # the argument to exit() directly.
                    
218    # since it is available and behaves consistently on all platforms,
                    
219    # including Windows. But it is only available starting in python 2.4.
                    
220    # In earlier python versions, we revert to the popen2 module, which is
                    
                
DeviceResolutionEmulator.html https://gitlab.com/crsr/openui5 | HTML | 379 lines
                    
47 			{ // our Nokia Lumia 800, as delivered
                    
48 				name : "Nokia Lumia 800 (Windows Phone 7.5)",
                    
49 				"long" : 800,
                    
50 				"short" : 480,
                    
51 				ua : "Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; NOKIA; Lumia 800)"
                    
52 			},
                    
81 			var trimmedUrl = jQuery.trim(url);
                    
82 			return !jQuery.sap.startsWith(trimmedUrl, "http:") && !jQuery.sap.startsWith(trimmedUrl, "https:")
                    
83 					&& !jQuery.sap.startsWith(trimmedUrl, "javascript:") && !jQuery.sap.startsWith(trimmedUrl, "/");
                    
165 			// URL of a page is given
                    
166 			if (jQuery.sap.startsWith(urlParts[1], "url=")) {
                    
167 				var rawUrl = urlParts[1].substr(4);
                    
                
UnknownSubtitle55.cs https://gitlab.com/minaz922/subtitleedit | C# | 162 lines
                    
53
                    
54            System.Windows.Forms.RichTextBox rtBox = new System.Windows.Forms.RichTextBox();
                    
55            rtBox.Text = sb.ToString();
                    
71            string rtf = sb.ToString().Trim();
                    
72            if (!rtf.StartsWith("{\\rtf"))
                    
73                return;
                    
74
                    
75            var rtBox = new System.Windows.Forms.RichTextBox();
                    
76            try
                    
                
ConfigHandler.cs https://bitbucket.org/leispire/phonegap.git | C# | 249 lines
                    
7using System.Text.RegularExpressions;
                    
8using System.Windows;
                    
9using System.Windows.Resources;
                    
105                // starts with wildcard match - we make the first '.' optional (so '*.org.apache.cordova' will match 'org.apache.cordova')
                    
106                if (tempHostName.StartsWith("*."))
                    
107                {    //"(\\s{0}|*.)"
                    
                
bootstrap.py https://bitbucket.org/Chris2048/watchdog.git | Python | 278 lines
                    
31        if ' ' in c:
                    
32            return '"%s"' % c # work around spawn lamosity on windows
                    
33        else:
                    
75
                    
76is_jython = sys.platform.startswith('java')
                    
77
                    
262    exitcode = subprocess.Popen(cmd, env=env).wait()
                    
263else: # Windows prefers this, apparently; otherwise we would prefer subprocess
                    
264    exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env]))
                    
                
JavaEnvUtilsTest.java https://bitbucket.org/kaendfinger/apache-ant.git | Java | 140 lines
                    
47
                    
48    public void testGetExecutableWindows() {
                    
49        if (Os.isFamily("windows")) {
                    
58                assertTrue(j+" is normalized and in the JRE dir",
                    
59                           j.startsWith(javaHome));
                    
60            } catch (AssertionFailedError e) {
                    
71                assertTrue(j+" is normalized and in the JDK dir",
                    
72                           j.startsWith(javaHomeParent));
                    
73                assertTrue(j+" is normalized and not in the JRE dir",
                    
73                assertTrue(j+" is normalized and not in the JRE dir",
                    
74                           !j.startsWith(javaHome));
                    
75
                    
86    public void testGetExecutableMostPlatforms() {
                    
87        if (!Os.isName("netware") && !Os.isFamily("windows")) {
                    
88            String javaHome =
                    
                
clang-include-fixer.py https://gitlab.com/Alioth-Project/clang-r445002 | Python | 219 lines
                    
88def execute(command, text):
                    
89  # Avoid flashing a cmd prompt on Windows.
                    
90  startupinfo = None
                    
90  startupinfo = None
                    
91  if sys.platform.startswith('win32'):
                    
92    startupinfo = subprocess.STARTUPINFO()
                    
                
HuPuWebView.java https://gitlab.com/gzsll/TLint | Java | 323 lines
                    
84    settings.setAllowFileAccess(true);
                    
85    settings.setSupportMultipleWindows(false);
                    
86    settings.setJavaScriptCanOpenWindowsAutomatically(true);
                    
129      String scheme = uri.getScheme();
                    
130      if (url.startsWith("hupu") || url.startsWith("kanqiu")) {
                    
131        if (scheme != null) {
                    
                
ApplicationIntegrationSpec.groovy https://github.com/andrewhj-mn/gradle.git | Groovy | 447 lines
                    
25
                    
26import static org.hamcrest.Matchers.startsWith
                    
27
                    
63        builder.executable "application"
                    
64        if (OperatingSystem.current().windows) {
                    
65            builder.environment('APPLICATION_OPTS', '-DtestValue=value -DtestValue2="some value" -DtestValue3="some value"')
                    
292        then:
                    
293        result.assertThatCause(startsWith("The specified installation directory '${file('build')}' is neither empty nor does it contain an installation"))
                    
294        where:
                    
308        then:
                    
309        File generatedWindowsStartScript = file("build/scripts/application.bat")
                    
310        generatedWindowsStartScript.exists()
                    
310        generatedWindowsStartScript.exists()
                    
311        assertLineSeparators(generatedWindowsStartScript, TextUtil.windowsLineSeparator, 90);
                    
312
                    
                
Common.cs https://bitbucket.org/hphuong/eventbrite-win8.git | C# | 282 lines
                    
12#if !WINRT_NOT_PRESENT
                    
13using Windows.Data.Xml.Dom;
                    
14#endif
                    
162                bool goodPrefix = this.StrictValidation || value == null;
                    
163                goodPrefix = goodPrefix || value.StartsWith("http://", StringComparison.OrdinalIgnoreCase);
                    
164                goodPrefix = goodPrefix || value.StartsWith("https://", StringComparison.OrdinalIgnoreCase);
                    
164                goodPrefix = goodPrefix || value.StartsWith("https://", StringComparison.OrdinalIgnoreCase);
                    
165                goodPrefix = goodPrefix || value.StartsWith("ms-appx:///", StringComparison.OrdinalIgnoreCase);
                    
166                goodPrefix = goodPrefix || value.StartsWith("ms-appdata:///local/", StringComparison.OrdinalIgnoreCase);
                    
                
TestHelper.java https://github.com/ikeji/openjdk7-jdk.git | Java | 385 lines
                    
57    static final boolean isWindows =
                    
58            System.getProperty("os.name", "unknown").startsWith("Windows");
                    
59    static final boolean is64Bit =
                    
63    static final boolean isSolaris =
                    
64            System.getProperty("os.name", "unknown").startsWith("SunOS");
                    
65    static final boolean isLinux =
                    
65    static final boolean isLinux =
                    
66            System.getProperty("os.name", "unknown").startsWith("Linux");
                    
67    static final boolean isDualMode = isSolaris;
                    
67    static final boolean isDualMode = isSolaris;
                    
68    static final boolean isSparc = System.getProperty("os.arch").startsWith("sparc");
                    
69
                    
81            : new File(JAVAHOME, "bin");
                    
82        File javaCmdFile = (isWindows)
                    
83                ? new File(binDir, "java.exe")
                    
                
TestDataNodeVolumeFailureReporting.java https://github.com/RS1999ent/hadoop-hdfs.git | Java | 278 lines
                    
102  public void testSuccessiveVolumeFailures() throws Exception {
                    
103    assumeTrue(!System.getProperty("os.name").startsWith("Windows"));
                    
104
                    
246  public void testVolFailureStatsPreservedOnNNRestart() throws Exception {
                    
247    assumeTrue(!System.getProperty("os.name").startsWith("Windows"));
                    
248
                    
                
file_path_utils.cc https://github.com/akesling/chromium.git | C++ | 161 lines
                    
131  // can't be a child, so we return the absolute path to the child.
                    
132  // file_util::AbsolutePath() normalizes '/' to '\' on Windows, so we
                    
133  // only need to check kSeparators[0].
                    
141#if defined(OS_WIN)
                    
142      // file_util::AbsolutePath() does not flatten case on Windows,
                    
143      // so we must do a case-insensitive compare.
                    
143      // so we must do a case-insensitive compare.
                    
144      StartsWith(child_str, parent_str, false)
                    
145#else
                    
145#else
                    
146      StartsWithASCII(child_str, parent_str, true)
                    
147#endif
                    
                
itkBase.py https://github.com/paniwani/ITK.git | Python | 242 lines
                    
48        for k, v in this_module.__dict__.items():
                    
49          if not (k.startswith('_') or k == 'swig'): namespace[k] = v
                    
50    return
                    
73      try:
                    
74        # for a windows tree
                    
75        execfile(os.path.join(path, '..', 'Configuration', name + 'Config.py'), data)
                    
118  for k, v in module.__dict__.items():
                    
119    if not k.startswith('__'): setattr(this_module.swig, k, v)
                    
120    if namespace is not None and not k.startswith('__'): setattr(swig, k, v)
                    
179
                    
180  if sys.platform.startswith('darwin'):
                    
181    dlopenflags = darwin_dlopenflags
                    
181    dlopenflags = darwin_dlopenflags
                    
182  elif sys.platform.startswith('win'):
                    
183    dlopenflags = None
                    
                
setup.py https://github.com/jobovy/galpy.git | Python | 326 lines
                    
15PY3= sys.version > '3'
                    
16WIN32= platform.system() == 'Windows'
                    
17no_compiler = False  # Flag for cases where we are sure there is no compiler exists in user's system
                    
38if WIN32:
                    
39    # On Windows it's unnecessary and erroneous to include m
                    
40    galpy_c_libraries.remove('m')
                    
40    galpy_c_libraries.remove('m')
                    
41    # Windows does not need 'gomp' whether compiled with OpenMP or not
                    
42    galpy_c_libraries.remove('gomp')
                    
72    extra_compile_args= ["-DNO_OMP"]
                    
73    if not WIN32:  # Because windows guarantee do not have 'gomp' in the list
                    
74        galpy_c_libraries.remove('gomp')
                    
103
                    
104#code to check the GSL version; list cmd w/ shell=True only works on Windows
                    
105# (https://docs.python.org/3/library/subprocess.html#converting-argument-sequence)
                    
                
network_monitor.py https://bitbucket.org/manaphassan/raspberry-pwn.git | Python | 260 lines
                    
30
                    
31    # if we are on windows, try and resolve the device UUID into an IP address.
                    
32    if sys.platform.startswith("win"):
                    
                
frmInstallData.cs https://gitlab.com/GRIN-Global/GRIN-Global-server | C# | 212 lines
                    
7using System.Text;
                    
8using System.Windows.Forms;
                    
9using System.Diagnostics;
                    
97            var output = Utility.Run((updaterPath + @"\GrinGlobal.Updater.exe").Replace(@"\\", @"\"), args, false, true);
                    
98            if (!output.StartsWith("FILES:")) {
                    
99                // failure
                    
                
AkPluginActivator.cs https://gitlab.com/NunezG/villeEmergente | C# | 386 lines
                    
100			pluginImporter.SetPlatformData (BuildTarget.StandaloneOSXUniversal, "CPU", "None");
                    
101			pluginImporter.SetPlatformData (BuildTarget.StandaloneWindows, "CPU", "None");
                    
102			pluginImporter.SetPlatformData (BuildTarget.StandaloneWindows64, "CPU", "None");
                    
110			pluginImporter.SetPlatformData (BuildTarget.StandaloneOSXUniversal, "CPU", "None");
                    
111			pluginImporter.SetPlatformData (BuildTarget.StandaloneWindows, "CPU", "None");
                    
112			pluginImporter.SetPlatformData (BuildTarget.StandaloneWindows64, "CPU", "None");
                    
121			pluginImporter.SetPlatformData (BuildTarget.StandaloneOSXUniversal, "CPU", "AnyCPU");
                    
122			pluginImporter.SetPlatformData (BuildTarget.StandaloneWindows, "CPU", "None");
                    
123			pluginImporter.SetPlatformData (BuildTarget.StandaloneWindows64, "CPU", "None");
                    
124			return;
                    
125		case BuildTarget.StandaloneWindows:
                    
126			pluginImporter.SetPlatformData (BuildTarget.StandaloneLinux, "CPU", "None");
                    
131			pluginImporter.SetPlatformData (BuildTarget.StandaloneOSXUniversal, "CPU", "None");
                    
132			pluginImporter.SetPlatformData (BuildTarget.StandaloneWindows, "CPU", "AnyCPU");
                    
133			pluginImporter.SetPlatformData (BuildTarget.StandaloneWindows64, "CPU", "None");
                    
                
path.cc https://gitlab.com/jslee1/omaha | C++ | 475 lines
                    
161  // For example: regsvr32 /u /s "c:\program files\google\googletoolbar3.dll"
                    
162  if (String_StartsWith(str, kRegSvr32Cmd1, true) ||
                    
163      String_StartsWith(str, kRegSvr32Cmd2, true)) {
                    
168  // Handle the string starting with "rundll32"
                    
169  // For example: "rundll32.exe setupapi.dll,InstallHinfSection DefaultUninstall 132 C:\WINDOWS\INF\PCHealth.inf"  // NOLINT
                    
170  if (String_StartsWith(str, kRunDll32Cmd1, true) ||
                    
170  if (String_StartsWith(str, kRunDll32Cmd1, true) ||
                    
171      String_StartsWith(str, kRunDll32Cmd2, true)) {
                    
172    int idx_space = str.Find(_T(' '));
                    
186  // For example: MsiExec.exe /I{25A13826-8E4A-4FBF-AD2B-776447FE9646}
                    
187  if (String_StartsWith(str, kMsiExecCmd1, true) ||
                    
188      String_StartsWith(str, kMsiExecCmd2, true)) {
                    
195  for (int i = 0; i < str.GetLength(); ++i) {
                    
196    if (String_StartsWith(str.GetString() + i, kDotExe, true)) {
                    
197      file->SetString(str, i + dot_exe_length);
                    
                
main.py https://bitbucket.org/kbengine/kbengine.git | Python | 277 lines
                    
62    # on Linux / Mac OS X 'foo.PY' is not importable, but on
                    
63    # Windows it is. Simpler to do a case insensitive match
                    
64    # a better check would be to check that the name is a
                    
68            rel_path = os.path.relpath(name, os.getcwd())
                    
69            if os.path.isabs(rel_path) or rel_path.startswith(os.pardir):
                    
70                return name
                    
71            name = rel_path
                    
72        # on Windows both '\' and '/' are used as path
                    
73        # separators. Better to replace both than rely on os.path.sep
                    
                
ioutils.cpp https://bitbucket.org/cvp2ri/qt5-tlsauth.git | C++ | 168 lines
                    
47#ifdef Q_OS_WIN
                    
48#  include <windows.h>
                    
49#else
                    
76{
                    
77    if (path.startsWith(QLatin1Char('/')))
                    
78        return false;
                    
79#ifdef Q_OS_WIN
                    
80    if (path.startsWith(QLatin1Char('\\')))
                    
81        return false;
                    
                
TestLocalDirAllocator.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 211 lines
                    
53  final static private boolean isWindows =
                    
54    System.getProperty("os.name").startsWith("Windows");
                    
55  final static int SMALL_FILE_SIZE = 100;
                    
74    assertTrue("Checking for " + BUFFER_DIR[i] + " in " + result + " - FAILED!", 
                    
75        result.getPath().startsWith(new File(BUFFER_DIR[i], FILENAME).getPath()));
                    
76  }
                    
94  public void test0() throws Exception {
                    
95    if (isWindows) return;
                    
96    try {
                    
112  public void test1() throws Exception {
                    
113    if (isWindows) return;
                    
114    try {
                    
128  public void test2() throws Exception {
                    
129    if (isWindows) return;
                    
130    try {
                    
                
LoginScreenManager.java https://github.com/aherbert/openmicroscopy.git | Java | 296 lines
                    
94	 */
                    
95	private void setWindowState(JFrame f, int state)
                    
96	{
                    
97		if (f == null) return;
                    
98		f.removeWindowStateListener(this);
                    
99		f.setState(state);
                    
99		f.setState(state);
                    
100		f.addWindowStateListener(this);
                    
101	}
                    
236		    		 	logo.getSize().height);
                    
237			logo.addWindowStateListener(this);
                    
238			logo.addWindowFocusListener(this);
                    
265	 * {@link ScreenLogin}.
                    
266	 * @see WindowStateListener#windowStateChanged(WindowEvent)
                    
267	 */
                    
                
ioutils.cpp https://gitlab.com/f3822/qtbase | C++ | 339 lines
                    
35#ifdef Q_OS_WIN
                    
36#  include <qt_windows.h>
                    
37#else
                    
104#ifdef QMAKE_BUILTIN_PRFS
                    
105    if (path.startsWith(QLatin1String(":/")))
                    
106        return false;
                    
121#else
                    
122    if (path.startsWith(QLatin1Char('/')))
                    
123        return false;
                    
240#  if defined(Q_OS_WIN)
                    
241static QString windowsErrorCode()
                    
242{
                    
282    if (rHand == INVALID_HANDLE_VALUE) {
                    
283        *errorString = fL1S("Cannot open reference file %1: %2").arg(referenceFileName, windowsErrorCode());
                    
284        return false;
                    
                
 

Source

Language