100+ results for 'if version startswith windows 9'

Not the results you expected?

FileUtil.java (https://gitlab.com/essere.lab.public/qualitas.class-corpus) Java · 468 lines

2 // CONTENT : CLASS FileUtil

3 // AUTHOR : Manfred Duchrow

4 // VERSION : 1.1 - 14/03/2003

5 // HISTORY :

6 // 17/05/2002 duma CREATED

25 *

26 * @author Manfred Duchrow

27 * @version 1.1

28 */

29 public class FileUtil

354 * Returns the given filename in the platform independent way that Java

355 * understands. That is all elements are separated by a forward slash rather

356 * than back slashes as on Windows systems.

357 *

358 * @param filename The name to be modified

RegistryUtil.cs (https://gitlab.com/nerdymishka/kweh) C# · 320 lines

25 var list = new List<string>()

26 {

27 @"HKLM:\SOFTWARE\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",

31 $"HKU:\\{sid}\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall",

32 $"HKU:\\{sid}\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall",

77 @"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",

78 @"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall",

79 @"HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",

284 if (path.Contains("%USERPROFILE%"))

285 {

286 subKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\" + sid);

287 if (subKey != null)

288 {

Configuration.cs (https://gitlab.com/minaz922/subtitleedit) C# · 264 lines

168 {

169 Instance._dataDir = BaseDirectory;

170 System.Windows.Forms.MessageBox.Show("Please re-install Subtitle Edit (installer version)");

171 System.Windows.Forms.Application.ExitThread();

173 }

174 }

175 else if (BaseDirectory.ToLower().StartsWith(pf.ToLower()) && Environment.OSVersion.Version.Major >= 6 ) // 6 == Vista/Win2008Server/Win7

176 { // windows vista and newer does not like programs writing to PF (nor does WinXp with non admin...)

184 {

185 Instance._dataDir = BaseDirectory;

186 System.Windows.Forms.MessageBox.Show("Please do not install portable version in 'Program Files' folder.");

187 System.Windows.Forms.Application.ExitThread();

201 {

202 string installerPath = null;

203 var key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SubtitleEdit_is1");

204 if (key != null)

205 {

TarEntry.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 730 lines ✨ Summary

This Java code is part of a Tar ( Tape Archive) file parser. It defines classes and methods to parse, create, and manipulate TarHeader information, which represents metadata about files in a Tar archive. The code handles various aspects of Tar file structure, including file names, permissions, ownership, timestamps, and checksums.

162 {

163 return

164 desc.header.name.toString().startsWith

165 ( this.header.name.toString() );

166 }

441 // REVIEW Would a better check be "(File.separator == '\')"?

442

443 // String Win32Prefix = "Windows";

444 // String prefix = osname.substring( 0, Win32Prefix.length() );

445 // if ( prefix.equalsIgnoreCase( Win32Prefix ) )

448

449 // Per Patrick Beard:

450 String Win32Prefix = "windows";

451 if ( osname.toLowerCase().startsWith( Win32Prefix ) )

468

469 // No absolute pathnames

470 // Windows (and Posix?) paths can start with "\\NetworkDrive\",

471 // so we loop on starting /'s.

472

ClassManagerImpl.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 576 lines ✨ Summary

This Java class manages a BeanShell interpreter’s classpath, handling imports, reloading classes, and notifying listeners of changes. It provides methods for defining new classes, getting the full classpath, and importing namespaces. The class also maintains a list of listeners that can be notified when the class cache is cleared or updated.

6 * Sun Public License Notice: *

7 * *

8 * The contents of this file are subject to the Sun Public License Version *

9 * 1.0 (the "License"); you may not use this file except in compliance with *

10 * the License. A copy of the License is available at http://www.sun.com *

19 * the GNU Lesser General Public License (the "LGPL"), in which case the *

20 * provisions of LGPL are applicable instead of those above. If you wish to *

21 * allow use of your version of this file only under the terms of the LGPL *

22 * and not to allow others to use your version of this file under the SPL, *

23 * indicate your decision by deleting the provisions above and replace *

24 * them with the notice and other provisions required by the LGPL. If you *

25 * do not delete the provisions above, a recipient may use your version of *

26 * this file under either the SPL or the LGPL. *

27 * *

183 // insure that core classes are loaded from the same loader

184 if ( c == null ) {

185 if ( name.startsWith( BSH_PACKAGE ) )

186 try {

187 c = Interpreter.class.getClassLoader().loadClass( name );

Helpers.cs (https://gitlab.com/jslee1/azure-powershell) C# · 199 lines

2 //

3 // Copyright Microsoft Corporation

4 // Licensed under the Apache License, Version 2.0 (the "License");

5 // you may not use this file except in compliance with the License.

6 // You may obtain a copy of the License at

16 using Microsoft.Azure.Commands.Batch.Properties;

17 using Microsoft.Azure.Management.Batch.Models;

18 using Microsoft.WindowsAzure.Commands.Utilities.Common;

19 using System;

20 using System.Collections;

140 if (tagValuePair != null)

141 {

142 if (tagValuePair.Name.StartsWith(ExcludedTagPrefix))

143 {

144 continue;

_MozillaCookieJar.py (https://github.com/atoun/jsrepl.git) Python · 149 lines

19 Don't expect cookies saved while the browser is running to be noticed by

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).

23

25 Netscape cookies on saving.

26

27 In particular, the cookie version and port number information is lost,

28 together with information about whether or not Path, Port and Discard were

29 specified by the Set-Cookie2 (or Set-Cookie) header, and whether or not the

64

65 # skip comments and blank lines XXX what is $ for?

66 if (line.strip().startswith(("#", "$")) or

67 line.strip() == ""):

68 continue

Util.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 700 lines ✨ Summary

This Java code provides a utility class with various methods for tasks such as URL path resolution, HTML escaping, and input stream reading. It also includes functions for resolving URLs to local file paths, escaping plain text strings for HTML, and reading input streams into memory. The methods are likely used in a web application or similar context.

3 All Rights Reserved.

4

5 Licensed under the Academic Free License version 2.1 or above OR the

6 modified BSD license. For more information on Dojo licensing, see:

7

570 String key = (String) iter.next();

571

572 if (urlPath.startsWith(key)) {

573 result = new File(((String) webmaps.get(key))

574 + urlPath.substring(key.length()));

StubPathBuilder.java (https://bitbucket.org/nbargnesi/idea.git) Java · 147 lines

2 * Copyright 2000-2009 JetBrains s.r.o.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

5 * you may not use this file except in compliance with the License.

6 * You may obtain a copy of the License at

123 final List<StubElement> children = parentStub.getChildrenStubs();

124

125 if (id.startsWith("#")) {

126 int count = Integer.parseInt(id.substring(1));

127

filebased.py (https://gitlab.com/areema/myproject) Python · 154 lines

34 return True

35

36 def get(self, key, default=None, version=None):

37 fname = self._key_to_file(key, version)

48 def set(self, key, value, timeout=DEFAULT_TIMEOUT, version=None):

49 self._createdir() # Cache dir can be deleted at any time.

50 fname = self._key_to_file(key, version)

51 self._cull() # make some room if necessary

52 fd, tmp_path = tempfile.mkstemp(dir=self._dir)

65 def delete(self, key, version=None):

66 self._delete(self._key_to_file(key, version))

67

68 def _delete(self, fname):

117 root cache path joined with the md5sum of the key and a suffix.

118 """

119 key = self.make_key(key, version=version)

120 self.validate_key(key)

121 return os.path.join(self._dir, ''.join(

SetAccess.java (https://github.com/Morriar/ProxyJDK.git) Java · 186 lines

4 *

5 * This code is free software; you can redistribute it and/or modify it

6 * under the terms of the GNU General Public License version 2 only, as

7 * published by the Free Software Foundation.

8 *

10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or

11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License

12 * version 2 for more details (a copy is included in the LICENSE file that

13 * accompanied this code).

14 *

52

53 public static void doTest(File f) throws Exception {

54 if (!System.getProperty("os.name").startsWith("Windows")) {

55 if (!f.setReadOnly())

56 throw new Exception(f + ": setReadOnly Failed");

CommonManagedWebLogicConfiguration.java (https://github.com/arquillian/arquillian-container-wls.git) Java · 185 lines

5 * full listing of individual contributors.

6 *

7 * Licensed under the Apache License, Version 2.0 (the "License");

8 * you may not use this file except in compliance with the License.

9 * You may obtain a copy of the License at

60 } else {

61 String os = System.getProperty("os.name").toLowerCase();

62 if (os.startsWith("windows")) {

63 startServerScript = DEFAULT_WIN_STARTUP_SCRIPT;

64 } else {

71 } else {

72 String os = System.getProperty("os.name").toLowerCase();

73 if (os.startsWith("windows")) {

74 stopServerScript = DEFAULT_WIN_SHUTDOWN_SCRIPT;

75 } else {

juce_PluginHostType.h (https://github.com/baeksanchang/juce.git) C Header · 188 lines

8

9 JUCE can be redistributed and/or modified under the terms of the GNU General

10 Public License (Version 2), as published by the Free Software Foundation.

11 A copy of the license is included in the JUCE distribution, or can be found

12 online at www.gnu.org/licenses.

152 if (hostFilename.containsIgnoreCase ("Wavelab")) return SteinbergWavelabGeneric;

153

154 #elif JUCE_WINDOWS

155 if (hostFilename.containsIgnoreCase ("Live 6.")) return AbletonLive6;

156 if (hostFilename.containsIgnoreCase ("Live 7.")) return AbletonLive7;

174 if (hostFilename.containsIgnoreCase ("Wavelab")) return SteinbergWavelabGeneric;

175 if (hostFilename.containsIgnoreCase ("rm-host")) return MuseReceptorGeneric;

176 if (hostFilename.startsWithIgnoreCase ("Sam")) return MagixSamplitude;

177 if (hostFilename.startsWith ("FL")) return FruityLoops;

qgsdecorationtitledialog.cpp (https://github.com/ricardogsilva/Quantum-GIS.git) C++ · 144 lines

9 * This program is free software; you can redistribute it and/or modify *

10 * it under the terms of the GNU General Public License as published by *

11 * the Free Software Foundation; either version 2 of the License, or *

12 * (at your option) any later version. *

108

109 // edit the selected expression if there's one

110 if ( selText.startsWith( QLatin1String( "[%" ) ) && selText.endsWith( QLatin1String( "%]" ) ) )

111 selText = selText.mid( 2, selText.size() - 4 );

112

JavaEnvUtilsTest.java (https://bitbucket.org/kaendfinger/apache-ant.git) Java · 140 lines

72 j.startsWith(javaHomeParent));

73 assertTrue(j+" is normalized and not in the JRE dir",

74 !j.startsWith(javaHome));

75

76 } catch (AssertionFailedError e) {

85

86 public void testGetExecutableMostPlatforms() {

87 if (!Os.isName("netware") && !Os.isFamily("windows")) {

88 String javaHome =

89 FILE_UTILS.normalize(System.getProperty("java.home"))

112 j.startsWith(javaHomeParent));

113

114 if (Os.isFamily("mac") && JavaEnvUtils.getJavaVersionNumber() <= JavaEnvUtils.VERSION_1_6) {

115 assertTrue(j+" is normalized and in the JRE dir",

116 j.startsWith(javaHome));

133 "Current java version is not at least the current java version...",

134 JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.getJavaVersion()));

135 assertFalse(

136 "In case the current java version is higher than 9.0 definitely a new algorithem will be needed",

VFSBrowser.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 2199 lines ✨ Summary

This Java code is part of a file browser application, specifically handling the display and editing of file paths and filters. It provides functionality for displaying a list of files, filtering by type, and editing the filter settings using a combo box editor. The code also handles various events such as focus changes and item state changes in the combo box.

8 * This program is free software; you can redistribute it and/or

9 * modify it under the terms of the GNU General Public License

10 * as published by the Free Software Foundation; either version 2

11 * of the License, or any later version.

57 *

58 * @author Slava Pestov

59 * @version $Id: VFSBrowser.java 21202 2012-02-24 21:12:36Z jarekczek $

60 */

61 public class VFSBrowser extends JPanel implements DefaultFocusComponent,

610 public void setDirectory(String path)

611 {

612 if(path.startsWith("file:"))

613 path = path.substring(5);

614 path = MiscUtilities.expandVariables(path);

629 public static String getRootDirectory()

630 {

631 if(OperatingSystem.isMacOS() || OperatingSystem.isWindows())

632 return FileRootsVFS.PROTOCOL + ':';

633 else

juce_PluginHostType.h (https://bitbucket.org/Klinkenstecker/owlsim.git) C Header · 158 lines

8

9 JUCE can be redistributed and/or modified under the terms of the GNU General

10 Public License (Version 2), as published by the Free Software Foundation.

11 A copy of the license is included in the JUCE distribution, or can be found

12 online at www.gnu.org/licenses.

121 if (hostPath.containsIgnoreCase ("Studio One")) return StudioOne;

122

123 #elif JUCE_WINDOWS

124 if (hostFilename.containsIgnoreCase ("Live 6.")) return AbletonLive6;

125 if (hostFilename.containsIgnoreCase ("Live 7.")) return AbletonLive7;

145 if (hostFilename.containsIgnoreCase ("Wavelab")) return SteinbergWavelabGeneric;

146 if (hostFilename.containsIgnoreCase ("rm-host")) return MuseReceptorGeneric;

147 if (hostFilename.startsWithIgnoreCase ("Sam")) return MagixSamplitude;

148 if (hostFilename.startsWith ("FL")) return FruityLoops;

ExecuteTest.groovy (https://github.com/groovy/groovy-core.git) Groovy · 150 lines

4 * distributed with this work for additional information

5 * regarding copyright ownership. The ASF licenses this file

6 * to you under the Apache License, Version 2.0 (the

7 * "License"); you may not use this file except in compliance

8 * with the License. You may obtain a copy of the License at

27 private String getCmd() {

28 def cmd = "ls -l"

29 if (System.properties.'os.name'.startsWith('Windows ')) {

30 cmd = "cmd /c dir"

31 }

HgScmProviderRepository.java (https://github.com/intelchen/maven-scm.git) Java · 266 lines

6 * distributed with this work for additional information

7 * regarding copyright ownership. The ASF licenses this file

8 * to you under the Apache License, Version 2.0 (the

9 * "License"); you may not use this file except in compliance

10 * with the License. You may obtain a copy of the License at

105 // Assume we have a file unless we find a URL based syntax

106 String prot = FILE;

107 if ( url.startsWith( SFTP ) )

108 {

109 prot = SFTP;

110 }

111 else if ( url.startsWith( HTTP ) )

112 {

113 prot = HTTP;

VaultVersionControlProvider.cs (https://github.com/DavidMoore/Foundation.git) C# · 175 lines

9 namespace Foundation.Build.VersionControl.Vault

10 {

11 public class VaultVersionControlProvider : BaseCommandLineVersionControlProvider

12 {

13 public VaultVersionControlProvider(string fileName) : base(fileName) {}

93 // If the argument is the version, then add that to the arguments.

94 if (!arguments.Version.IsNullOrEmpty()) sb.Append(" ").Append(arguments.Version);

95

96 // The source path / file

134 }

135

136 public override string MapVersionControlSourcePath(string localPath, VersionControlArguments args)

137 {

138 if( args.DestinationPath.IsNullOrEmpty()) throw new ArgumentException("The DestinationPath is empty, so we cannot map a version control file if we have no working path.", "args");

165 return !args.Label.IsNullOrEmpty() ? "getlabel" : "getversion";

166

167 case VersionControlOperation.GetLocalVersion:

168 return "listfolder";

169

LinkContext.cs (https://github.com/t-ashula/mono.git) C# · 258 lines

139 }

140

141 return Resolve (new AssemblyNameReference (name, new Version ()));

142 }

143

221 case "PresentationFramework":

222 case "PresentationCore":

223 case "WindowsBase":

224 case "UIAutomationProvider":

225 case "UIAutomationTypes":

228 return true;

229 default:

230 return name.Name.StartsWith ("System")

231 || name.Name.StartsWith ("Microsoft");

Make_Bug_Report.bsh (https://jedit.svn.sourceforge.net/svnroot/jedit) Unknown · 119 lines

9 * This program is free software; you can redistribute it and/or

10 * modify it under the terms of the GNU General Public License

11 * as published by the Free Software Foundation; either version 2

12 * of the License, or any later version.

59 {

60 if(!startupDone &&

61 (line.startsWith("[message] jEdit:")

62 || line.startsWith("[notice] jEdit:")

63 || line.startsWith("[notice] JARClassLoader:")))

64 {

65 report.append(line).append('\n');

69 }

70 }

71 else if(line.startsWith("[error]"))

72 {

73 if(!insideError)

xmlInjections-html.xml (https://bitbucket.org/nbargnesi/idea.git) XML · 27 lines

1 <?xml version="1.0" encoding="UTF-8"?>

2 <component name="LanguageInjectionConfiguration">

3 <injection language="JavaScript" injector-id="xml">

8 <injection language="JavaScript" injector-id="xml">

9 <display-name>*/@on.*</display-name>

10 <place><![CDATA[xmlAttribute().withLocalName(string().startsWith("on")).withParent(xmlTag().withNamespace(string().equalTo("http://www.w3.org/1999/xhtml")))]]></place>

11 </injection>

12 <injection language="CSS" injector-id="xml">

OSGiLoadService.java (https://gitlab.com/essere.lab.public/qualitas.class-corpus) Java · 158 lines

1 /***** BEGIN LICENSE BLOCK *****

2 * Version: EPL 1.0/GPL 2.0/LGPL 2.1

3 *

4 * The contents of this file are subject to the Common Public

5 * License Version 1.0 (the "License"); you may not use this file

6 * except in compliance with the License. You may obtain a copy of

7 * the License at http://www.eclipse.org/legal/cpl-v10.html

15 *

16 * Alternatively, the contents of this file may be used under the terms of

17 * either of the GNU General Public License Version 2 or later (the "GPL"),

18 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),

19 * in which case the provisions of the GPL or the LGPL are applicable instead

20 * of those above. If you wish to allow use of your version of this file only

21 * under the terms of either the GPL or the LGPL, and not to allow others to

22 * use your version of this file under the terms of the EPL, indicate your

SingleInstanceManager.java (https://github.com/carrot-garden/carrot-jnlper.git) Java · 189 lines

59 // if file with the same prefix already exist, server is

60 // running

61 if (fList[i].startsWith(

62 SingleInstanceImpl.getSingleInstanceFilePrefix(idString +

63 Config.getInstance().getSessionSpecificString()))) {

177 return false;

178 } catch (java.net.SocketException se) {

179 // for windows

180 // no server is running - continue launch

181 Trace.println("no server is running - continue launch!", TraceLevel.TEMP);

StringBufferReplaceableWithStringFixTest.java (https://bitbucket.org/nbargnesi/idea.git) Java · 27 lines

19 public void testStringBufferVariable() { doTest(); }

20 public void testStringBufferVariable2() { doTest(); }

21 public void testStartsWithPrimitive() { doTest(); }

22 public void testPrecedence() { doTest(InspectionGadgetsBundle.message("string.builder.replaceable.by.string.quickfix")); }

23 public void testPrecedence2() { doTest(InspectionGadgetsBundle.message("string.builder.replaceable.by.string.quickfix")); }

PortletEntityIdStringUtils.java (https://github.com/Jasig/uPortal.git) Java · 97 lines

2 * Licensed to Apereo under one or more contributor license agreements. See the NOTICE file

3 * distributed with this work for additional information regarding copyright ownership. Apereo

4 * licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use

5 * this file except in compliance with the License. You may obtain a copy of the License at the

6 * following location:

70

71 public static boolean isDelegateLayoutNode(final String layoutNodeId) {

72 return layoutNodeId.startsWith(DELEGATE_LAYOUT_NODE_ID_PREFIX);

73 }

74

MailingList.py (https://github.com/cherokee/web.git) Python · 140 lines

10 #

11 # This program is free software; you can redistribute it and/or

12 # modify it under the terms of version 2 of the GNU General Public

13 # License as published by the Free Software Foundation.

14 #

58 # Clean title

59 title = entry['title']

60 if title.lower().startswith("re: "):

61 title = title[4:]

62 if title.lower().startswith("[cherokee] "):

MimeResponseImpl.java (https://github.com/kiyoshilee/liferay-portal.git) Java · 189 lines

4 * This library is free software; you can redistribute it and/or modify it under

5 * the terms of the GNU Lesser General Public License as published by the Free

6 * Software Foundation; either version 2.1 of the License, or (at your option)

7 * any later version.

16

17 import com.liferay.portal.kernel.model.Portlet;

18 import com.liferay.portal.kernel.portlet.LiferayWindowState;

19 import com.liferay.portal.kernel.util.Validator;

20

166

167 String lifecycle = getLifecycle();

168 WindowState windowState = portletRequestImpl.getWindowState();

169

170 if (!contentType.startsWith(

171 portletRequestImpl.getResponseContentType()) &&

172 !lifecycle.equals(PortletRequest.RESOURCE_PHASE) &&

173 !windowState.equals(LiferayWindowState.EXCLUSIVE)) {

174

175 throw new IllegalArgumentException(

BazaarScmProviderRepository.java (https://github.com/intelchen/maven-scm.git) Java · 311 lines

6 * distributed with this work for additional information

7 * regarding copyright ownership. The ASF licenses this file

8 * to you under the Apache License, Version 2.0 (the

9 * "License"); you may not use this file except in compliance

10 * with the License. You may obtain a copy of the License at

124 {

125 String prot = UNKNOWN;

126 if ( url.startsWith( FILE ) )

127 {

128 prot = FILE;

129 }

130 else if ( url.startsWith( FTP ) )

131 {

132 prot = FTP;

Neo4jGraphTest.java (https://github.com/tor5/blueprints.git) Java · 201 lines

109 deleteDirectory(new File(directory));

110 for (Method method : testSuite.getClass().getDeclaredMethods()) {

111 if (method.getName().startsWith("test")) {

112 System.out.println("Testing " + method.getName() + "...");

113 method.invoke(testSuite);

121 String directory = System.getProperty("neo4jGraphDirectory");

122 if (directory == null) {

123 if (System.getProperty("os.name").toUpperCase().contains("WINDOWS"))

124 directory = "C:/temp/blueprints_test";

125 else

129 }

130

131 public void testLongIdConversions() {

132 String id1 = "100"; // good 100

133 String id2 = "100.0"; // good 100

Test_PRL_05_01_004_AddNewCateogryWithNameStartsWithDashChars.html (https://github.com/anhnht/exogtn.git) HTML · 196 lines

1 <?xml version="1.0" encoding="UTF-8"?>

2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

6 <link rel="selenium.base" href="" />

7 <title>Test_PRL_05_01_004_AddNewCateogryWithNameStartsWithDashChars</title>

8 </head>

9 <body>

10 <table cellpadding="1" cellspacing="1" border="1">

11 <thead>

12 <tr><td rowspan="1" colspan="3">Test_PRL_05_01_004_AddNewCateogryWithNameStartsWithDashChars</td></tr>

13 </thead><tbody>

14 <tr>

FindVIGRANUMPY_DEPENDENCIES.cmake (https://github.com/cbecker/vigra.git) CMake · 137 lines

12 # fallback when standard search does not work

13 execute_process(COMMAND ${PYTHON_EXECUTABLE} -c

14 "import sys; skip = 2 if sys.platform.startswith('win') else 1; print 'python' + sys.version[0:3:skip]"

15 OUTPUT_VARIABLE PYTHON_LIBRARY_NAME OUTPUT_STRIP_TRAILING_WHITESPACE)

16 execute_process(COMMAND ${PYTHON_EXECUTABLE} -c

110 ######################################################################

111 execute_process(COMMAND ${PYTHON_EXECUTABLE} -c

112 "import sys; p = sys.platform; print 'windows' if p.startswith('win') else p"

113 OUTPUT_VARIABLE PYTHON_PLATFORM OUTPUT_STRIP_TRAILING_WHITESPACE)

114

OsConstraintHelper.java (https://github.com/maslovalex/izpack.git) Java · 152 lines

35 } // end if

36

37 if (match && (osModel.getVersion() != null) && (osModel.getVersion().length() != 0))

38 {

39 match = System.getProperty("os.version").toLowerCase().equals(osModel.getVersion());

49 if ("windows".equals(osModel.getFamily()))

50 {

51 match = OsVersion.IS_WINDOWS;

52 } // end if

53 else if ("mac".equals(osModel.getFamily()) || "osx".equals(osModel.getFamily()))

63 if (match && (osModel.getJre() != null) && (osModel.getJre().length() > 0))

64 {

65 match = System.getProperty("java.version").toLowerCase().startsWith(osModel.getJre());

66 }

67

QuestionPrevLineStartsWithTest.java (https://gitlab.com/essere.lab.public/qualitas.class-corpus) Java · 171 lines

42 * Tests the indention rule which detects whether the immediately previous line

43 * starts with a particular string.

44 * @version $Id: QuestionPrevLineStartsWithTest.java 5175 2010-01-20 08:46:32Z mgricken $

45 */

46 public final class QuestionPrevLineStartsWithTest extends IndentRulesTestCase {

48 /** Tests not having the prefix in the text. */

49 public void testNoPrefix() throws BadLocationException {

50 IndentRuleQuestion rule = new QuestionPrevLineStartsWith("{", null, null);

51

52 // Open brace

91 public void testStartsWithPrefixWithText() throws BadLocationException {

92 IndentRuleQuestion rule = new QuestionPrevLineStartsWith("}", null, null);

93

94 // Prefix plus text (no space)

109 public void testStartsWithPrefixNoText() throws BadLocationException {

110 IndentRuleQuestion rule = new QuestionPrevLineStartsWith("*", null, null);

111

112 // Prefix plus no text (no space)

OSGiLoadService.java (https://github.com/rkh/jruby.git) Java · 158 lines

1 /***** BEGIN LICENSE BLOCK *****

2 * Version: CPL 1.0/GPL 2.0/LGPL 2.1

3 *

4 * The contents of this file are subject to the Common Public

5 * License Version 1.0 (the "License"); you may not use this file

6 * except in compliance with the License. You may obtain a copy of

7 * the License at http://www.eclipse.org/legal/cpl-v10.html

15 *

16 * Alternatively, the contents of this file may be used under the terms of

17 * either of the GNU General Public License Version 2 or later (the "GPL"),

18 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),

19 * in which case the provisions of the GPL or the LGPL are applicable instead

20 * of those above. If you wish to allow use of your version of this file only

21 * under the terms of either the GPL or the LGPL, and not to allow others to

22 * use your version of this file under the terms of the CPL, indicate your

Misc.java (https://github.com/Morriar/ProxyJDK.git) Java · 169 lines

4 *

5 * This code is free software; you can redistribute it and/or modify it

6 * under the terms of the GNU General Public License version 2 only, as

7 * published by the Free Software Foundation.

8 *

10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or

11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License

12 * version 2 for more details (a copy is included in the LICENSE file that

13 * accompanied this code).

14 *

15 * You should have received a copy of the GNU General Public License version

16 * 2 along with this work; if not, write to the Free Software Foundation,

17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.

35 static final boolean isWindows =

36 System.getProperty("os.name").startsWith("Windows");

37 static boolean supportsLinks;

38

convert.py (https://bitbucket.org/acaceres/mr-injector.git) Python · 182 lines

71

72 value = value.lower()

73 return (value[2:] if value.startswith("0x") else value).decode("hex")

74

75 def hexencode(value):

121 def htmlunescape(value):

122 """

123 Returns (basic conversion) HTML unescaped value

124

125 >>> htmlunescape('a&lt;b')

146 if output != data:

147 warnMsg = "cannot properly display Unicode characters "

148 warnMsg += "inside Windows OS command prompt "

149 warnMsg += "(http://bugs.python.org/issue1602). All "

150 warnMsg += "unhandled occurances will result in "

env.js (https://github.com/ivmartel/dwv.git) JavaScript · 278 lines

30 dwv.env.hasFileApi = function () {

31 // regular test does not work on Safari 5

32 var isSafari5 = (navigator.appVersion.indexOf('Safari') !== -1) &&

33 (navigator.appVersion.indexOf('Chrome') === -1) &&

34 ((navigator.appVersion.indexOf('5.0.') !== -1) ||

35 (navigator.appVersion.indexOf('5.1.') !== -1));

118 * Browser check for clamped array.

119 * Missing in:

120 * - Safari 5.1.7 for Windows

121 * - PhantomJS 1.9.20 (on Travis).

122 *

268 }

269

270 // check string startsWith

271 if (!String.prototype.startsWith) {

ConnectionInfo.cs (https://gitlab.com/GRIN-Global/GRIN-Global-server) C# · 238 lines

94 ci.DatabaseEngineServerName = nd.Attributes.GetValue("DatabaseEngineName");

95 ci.DatabaseEngineProviderName = nd.Attributes.GetValue("DatabaseEngineProvider", "sqlserver");

96 ci.UseWindowsAuthentication = Toolkit.ToBoolean(nd.Attributes.GetValue("UseWindowsAuthentication", "true"), true);

97 ci.DatabaseEngineRememberPassword = Toolkit.ToBoolean(nd.Attributes.GetValue("DatabaseEngineRememberPassword", "true"), true);

98 ci.DatabaseEngineDatabaseName = nd.Attributes.GetValue("DatabaseEngineDatabaseName", "gringlobal");

125 nd.Attributes.SetValue("DatabaseEngineName", DatabaseEngineServerName);

126 nd.Attributes.SetValue("DatabaseEngineProvider", DatabaseEngineProviderName);

127 nd.Attributes.SetValue("UseWindowsAuthentication", UseWindowsAuthentication.ToString());

128 nd.Attributes.SetValue("DatabaseEngineRememberPassword", DatabaseEngineRememberPassword.ToString());

129 nd.Attributes.SetValue("DatabaseEngineDatabaseName", DatabaseEngineDatabaseName);

156 DatabaseEngineServerName = info.GetString("DatabaseEngineServerName");

157 DatabaseEngineProviderName = info.GetString("DatabaseEngineProvider");

158 UseWindowsAuthentication = info.GetBoolean("UseWindowsAuthentication");

159 DatabaseEngineRememberPassword = info.GetBoolean("DatabaseEngineRememberPassword");

160 DatabaseEngineDatabaseName = info.GetString("DatabaseEngineDatabaseName");

GitRepositoryCommand.cpp (https://github.com/murank/TortoiseGitMod.git) C++ · 191 lines

1 // TortoiseGit - a Windows shell extension for easy version control

2

3 // Copyright (C) 2008-2011 - TortoiseGit

5 // This program is free software; you can redistribute it and/or

6 // modify it under the terms of the GNU General Public License

7 // as published by the Free Software Foundation; either version 2

8 // of the License, or (at your option) any later version.

165 std::vector<CString> GitRepositoryCommand::GetStatusStrings(const CString& path) const

166 {

167 assert(StartsWith(path, GetProjectRoot()) && "the path must be in a git repository");

168 if(!StartsWith(path, GetProjectRoot())) {

prepare_bootstrap.py (https://github.com/tris-sondon/numpy.git) Python · 109 lines

10 # Yeah, the name logic is harcoded in distutils. We have to reproduce it

11 # here

12 name = "numpy-%s.zip" % get_numpy_version()

13 return name

14

32 for name in zid.namelist():

33 cnt = zid.read(name)

34 if name.startswith(root):

35 # XXX: even on windows, the path sep in zip is '/' ?

66

67 shutil.copy('build.py', bootstrap)

68 prepare_nsis_script(bootstrap, pyver, get_numpy_version())

69

70 def get_binary_name(arch):

77 chdir = cwd

78 os.chdir(chdir)

79 version = subprocess.Popen(['python', '-c', 'import __builtin__; __builtin__.__NUMPY_SETUP__ = True; from numpy.version import version;print version'], stdout = subprocess.PIPE).communicate()[0]

80 version = version.strip()

Interpreter.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 1234 lines ✨ Summary

This Java code defines a class Interpreter that represents an interactive shell for executing BeanShell scripts. It provides methods for sourcing scripts, evaluating expressions, and controlling output and error streams. The class also handles security exceptions and provides features like verbose printing and exit on EOF control.

6 * Sun Public License Notice: *

7 * *

8 * The contents of this file are subject to the Sun Public License Version *

9 * 1.0 (the "License"); you may not use this file except in compliance with *

10 * the License. A copy of the License is available at http://www.sun.com *

19 * the GNU Lesser General Public License (the "LGPL"), in which case the *

20 * provisions of LGPL are applicable instead of those above. If you wish to *

21 * allow use of your version of this file only under the terms of the LGPL *

22 * and not to allow others to use your version of this file under the SPL, *

23 * indicate your decision by deleting the provisions above and replace *

24 * them with the notice and other provisions required by the LGPL. If you *

25 * do not delete the provisions above, a recipient may use your version of *

26 * this file under either the SPL or the LGPL. *

27 * *

387 // returns too large a value. This bug has been fixed in JDK 1.2.

388 InputStream src;

389 if ( System.getProperty("os.name").startsWith("Windows")

390 && System.getProperty("java.version").startsWith("1.1."))

IFrameDisplayContext.java (https://github.com/kiyoshilee/liferay-portal.git) Java · 300 lines

4 * This library is free software; you can redistribute it and/or modify it under

5 * the terms of the GNU Lesser General Public License as published by the Free

6 * Software Foundation; either version 2.1 of the License, or (at your option)

7 * any later version.

35

36 import javax.portlet.PortletRequest;

37 import javax.portlet.WindowState;

38

39 /**

82 }

83

84 String windowState = String.valueOf(_request.getWindowState());

85

86 if (windowState.equals(WindowState.MAXIMIZED)) {

193 String name = enu.nextElement();

194

195 if (name.startsWith(_IFRAME_PREFIX)) {

196 iFrameVariables.add(

197 name.substring(_IFRAME_PREFIX.length()) + StringPool.EQUAL +

OAuth1Authenticator.cs (https://github.com/petejohanson/RestSharp.git) C# · 232 lines

5 using RestSharp.Authenticators.OAuth.Extensions;

6

7 #if WINDOWS_PHONE

8 using System.Net;

9 #else

27 internal virtual string TokenSecret { get; set; }

28 internal virtual string Verifier { get; set; }

29 internal virtual string Version { get; set; }

30 internal virtual string CallbackUrl { get; set; }

31 internal virtual string SessionHandle { get; set; }

134 SignatureTreatment = SignatureTreatment,

135 Verifier = Verifier,

136 Version = Version,

137 CallbackUrl = CallbackUrl,

138 SessionHandle = SessionHandle,

bootstrap.py (https://github.com/emilian/django-blog-zinnia.git) Python · 121 lines

5 #

6 # This software is subject to the provisions of the Zope Public License,

7 # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.

8 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED

9 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED

26 tmpeggs = tempfile.mkdtemp()

27

28 is_jython = sys.platform.startswith('java')

29

30 # parsing arguments

31 parser = OptionParser()

32 parser.add_option("-v", "--version", dest="version",

33 help="use a specific zc.buildout version")

48 if options.version is not None:

49 VERSION = '==%s' % options.version

50 else:

51 VERSION = ''

Selection.cs (https://github.com/bangonkali/electronics.git) C# · 460 lines

12 using Alsing.SourceCode;

13

14 namespace Alsing.Windows.Forms.SyntaxBox

15 {

16 /// <summary>

276 ActionGroup.Add(b);

277 string s = xtr.Text;

278 if (s.StartsWith("\t"))

279 {

280 b.Text = s.Substring(0, 1);

281 s = s.Substring(1);

282 }

283 if (s.StartsWith(" "))

284 {

285 b.Text = s.Substring(0, 4);

monkey.py (https://gitlab.com/phongphans61/machine-learning-tictactoe) Python · 177 lines

52 cls

53 for cls in _get_mro(cls)

54 if not cls.__module__.startswith('setuptools')

55 )

56 base = next(external_bases)

57 if not base.__module__.startswith('distutils'):

58 msg = "distutils has already been patched by %r" % cls

59 raise AssertionError(msg)

65 distutils.core.Command = setuptools.Command

66

67 has_issue_12885 = sys.version_info <= (3, 5, 3)

68

69 if has_issue_12885:

MockStorageTableManagement.cs (https://gitlab.com/jslee1/azure-powershell) C# · 223 lines

2 //

3 // Copyright 2012 Microsoft Corporation

4 // Licensed under the Apache License, Version 2.0 (the "License");

5 // you may not use this file except in compliance with the License.

6 // You may obtain a copy of the License at

16 using System.Collections.Generic;

17 using System.Threading.Tasks;

18 using Microsoft.WindowsAzure.Commands.Common.Storage;

19 using Microsoft.WindowsAzure.Commands.Storage.Model.Contract;

20 using Microsoft.WindowsAzure.Storage;

21 using Microsoft.WindowsAzure.Storage.Table;

22

23 namespace Microsoft.WindowsAzure.Commands.Storage.Test.Service

24 {

25 /// <summary>

BaseDirFileResolverSpec.groovy (https://github.com/andrewhj-mn/gradle.git) Groovy · 218 lines

2 * Copyright 2011 the original author or authors.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

5 * you may not use this file except in compliance with the License.

6 * You may obtain a copy of the License at

16 package org.gradle.api.internal.file

17

18 import org.gradle.internal.typeconversion.UnsupportedNotationException

19 import org.gradle.test.fixtures.file.TestFile

20 import org.gradle.test.fixtures.file.TestNameTestDirectoryProvider

142 }

143

144 @Requires(TestPrecondition.WINDOWS)

145 def "normalizes path which uses windows 8.3 name"() {

160 }

161

162 @Requires(TestPrecondition.WINDOWS)

163 def "normalizes non-existent file system root"() {

164 def file = new File("Q:\\")

DirectoryWatcher.java (https://github.com/aclement/grails-core.git) Java · 220 lines

2 * Copyright 2011 SpringSource

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

5 * you may not use this file except in compliance with the License.

6 * You may obtain a copy of the License at

43 private boolean active = true;

44 private long sleepTime = 3000;

45 private boolean windows;

46

47 public DirectoryWatcher() {

48 setDaemon(true);

49 windows = System.getProperty("os.name").toLowerCase().indexOf("windows") != -1;

50 }

51

db_javaJNI.java (https://gitlab.com/OpenSourceMirror/sourcenav) Java · 320 lines

19 v_minor = DbConstants.DB_VERSION_MINOR;

20 v_patch = DbConstants.DB_VERSION_PATCH;

21

22 if ((libname =

28 else {

29 String os = System.getProperty("os.name");

30 if (os != null && os.startsWith("Windows")) {

31 /*

32 * On Windows, library name is something like

60 DbEnv_get_version_minor() != v_minor ||

61 DbEnv_get_version_patch() != v_patch)

62 throw new RuntimeException(

63 "Berkeley DB library version " +

64 DbEnv_get_version_major() + "." +

65 DbEnv_get_version_minor() + "." +

66 DbEnv_get_version_patch() +

SystemHelpers.java (https://gitlab.com/Manouchehri/binnavi) Java · 177 lines

59 // TODO(cblichmann): Change to "/Library/Application Support".

60 // For now, be consistent with the the CLI

61 // versions of BinDiff/BinDetego

62 result = "/etc/opt"; // Resolves to "/private/etc/opt"

63 } else {

147

148 /**

149 * Determines whether the program is running in Windows.

150 *

151 * @return true, if the program is running in Windows, false otherwise.

156

157 /**

158 * Determines whether the program is running in Windows.

159 *

160 * @return true, if the program is running in Windows, false otherwise.

162 public static boolean isRunningWindows() {

163 return System.getProperty("os.name").startsWith("Windows");

164 }

165

OperatingSystemFamily.java (https://github.com/bmoussaud/overthere.git) Java · 136 lines

4 * Overthere is free software: you can redistribute it and/or modify

5 * it under the terms of the GNU General Public License as published by

6 * the Free Software Foundation, either version 3 of the License, or

7 * (at your option) any later version.

26 public enum OperatingSystemFamily {

27 /**

28 * An operating system from the Windows family: NT, XP, Server 2003, Vista, etc.

29 */

30 WINDOWS,

39 */

40 public static OperatingSystemFamily getLocalHostOperatingSystemFamily() {

41 return System.getProperty("os.name").startsWith("Windows") ? WINDOWS : UNIX;

42 }

43

49 */

50 public String getScriptExtension() {

51 if (this == WINDOWS) {

52 return ".bat";

53 } else {

_django.py (https://bitbucket.org/beqa/nvdadependencyvirtualenvironment.git) Python · 141 lines

4 # Author: Cody Precord <cprecord@editra.org> #

5 # Copyright: (c) 2008 Cody Precord <staff@editra.org> #

6 # License: wxWindows License #

7 ###############################################################################

8

112 # print token, txt

113 style = TOKEN_MAP.get(token, STC_DJANGO_DEFAULT)

114 if style == STC_DJANGO_PREPROCESSOR and txt.startswith(u'#'):

115 style = STC_DJANGO_COMMENT

116 # elif style == STC_DJANGO_STRING and txt[-1] not in '"\'':

StaticStringy.php (https://gitlab.com/judielsm/Handora) PHP · 979 lines

42

43 /**

44 * Returns a camelCase version of the string. Trims surrounding spaces,

45 * capitalizes letters following digits, spaces, dashes and underscores,

46 * and removes spaces, dashes, as well as underscores.

56

57 /**

58 * Returns an UpperCamelCase version of the supplied string. It trims

59 * surrounding spaces, capitalizes letters following digits, spaces, dashes

60 * and underscores, and removes spaces, dashes, underscores.

115

116 /**

117 * Returns a case swapped version of the string.

118 *

119 * @param string $str String to swap case

mailslot.py (https://github.com/janschejbal/sabnzbd.git) Python · 130 lines

4 # This program is free software; you can redistribute it and/or

5 # modify it under the terms of the GNU General Public License

6 # as published by the Free Software Foundation; either version 2

7 # of the License, or (at your option) any later version.

34

35 class MailSlot(object):

36 """ Simple Windows Mailslot communication

37 """

38 slotname = r'mailslot\SABnzbd\ServiceSlot'

109 if data is not None:

110 print data

111 if data.startswith('stop'):

112 break

113 sleep(2.0)

FindFileEntryAction.java (https://github.com/spreddy/liferay-portal.git) Java · 146 lines

4 * This library is free software; you can redistribute it and/or modify it under

5 * the terms of the GNU Lesser General Public License as published by the Free

6 * Software Foundation; either version 2.1 of the License, or (at your option)

7 * any later version.

30 import javax.portlet.PortletRequest;

31 import javax.portlet.PortletURL;

32 import javax.portlet.WindowState;

33

34 import javax.servlet.http.HttpServletRequest;

60 request, getPortletId(plid), plid, PortletRequest.RENDER_PHASE);

61

62 portletURL.setWindowState(WindowState.NORMAL);

63 portletURL.setPortletMode(PortletMode.VIEW);

64

134

135 for (String portletId : layoutTypePortlet.getPortletIds()) {

136 if (portletId.startsWith(PortletKeys.DOCUMENT_LIBRARY) ||

137 portletId.startsWith(PortletKeys.DOCUMENT_LIBRARY_DISPLAY)) {

db_javaJNI.java (https://github.com/cparedes/omnibus.git) Java · 356 lines

19 v_minor = DbConstants.DB_VERSION_MINOR;

20 v_patch = DbConstants.DB_VERSION_PATCH;

21

22 if ((libname =

28 else {

29 String os = System.getProperty("os.name");

30 if (os != null && os.startsWith("Windows")) {

31 /*

32 * On Windows, library name is something like

63 "Berkeley DB library version " +

64 DbEnv_get_version_major() + "." +

65 DbEnv_get_version_minor() + "." +

66 DbEnv_get_version_patch() +

67 " doesn't match Java class library version " +

NodeRenamerAction.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 335 lines ✨ Summary

This Java code is part of a project that allows users to rename nodes (files, directories) within a project structure. It provides a dialog for inputting new names and includes options to prevent changes on disk. The code handles renaming files, directories, and projects, and updates the project structure accordingly.

5 * This program is free software; you can redistribute it and/or

6 * modify it under the terms of the GNU General Public License

7 * as published by the Free Software Foundation; either version 2

8 * of the License, or any later version.

56 *

57 * @author Marcelo Vanzin

58 * @version $Id: NodeRenamerAction.java 6382 2006-01-12 05:14:54Z vanza $

59 */

60 public class NodeRenamerAction extends Action {

158 for (Iterator i = project.getOpenableNodes().iterator(); i.hasNext(); ) {

159 VPTNode n = (VPTNode) i.next();

160 if (n.isFile() && n.getNodePath().startsWith(oldDir)) {

161 renameFile((VPTFile)n, new File(dir.getFile(), n.getName()), false);

162 }

HtmlParser.jj (https://jedit.svn.sourceforge.net/svnroot/jedit) Unknown · 649 lines

4 *

5 * This program is free software; you can redistribute it and/or modify

6 * it under the terms of the GNU General Public License, version 2, as

7 * published by the Free Software Foundation.

8 *

19 *

20 * Author: Brian Goetz, Quiotix

21 * Version: 1.03

22 * Revision: $Id: HtmlParser.jj 18084 2010-06-15 17:46:18Z daleanson $

23 *

157 private boolean isProperAttribute(String s) {

158 // could have double quotes

159 if (s.startsWith("\"") && s.endsWith("\"")) {

160 return true;

161 }

AntFarmShell.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 371 lines ✨ Summary

This Java code implements a shell for an Ant build tool, allowing users to interact with their project files and execute Ant commands. It provides functionality for loading projects, adding build files, executing tasks, and displaying project information. The shell also handles errors and provides output to the user.

5 * This program is free software; you can redistribute it and/or

6 * modify it under the terms of the GNU General Public License

7 * as published by the Free Software Foundation; either version 2

8 * of the License, or any later version.

104 command = command.trim();

105

106 if (command.startsWith("!"))

107 {

108 if (_currentProject == null)

156 output.commandDone();

157 }

158 else if (command.startsWith("="))

159 {

160

204 }

205 }

206 else if (command.startsWith("+"))

207 {

208

BrowserView.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 562 lines ✨ Summary

This Java code implements a file browser component for a GUI application. It displays a tree-like structure of files and directories, allowing users to navigate and select files for viewing or opening. The code handles mouse events, such as clicks and releases, to trigger actions like expanding/collapsing folders, selecting files, and opening files in a new view.

8 * This program is free software; you can redistribute it and/or

9 * modify it under the terms of the GNU General Public License

10 * as published by the Free Software Foundation; either version 2

11 * of the License, or any later version.

38 * VFS browser tree view.

39 * @author Slava Pestov

40 * @version $Id: BrowserView.java 4965 2004-02-04 00:07:34Z spestov $

41 */

42 class BrowserView extends JPanel

248 // the local filesystem, do a tree scan

249

250 if(!browserDir.startsWith(FavoritesVFS.PROTOCOL)

251 && !browserDir.startsWith(FileRootsVFS.PROTOCOL)

252 && !path.startsWith(symlinkBrowserDir))

253 return;

254

process_util.py (https://bitbucket.org/mdavid/dlr.git) Python · 147 lines

3 # Copyright (c) Microsoft Corporation. All rights reserved.

4 #

5 # This source code is subject to terms and conditions of the Apache License, Version 2.0. A

6 # copy of the license can be found in the License.html file at the root of this distribution. If

7 # you cannot locate the Apache License, Version 2.0, please send an email to

8 # ironpy@microsoft.com. By using this source code in any fashion, you are agreeing to be bound

9 # by the terms of the Apache License, Version 2.0.

10 #

11 # You must not remove this notice, or any other, from this software.

47 switches = []

48 for param in System.Environment.GetCommandLineArgs():

49 if param.startswith('-T:') or param.startswith('-O:'):

50 continue

51 if param.startswith("-"):

PdtPlugin.java (https://github.com/CyanogenMod/android_sdk.git) Java · 146 lines

2 * Copyright (C) 2010 The Android Open Source Project

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

5 * you may not use this file except in compliance with the License.

6 * You may obtain a copy of the License at

54 // if the SDK changed, we have to do some extra work

55 if (PrefPage.PREFS_DEVTREE_DIR.equals(event.getProperty())) {

56 // restart adb, in case it's a different version

57 DdmsPlugin.setToolsLocation(getAdbLocation(), true /* startAdb */,

58 getHprofConvLocation(), getTraceViewLocation());

136 if (os.startsWith("Mac OS")) { //$NON-NLS-1$

137 return "darwin-x86"; //$NON-NLS-1$

138 } else if (os.startsWith("Windows")) { //$NON-NLS-1$

139 return "windows"; //$NON-NLS-1$

140 } else if (os.startsWith("Linux")) { //$NON-NLS-1$

141 return "linux-x86"; //$NON-NLS-1$

142 }

IniFile.java (https://github.com/srstclair/ant-contrib.git) Java · 211 lines

2 * Copyright (c) 2001-2004 Ant-Contrib project. All rights reserved.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

5 * you may not use this file except in compliance with the License.

6 * You may obtain a copy of the License at

29

30 /**

31 * Class representing a windows style .ini file.

32 *

33 * @author <a href="mailto:mattinger@yahoo.com">Matthew Inger</a>

188 while ((line = br.readLine()) != null) {

189 line = StringTools.trim(line);

190 if (line.length() > 0 && !line.startsWith("#") && !line.startsWith(";")) {

191 if (line.startsWith("[") && line.endsWith("]")) {

FileNamingGenerator.cs (https://gitlab.com/jslee1/azure-powershell) C# · 163 lines

2 //

3 // Copyright Microsoft Corporation

4 // Licensed under the Apache License, Version 2.0 (the "License");

5 // you may not use this file except in compliance with the License.

6 // You may obtain a copy of the License at

18 using System.Text;

19

20 namespace Microsoft.WindowsAzure.Management.Storage.Test.Common

21 {

22 /// <summary>

60 }

61

62 public static string GenerateInvalidShareName_StartsWithDash(int length)

63 {

64 return GenerateShareNameInternal(length, startsWithDash: true);

StrutsURLEncoder.java (https://github.com/spreddy/liferay-portal.git) Java · 223 lines

59 liferayPortletURL.setWindowState(

60 WindowStateFactory.getWindowState(value));

61 }

62 catch (WindowStateException wse) {

98 _setServletMapping(servletMapping);

99 _liferayPortletURL = liferayPortletURL;

100 _windowState = liferayPortletURL.getWindowState();

101 _portletMode = liferayPortletURL.getPortletMode();

102 }

126

127 try {

128 _liferayPortletURL.setWindowState(_windowState);

129 }

130 catch (WindowStateException wse) {

219 private PortletMode _portletMode;

220 private String _servletMapping = StringPool.BLANK;

221 private WindowState _windowState;

222

223 }

MessageContext.java (https://github.com/mbamarante/itsumo.git) Java · 333 lines

22 public class MessageContext implements Serializable, Cloneable, Comparable {

23

24 private static final long serialVersionUID = 1L;

25

26 SortedMap elements;

39 MessageContext mc = new MessageContext();

40 str = str.trim();

41 if (str.startsWith("["))

42 str = str.substring(1);

43 if (str.endsWith("]"))

PermissiveRecordMatcherWithApiExclusion.cs (https://gitlab.com/jslee1/azure-powershell) C# · 150 lines

57 if (ContainsIgnoredProvider(path, out version))

58 {

59 path = RemoveOrReplaceApiVersion(path, version);

60 }

61 else if (_userAgentsToIgnore != null && _userAgentsToIgnore.Any())

135 }

136

137 private string RemoveOrReplaceApiVersion(string requestUri, string version)

138 {

139 if (!string.IsNullOrWhiteSpace(version))

140 {

141 return Regex.Replace(requestUri, @"([\?&])api-version=[^&]+", string.Format("$1api-version={0}", version));

142 }

143 else

Add.java (https://gitlab.com/essere.lab.public/qualitas.class-corpus) Java · 97 lines

87 if (serverMessage.indexOf("cvs commit") != -1 && serverMessage.indexOf("add") != -1 && serverMessage.indexOf("permanently") != -1) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

88 return OK;

89 if (serverMessage.startsWith("scheduling file") && serverMessage.indexOf("for addition") != -1) //$NON-NLS-1$ //$NON-NLS-2$

90 return OK;

91 }

FindVIGRANUMPY_DEPENDENCIES.cmake (https://github.com/hzg1/vigra.git) CMake · 174 lines

6

7 IF(PYTHONINTERP_FOUND)

8 # check that Python version 2.x is used

9 execute_process(COMMAND ${PYTHON_EXECUTABLE} -c

10 "import sys; print (sys.version[0])"

11 OUTPUT_VARIABLE PYTHON_MAJOR_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)

12 IF(${PYTHON_MAJOR_VERSION} EQUAL 2 OR ${PYTHON_MAJOR_VERSION} EQUAL 3)

13 SET(PYTHONINTERP_V2_FOUND 1)

14 ELSE()

39 ELSE()

40 execute_process(COMMAND ${PYTHON_EXECUTABLE} -c

41 "import sys; skip = 2 if sys.platform.startswith('win') else 1; print ('python' + sys.version[0:3:skip])"

42 OUTPUT_VARIABLE PYTHON_LIBRARY_NAME OUTPUT_STRIP_TRAILING_WHITESPACE)

43 FIND_LIBRARY(PYTHON_LIBRARIES ${PYTHON_LIBRARY_NAME} PATHS "${PYTHON_PREFIX}"

144 ######################################################################

145 execute_process(COMMAND ${PYTHON_EXECUTABLE} -c

146 "import sys; p = sys.platform; print ('windows' if p.startswith('win') else p)"

147 OUTPUT_VARIABLE PYTHON_PLATFORM OUTPUT_STRIP_TRAILING_WHITESPACE)

148

AnsiWindowsTerminal.java (https://github.com/gkossakowski/scala-dev.git) Java · 90 lines

2 * Copyright (C) 2009 the original author(s).

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

5 * you may not use this file except in compliance with the License.

6 * You may obtain a copy of the License at

21 import org.fusesource.jansi.AnsiConsole;

22 import org.fusesource.jansi.AnsiOutputStream;

23 import org.fusesource.jansi.WindowsAnsiOutputStream;

24

25 import java.io.ByteArrayOutputStream;

27

28 /**

29 * ANSI-supported {@link WindowsTerminal}.

30 *

31 * @since 2.0

50 private static OutputStream wrapOutputStream(final OutputStream stream) {

51 String os = System.getProperty("os.name");

52 if( os.startsWith("Windows") ) {

53 // On windows we know the console does not interpret ANSI codes..

RemoteSdkCredentialsHolder.java (https://github.com/JetBrains/intellij-community.git) Java · 249 lines

37 */

38 public static String getInterpreterPathFromFullPath(String fullPath) {

39 if (fullPath.startsWith(SSH_PREFIX)) {

40 fullPath = fullPath.substring(SSH_PREFIX.length());

41 int index = fullPath.indexOf(":");

42 if (index != -1 && index < fullPath.length()) {

43 fullPath = fullPath.substring(index + 1); // it is like 8080/home/user or 8080C:\Windows

44 index = 0;

45 while (index < fullPath.length() && Character.isDigit(fullPath.charAt(index))) {

98

99 @Override

100 public boolean isHelpersVersionChecked() {

101 return myRemoteSdkProperties.isHelpersVersionChecked();

103

104 @Override

105 public void setHelpersVersionChecked(boolean helpersVersionChecked) {

106 myRemoteSdkProperties.setHelpersVersionChecked(helpersVersionChecked);

PropertiesUtil.java (https://github.com/kiyoshilee/liferay-portal.git) Java · 273 lines

4 * This library is free software; you can redistribute it and/or modify it under

5 * the terms of the GNU Lesser General Public License as published by the Free

6 * Software Foundation; either version 2.1 of the License, or (at your option)

7 * any later version.

86 String key = enu.nextElement();

87

88 if (key.startsWith(prefix)) {

89 String value = properties.getProperty(key);

90

159 String value = properties.getProperty(key);

160

161 // Trim values because it may leave a trailing \r in certain Windows

162 // environments. This is a known case for loading SQL scripts in SQL

163 // Server.

MacUtils.java (https://gitlab.com/MetadataDev/cpom) Java · 224 lines

12 *

13 * @author ThinkGem

14 * @version 2013-12-21

15 */

16 public class MacUtils {

132 * @return mac地址

133 */

134 public static String getWindowsMACAddress() {

135 String mac = null;

136 BufferedReader bufferedReader = null;

192 String os = getOSName();

193 String mac;

194 if (os.startsWith("windows")) {

195 mac = getWindowsMACAddress();

210 String os = getOSName();

211 System.out.println("os: " + os);

212 if (os.startsWith("windows")) {

213 String mac = getWindowsMACAddress();

GrabKeyDialog.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 598 lines ✨ Summary

This Java code is for a graphical user interface (GUI) application that allows users to define keyboard shortcuts. It provides a dialog box where users can input a shortcut key and its corresponding action, such as opening a file or executing a command. The application checks for conflicts with existing shortcuts and prompts the user to confirm or override them.

8 * This program is free software; you can redistribute it and/or

9 * modify it under the terms of the GNU General Public License

10 * as published by the Free Software Foundation; either version 2

11 * of the License, or any later version.

295 Field field = fields[i];

296 String name = field.getName();

297 if(name.startsWith("VK_")

298 && field.getInt(null) == keyCode)

299 {

351

352 // eg, trying to bind C+n C+p if C+n already bound

353 if(spacedShortcut.startsWith(spacedKbShortcut))

354 return kb;

355

356 // eg, trying to bind C+e if C+e is a prefix

357 if(spacedKbShortcut.startsWith(spacedShortcut))

358 {

359 // create a temporary (synthetic) prefix

GlobFilter.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 175 lines ✨ Summary

This Java code defines a GlobFilter class that filters files based on user-provided settings. It creates a filter for importing files into an editor, allowing users to specify file types and directories to ignore. The filter uses regular expressions to match file names and directory paths, providing case-insensitive matching options.

5 * This program is free software; you can redistribute it and/or

6 * modify it under the terms of the GNU General Public License

7 * as published by the Free Software Foundation; either version 2

8 * of the License, or any later version.

42 *

43 * @author Marcelo Vanzin

44 * @version $Id: GlobFilter.java 6410 2006-06-12 01:53:11Z vanza $

45 * @since PV 2.1.1

46 */

117 while (globs.hasMoreTokens()) {

118 String token = globs.nextToken();

119 if (token.startsWith("!")) {

120 fNeg.append(MiscUtilities.globToRE(token.substring(1)));

121 fNeg.append("|");

open_env.py (https://github.com/titoBouzout/Open-Include.git) Python · 156 lines

19 settings = sublime.load_settings(PluginName + '.sublime-settings')

20 os_specific_settings = {}

21 if sublime.platform() == 'windows':

22 os_specific_settings = sublime.load_settings(PluginName + ' (Windows).sublime-settings')

120 root = os.path.expandvars(root)

121 root = os.path.normpath(root).lower()

122 if file_name.startswith(root):

123 base_name = file_name.replace(root.lower(), "")

124 if base_name[0] == os.sep:

153 return False

154

155 if int(sublime.version()) < 3000:

156 plugin_loaded()

157

_os.py (https://github.com/blacktear23/django.git) Python · 67 lines

8 # characters in it. This isn't necessary on Windows since the

9 # Windows version of abspath handles this correctly. The Windows

10 # abspath also handles drive letters differently than the pure

11 # Python implementation, so it's best not to replace it.

15 def abspathu(path):

16 """

17 Version of os.path.abspath that uses the unicode representation

18 of the current working directory, thus avoiding a UnicodeDecodeError

19 in join when the cwd has non-ASCII characters.

26 """

27 Joins one or more path components to the base path component intelligently.

28 Returns a normalized, absolute version of the final path.

29

30 The final path must be located inside of the base path component (otherwise

32 """

33 # We need to use normcase to ensure we don't false-negative on case

34 # insensitive operating systems (like Windows).

35 base = force_unicode(base)

36 paths = [force_unicode(p) for p in paths]

QuestionCurrLineStartsWithSkipCommentsTest.java (https://gitlab.com/essere.lab.public/qualitas.class-corpus) Java · 189 lines

30 * Open Source Initative Approved is a trademark of the Open Source Initiative.

31 *

32 * This file is part of DrJava. Download the current version of this project

33 * from http://www.drjava.org/ or http://sourceforge.net/projects/drjava/

34 *

41 /** Tests the proper functionality of the class QuestionCurrLineStartsWithSkipComments.

42 * @version $Id: QuestionCurrLineStartsWithSkipCommentsTest.java 5175 2010-01-20 08:46:32Z mgricken $

43 */

44 public final class QuestionCurrLineStartsWithSkipCommentsTest extends IndentRulesTestCase {

69 _setDocText(_text);

70

71 IndentRuleQuestion rule = new QuestionCurrLineStartsWithSkipComments("", null, null);

72

73 // This rule should always apply, unless the entire line is inside a comment.

115 _setDocText(_text);

116

117 _rule = new QuestionCurrLineStartsWithSkipComments("{", null, null);

118

119 assertTrue("At 0 - line doesn't start with an open brace.", !_rule.testApplyRule(_doc, 0, Indenter.IndentReason.OTHER));

StaticStringy.php (https://gitlab.com/techniconline/kmc) PHP · 979 lines

42

43 /**

44 * Returns a camelCase version of the string. Trims surrounding spaces,

45 * capitalizes letters following digits, spaces, dashes and underscores,

46 * and removes spaces, dashes, as well as underscores.

56

57 /**

58 * Returns an UpperCamelCase version of the supplied string. It trims

59 * surrounding spaces, capitalizes letters following digits, spaces, dashes

60 * and underscores, and removes spaces, dashes, underscores.

115

116 /**

117 * Returns a case swapped version of the string.

118 *

119 * @param string $str String to swap case

fck_dialog_common.js (https://github.com/yourhty/hypervm.git) JavaScript · 154 lines

8 * choice:

9 *

10 * - GNU General Public License Version 2 or later (the "GPL")

11 * http://www.gnu.org/licenses/gpl.html

12 *

13 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")

14 * http://www.gnu.org/licenses/lgpl.html

15 *

16 * - Mozilla Public License Version 1.1 or later (the "MPL")

17 * http://www.mozilla.org/MPL/MPL-1.1.html

18 *

AssemblyFileUtils.java (https://github.com/tobrien/maven-plugins.git) Java · 222 lines

6 * distributed with this work for additional information

7 * regarding copyright ownership. The ASF licenses this file

8 * to you under the Apache License, Version 2.0 (the

9 * "License"); you may not use this file except in compliance

10 * with the License. You may obtain a copy of the License at

46 public static final String LINE_ENDING_KEEP = "keep";

47 public static final String LINE_ENDING_DOS = "dos";

48 public static final String LINE_ENDING_WINDOWS = "windows";

49 public static final String LINE_ENDING_UNIX = "unix";

50 public static final String LINE_ENDING_CRLF = "crlf";

75 if ( path.length() > 0 )

76 {

77 if ( path.startsWith( "/" ) || path.startsWith( "\\" ) )

78 {

79 path = path.substring( 1 );

index.js (https://github.com/gitlabhq/gitlabhq.git) JavaScript · 130 lines

78 const gitlabLanguage = languageCode();

79 // The GitLab language may or may not contain a country code,

80 // so we create the short version as well, e.g. de-AT => de

81 const lang = gitlabLanguage.substring(0, 2);

82 const locales = navigator.languages.filter((l) => l.startsWith(lang));

SimpleCPCParser.cs (https://github.com/suhailsherif/MySQL-5.1-.git) C# · 375 lines

3 This program is free software; you can redistribute it and/or modify

4 it under the terms of the GNU General Public License as published by

5 the Free Software Foundation; version 2 of the License.

6

7 This program is distributed in the hope that it will be useful,

17 using System.Collections;

18 using System.IO;

19 using System.Windows.Forms;

20 using NDB_CPC;

21 using NDB_CPC.socketcomm;

93 while(!line.Equals(""))

94 {

95 if(line.StartsWith("status:"))

96 {

97 line=line.Remove(0,7);

__init__.py (https://github.com/oyiptong/django-haystack.git) Python · 190 lines

51 self.css_class = kwargs['css_class']

52

53 self.query_words = set([word.lower() for word in self.query.split() if not word.startswith('-')])

54

55 def highlight(self, text_block):

130

131 # Only replace if we have a bigger (not equal density) so we

132 # give deference to windows earlier in the document.

133 if current_density > highest_density:

134 best_start = start

160

161 # Copy the part from the start of the string to the first match,

162 # and there replace the match with a highlighted version.

163 highlighted_chunk = ""

164 matched_so_far = 0

CodeCompletionListView.cs (https://github.com/Ziaw/npad.git) C# · 293 lines

3 // <license see="prj:///doc/license.txt"/>

4 // <owner name="Mike Krüger" email="mike@icsharpcode.net"/>

5 // <version>$Revision$</version>

6 // </file>

7

8 using System;

9 using System.Drawing;

10 using System.Windows.Forms;

11

12 namespace ICSharpCode.TextEditor.Gui.CompletionWindow

15 /// Description of CodeCompletionListView.

16 /// </summary>

17 public class CodeCompletionListView : System.Windows.Forms.UserControl

18 {

19 ICompletionData[] completionData;

Program.cs (https://gitlab.com/GRIN-Global/GRIN-Global-server) C# · 205 lines

3 using System.Linq;

4 using System.Text;

5 using System.Windows.Forms;

6 using GrinGlobal.Core;

7 using System.Diagnostics;

62 if (program == null){

63

64 if (a.StartsWith("/") || a.StartsWith("-")) {

65 showUsage();

66 return;

114

115 try {

116 if (program.StartsWith(@"""")) {

117 program = program.Substring(1);

118 }

197 private static bool IsVistaOrBetter {

198 get {

199 return Environment.OSVersion.Version.Major >= 6

200 && Environment.OSVersion.Version.Minor >= 0;

PathUtil.java (https://github.com/hferentschik/zanata.git) Java · 183 lines

41 * @param base basePath is calculated from this file

42 * @param separator directory separator. The platform default is not assumed

43 * so that we can test Unix behaviour when running on Windows (for

44 * example)

45 * @return

62 else if (pathSeparator.equals("\\"))

63 {

64 normalizedTargetPath = FilenameUtils.separatorsToWindows(normalizedTargetPath);

65 normalizedBasePath = FilenameUtils.separatorsToWindows(normalizedBasePath);

151 String dirPath = parentDir.getAbsolutePath();

152 String filePath = f.getAbsolutePath();

153 if (!filePath.startsWith(dirPath))

154 {

155 throw new PathResolutionException("can't find relative path from " + parentDir + " to " + f);

163 static class PathResolutionException extends RuntimeException

164 {

165 private static final long serialVersionUID = 1L;

166

167 PathResolutionException(String msg)

powerup_checks.py (https://gitlab.com/edgardo001/Python) Python · 98 lines

3 # Created : 25th June 2013

4 # Last Modified :

5 # Version : 1.0

6

7 # Modifications :

33 -site2 For the Servers located in site2'''

34

35 def windows(): # This is the function to run if it detects the OS is windows.

36 f = open(outputfile, 'a') # Open the logfile

37 for server in open(serverfile,'r'): # Read the list of servers from the list

79 sys.exit(0) # Exit the script after displaying help

80 else:

81 if sys.argv[1].lower().startswith('-site1'): # If the argument is site1

82 query = 'site1' # Set the variable to have the value site

83 elif sys.argv[1].lower().startswith('-site2'): # Else if the variable is bromley

92 elif os.name in ("nt", "dos", "ce"): # If the OS is Windows...

93 windows() # Call the windows function

94

95 print ('\n[+] Check the log file ' + outputfile + ' [+]\n') # Display the name of the log

ReplaceForEachLoopWithIndexedForLoopIntention.java (https://bitbucket.org/nbargnesi/idea.git) Java · 272 lines

2 * Copyright 2003-2012 Dave Griffith, Bas Leijdekkers

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

5 * you may not use this file except in compliance with the License.

6 * You may obtain a copy of the License at

144 return null;

145 }

146 if (name.startsWith("to") && name.length() > 2) {

147 return StringUtil.decapitalize(name.substring(2));

148 }

149 else if (name.startsWith("get") && name.length() > 3) {

150 return StringUtil.decapitalize(name.substring(3));

151 }

deployment.cpp (https://bitbucket.org/ultra_iter/qt-vtl.git) C++ · 293 lines

170

171 #ifndef QT_CETEST_NO_ACTIVESYNC

172 // QtRemote deployment. We always deploy to \Windows

173 if (!project->values("QMAKE_LIBDIR").isEmpty()) {

174 QString remoteLibName = QLatin1String("QtRemote.dll");

188 const QString mkspec = project->values("QMAKESPEC").first();

189 if (mkspec.endsWith("2008"))

190 runtimeVersion.append("90");

191 else

192 runtimeVersion.append("80");

238 if (addPath == QLatin1String("."))

239 addPath.clear();

240 if (!addPath.startsWith("/") && !addPath.startsWith(QLatin1String("\\")))

241 addPath = targetPath + "/" + addPath;

242

Make_Bug_Report.bsh (https://jedit.svn.sourceforge.net/svnroot/jedit) Unknown · 130 lines

9 * This program is free software; you can redistribute it and/or

10 * modify it under the terms of the GNU General Public License

11 * as published by the Free Software Foundation; either version 2

12 * of the License, or any later version.

70 {

71 if(!startupDone &&

72 (line.startsWith(MessagejEditLabel)

73 || line.startsWith(NoticejEditLabel)

74 || line.startsWith(NoticeJarClassLoaderLabel)))

75 {

76 report.append(line).append('\n');

80 }

81 }

82 else if(line.startsWith(ErrorLabel))

83 {

84 if(!insideError)

test_decorators.py (https://gitlab.com/pooja043/Globus_Docker_3) Python · 169 lines

28 'defaults' is an n-tuple of the default values of the last n arguments.

29

30 Modified version of inspect.getargspec from the Python Standard

31 Library."""

32

158 @dec.skip_linux

159 def test_linux():

160 nt.assert_false(sys.platform.startswith('linux'),"This test can't run under linux")

161

162 @dec.skip_win32

163 def test_win32():

164 nt.assert_not_equal(sys.platform,'win32',"This test can't run under windows")

165

166 @dec.skip_osx

WebServicesLocator.cs (https://gitlab.com/GRIN-Global/GRIN-Global-Curator-tool) C# · 221 lines

6 using System.Linq;

7 using System.Text;

8 using System.Windows.Forms;

9

10 namespace GRINGlobal.Client.Common

109 // If we made it past the DownloadData() method the URL must be up and running - so test if it is a GG website...

110 WebServices ws = new WebServices(serverAddress, "", "", "", "");

111 string wsVersion = ws.GetVersion();

112 if (wsVersion.ToLower().StartsWith("gringlobal.web"))

113 {

114 MessageBox.Show("Successfully connected to server running '" + wsVersion + "'");

115 }

116 else

117 {

118 MessageBox.Show("'" + ux_textboxServerName.Text.Trim() + "' is not a valid GRIN-Global server.\n\r\n\r" + "Server response: '" + wsVersion + "'");

119 }

120 }

DiskCryptor.cs (https://github.com/mydlp/mydlp-endpoint-win.git) C# · 269 lines

6 // MyDLP is free software: you can redistribute it and/or modify

7 // it under the terms of the GNU General Public License as published by

8 // the Free Software Foundation, either version 3 of the License, or

9 // (at your option) any later version.

83 return null;

84

85 if (line.Contains("is not compatible with the version of Windows"))

86 return null;

87

107 foreach (string line in lines)

108 {

109 if (line.StartsWith("Cipher:"))

110 return true;

111 }

136 return false;

137

138 if (line.Contains("is not compatible with the version of Windows"))

139 return false;

140 }

TestSGEuseAlternateFontforJALocales.java (https://github.com/Morriar/ProxyJDK.git) Java · 99 lines

4 *

5 * This code is free software; you can redistribute it and/or modify it

6 * under the terms of the GNU General Public License version 2 only, as

7 * published by the Free Software Foundation.

8 *

10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or

11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License

12 * version 2 for more details (a copy is included in the LICENSE file that

13 * accompanied this code).

14 *

15 * You should have received a copy of the GNU General Public License version

16 * 2 along with this work; if not, write to the Free Software Foundation,

17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.

mconfig.py (https://github.com/jleyva/mooconsole.git) Python · 125 lines

10 # Thanks to http://us.pycon.org/media/2010/talkdata/PyCon2010/038/paper.html

11 def platform(self):

12 if sys.platform.startswith('win'):

13 return 'windows'

14 elif sys.platform.startswith('darwin'):

15 return 'mac'

16 return 'linux'

35 if context == ('mac', 'frozen'):

36 DATA = os.path.join(APP_ROOT, 'Contents','Resources') # py2app

37 elif context == ('windows', 'frozen'):

38 self.path_data = os.path.join(os.getcwd(),'data')

39 self.path_user_data = os.path.join(os.getcwd(),'user_data')

65

66 self.release = '2010060101'

67 self.version = '0.9 alpha'

68

69 self.preferences['user_agent'] = 'Mozilla/4.0 (compatible; MSIE 5.5; WindowsNT)'

AnnotationPatternList.java (https://gitlab.com/essere.lab.public/qualitas.class-corpus) Java · 217 lines

19 import org.aspectj.weaver.IntMap;

20 import org.aspectj.weaver.ResolvedType;

21 import org.aspectj.weaver.VersionedDataInputStream;

22 import org.aspectj.weaver.World;

23

152 } else {

153 String annPatt = type.toString();

154 buf.append(annPatt.startsWith("@") ? annPatt.substring(1) : annPatt);

155 }

156 }

184 }

185

186 public static AnnotationPatternList read(VersionedDataInputStream s, ISourceContext context) throws IOException {

187 short len = s.readShort();

188 AnnotationTypePattern[] arguments = new AnnotationTypePattern[len];

Patch.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 395 lines ✨ Summary

This Java code implements a patch editor that applies changes to a text file by applying chunks of text, known as “patches”, to the original file. It supports three types of patches: add (insertion), change (replacement), and delete (removal). The code uses an offset-based system to apply patches to the original file, allowing for precise control over where in the file each patch is applied.

26 * jPatchLib is free software; you can redistribute it and/or modify

27 * it under the terms of the GNU General Public License as published by

28 * the Free Software Foundation; either version 2 of the License, or

29 * (at your option) any later version.

172 log( "--- Chunk Name: " + chunks[ numChunks ].getName() );

173 }

174 else if ( patchSrc[ i ].startsWith( "<" ) ) {

175 String line = "";

176 if ( patchSrc[ i ].length() > 2 )

179 fromBuf.add( line );

180 }

181 else if ( patchSrc[ i ].startsWith( ">" ) ) {

182 String line = "";

183 if ( patchSrc[ i ].length() > 2 )

186 toBuf.add( line );

187 }

188 else if ( patchSrc[ i ].startsWith( "---" ) ) {

189 log( "Got separation line: " + patchSrc[ i ] );

190 }

SMSMMSResultParser.cs (https://bitbucket.org/jrasanen/silverlightzxing.git) C# · 123 lines

2 * Copyright 2008 ZXing authors

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

5 * you may not use this file except in compliance with the License.

6 * You may obtain a copy of the License at

47 }

48 int prefixLength;

49 if (rawText.StartsWith("sms:") || rawText.StartsWith("SMS:") || rawText.StartsWith("mms:") || rawText.StartsWith("MMS:"))

50 {

51 prefixLength = 4;

52 }

53 else if (rawText.StartsWith("smsto:") || rawText.StartsWith("SMSTO:") || rawText.StartsWith("mmsto:") || rawText.StartsWith("MMSTO:"))

54 {

55 prefixLength = 6;

RepositoryComboBox.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 238 lines ✨ Summary

This Java class, RepositoryComboBox, is a custom JComboBox that allows users to select a repository from a dropdown list. It populates the list from jEdit properties and saves changes back to the properties file. The combo box displays friendly names of repositories and allows users to add, remove, and save repository data.

130 RepositoryData rd = entry.getValue();

131 String comp_url = rd.getURL();

132 if (url.equals(comp_url) || url.startsWith(comp_url) || comp_url.startsWith(url)) {

133 super.setSelectedItem(entry.getKey());

134 return;

DscExtensionSettingsSerializerTests.cs (https://gitlab.com/jslee1/azure-powershell) C# · 195 lines

2 //

3 // Copyright Microsoft Corporation

4 // Licensed under the Apache License, Version 2.0 (the "License");

5 // you may not use this file except in compliance with the License.

6 // You may obtain a copy of the License at

19 using System.Management.Automation;

20 using System.Security;

21 using Microsoft.WindowsAzure.Commands.Common.Extensions.DSC;

22 using Microsoft.WindowsAzure.Commands.ServiceManagement.Test;

25 using Newtonsoft.Json.Linq;

26

27 namespace Microsoft.WindowsAzure.Commands.Common.Test.Extensions.DSC

28 {

29 /// <summary>

55 Assert.NotNull(passwordRef);

56

57 Assert.True(passwordRef.StartsWith("PrivateSettingsRef:"));

58 passwordRef = passwordRef.Substring("PrivateSettingsRef:".Length);

59

misc.py (https://gitlab.com/orvi2014/rcs-db-ext) Python · 104 lines

60

61

62 def _hack_unix2win_path_conversion(cmdln_options, option_names):

63 """Hack to convert Unix paths in cmdln options (via config file) to

64 Windows specific netshare location

80 """Given a unix path return the platform-specific path

81

82 On Windows, use the given mapping to translate the path. On Unix platforms,

83 this function essentially returns `unixpath`.

84

85 The mapping is simply a buildout.cfg-friendly multiline string that would

86 get parsed as dictionary which should have path prefixes as keys, and the

87 translated Windows net share path as the values. See PyPM's

88 etc/activestate.conf for an example.

89

IndentingTransformer.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 543 lines ✨ Summary

This Java code is a parser for XML documents, specifically handling the parsing of XML declarations, processing instructions, comments, and text content. It reads an input XML string, tokenizes it into individual elements, and then writes the parsed XML to an output writer. The parser also handles various edge cases such as closing tags, doc types, and processing instructions.

6 * This program is free software; you can redistribute it and/or

7 * modify it under the terms of the GNU General Public License

8 * as published by the Free Software Foundation; either version 2

9 * of the License, or any later version.

190 start = end;

191

192 if ( xml.startsWith( "<!--", start ) ) {

193 end = writeComment( start );

194

195 }

196 else if ( xml.startsWith( "<?", start ) ) {

197 end = writeXmlDeclarationOrProcessingInstruction( start );

198

199 }

200 else if ( xml.startsWith( "<!", start ) ) {

201 if ( xml.startsWith( "<![CDATA[", start ) ) {

CSS2Parser.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 3155 lines ✨ Summary

This Java code is a part of a CSS parser, specifically for parsing CSS rules and at-rules. It defines various methods to match different parts of CSS syntax, such as selectors, properties, values, and media queries. The code uses a finite state machine approach to recognize patterns in the input string and return true if the pattern matches, or false otherwise.

67 Token t = pe.currentToken;

68 if (t != null) {

69 if (t.next != null && t.next.image.startsWith("<%")) {

70 return;

71 }

GrabKeyDialog.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 561 lines ✨ Summary

This Java code creates a dialog for setting and managing keyboard shortcuts. It allows users to input a shortcut, check if it’s already in use, and override existing shortcuts. The dialog also includes features like confirmation prompts and error handling for duplicate or conflicting shortcuts. It appears to be part of a larger application that uses keyboard shortcuts extensively.

8 * This program is free software; you can redistribute it and/or

9 * modify it under the terms of the GNU General Public License

10 * as published by the Free Software Foundation; either version 2

11 * of the License, or any later version.

268 Field field = fields[i];

269 String name = field.getName();

270 if(name.startsWith("VK_")

271 && field.getInt(null) == keyCode)

272 {

321

322 // eg, trying to bind C+n C+p if C+n already bound

323 if (spacedShortcut.startsWith(spacedKbShortcut))

324 return kb;

325

326 // eg, trying to bind C+e if C+e is a prefix

327 if (spacedKbShortcut.startsWith(spacedShortcut))

328 {

329 // create a temporary (synthetic) prefix

CompletionRequest.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 219 lines ✨ Summary

This Java class, CompletionRequest, is part of a CSS editor’s auto-completion feature. It analyzes user input and suggests possible completions based on CSS properties, units, and values. The class uses regular expressions to parse the input text and determine whether it matches certain patterns, allowing it to provide relevant suggestions for completion.

7 * This program is free software; you can redistribute it and/or

8 * modify it under the terms of the GNU General Public License

9 * as published by the Free Software Foundation; either version 2

10 * of the License, or any later version.

121

122 //{{{ findMatchedProperties() method

123 private ArrayList findMatchedProperties(String startsWith) {

124 ArrayList found = new ArrayList();

125 Iterator it = CssSideKickCompletion.getCssProperties().keySet().iterator();

126 while (it.hasNext()) {

127 String n = (String) it.next();

128 if (!startsWith.equals(n) && n.startsWith(startsWith)) {

129 found.add(n);

130 }

140 while (it.hasNext()) {

141 value = (String)it.next();

142 if (value.length() > startsWith.length() && value.startsWith(startsWith)) {

143 completionList.add(value);

144 }

BrowserView.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 743 lines ✨ Summary

This Java code defines a GUI component for displaying and navigating directories, specifically a JList that displays directory paths. It handles keyboard events to navigate up, down, left, right, and enter, as well as special keys like Tab, Backspace, F5, and Ctrl+N. The component is part of a larger application, likely a file manager or editor, and interacts with other components to perform actions like selecting files, deleting directories, and creating new ones.

8 * This program is free software; you can redistribute it and/or

9 * modify it under the terms of the GNU General Public License

10 * as published by the Free Software Foundation; either version 2

11 * of the License, or any later version.

43 * VFS browser tree view.

44 * @author Slava Pestov

45 * @version $Id: BrowserView.java 16560 2009-11-29 19:06:17Z kerik-sf $

46 */

47 class BrowserView extends JPanel

293 // the local filesystem, do a tree scan

294

295 if(!browserDir.startsWith(FavoritesVFS.PROTOCOL)

296 && !browserDir.startsWith(FileRootsVFS.PROTOCOL)

297 && !path.startsWith(symlinkBrowserDir))

298 return;

299

SideKickParser.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 274 lines ✨ Summary

This is a Java class that defines an interface for a text editor’s completion feature. It provides methods for handling backspace, completion, and parsing triggers. The class also includes default implementations for some of its methods, allowing developers to easily create their own custom completion functionality.

9 * This program is free software; you can redistribute it and/or

10 * modify it under the terms of the GNU General Public License

11 * as published by the Free Software Foundation; either version 2

12 * of the License, or any later version.

51 *mode.lisp.sidekick.parser=lisp</pre>

52 *

53 * @version $Id: SideKickParser.java 7616 2006-10-18 11:45:49Z hertzhaft $

54 * @author Slava Pestov

55 */

227 for (int i = 0; i < keywords.length; i++) {

228 String kw = keywords[i];

229 if (kw.startsWith(word) && !kw.equals(word)) {

230 possibles.add(keywords[i]);

231 }

PluginResURLConnection.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 132 lines ✨ Summary

This Java class, PluginResURLConnection, extends URLConnection to handle resource URLs for a jEdit plugin. It extracts the plugin and resource names from the URL, connects to the corresponding resource (either by loading it directly or searching through plugins), and provides methods to retrieve the resource as an input stream or get specific headers.

8 * This program is free software; you can redistribute it and/or

9 * modify it under the terms of the GNU General Public License

10 * as published by the Free Software Foundation; either version 2

11 * of the License, or any later version.

56 }

57

58 if(plugin != null && resource.startsWith("/"))

59 resource = resource.substring(1);

60 }

XMLHttpRequest.cpp (https://bitbucket.org/ultra_iter/qt-vtl.git) C++ · 1131 lines

8 * modify it under the terms of the GNU Lesser General Public

9 * License as published by the Free Software Foundation; either

10 * version 2 of the License, or (at your option) any later version.

11 *

12 * This library is distributed in the hope that it will be useful,

839 bool XMLHttpRequest::isSafeRequestHeader(const String& name) const

840 {

841 return !staticData->m_forbiddenRequestHeaders.contains(name) && !name.startsWith(staticData->m_proxyHeaderPrefix, false)

842 && !name.startsWith(staticData->m_secHeaderPrefix, false);

Locator.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 597 lines ✨ Summary

This Java code provides utility methods for working with Java classes, files, and URLs. It can load Sun compiler tools, find jar files in a location, scan directories for matching files, and more. The code is designed to be used by the Eclipse IDE’s Java Development Tools (JDT) project.

176 JarEntry entry = ( JarEntry ) entries.nextElement();

177 String classname = entry.getName();

178 if ( classname.startsWith( "java/" ) ||

179 classname.startsWith( "javax/" ) ||

180 classname.startsWith( "org/omg/" ) ||

181 classname.startsWith( "org/ietf/" ) ||

182 classname.startsWith( "org/w3c/" ) ||

183 classname.startsWith( "org/xml/" ) ) {

226 for ( Iterator it = runtimeClassNames.iterator(); it.hasNext(); ) {

227 String fullClassName = ( String ) it.next();

228 if ( fullClassName.startsWith( name ) && fullClassName.indexOf( "$" ) < 0 ) {

229 list.add( fullClassName.substring( fullClassName.lastIndexOf( "/" ) + 1 ) );

230 }

XmlParser.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 230 lines ✨ Summary

This Java class, XmlParser, is a base class for parsing XML and HTML documents. It provides auto-completion functionality for closing element tags, attributes, and entities. The parser analyzes the current text position in the document and suggests possible completions based on the context. It also supports customizing the completion behavior through configuration properties.

11 *

12 * "Permission is granted to link this code with software released under

13 * the Apache license version 1.1, for example used by the Xerces XML

14 * parser package."

15 */

146 closingTag = tag.tag;

147

148 if("!--".startsWith(word))

149 allowedCompletions.add(new XmlListCellRenderer.Comment());

150 if(!data.html && "![CDATA[".startsWith(word))

151 allowedCompletions.add(new XmlListCellRenderer.CDATA());

152 if(closingTag != null && ("/" + closingTag).startsWith(word))

153 {

154 if(word.length() == 0 || !jEdit.getBooleanProperty("xml.close-complete"))

Command.java (http://loon-simple.googlecode.com/svn/trunk/) Java · 1004 lines ✨ Summary

This Java code is a part of a scripting engine, responsible for parsing and executing script commands. It processes input strings, splitting them into individual commands, and then executes these commands based on their type (e.g., include, print, etc.). The code also manages various data structures to store scripts, environment variables, and cache.

24 * Copyright 2008 - 2010

25 *

26 * Licensed under the Apache License, Version 2.0 (the "License"); you may not

27 * use this file except in compliance with the License. You may obtain a copy of

28 * the License at

39 * @author chenpeng

40 * @email ceponline@yahoo.com.cn

41 * @version 0.1.2

42 */

43 @SuppressWarnings("unchecked")

44 public class Command extends Conversion implements Serializable, LRelease {

45

46 /**

finddialog.cpp (https://bitbucket.org/ultra_iter/qt-vtl.git) C++ · 154 lines

10 ** GNU Lesser General Public License Usage

11 ** This file may be used under the terms of the GNU Lesser General Public

12 ** License version 2.1 as published by the Free Software Foundation and

13 ** appearing in the file LICENSE.LGPL included in the packaging of this

14 ** file. Please review the following information to ensure the GNU Lesser

15 ** General Public License version 2.1 requirements will be met:

16 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.

17 **

18 ** In addition, as a special exception, Nokia gives you certain additional

19 ** rights. These rights are described in the Nokia Qt LGPL Exception

20 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.

21 **

22 ** GNU General Public License Usage

PluginJAR.java (https://jedit.svn.sourceforge.net/svnroot/jedit) Java · 1485 lines ✨ Summary

This Java code defines a class for storing and managing plugin data, specifically for a text editor application. It provides methods for reading and writing plugin metadata, such as plugin names, URLs, and boolean flags, to and from a file. The data is stored in a binary format using DataInputStream and DataOutputStream classes.

78 * <h3>Dynamic and deferred loading</h3>

79 *

80 * Unlike in prior jEdit versions, jEdit 4.2 and later allow

81 * plugins to be added and removed to the resident set at any time using

82 * the {@link jEdit#addPluginJAR(String)} and

262 String needs = MiscUtilities.buildToVersion(arg);

263 String[] args = { needs,

264 jEdit.getVersion() };

265 jEdit.pluginError(path,

266 "plugin-error.dep-jedit",args);

281

282 String pluginName = arg.substring(0,index2);

283 String needVersion = arg.substring(index2 + 1);

284 String currVersion = jEdit.getProperty("plugin."

299 }

300 else if(MiscUtilities.compareStrings(

301 currVersion,needVersion,false) < 0)

302 {

303 if(!optional)

JdkUtil.java (https://bitbucket.org/nbargnesi/idea.git) Java · 313 lines

2 * Copyright 2000-2012 JetBrains s.r.o.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

5 * you may not use this file except in compliance with the License.

6 * You may obtain a copy of the License at

73 }

74 if (rtJar == null) {

75 String versionString = jdk.getVersionString();

76 if (versionString != null) {

77 final int start = versionString.indexOf("\"");

78 final int end = versionString.lastIndexOf("\"");

79 versionString = start >= 0 && (end > start)? versionString.substring(start + 1, end) : null;

80 }

81 return versionString;