100+ results for 'foreach'

Not the results you expected?

Document.cs (https://gitlab.com/justbediego/Isaap) C# · 596 lines

460 Message = "تصویر مدرک دکترا وارد نشده است"

461 };

462 foreach (var certification in SafetyCertifications)

463 if (certification.CertificationScan_ID == null)

464 return new CompletionStatus()

options-sanitize.php (https://gitlab.com/Blueprint-Marketing/interoccupy.net) PHP · 377 lines

48 $output = '';

49 if ( is_array( $input ) ) {

50 foreach( $option['options'] as $key => $value ) {

51 $output[$key] = "0";

52 }

53 foreach( $input as $key => $value ) {

54 if ( array_key_exists( $key, $option['options'] ) && $value ) {

55 $output[$key] = "1";

DefaultCasSslContext.java (https://github.com/frett/cas.git) Java · 232 lines

156 public String[] getClientAliases(final String keyType, final Principal[] issuers) {

157 val aliases = new ArrayList<String>();

158 this.keyManagers.forEach(keyManager -> aliases.addAll(CollectionUtils.wrapList(keyManager.getClientAliases(keyType, issuers))));

159 return aliases.toArray(new String[]{});

160 }

163 public String[] getServerAliases(final String keyType, final Principal[] issuers) {

164 val aliases = new ArrayList<String>();

165 this.keyManagers.forEach(keyManager -> aliases.addAll(CollectionUtils.wrapList(keyManager.getServerAliases(keyType, issuers))));

166 return aliases.toArray(new String[]{});

167 }

226 public X509Certificate[] getAcceptedIssuers() {

227 val certificates = new ArrayList<X509Certificate>();

228 this.trustManagers.forEach(trustManager -> certificates.addAll(CollectionUtils.wrapList(trustManager.getAcceptedIssuers())));

229 return certificates.toArray(new X509Certificate[0]);

230 }

Rscf.php (https://github.com/sharpmachine/wakeupmedia.com.git) PHP · 359 lines

155 }

156

157 foreach ($files as $local_path => $remote_path) {

158 if (!file_exists($local_path)) {

159 $results[] = $this->_get_result($local_path, $remote_path, W3TC_CDN_RESULT_ERROR, 'Source file not found.');

217 }

218

219 foreach ($files as $local_path => $remote_path) {

220 try {

221 $this->_container->delete_object($remote_path);

mutations.js (https://gitlab.com/artofhuman/gitlab-ce) JavaScript · 264 lines

111 // To support legacy notes, should be very rare case.

112 if (discussion.individual_note && discussion.notes.length > 1) {

113 discussion.notes.forEach(n => {

114 acc.push({

115 ...discussion,

Column.php (https://gitlab.com/ptisky/API_prestashop) PHP · 394 lines

370 public function __clone() {

371 $vars = get_object_vars($this);

372 foreach ($vars as $key => $value) {

373 if (is_object($value)) {

374 if ($key == '_parent') {

381 // The columns array of PHPExcel_Worksheet_AutoFilter objects

382 $this->$key = array();

383 foreach ($value as $k => $v) {

384 $this->$key[$k] = clone $v;

385 // attach the new cloned Rule to this new cloned Autofilter Cloned object

HttpStatusLineParserTests.cs (https://bitbucket.org/mdavid/aspnetwebstack.git) C# · 285 lines

135 public void StatusLineParserAcceptsStandardStatusCodes()

136 {

137 foreach (HttpStatusCode status in HttpUnitTestDataSets.AllHttpStatusCodes)

138 {

139 byte[] data = CreateBuffer("HTTP/1.1", ((int)status).ToString(), "Reason");

159 public void StatusLineParserAcceptsCustomStatusCodes()

160 {

161 foreach (HttpStatusCode status in HttpUnitTestDataSets.CustomHttpStatusCodes)

162 {

163 byte[] data = CreateBuffer("HTTP/1.1", ((int)status).ToString(), "Reason");

183 public void StatusLineParserRejectsInvalidStatusCodes()

184 {

185 foreach (string invalidStatus in ParserData.InvalidStatusCodes)

186 {

187 byte[] data = CreateBuffer("HTTP/1.1", invalidStatus, "Reason");

ProteinDataBankFile.cs (https://github.com/AnthonyNystrom/NuGenBioChem.git) C# · 241 lines

100 void Parse(IEnumerable<string> pdbLines)

101 {

102 foreach (string pdbLine in pdbLines)

103 {

104 if (pdbLine.StartsWith("REMARK"))

TableEntity.php (https://github.com/ftaiolivista/Zend-Framework-Namespaced-.git) PHP · 333 lines

184 // Loop accessors and retrieve values

185 $returnValue = array();

186 foreach ($accessors as $accessor) {

187 if ($accessor->EntityType == 'ReflectionProperty') {

188 $property = $accessor->EntityAccessor;

220 // Loop accessors and set values

221 $returnValue = array();

222 foreach ($accessors as $accessor) {

223 if (isset($values[$accessor->AzurePropertyName])) {

224 // Cast to correct type

272 // Loop all properties

273 $properties = $type->getProperties();

274 foreach ($properties as $property) {

275 $accessor = self::getAzureAccessor($property);

276 if ($accessor !== null) {

Source.php (https://bitbucket.org/cesarmedrano/cesarmedrano.git) PHP · 629 lines

526 if (!is_null($this->attributes)) {

527 if (is_array($this->attributes)) {

528 foreach ($this->attributes as $attributeName => $attributeValue) {

529 $xmlWriter->writeAttribute($attributeName, $attributeValue);

530 }

FilesystemBookmarkFunction.cs (https://bitbucket.org/henderea/popupmultibox.git) C# · 318 lines

55 return null;

56 List<ResultItem> ritms = new List<ResultItem>(0);

57 foreach (BookmarkItem itm in itms)

58 {

59 try

268 {

269 string name2 = name.ToLower();

270 foreach (BookmarkItem itm in items)

271 {

272 if (itm.Name.ToLower().Equals(name2))

305 string[] lines = Filesystem.FileReadAllLines(Filesystem.UserProfile + "\\Popup Multibox\\bookmarks.txt");

306 items.Clear();

307 foreach (string line in lines)

308 {

309 BookmarkItem tmp = BookmarkItem.FromFileString(line);

frm_time_and_agent.blade.php (https://gitlab.com/pedramkousari/soratjalase) PHP · 302 lines

29 <select name="data[xfrm_data_chief]" class="form-control" required>

30 <option value="">{{'انتخاب کنید'}}</option>

31 @foreach(@$userPartner as $key => $value)

32 <option value="{{ $value }}">{{ $value }}</option>

33 @endforeach

77 <select name="data[xfrm_data_supervisor_first]" required class="form-control">

78 <option value="">{{'انتخاب کنید'}}</option>

79 @foreach(@$userPartner as $key => $value)

80 <option value="{{ $value }}">{{ $value }}</option>

81 @endforeach

125 <select name="data[xfrm_data_supervisor_second]" required class="form-control">

126 <option value="">{{'انتخاب کنید'}}</option>

127 @foreach(@$userPartner as $key => $value)

128 <option value="{{ $value }}">{{ $value }}</option>

129 @endforeach

StringyTest.php (https://gitlab.com/Pasantias/pasantiasASLG) PHP · 994 lines

82

83 $valResult = array();

84 foreach ($stringy as $char) {

85 $valResult[] = $char;

86 }

87

88 $keyValResult = array();

89 foreach ($stringy as $pos => $char) {

90 $keyValResult[$pos] = $char;

91 }

179 $result = S::create($str, $encoding)->chars();

180 $this->assertInternalType('array', $result);

181 foreach ($result as $char) {

182 $this->assertInternalType('string', $char);

183 }

DbTable.php (https://github.com/frhumanes/PLM.git) PHP · 220 lines

164

165 $tableResources = array();

166 foreach ($db->listTables() as $actualTableName) {

167

168 $dbTableName = $this->_convertTableNameToClassName($actualTableName);

190 if ($this->_registry->getRequest()->isPretend()) {

191

192 foreach ($tableResources as $tableResource) {

193 $this->_registry->getResponse()->appendContent('Would create a DbTable at ' . $tableResource->getContext()->getPath());

194 }

196 } else {

197

198 foreach ($tableResources as $tableResource) {

199 $this->_registry->getResponse()->appendContent('Creating a DbTable at ' . $tableResource->getContext()->getPath());

200 $tableResource->create();

NonReflectiveBinderFixture.cs (https://github.com/whut/nhibernate-core.git) C# · 198 lines

50 Assert.That(values[2], Is.EqualTo("Foo.BogusVisitor"));

51

52 foreach (var element in cm.PropertyIterator)

53 {

54 var ma = element.MetaAttributes;

Date.js (https://github.com/johnjbarton/JavaScriptLibraries.git) JavaScript · 174 lines

16 var partLocaleList = ["th"];

17

18 dojo.forEach(partLocaleList, function(locale){

19 dojo.requireLocalization("dojo.cldr", "greg", locale);

20 dojo.requireLocalization("dojo.cldr", "buddhist", locale);

test.js (https://gitlab.com/nVySin/Mo_Grabber) JavaScript · 389 lines

24 ];

25

26 methods.forEach(function (method) {

27 expect(logger).to.have.property(method);

28 });

Absence.php (https://github.com/westernmagic/schades.git) PHP · 327 lines

283 if( $week !== NULL ) {

284 $temp = array() ;

285 foreach( $abs as $absence ) {

286 if( $absence->getDate()->getWeek() == $week ) {

287 $temp[ $absence->getDate()->getDay() * 12 + $absence->getLesson() ] = $absence ;

294 if( $day !== NULL ) {

295 $temp = array() ;

296 foreach( $abs as $absence ) {

297 if( $absence->getDate()->getDay() == $day ) {

298 $temp[ $absence->getLesson() ] = $absence ;

316 public static function abs_type( $abs ) {

317 $result = array() ;

318 foreach( $abs as $key => $value ) {

319 $result[ $key ] = $value->getType() ;

320 }

ValueProviderDictionary.cs (https://github.com/iainlane/mono.git) C# · 208 lines

132 if (form != null) {

133 string[] keys = form.AllKeys;

134 foreach (string key in keys) {

135 string[] rawValue = form.GetValues(key);

136 string attemptedValue = form[key];

142 RouteValueDictionary routeValues = ControllerContext.RouteData.Values;

143 if (routeValues != null) {

144 foreach (var kvp in routeValues) {

145 string key = kvp.Key;

146 object rawValue = kvp.Value;

154 if (queryString != null) {

155 string[] keys = queryString.AllKeys;

156 foreach (string key in keys) {

157 string[] rawValue = queryString.GetValues(key);

158 string attemptedValue = queryString[key];

controller.radar.tests.js (https://gitlab.com/mnomansheikh/ampuz) JavaScript · 465 lines

143 { x: 256, y: 272, cppx: 256, cppy: 272, cpnx: 256, cpny: 272},

144 { x: 256, y: 272, cppx: 256, cppy: 272, cpnx: 256, cpny: 272},

145 ].forEach(function(expected, i) {

146 expect(meta.data[i]._model.x).toBeCloseToPixel(expected.x);

147 expect(meta.data[i]._model.y).toBeCloseToPixel(expected.y);

170 { x: 256, y: 272, cppx: 276.9, cppy: 272, cpnx: 250.4, cpny: 272 },

171 { x: 200, y: 272, cppx: 200, cppy: 275, cpnx: 200, cpny: 261 },

172 ].forEach(function(expected, i) {

173 expect(meta.data[i]._model.x).toBeCloseToPixel(expected.x);

174 expect(meta.data[i]._model.y).toBeCloseToPixel(expected.y);

231 { x: 256, y: 272 },

232 { x: 200, y: 272 },

233 ].forEach(function(expected, i) {

234 expect(meta.data[i]._model.x).toBeCloseToPixel(expected.x);

235 expect(meta.data[i]._model.y).toBeCloseToPixel(expected.y);

SessionManager.js (https://github.com/Yaco-Sistemas/etherpad-lite.git) JavaScript · 397 lines

360 }

361

362 //foreach trough the sessions and get the sessioninfos

363 async.forEach(sessionIDs, function(sessionID, callback)

MembershipStatus.php (https://github.com/michaelmcandrew/vaw.git) PHP · 258 lines

113 $properties = array_keys($membershipStatusBAO->fields());

114

115 foreach ($properties as $name) {

116 if (array_key_exists($name, $params)) {

117 $membershipStatusBAO->$name = $params[$name];

169 if ($membershipStatusBAO->find(true)) {

170 $fields = $membershipStatusBAO->fields( );

171 foreach ( $fields as $name => $field) {

172 if (array_key_exists($name, $params)) {

173 $membershipStatusBAO->$name = $params[$name];

db.c (https://gitlab.com/wushin/evol-server-code-old) C · 627 lines

530 }

531

532 void db_foreach (struct dbt *table, int (*func) (void *, void *, va_list),

533 ...)

534 {

cat_supplier_update.php (https://gitlab.com/ptisky/API_prestashop) PHP · 449 lines

41 case 'fields':

42 $field=Tools::getValue('field','');

43 foreach($ids as $id)

44 {

45 if(isset($value))

125 $value = 0;

126

127 foreach($ids as $id)

128 {

129 $product = new Product((int)$id, false, (int)$id_lang, (int)SCI::getSelectedShop());

211 if(!empty($combinations))

212 {

213 foreach($combinations as $combination)

214 {

215 $id_product = $id;

UnitTestingWindow.cs (https://bitbucket.org/createdbyx/codefarts.unitytesting.git) C# · 260 lines

143 var setValues = new Action<bool>(value =>

144 {

145 foreach (var model in this.testModels)

146 {

147 foreach (var item in model.Value)

157 if (GUILayout.Button(local.Get("Expand")))

158 {

159 foreach (var item in this.testModels)

160 {

161 item.Key.Expanded = true;

165 if (GUILayout.Button(local.Get("Collapse")))

166 {

167 foreach (var item in this.testModels)

168 {

169 item.Key.Expanded = false;

CoalesceTests.java (https://github.com/mbastian/datafu.git) Java · 513 lines

24 data = LOAD 'input' using PigStorage(',') AS (testcase:INT,val1:INT,val2:INT,val3:INT);

25

26 data2 = FOREACH data GENERATE testcase, COALESCE(val1,val2,val3) as result;

27

28 describe data2;

29

30 data3 = FOREACH data2 GENERATE testcase, result;

31

32 STORE data3 INTO 'output';

80 data = LOAD 'input' using PigStorage(',') AS (testcase:INT,val1:LONG);

81

82 data2 = FOREACH data GENERATE testcase, COALESCE(val1,100L) as result;

83

84 describe data2;

Capabilities.php (https://github.com/zucchi/zf2.git) PHP · 547 lines

172 $this->baseCapabilities = $baseCapabilities;

173

174 foreach ($capabilities as $name => $value) {

175 $this->setCapability($marker, $name, $value);

176 }

228

229 // check/normalize datatype values

230 foreach ($datatypes as $type => &$toType) {

231 if (!in_array($type, $allTypes)) {

232 throw new Exception\InvalidArgumentException("Unknown datatype '{$type}'");

245 // add missing datatypes as not supported

246 $missingTypes = array_diff($allTypes, array_keys($datatypes));

247 foreach ($missingTypes as $type) {

248 $datatypes[$type] = false;

249 }

array.js.uncompressed.js (https://gitlab.com/alidz1982/cdnjs) JavaScript · 344 lines

38 // returns: Number

39 };

40 dojo.forEach = function(arr, callback, thisObject){

41 // summary:

42 // for every item in arr, callback is invoked. Return values are ignored.

43 // If you want to break out of the loop, consider using dojo.every() or dojo.some().

44 // forEach does not allow breaking out of the loop over the items in arr.

45 // arr:

46 // the array to iterate over. If a string, operates on individual characters.

332 indexOf: index(true),

333 lastIndexOf: index(false),

334 forEach: forEach,

335 map: map,

336 filter: filter,

MultiGetProfiling.cs (https://github.com/Titaye/ravendb.git) C# · 266 lines

42 var responses = JsonConvert.DeserializeObject<GetResponse[]>(profilingInformation.Requests[0].Result);

43 Assert.Equal(3, responses.Length);

44 foreach (var response in responses)

45 {

46 Assert.Equal(404, response.Status);

Cleaner.php (https://gitlab.com/crazybutterfly815/magento2) PHP · 245 lines

132 } else {

133 if (array_key_exists('aggregations', $this->requestData) && is_array($this->requestData['aggregations'])) {

134 foreach ($this->requestData['aggregations'] as $aggregationName => $aggregationValue) {

135 switch ($aggregationValue['type']) {

136 case 'dynamicBucket':

175 case FilterInterface::TYPE_RANGE:

176 $keys = ['from', 'to'];

177 foreach ($keys as $key) {

178 if (isset($filter[$key]) && preg_match('/^\$(.+)\$$/si', $filter[$key])) {

179 unset($this->requestData['filters'][$filterName][$key]);

206 private function processQueryReference($queryReference)

207 {

208 foreach ($queryReference as $key => $value) {

209 $this->cleanQuery($value['ref']);

210 if (!isset($this->requestData['queries'][$value['ref']])) {

test.js (https://bitbucket.org/cladiomartins/mondleitor.git) JavaScript · 406 lines

43 , ["1.2.3-5-foo", "1.2.3-5-Foo"]

44 , ["3.0.0", "2.7.2+"]

45 ].forEach(function (v) {

46 var v0 = v[0]

47 , v1 = v[1]

94 , ["1.2.3beta", " v 1.2.3beta"]

95 , ["1.2.3beta", " = 1.2.3beta"]

96 ].forEach(function (v) {

97 var v0 = v[0]

98 , v1 = v[1]

178 , [">=0.7.x", "0.7.0-asdf"]

179 , ["<=0.7.x", "0.6.2"]

180 ].forEach(function (v) {

181 t.ok(satisfies(v[1], v[0]), v[0]+" satisfied by "+v[1])

182 })

no-duplicate-imports.js (https://gitlab.com/nguyenthehiep3232/marius) JavaScript · 290 lines

174 }

175 }

176 messagesIds.forEach(messageId =>

177 context.report({

178 node,

class-wp-block-type.php (https://gitlab.com/campus-academy/krowkaramel) PHP · 373 lines

295 }

296

297 foreach ( $attributes as $attribute_name => $value ) {

298 // If the attribute is not defined by the block type, it cannot be

299 // validated.

317 // defines a default.

318 $missing_schema_attributes = array_diff_key( $this->attributes, $attributes );

319 foreach ( $missing_schema_attributes as $attribute_name => $schema ) {

320 if ( isset( $schema['default'] ) ) {

321 $attributes[ $attribute_name ] = $schema['default'];

354 $args = apply_filters( 'register_block_type_args', $args, $this->name );

355

356 foreach ( $args as $property_name => $property_value ) {

357 $this->$property_name = $property_value;

358 }

TwoTestClassesInDifferentNamespacesTestFixture.cs (https://github.com/eusebiu/SharpDevelop.git) C# · 282 lines

140

141 ExtTreeNode newTestClassNode = null;

142 foreach (ExtTreeNode node in testsNamespaceNode.Nodes) {

143 if (node.Text == "MyNewTestFixture") {

144 newTestClassNode = node;

182

183 ExtTreeNode testClassNode = null;

184 foreach (ExtTreeNode node in testsNamespaceNode.Nodes) {

185 if (node.Text == "MyTestFixture") {

186 testClassNode = node;

217

218 ExtTreeNode testClassNode = null;

219 foreach (ExtTreeNode node in testsNamespaceNode.Nodes) {

220 if (node.Text == "MyTestFixture") {

221 testClassNode = node;

Client.php (https://github.com/mhoofman/wordpress-heroku.git) PHP · 297 lines

224 $commandRequests = new \SplObjectStorage();

225

226 foreach ($commands as $command) {

227 $request = $this->prepareCommand($command);

228 $commandRequests[$request] = $command;

232 try {

233 $this->send($requests);

234 foreach ($commands as $command) {

235 $this->dispatch('command.after_send', array('command' => $command));

236 }

241

242 // Remove failed requests from the successful requests array and add to the failures array

243 foreach ($failureException->getFailedRequests() as $request) {

244 if (isset($commandRequests[$request])) {

245 $e->addFailedCommand($commandRequests[$request]);

SIP_t_AcceptRange.cs (https://github.com/prasad83/inbox2_desktop.git) C# · 232 lines

135 StringBuilder retVal = new StringBuilder();

136 retVal.Append(m_MediaType);

137 foreach(SIP_Parameter parameter in m_pMediaParameters){

138 if(parameter.Value != null){

139 retVal.Append(";" + parameter.Name + "=" + parameter.Value);

143 }

144 }

145 foreach(SIP_Parameter parameter in m_pParameters){

146 if(parameter.Value != null){

147 retVal.Append(";" + parameter.Name + "=" + parameter.Value);

pane.php (https://github.com/andreatarr/joomla-platform.git) PHP · 417 lines

236 $opt['onBackground'] = (isset($params['onBackground'])) ? $params['onBackground'] : null;

237 $opt['display'] = (isset($params['startOffset'])) ? (int) $params['startOffset'] : null;

238 foreach ($opt as $k => $v)

239 {

240 if ($v)

397 $opt['opacity'] = (isset($params['opacityTransition']) && ($params['opacityTransition'])) ? 'true' : 'false';

398 $opt['alwaysHide'] = (isset($params['allowAllClose']) && (!$params['allowAllClose'])) ? 'false' : 'true';

399 foreach ($opt as $k => $v)

400 {

401 if ($v)

filecache.php (https://github.com/rynodivino/system.git) PHP · 332 lines

74 $valid = true;

75 $now = time();

76 foreach ( $this->cache_files[$ghash] as $hash => $record ) {

77 if ( ! file_exists( $record['file'] ) || $record['expires'] <= $now ) {

78 $valid = false;

100 $this->cache_data[$group] = array();

101 if ( isset( $this->cache_files[$ghash] ) ) {

102 foreach ( $this->cache_files[$ghash] as $hash => $record ) {

103 $this->cache_data[$group][$record['name']] = unserialize(

104 file_get_contents( $record['file'] )

197

198 $ghash = $this->get_group_hash( $group );

199 foreach ( $keys as $key ) {

200 Plugins::act( 'cache_expire_before', $name, $group );

201

category.php (https://github.com/smadi/arabian-land.git) PHP · 195 lines

10 }

11

12 foreach ($data['category_description'] as $language_id => $value) {

13 $this->db->query("INSERT INTO " . DB_PREFIX . "category_description SET category_id = '" . (int)$category_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', description = '" . $this->db->escape($value['description']) . "'");

14 }

15

16 if (isset($data['category_store'])) {

17 foreach ($data['category_store'] as $store_id) {

18 $this->db->query("INSERT INTO " . DB_PREFIX . "category_to_store SET category_id = '" . (int)$category_id . "', store_id = '" . (int)$store_id . "'");

19 }

21

22 if (isset($data['category_layout'])) {

23 foreach ($data['category_layout'] as $store_id => $layout) {

24 if ($layout['layout_id']) {

25 $this->db->query("INSERT INTO " . DB_PREFIX . "category_to_layout SET category_id = '" . (int)$category_id . "', store_id = '" . (int)$store_id . "', layout_id = '" . (int)$layout['layout_id'] . "'");

FunctionCommentThrowTagSniff.php (https://bitbucket.org/lordgnu/php_codesniffer.git) PHP · 215 lines

174 $throwTags = array();

175 $lineNumber = array();

176 foreach ($throws as $throw) {

177 $throwTags[] = $throw->getValue();

178 $lineNumber[$throw->getValue()] = $throw->getLine();

195 } else {

196 // Exception type in @throws tag must be thrown in the function.

197 foreach ($throwTags as $i => $throwTag) {

198 $errorPos = ($commentStart + $lineNumber[$throwTag]);

199 if (empty($throwTag) === false && $throwTag !== $throwTokens[$i]) {

RavenDB-5256.cs (https://github.com/fitzchak/ravendb.git) C# · 376 lines

112 //using (var session = documentStore.OpenSession())

113 //{

114 // foreach (var user in users)

115 // {

116 // session.Store(user);

117 // }

118 // foreach (var userRole in userRoles)

119 // {

120 // session.Store(userRole);

132 // var userRolesFromDb = session.Load<UserRole>(roleIds.Cast<ValueType>());

133

134 // foreach (var key in keys)

135 // {

136 // Assert.True(session.Advanced.IsLoaded(key));

EnumerableDoublesTest.java (https://github.com/danielbodart/enumerable.git) Java · 294 lines

20

21 @Test

22 public void callsBlockOnceForEachElement() throws Exception {

23 List<Double> actual = list();

24 each(doublesOneToFive, λ(d, actual.add(d)));

34

35 @Test

36 public void callsBlockOnceForEachElementWithDoubleReturn() throws Exception {

37 double result = 1;

38 each(doublesOneToFive, λ(d, result *= 3.14 * d));

BezierCurve.cs (https://github.com/White-Wolf/Minesharp.git) C# · 262 lines

207 int i = 0;

208

209 foreach (Vector2 pt in points)

210 {

211 temp = (float)Functions.BinomialCoefficient(points.Count - 1, i) * (float)(System.Math.Pow(t, i) *

243 int i = 0;

244

245 foreach (Vector2 pt in points)

246 {

247 temp = (float)Functions.BinomialCoefficient(points.Count - 2, i) * (float)(System.Math.Pow(t, i) *

GISMultilinestring.php (https://gitlab.com/luyxtran264/myproject) PHP · 441 lines

68 $linestirngs = explode("),(", $multilinestirng);

69

70 foreach ($linestirngs as $linestring) {

71 $min_max = $this->setMinMax($linestring, $min_max);

72 }

112

113 $first_line = true;

114 foreach ($linestirngs as $linestring) {

115 $points_arr = $this->extractPoints($linestring, $scale_data);

116 foreach ($points_arr as $point) {

179

180 $first_line = true;

181 foreach ($linestirngs as $linestring) {

182 $points_arr = $this->extractPoints($linestring, $scale_data);

183 foreach ($points_arr as $point) {

sfWidgetFormDateTest.php (https://github.com/aarontrett/AegisBorn.git) PHP · 142 lines

21 $t->diag('->render()');

22

23 foreach (array(

24 '2005-10-15' => array('year' => 2005, 'month' => 10, 'day' => 15),

25 time() => array('year' => date('Y'), 'month' => date('m'), 'day' => date('d')),

ltablib.cs (https://github.com/cadahl/kopilua.git) C# · 298 lines

17 private static int aux_getn(lua_State L, int n) {luaL_checktype(L, n, LUA_TTABLE); return luaL_getn(L, n);}

18

19 private static int foreachi (lua_State L) {

20 int i;

21 int n = aux_getn(L, 1);

34

35

36 private static int _foreach (lua_State L) {

37 luaL_checktype(L, 1, LUA_TTABLE);

38 luaL_checktype(L, 2, LUA_TFUNCTION);

278 private readonly static luaL_Reg[] tab_funcs = {

279 new luaL_Reg("concat", tconcat),

280 new luaL_Reg("foreach", _foreach),

281 new luaL_Reg("foreachi", foreachi),

paysystem.php (https://gitlab.com/alexprowars/bitrix) PHP · 297 lines

95

96 // first - those which have descriptions OR payment system has price

97 foreach($arResult["PAY_SYSTEM"] as $arPaySystem)

98 {

99 if (strlen(trim(str_replace("<br />", "", $arPaySystem["DESCRIPTION"]))) > 0 || intval($arPaySystem["PRICE"]) > 0)

200

201 // payment system without descriptions OR payment_forward_calc

202 foreach($arResult["PAY_SYSTEM"] as $arPaySystem)

203 {

204 if (strlen(trim(str_replace("<br />", "", $arPaySystem["DESCRIPTION"]))) == 0 && intval($arPaySystem["PRICE"]) == 0)

Cohort.php (https://github.com/FriedWishes/users.git) PHP · 362 lines

306 $cohort_titles = array();

307

308 foreach (UserConfig::$authentication_modules as $module) {

309 $cohort_titles[$module->getID()] = $module->getTitle();

310 }

defaults.bb-schema.php (https://github.com/jazbek/nycga2.git) PHP · 235 lines

149

150 // Set the charset and collation on each table

151 foreach ($bb_queries as $_table_name => $_sql) {

152 // Skip SQL that isn't creating a table

153 if (!preg_match('@^\s*CREATE\s+TABLE\s+@im', $_sql)) {

Instance.php (https://github.com/jtai/zf2.git) PHP · 333 lines

107 }

108

109 foreach ($this->attributeRequired as $key) {

110 if (empty($data[$key])) {

111 throw new Exception\InvalidArgumentException(sprintf(

ArrayScript.cs (https://gitlab.com/smurmann/KDUProjects) C# · 322 lines

154 openList.Add(start);

155

156 foreach (Node i in nodeArray)

157 {

158 i.previousNode = null;

172 // Debug.Log("OpenList Count: " + openList.Count);

173 Node tempNode = null;

174 foreach (Node lowest in openList)

175 {

176 if(method == SearchMethod.Dijkstra)

232 tempNode.neighbourNodes.Add(nodeArray[tempNode.X, tempNode.Y + 1]);

233

234 foreach (Node v in tempNode.neighbourNodes)

235 {

236 if (unvisitedNodes.IndexOf(v) > -1 && v.currentState != NodeScript.TileState.Obstacle)

bp-core-taxonomy.php (https://github.com/livinglab/openlab.git) PHP · 502 lines

56 $taxonomies = bp_get_default_taxonomies();

57

58 foreach ( $taxonomies as $taxonomy_name => $taxonomy_params ) {

59 if ( ! isset( $taxonomy_params['object'] ) || ! isset( $taxonomy_params['args'] ) ) {

60 continue;

153 // Different taxonomies must be stored on different sites.

154 $taxonomy_site_map = array();

155 foreach ( (array) $taxonomies as $taxonomy ) {

156 $taxonomy_site_id = bp_get_taxonomy_term_site_id( $taxonomy );

157 $taxonomy_site_map[ $taxonomy_site_id ][] = $taxonomy;

159

160 $retval = array();

161 foreach ( $taxonomy_site_map as $taxonomy_site_id => $site_taxonomies ) {

162 $switched = false;

163 if ( $taxonomy_site_id !== get_current_blog_id() ) {

AbstractTest.php (https://gitlab.com/rsilveira1987/Expresso) PHP · 224 lines

218 protected function _deleteDummyUsers()

219 {

220 foreach ($this->_objects as $object) {

221 $this->_uit->deleteUser($object->getId());

222 }

FlashMessenger.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 313 lines

81 if (!self::$_session instanceof Zend_Session_Namespace) {

82 self::$_session = new Zend_Session_Namespace($this->getName());

83 foreach (self::$_session as $namespace => $messages) {

84 self::$_messages[$namespace] = $messages;

85 unset(self::$_session->{$namespace});

shipping.html (https://gitlab.com/yousafsyed/easternglamor) HTML · 161 lines

12

13 <!-- ko if: (!quoteIsVirtual) -->

14 <!-- ko foreach: getRegion('customer-email') -->

15 <!-- ko template: getTemplate() --><!-- /ko -->

16 <!--/ko-->

17 <!--/ko-->

18

19 <!-- ko foreach: getRegion('address-list') -->

20 <!-- ko template: getTemplate() --><!-- /ko -->

21 <!--/ko-->

22

23 <!-- ko foreach: getRegion('address-list-additional-addresses') -->

24 <!-- ko template: getTemplate() --><!-- /ko -->

25 <!--/ko-->

FastPriorityQueue.php (https://gitlab.com/reasonat/test8) PHP · 343 lines

250 {

251 $array = [];

252 foreach (clone $this as $item) {

253 $array[] = $item;

254 }

267

268 $data = [];

269 foreach ($clone as $item) {

270 $data[] = $item;

271 }

282 public function unserialize($data)

283 {

284 foreach (unserialize($data) as $item) {

285 $this->insert($item['data'], $item['priority']);

286 }

ReflectionCache.cs (https://bitbucket.org/mdavid/dlr.git) C# · 203 lines

192 public override int GetHashCode() {

193 int res = 6551;

194 foreach (MemberInfo mi in _members) {

195 res ^= res << 5 ^ mi.DeclaringType.GetHashCode() ^ mi.MetadataToken;

196 }

Comprehension.cs (https://bitbucket.org/mdavid/dlr.git) C# · 256 lines

123 }

124 if (_iterators != null) {

125 foreach (ComprehensionIterator ci in _iterators) {

126 ci.Walk(walker);

127 }

180 }

181 if (_iterators != null) {

182 foreach (ComprehensionIterator ci in _iterators) {

183 ci.Walk(walker);

184 }

246 }

247 if (_iterators != null) {

248 foreach (ComprehensionIterator ci in _iterators) {

249 ci.Walk(walker);

250 }

array.js.uncompressed.js (https://gitlab.com/Mirros/cdnjs) JavaScript · 343 lines

174 =====*/

175

176 forEach: function(arr, callback, thisObject){

177 // summary:

178 // for every item in arr, callback is invoked. Return values are ignored.

179 // If you want to break out of the loop, consider using array.every() or array.some().

180 // forEach does not allow breaking out of the loop over the items in arr.

181 // arr:

182 // the array to iterate over. If a string, operates on individual characters.

186 // may be used to scope the call to callback

187 // description:

188 // This function corresponds to the JavaScript 1.6 Array.forEach() method, with one difference: when

189 // run over sparse arrays, this implementation passes the "holes" in the sparse array to

190 // the callback function with a value of undefined. JavaScript 1.6's forEach skips the holes in the sparse array.

stream.tcl (https://gitlab.com/unofficial-mirrors/redis) TCL · 256 lines

37 proc streamSimulateXRANGE {items start end} {

38 set res {}

39 foreach i $items {

40 set this_id [lindex $i 0]

41 if {[streamCompareID $this_id $start] >= 0} {

91 set res [r xrange mystream - +]

92 set expected 995

93 foreach r $res {

94 assert {[lindex $r 1 1] == $expected}

95 incr expected

132 set elements [r xrange mystream $last_id + COUNT 100]

133 if {[llength $elements] == 0} break

134 foreach e $elements {

135 assert {[lrange [lindex $e 1] 0 1] eq [list item $j]}

136 incr j;

Email.php (https://bitbucket.org/jokusafet/magento2.git) PHP · 300 lines

261 ->setStore($store)

262 ->reset();

263 foreach ($this->_priceProducts as $product) {

264 $product->setCustomerGroupId($this->_customer->getGroupId());

265 $this->_getPriceBlock()->addProduct($product);

271 ->setStore($store)

272 ->reset();

273 foreach ($this->_stockProducts as $product) {

274 $product->setCustomerGroupId($this->_customer->getGroupId());

275 $this->_getStockBlock()->addProduct($product);

basic-querying.test.js (https://bitbucket.org/allmas/jugglingdb.git) JavaScript · 280 lines

93 should.exists(users);

94 should.not.exists(err);

95 users.forEach(function(u, i) {

96 u.order.should.eql(i + 1);

97 });

104 should.exists(users);

105 should.not.exists(err);

106 users.forEach(function(u, i) {

107 u.order.should.eql(users.length - i);

108 });

268 ];

269 User.destroyAll(function() {

270 beatles.forEach(function(beatle) {

271 User.create(beatle, ok);

272 });

ComAdapter.cs (https://gitlab.com/unofficial-mirrors/PowerShell) C# · 328 lines

43 {

44 yield return GetComTypeName(_comTypeInfo.Clsid);

45 foreach (string baseType in GetDotNetTypeNameHierarchy(obj))

46 {

47 yield return baseType;

105 if (lookingForProperties || lookingForParameterizedProperties)

106 {

107 foreach (ComProperty prop in _comTypeInfo.Properties.Values)

108 {

109 if (prop.IsParameterized)

125 if (lookingForMethods)

126 {

127 foreach (ComMethod method in _comTypeInfo.Methods.Values)

128 {

129 if (collection[method.Name] == null)

rimraf.js (https://gitlab.com/cpdev/whatsWeatherApp) JavaScript · 343 lines

26 'readdir'

27 ]

28 methods.forEach(function(m) {

29 options[m] = options[m] || fs[m]

30 m = m + 'Sync'

83 return cb()

84

85 results.forEach(function (p) {

86 rimraf_(p, options, function CB (er) {

87 if (er) {

243 return options.rmdir(p, cb)

244 var errState

245 files.forEach(function (f) {

246 rimraf(path.join(p, f), options, function (er) {

247 if (errState)

f_invite.tpl (https://github.com/usagi-project/mynets1.git) Smarty Template · 266 lines

151

152 <table>

153 ({foreach from=$f_invite_list item=c_invite})

154 ({counter assign=_cnt})

155 ({if $_cnt % 3 == 1})<tr>({/if})

157 <td style="padding-right:1em"><label for="m({$c_invite.c_member_id})">({$c_invite.nickname|t_body:'name'})</label></td>

158 ({if $_cnt % 3 == 0})</tr>({/if})

159 ({/foreach})

160 ({if $_cnt % 3 != 0})</tr>({/if})

161 </table>

FPSplitSelect.class.php (https://github.com/fmake/adv.git) PHP · 341 lines

38 if (!isset($params["right_ids"])) {

39 $this->_rightIDs = array();

40 foreach ($this->_options as $key => $val) {

41 if (!in_array($key, $this->_leftIDs))

42 $this->_rightIDs[] = $key;

48 if (!isset($params["left_ids"])) {

49 $this->_leftIDs = array();

50 foreach ($this->_options as $key => $val) {

51 if (!in_array($key, $this->_rightIDs))

52 $this->_leftIDs[] = $key;

98

99 $this->_leftIDs = array();

100 foreach ($this->_options as $key => $val) {

101 if (!in_array($key, $this->_rightIDs))

102 $this->_leftIDs[] = $key;

Collection.php (https://bitbucket.org/spenna/alexoo_produzione.git) PHP · 197 lines

54 protected function processIntervals()

55 {

56 foreach ($this->_intervals as $key=>&$interval){

57 $interval['start'] = $this->_helper()->timezoneFactory($interval['start']);

58 $interval['end'] = $this->_helper()->timezoneFactory($interval['end']);

ConventionPartCreator.cs (https://github.com/jorgemuza/MefContrib.git) C# · 213 lines

103 var importDefinitionsFromConvention = new List<ImportDefinition>();

104

105 foreach (var importConvention in importConventions)

106 {

107 foreach (var member in importConvention.Members.Invoke(type))

bgp_proto.lua (https://gitlab.com/jiangming1399/routing) Lua · 286 lines

28

29 tab_templates = {}

30 uci:foreach('bird6', 'bgp_template', function (s)

31 local name = s[".name"]

32 if (name ~= nil) then

50 table = sect_templates:option(ListValue, "table", "Table", "Set the table used for BGP Routing")

51 table.optional=true

52 uci:foreach("bird6", "table",

53 function (s)

54 table:value(s.name)

59 igp_table = sect_templates:option(ListValue, "igp_table", "IGP Table", "Select the IGP Routing Table to use. Hint: usually the same table as BGP.")

60 igp_table.optional = true

61 uci:foreach("bird6", "table",

62 function(s)

63 igp_table:value(s.name)

GridLines.php (https://gitlab.com/Zinnurain/destination_finder_beta) PHP · 458 lines

329 private function _setShadowProperiesMapValues(array $properties_map, &$reference = NULL) {

330 $base_reference = $reference;

331 foreach ($properties_map as $property_key => $property_val) {

332 if (is_array($property_val)) {

333 if ($reference === NULL) {

authentication.php (https://bitbucket.org/jstechnologies/cats.git) PHP · 238 lines

193 return false;

194 }

195 foreach ($this->_realms[$url->getHost()] as $name => $realm) {

196 if ($realm->isWithin($url)) {

197 return $realm;

Builder.php (https://bitbucket.org/gkawka/zend-framework.git) PHP · 398 lines ✨ Summary

This PHP class generates an RSS feed from a given data array. It creates entries for articles, each with title, link, description, and optional author, guid, content, last update, comments, source, category, and enclosure fields. The class also handles itunes metadata and skip hours/day settings. It throws exceptions if required fields are missing, ensuring the generated feed is valid and complete.

216 {

217 $mandatories = array('title', 'link', 'charset');

218 foreach ($mandatories as $mandatory) {

219 if (!isset($data[$mandatory])) {

220 /**

264 if (isset($data['cloud'])) {

265 $mandatories = array('domain', 'path', 'registerProcedure', 'protocol');

266 foreach ($mandatories as $mandatory) {

267 if (!isset($data['cloud'][$mandatory])) {

268 /**

278 if (isset($data['textInput'])) {

279 $mandatories = array('title', 'description', 'name', 'link');

280 foreach ($mandatories as $mandatory) {

281 if (!isset($data['textInput'][$mandatory])) {

282 /**

CanonXMLWriter.pm (http://keywatch.googlecode.com/svn/trunk/) Perl · 181 lines ✨ Summary

This Perl code defines a class XML::Handler::CanonXMLWriter that generates canonical XML output. It handles various XML elements, such as start and end tags, characters, comments, and processing instructions, and escapes special characters to ensure valid XML. The class can be used with the PerlSAX parser to generate canonical XML from an input XML document.

56 my $key;

57 my $attrs = $element->{Attributes};

58 foreach $key (sort keys %$attrs) {

59 $self->_print(" $key=\"" . $self->_escape($attrs->{$key}) . '"');

60 }

default_metadata.php (https://bitbucket.org/kraymitchell/fcd.git) PHP · 27 lines

15 <ul class="adminformlist">

16 <?php

17 foreach ($this->form->getFieldset('metadata') as $field):

18 ?>

19 <li><?php echo $field->label; ?>

20 <?php echo $field->input; ?></li>

21 <?php

22 endforeach;

23 ?>

24 </ul>

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

141 return;

142 const QList<QUrl> urlList = mimeData->urls();

143 foreach (const QUrl &url, urlList) {

144 if (url.scheme() == QLatin1String("file")) {

145 static_cast<QDeclarativeViewer *>(parent())->open(url.toLocalFile());

212 QStringList sl;

213 int curIdx = -1, idx = 0;

214 foreach (QAction *a, m_actions->actions()) {

215 sl << a->text();

216 if (a->isChecked())

459 QList<QNetworkCookie> list = allCookies();

460 QByteArray data;

461 foreach (QNetworkCookie cookie, list) {

462 if (!cookie.isSessionCookie()) {

463 data.append(cookie.toRawForm());

launcher-guide.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 592 lines

453 die "JEditLauncher: not found !\n";

454 @files = ();

455 foreach $entry (@ARGV) {

456 @new = glob($entry);

457 push(@files,@new);

csharp.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 187 lines

108 <KEYWORD1>fixed</KEYWORD1>

109 <KEYWORD1>for</KEYWORD1>

110 <KEYWORD1>foreach</KEYWORD1>

111 <KEYWORD1>goto</KEYWORD1>

112 <KEYWORD1>if</KEYWORD1>

IDBBackingStore.h (https://bitbucket.org/ultra_iter/qt-vtl.git) C Header · 114 lines

73 virtual ~ObjectStoreRecordCallback() {};

74 };

75 virtual bool forEachObjectStoreRecord(int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback&) = 0;

76

77 virtual void getIndexes(int64_t databaseId, int64_t objectStoreId, Vector<int64_t>& foundIds, Vector<String>& foundNames, Vector<String>& foundKeyPaths, Vector<bool>& foundUniqueFlags) = 0;

perl.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 595 lines

148 <KEYWORD1>unless</KEYWORD1>

149 <KEYWORD1>for</KEYWORD1>

150 <KEYWORD1>foreach</KEYWORD1>

151 <KEYWORD1>BEGIN</KEYWORD1>

152 <KEYWORD1>END</KEYWORD1>

ServiceHandler.java (http://keywatch.googlecode.com/svn/trunk/) Java · 316 lines ✨ Summary

This Java code is part of a service handler that manages tasks and jobs for an agent. It registers an agent with the system, sets its properties, and starts monitoring its activity. The code handles agent registration, job management, and property updates, ensuring seamless interaction between the agent and the system. It also logs events and errors to facilitate debugging and troubleshooting.

257 }

258

259 }// foreach job

260

261 KeyXmlRpcServer.softDeleteMissingJobs(agentTask, jobs);

join.cpp (http://hadesmem.googlecode.com/svn/trunk/) C++ · 0 lines ✨ Summary

This C++ code is a unit test suite for the boost::range library, specifically testing the join() function. It creates various combinations of source range types and tests their join functionality with different target ranges, ensuring correct behavior and type demotion. The test suite covers various range types, including vectors, lists, and deques, to ensure comprehensive coverage.

11 #include <boost/range/join.hpp>

12

13 #include <boost/foreach.hpp>

14 #include <boost/test/test_tools.hpp>

15 #include <boost/test/unit_test.hpp>

72

73 std::vector<value_type> test_result;

74 BOOST_REVERSE_FOREACH( value_type x, join(rng1, rng2) )

75 {

76 test_result.push_back(x);

235 right_containers.push_back(makeCollection<Collection2>(irange(0,100)));

236

237 BOOST_FOREACH( collection1_cptr left_container, left_containers )

238 {

239 BOOST_FOREACH( collection2_cptr right_container, right_containers )

eattr.c (http://omnia2droid.googlecode.com/svn/trunk/) C · 1506 lines ✨ Summary

This C code is part of a file system implementation, specifically for the ext2/3/4 file systems on Linux. It handles the deallocation of extended attributes (EAs) associated with an inode. The code iterates through all EAs, deallocating each one and updating the inode’s disk flags accordingly. If an EA is indirect, it calls a specialized function to handle its deallocation.

71 struct gfs2_ea_header *prev, void *private);

72

73 static int ea_foreach_i(struct gfs2_inode *ip, struct buffer_head *bh,

74 ea_call_t ea_call, void *data)

75 {

108 }

109

110 static int ea_foreach(struct gfs2_inode *ip, ea_call_t ea_call, void *data)

111 {

112 struct buffer_head *bh, *eabh;

119

120 if (!(ip->i_diskflags & GFS2_DIF_EA_INDIRECT)) {

121 error = ea_foreach_i(ip, bh, ea_call, data);

122 goto out;

123 }

ValidatePP.pm (git://github.com/openmelody/melody.git) Perl · 714 lines ✨ Summary

This is a pure Perl implementation of the Params::Validate module, which validates parameters passed to a subroutine. It provides options for customizing validation behavior and error handling. The code defines various helper functions and constants used in the validation process, including type checking and callback functions.

109

110 my $bigger = $#p > $#specs ? $#p : $#specs;

111 foreach ( 0 .. $bigger ) {

112 my $spec = $specs[$_];

113

125 _validate_pos_depends( \@p, \@specs );

126

127 foreach (

128 grep {

129 defined $p[$_]

177 my ( $p, $specs ) = @_;

178

179 foreach my $pname ( keys %$p ) {

180 my $spec = $specs->{$pname};

181

lua.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 235 lines

165 <KEYWORD2>string.gsub</KEYWORD2>

166 <KEYWORD2>table.concat</KEYWORD2>

167 <KEYWORD2>table.foreach</KEYWORD2>

168 <KEYWORD2>table.foreachi</KEYWORD2>

MoveTask.php (git://github.com/alexgorbatchev/SyntaxHighlighter.git) text · 0 lines

81 if (count($this->completeDirMap) > 0)

82 {

83 foreach ($this->completeDirMap as $from => $to)

84 {

85 $f = new PhingFile($from);

103 $this->log("Moving $copyMapSize files to " . $this->destDir->getAbsolutePath());

104

105 foreach($this->fileCopyMap as $from => $to) {

106 if ($from == $to) {

107 $this->log("Skipping self-move of $from", $this->verbosity);

136 }

137 } // if !moved

138 } // foreach fileCopyMap

139 } // if copyMapSize

140

PluginLoader.as (http://flowplayer-core.googlecode.com/svn/) ActionScript · 350 lines ✨ Summary

This ActionScript code is a plugin loader for Adobe Flash Player. It loads and initializes plugins, such as fonts, display objects, and stream providers, from external sources. The code manages the loading process, handles errors, and sets up configuration for each plugin. It also provides access to loaded plugins through various methods, allowing developers to interact with them in their application.

189 return function(event:IOErrorEvent):void {

190 log.error("onIoError " + url);

191 _loadables.forEach(function(loadable:Loadable, index:int, array:Array):void {

192 if (! loadable.loadFailed && hasSwiff(url, loadable.url)) {

193 log.debug("onIoError: this is the swf for loadable " + loadable);

214

215 var instanceUsed:Boolean = false;

216 _loadables.forEach(function(loadable:Loadable, index:int, array:Array):void {

217 if (! loadable.plugin && hasSwiff(info.url, loadable.url)) {

218 log.debug("this is the swf for loadable " + loadable);

309

310 public function setConfigPlugins():void {

311 _allPlugins.forEach(function(loadable:Loadable, index:int, array:Array):void {

312 if (! loadable.loadFailed) {

313 var pluginInstance:Object = plugins[loadable];

declare.js (http://enginey.googlecode.com/svn/trunk/) JavaScript · 191 lines ✨ Summary

This JavaScript code defines a class system, allowing for the creation of classes with inheritance and mixin functionality. It provides methods for initializing instances, overriding inherited properties, and accessing mixin ancestors. The code is designed to be flexible and customizable, enabling developers to create complex class hierarchies and compositions.

62 // construct intermediate classes for mixins

63 if(mixins){

64 dojo.forEach(mixins, function(m){

65 if(!m){ throw(className + ": mixin #" + i + " is null"); } // It's likely a required module is not loaded

66 superclass = dd._delegate(superclass, m);

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

63 QString loaders;

64 QString line(QLatin1String(" %1 - %2\n"));

65 foreach (Translator::FileFormat format, Translator::registeredFileFormats())

66 loaders += line.arg(format.extension, -5).arg(format.description);

67

RPC2.pm (http://keywatch.googlecode.com/svn/trunk/) Perl · 825 lines ✨ Summary

This Perl code implements an XML parser for RPC (Remote Procedure Call) data types. It defines a set of classes to represent various data types, such as strings, integers, and dates, which can be used in RPC requests. The parser uses these classes to parse incoming XML data and convert it into usable values.

168

169 my $item;

170 foreach $item (@$array)

171 {

172 push (@text, "<param>",

283

284 my $item;

285 foreach $item (@$array)

286 {

287 push @text, $self->_item($item);

query.php (http://forceworkbench.googlecode.com/svn/trunk/workbench/) PHP · 996 lines ✨ Summary

This PHP code is part of a Salesforce Workbench application, handling query-related functionality. It generates query results, exports data to CSV, and allows users to execute queries asynchronously. The code also handles errors, warnings, and export options, providing a user-friendly interface for interacting with Salesforce data.

124

125 $fieldValuesToLabels = array();

126 foreach ($describeSObjectResult->fields as $field) {

127 $fieldValuesToLabels[$field->name] = $field->name;

128 }

135 print "var field_type_array = new Array();\n";

136 if (isset($describeSObjectResult)) {

137 foreach ($describeSObjectResult->fields as $fields => $field) {

138 print " field_type_array[\"$field->name\"]=[\"$field->type\"];\n";

139 }

158

159 print "var compOper_array = new Array();\n";

160 foreach ($ops as $opValue => $opLabel) {

161 print " compOper_array[\"$opValue\"]=[\"$opLabel\"];\n";

162 }

NetPeer.MessagePools.cs (http://lidgren-network-gen3.googlecode.com/svn/trunk/) C# · 229 lines ✨ Summary

This C# code is part of a network library, specifically handling peer-to-peer communication. It manages message storage and recycling to optimize memory usage and reduce garbage collection. The code provides methods for creating outgoing and incoming messages, as well as recycling them to reuse existing data and minimize memory allocation.

161 lock (m_storagePool)

162 {

163 foreach (var msg in toRecycle)

164 {

165 var storage = msg.m_data;

shBrushCSharp.js (git://github.com/alexgorbatchev/SyntaxHighlighter.git) JavaScript · 50 lines ✨ Summary

This JavaScript code defines a syntax highlighting brush for C# programming language, specifically for use with SyntaxHighlighter. It includes regular expressions to match various C# features such as comments, strings, keywords, and preprocessor directives. The brush is then registered with the SyntaxHighlighter library, allowing it to be used in HTML documents to highlight C# code.

8 var keywords = 'abstract as base bool break byte case catch char checked class const ' +

9 'continue decimal default delegate do double else enum event explicit volatile ' +

10 'extern false finally fixed float for foreach get goto if implicit in int ' +

11 'interface internal is lock long namespace new null object operator out ' +

12 'override params private protected public readonly ref return sbyte sealed set ' +

default_locale.php (https://bitbucket.org/kraymitchell/fcd.git) PHP · 27 lines

15 <ul class="adminformlist">

16 <?php

17 foreach ($this->form->getFieldset('locale') as $field):

18 ?>

19 <li><?php echo $field->label; ?>

20 <?php echo $field->input; ?></li>

21 <?php

22 endforeach;

23 ?>

24 </ul>

SimulationBase.cs (git://github.com/aurora-sim/Aurora-Sim.git) C# · 604 lines ✨ Summary

This is a C# class that represents the main application of an HTTP server. It handles startup, shutdown, and configuration processes, including loading configurations, starting and stopping servers, and performing garbage collection. The class also includes methods for handling console commands and logging information to the console. It appears to be part of a larger web development framework or application.

294 {

295 m_applicationPlugins = AuroraModuleLoader.PickupModules<IApplicationPlugin>();

296 foreach (IApplicationPlugin plugin in m_applicationPlugins)

297 plugin.PreStartup(this);

298 }

303 public virtual void StartModules()

304 {

305 foreach (IApplicationPlugin plugin in m_applicationPlugins)

306 plugin.Initialize(this);

307

308 foreach (IApplicationPlugin plugin in m_applicationPlugins)

309 plugin.PostInitialise();

310

DropVertexTypeNode.cs (git://github.com/sones/sones.git) C# · 114 lines ✨ Summary

This C# code defines a class DropVertexTypeNode that represents a statement node for dropping a vertex type in a graph database. It inherits from AStatement and implements methods to initialize, execute, and generate output for the drop operation. The class is part of a larger system for managing graph data and provides a way to interact with the database using GraphQL queries.

94 var temp = new Dictionary<String, object>();

95

96 foreach(var item in myDeletedTypeIDs)

97 {

98 temp.Add("RemovedTypeID", item.Key);

thorport.hpp (git://github.com/hpcc-systems/HPCC-Platform.git) C++ Header · 82 lines ✨ Summary

This C++ header file defines a set of functions and classes for managing ports, specifically for use with the HPCC Systems software. It provides functions to allocate and free ports, as well as get fixed port numbers based on categories. A CPortGroup class is also defined to manage a collection of allocated ports, ensuring they are properly freed when no longer in use.

70 virtual ~CPortGroup()

71 {

72 ForEachItemIn(i,portsinuse) {

73 freePort(portsinuse.item(i));

74 }

WorkItemsGroup.cs (git://github.com/aurora-sim/Aurora-Sim.git) C# · 510 lines ✨ Summary

This is a C# implementation of a work items group, which manages a pool of tasks to be executed by a thread pool. It provides methods for starting and stopping the group, canceling all tasks, and firing an event when the group is idle. The code uses synchronization mechanisms to ensure thread safety and handles task completion and cancellation.

408

409 Delegate[] delegates = onIdle.GetInvocationList();

410 foreach (WorkItemsGroupIdleHandler eh in delegates)

411 {

412 try

Calc.pm (git://github.com/openmelody/melody.git) Perl · 2610 lines ✨ Summary

This is a Perl module documentation, explaining how to use and wrap existing libraries for big numbers with the Math::BigInt interface. It outlines the required and optional functions, input parameters, return values, and licensing information. The code provides a framework for porting custom c-libraries to work with Math::BigInt.

279 my $fac = 1;

280 my $num = 0;

281 foreach (@$x)

282 {

283 $num += $fac*$_; $fac *= $BASE;

307

308 # for each in Y, add Y to X and carry. If after that, something is left in

309 # X, foreach in X add carry to X and then return X, carry

310 # Trades one "$j++" for having to shift arrays

311 my $i; my $car = 0; my $j = 0;

411 # multiply a large number a by a single element one, so speed up

412 my $y = $yv->[0]; my $car = 0;

413 foreach my $i (@$xv)

414 {

415 $i = $i * $y + $car; $car = int($i * $RBASE); $i -= $car * $BASE;

service.js (git://github.com/OpenRTMFP/ArcusNode.git) JavaScript · 78 lines ✨ Summary

This JavaScript code sets up and runs an ArcusNode RTMFP Service, a real-time middleware platform. It takes command line arguments for logging level and file, and displays usage instructions if unknown arguments are provided. The service is then started, and the process listens for SIGINT and exit events to gracefully shut down when necessary.

25 //Take command line arguments

26 var settings = {};

27 process.argv.forEach(function (val, index, array) {

28 if(index < 2)

29 return;

middle.js (git://github.com/OpenRTMFP/ArcusNode.git) JavaScript · 295 lines ✨ Summary

This JavaScript code establishes a Real-Time Messaging Protocol (RTMP) connection between two endpoints, typically a client and a server. It handles handshake requests, key exchanges, and data transmission using symmetric encryption keys. The code generates random values for authentication and encryption, and uses these to establish a secure connection for real-time communication.

33

34 //Take arguments

35 process.argv.forEach(function (val, index, array) {

36 if(index < 2)

37 return;