PageRenderTime 471ms queryFilters 0ms Sphinxql 365ms app.CodeModel.GetByIds 59ms findMatchingLines 17ms GetByIds 76ms meta 0ms repositoryFilters 10ms languageFilters 7ms sourceFilters 3ms

4,916,907 results for 'foreach' (471 ms)

Source

Language

Repository

ReadPermissionsOptimizationUtil.php https://bitbucket.org/ddonthula/zurmounl | PHP | 1,031 lines
39            assert('is_bool($forcePhp)');
40            foreach (self::getMungableModelClassNames() as $modelClassName)
41            {
103                $models = RedBeanModel::getSubset(null, $i, $subset, null, null, $modelClassName);
104                foreach ($models as $model)
105                {
108                    $users = User::getAll();
109                    foreach ($users as $user)
110                    {
118                    $groups = Group::getAll();
119                    foreach ($groups as $group)
120                    {
125                            self::incrementCount($mungeTableName, $securableItemId, $group);
126                            foreach ($group->users as $user)
127                            {
CActiveFinder.php https://bitbucket.org/quarkmarino/yii-bootstrap | PHP | 1,615 lines
79				$array=array();
80				foreach($result as $object)
81					$array[$object->$index]=$object;
274		// $with is an array, keys are relation name, values are relation spec
275		foreach($with as $key=>$value)
276		{
382			$prefix='t'.$id.'_c';
383		foreach($table->getColumnNames() as $key=>$name)
384		{
401		{
402			foreach($this->children as $child)
403				$child->destroy();
430
431		foreach($this->children as $child) // find recursively
432			$child->find();
tests.mk https://github.com/pnkfelix/rust.git | Unknown | 705 lines
91
92$(foreach target,$(CFG_TARGET_TRIPLES), \
93  $(eval $(call DEF_TARGET_COMMANDS,$(target))))
210check-stage$(1)-T-$(2)-H-$(3)-crates-exec: \
211	$$(foreach crate,$$(TEST_CRATES), \
212           check-stage$(1)-T-$(2)-H-$(3)-$$(crate)-exec)
216check-stage$(1)-T-$(2)-H-$(3)-crates-exec: \
217	$$(foreach crate,$$(TEST_TARGET_CRATES), \
218           check-stage$(1)-T-$(2)-H-$(3)-$$(crate)-exec)
222check-stage$(1)-T-$(2)-H-$(3)-doc-exec: \
223        $$(foreach docname,$$(DOC_TEST_NAMES), \
224           check-stage$(1)-T-$(2)-H-$(3)-doc-$$(docname)-exec)
234
235$(foreach host,$(CFG_HOST_TRIPLES), \
236 $(foreach target,$(CFG_TARGET_TRIPLES), \
class.latte https://github.com/cakephp/cakephp-api-docs.git | Unknown | 509 lines
26	<dl class="tree" n:if="$class->parentClass || $class->ownInterfaces || $class->ownTraits">
27		<dd n:foreach="$tree as $item" style="padding-left:{($iterator->counter - 1) * 30}px">
28			<img src="resources/inherit.png" alt="Extended by" n:if="$iterator->counter > 1">
36			{var $itemOwnTraits = $item->ownTraits}
37			{if $itemOwnTraits} uses {foreach $itemOwnTraits as $trait}
38				<a href="{$trait|classUrl}" n:tag-if="$trait->documented"><span n:class="$trait->deprecated ? deprecated, !$trait->valid ? invalid">{$trait->name}</span></a>{sep}, {/sep}
38				<a href="{$trait|classUrl}" n:tag-if="$trait->documented"><span n:class="$trait->deprecated ? deprecated, !$trait->valid ? invalid">{$trait->name}</span></a>{sep}, {/sep}
39			{/foreach}{/if}
40		</dd>
271			{foreach $methods as $data}
272				<a href="{$data['method']|methodUrl:$data['method']->declaringTrait}" n:tag-if="$template->getClass($traitName)"><span n:tag-if="$data['method']->deprecated" class="deprecated">{$data['method']->originalName}()</span></a>{if $data['aliases']}(as {foreach $data['aliases'] as $alias}<span n:tag-if="$data['method']->deprecated" class="deprecated">{$alias->name}()</span>{sep}, {/sep}{/foreach}){/if}{sep}, {/sep}
273			{/foreach}
306			{foreach $methods as $data}
307				<a href="{$data['method']|methodUrl:$data['method']->declaringTrait}" n:tag-if="$template->getClass($traitName)"><span n:tag-if="$data['method']->deprecated" class="deprecated">{$data['method']->originalName}()</span></a>{if $data['aliases']}(as {foreach $data['aliases'] as $alias}<span n:tag-if="$data['method']->deprecated" class="deprecated">{$alias->name}()</span>{sep}, {/sep}{/foreach}){/if}{sep}, {/sep}
308			{/foreach}
Generator.php https://github.com/cakephp/cakephp-api-docs.git | PHP | 1,720 lines
164
165		foreach ($this->config->source as $source) {
166			$entries = array();
167			if (is_dir($source)) {
168				foreach (new \RecursiveIteratorIterator(new SourceFilesFilterIterator(new \RecursiveDirectoryIterator($source, $flags), $this->config->exclude)) as $entry) {
169					if (!$entry->isFile()) {
177				}
178				foreach (new \RecursiveIteratorIterator(new \Phar($source, $flags)) as $entry) {
179					if (!$entry->isFile()) {
188			$regexp = '~\\.' . implode('|', $this->config->extensions->toArray()) . '$~i';
189			foreach ($entries as $entry) {
190				if (!preg_match($regexp, $entry->getFilename())) {
211
212		foreach ($files as $filePath => $size) {
213			$content = $this->charsetConvertor->convertFile($filePath);
default_commands.js https://github.com/lbl52001/ace.git | JavaScript | 460 lines
109    exec: function(editor) { editor.getSelection().selectFileStart(); },
110    multiSelectAction: "forEach",
111    readOnly: true
115    exec: function(editor) { editor.navigateFileStart(); },
116    multiSelectAction: "forEach",
117    readOnly: true
121    exec: function(editor) { editor.getSelection().selectUp(); },
122    multiSelectAction: "forEach",
123    readOnly: true
127    exec: function(editor, args) { editor.navigateUp(args.times); },
128    multiSelectAction: "forEach",
129    readOnly: true
133    exec: function(editor) { editor.getSelection().selectFileEnd(); },
134    multiSelectAction: "forEach",
135    readOnly: true
tests.mk https://github.com/Trinick/rust.git | Makefile | 820 lines
91
92$(foreach target,$(CFG_TARGET_TRIPLES), \
93  $(eval $(call DEF_TARGET_COMMANDS,$(target))))
100
101$(foreach target,$(CFG_TARGET_TRIPLES), \
102  $(if $(findstring $(target),"arm-linux-androideabi"), \
257check-stage$(1)-T-$(2)-H-$(3)-crates-exec: \
258	$$(foreach crate,$$(TEST_CRATES), \
259           check-stage$(1)-T-$(2)-H-$(3)-$$(crate)-exec)
263check-stage$(1)-T-$(2)-H-$(3)-crates-exec: \
264	$$(foreach crate,$$(TEST_TARGET_CRATES), \
265           check-stage$(1)-T-$(2)-H-$(3)-$$(crate)-exec)
269check-stage$(1)-T-$(2)-H-$(3)-doc-exec: \
270        $$(foreach docname,$$(DOC_TEST_NAMES), \
271           check-stage$(1)-T-$(2)-H-$(3)-doc-$$(docname)-exec)
TestNewPlanPushDownForeachFlatten.java https://github.com/dorefiend/pig.git | Java | 1,234 lines
289        Assert.assertTrue( foreach instanceof LOForEach );
290        foreach = newLogicalPlan.getSuccessors( foreach ).get( 0 );
291        Assert.assertTrue( foreach instanceof LOForEach );
1105        Operator store = newLogicalPlan.getSinks().get( 0 );
1106        LOForEach foreach = (LOForEach)newLogicalPlan.getPredecessors(store).get(0);
1107        Assert.assertTrue(foreach.getSchema().getField(1).alias.equals("q1"));
1161            s = new HashSet<Rule>();
1162            r = new PushDownForEachFlatten( "PushDownForEachFlatten" );
1163            s.add(r);
1197            s = new HashSet<Rule>();
1198            r = new PushDownForEachFlatten( "PushDownForEachFlatten" );
1199            s.add(r);            
1225        Assert.assertTrue( foreach instanceof LOForEach );
1226        foreach = newLogicalPlan.getSuccessors( foreach ).get( 0 );
1227        Assert.assertTrue( foreach instanceof LOForEach );
TestNewPlanColumnPrune.java https://github.com/dorefiend/pig.git | Java | 445 lines
41import org.apache.pig.newplan.logical.relational.LogicalRelationalOperator;
42import org.apache.pig.newplan.logical.rules.AddForEach;
43import org.apache.pig.newplan.logical.rules.ColumnMapKeyPrune;
77        query = "a = load 'd.txt';" +
78        "b = foreach a generate $0, $1;" +
79        "store b into 'empty';";
85        query = "a = load 'd.txt';"+
86        "b = foreach a generate $0, $1;"+
87        "store b into 'empty';";
93    public void testPrune() throws Exception  {
94        // only foreach
95        String query = "a = load 'd.txt' as (id, v1, v2);" +
434
435            r = new AddForEach("AddForEach");
436            s = new HashSet<Rule>();
TestMultiQueryCompiler.java https://github.com/dorefiend/pig.git | Java | 1,566 lines
104            myPig.registerQuery("A = load '" + INPUT_FILE + "' as (col1:int, col2:int, col3:int);");
105            myPig.registerQuery("B1 = foreach A generate col1, col2;");
106            myPig.registerQuery("B2 = foreach A generate col2, col3;");
108            myPig.registerQuery("C2 = group B2 by (col2, col3);");
109            myPig.registerQuery("D1 = foreach C1 generate col1, col2;");
110            myPig.registerQuery("D2 = foreach C2 generate B2.col2, B2.col3;");
152            myPig.registerQuery("g1 = group f1 by name;");
153            myPig.registerQuery("p1 = foreach g1 generate group, COUNT(f1.gid);");
154            myPig.registerQuery("store p1 into '/tmp/output1';");
157            myPig.registerQuery("g2 = group f2 by name;");
158            myPig.registerQuery("p2 = foreach g2 generate group, COUNT(f2.gid);");
159            myPig.registerQuery("store p2 into '/tmp/output2';");
162            myPig.registerQuery("g3 = group f3 by name;");
163            myPig.registerQuery("p3 = foreach g3 generate group, COUNT(f3.gid);");
164            myPig.registerQuery("store p3 into '/tmp/output3';");
TestLogicalPlanBuilder.java https://github.com/dorefiend/pig.git | Java | 2,152 lines
1012        store = lp.getSinks().get(0);
1013        LOForEach foreach  = (LOForEach) lp.getPredecessors(store).get(0);
1014
1326        //        Assert.assertTrue(nestedForeach instanceof LOForEach);
1327        //        LogicalPlan nestedForeachPlan = ((LOForEach)nestedForeach).getForEachPlans().get(0);
1328        //        LogicalOperator nestedProject = nestedForeachPlan.getRoots().get(0);
1944        Operator store = lp.getSinks().get(0);
1945        LOForEach foreach = (LOForEach) lp.getPredecessors(store).get(0);
1946
1956        Operator store = lp.getSinks().get(0);
1957        LOForEach foreach = (LOForEach) lp.getPredecessors(store).get(0);
1958
1968        Operator op = lp.getSinks().get(0);
1969        LOForEach foreach = (LOForEach)lp.getPredecessors(op).get(0);
1970
nightly.conf https://github.com/dorefiend/pig.git | Perl | 5,182 lines
50e = cogroup c by (name, age), d by (name, age) ;
51f = foreach e generate flatten(c), flatten(d);
52g = group f by registration;
52g = group f by registration;
53h = foreach g generate group, SUM(f.d::contributions);
54i = order h by $1;
105a = load ':INPATH:/singlefile/studenttab10k' as (name, age, gpa);
106b = foreach a generate name, org.apache.pig.test.udf.evalfunc.Swap(name, age), TOKENIZE((chararray)name), org.apache.pig.test.udf.evalfunc.CreateMap((chararray)name, age); 
107store b into ':OUTPATH:.intermediate' using BinStorage();
122a = load ':INPATH:/singlefile/textdoc' using TextLoader();
123b = foreach a generate TOKENIZE((chararray)$0);
124store b into ':OUTPATH:' using org.apache.pig.test.udf.storefunc.StringStore();\,
495e = filter d by not IsEmpty(b);
496f = foreach e generate flatten(a), flatten(b);
497store f into ':OUTPATH:';\,
multiquery.conf https://github.com/dorefiend/pig.git | Perl | 519 lines
63                        c = group b by age; 
64                        d = foreach c generate group, SUM(b.gpa);
65                        store d into ':OUTPATH:.2'; #,
92                        e = cogroup c by name, d by name; 
93                        f = foreach e generate flatten(c), flatten(d); 
94                        store f into ':OUTPATH:.3'; #,
106                        c = group b by age; 
107                        d = foreach c generate group, AVG(b.gpa); 
108                        store d into ':OUTPATH:.1'; 
119                        c = group b by age; 
120                        d = foreach c generate group, AVG(b.gpa); 
121                        store d into ':OUTPATH:.1'; 
123                        f = group e by $1; 
124                        g = foreach f generate group, SUM(e.$0); 
125                        store g into ':OUTPATH:.2'; #,
macro.conf https://github.com/dorefiend/pig.git | Unknown | 615 lines
43                         a = load ':INPATH:/singlefile/studenttab10k' as (name, age, gpa);
44                         b = foreach a generate age, name;
45                         store b into ':OUTPATH:';
49          'verify_pig_script' => q#a = load ':INPATH:/singlefile/studenttab10k' as (name, age, gpa);
50                                   b = foreach a generate age, name;
51                                   store b into ':OUTPATH:';#,
56                         a = load '$loadfile' as (name, age, gpa);
57                         b = foreach a generate age, name;
58                         store b into ':OUTPATH:';
62          'verify_pig_script' => q#a = load ':INPATH:/singlefile/studenttab10k' as (name, age, gpa);
63                                   b = foreach a generate age, name;
64                                   store b into ':OUTPATH:';#,
69                         a = load '$loadfile' as (name, age, gpa);
70                         $b = foreach a generate age, name;
71                     }
CombinerOptimizer.java https://github.com/dorefiend/pig.git | Java | 1,011 lines
166        if (successor instanceof POForEach) {
167            POForEach foreach = (POForEach)successor;
168            List<PhysicalPlan> feInners = foreach.getInputPlans();
204                //create new map foreach
205                POForEach mfe = createForEachWithGrpProj(foreach, rearrange.getKeyType());                
206                Map<PhysicalOperator, Integer> op2newpos = 
230                //create new combine foreach
231                POForEach cfe = createForEachWithGrpProj(foreach, rearrange.getKeyType());
232                //add algebraic functions with appropriate projection
483     */
484    private POForEach createForEachWithGrpProj(POForEach foreach, byte keyType) {
485        String scope = foreach.getOperatorKey().scope;
866        @Override
867        public void visitPOForEach(POForEach fe) throws VisitorException {
868            // we need to allow foreach as input for distinct
perf.xml https://github.com/dorefiend/pig.git | XML | 1,233 lines
91<p>The combiner is also used with a nested foreach as long as the only nested operation used is DISTINCT
92(see <a href="basic.html#FOREACH">FOREACH</a> and <a href="basic.html#nestedblock">Example: Nested Block</a>).
93</p>
105<title>When the Combiner is Not Used</title> 
106<p>The combiner is generally not used if there is any operator that comes between the GROUP and FOREACH statements in the execution plan. Even if the statements are next to each other in your script, the optimizer might rearrange them. In this example, the optimizer will push FILTER above FOREACH which will prevent the use of the combiner:</p>
107<source>
124
125<p><strong>Note:</strong> One exception to the above rule is LIMIT. Starting with Pig 0.9, even if LIMIT comes between GROUP and FOREACH, the combiner will still be used. In this example, the optimizer will push LIMIT above FOREACH but this will not prevent the use of the combiner.</p>
126
573<title>PushDownForEachFlatten</title>
574<p>The objective of this rule is to reduce the number of records that flow through the pipeline by moving FOREACH operators with a FLATTEN down the data flow graph. In the example shown below, it would be more efficient to move the foreach after the join to reduce the cost of the join operation.</p>
575<source>
1154<li>Data must come directly from either a Load or an Order statement.</li>
1155<li>There may be filter statements and foreach statements between the sorted data source and the join statement. The foreach statement should meet the following conditions: 
1156  <ul>
Permission.pm git://github.com/movabletype/movabletype.git | Perl | 1,104 lines
26    if (%params) {
27        foreach my $key ( keys %params ) {
28            $values->{$key} = $params{$key};
81    if (%params) {
82        foreach my $key ( keys %params ) {
83            $values->{$key} = $params{$key};
141    if (%params) {
142        foreach my $key ( keys %params ) {
143            $values->{$key} = $params{$key};
209    if (%params) {
210        foreach my $key ( keys %params ) {
211            $values->{$key} = $params{$key};
245    if (%params) {
246        foreach my $key ( keys %params ) {
247            $values->{$key} = $params{$key};
Preloading.php git://github.com/gabordemooij/redbean.git | PHP | 1,617 lines
67		$foundMagazine = NULL;
68		foreach ( $books as $book ) {
69			if ( $book->title === 'magazine' ) {
209
210		foreach ( $books as $book ) {
211			$i++;
228		$i = 0;
229		foreach ( $books as $book ) {
230			asrt( $book->author->id, 0 );
244
245		foreach ( $books as $book ) {
246			$i++;
265		$i = 0;
266		foreach ( $books as $book ) {
267			asrt( $book->author->name, strval( ++$i ) );
foreach_tags.txt https://github.com/ryog/topaz.git | Unknown | 46 lines
1fails:IO.foreach raises TypeError if the first parameter is nil
2fails:IO.foreach raises Errno::ENOENT if the file does not exist
2fails:IO.foreach raises Errno::ENOENT if the file does not exist
3fails:IO.foreach converts first parameter to string and uses as file name
4fails:IO.foreach returns an Enumerator when called without a block
4fails:IO.foreach returns an Enumerator when called without a block
5fails:IO.foreach accepts an optional options argument
6fails:IO.foreach with no separator argument yields a sequence of Strings that were separated by $/
6fails:IO.foreach with no separator argument yields a sequence of Strings that were separated by $/
7fails:IO.foreach with no separator argument updates $. with each yield
8fails:IO.foreach with nil as the separator argument yields a single string with entire content
8fails:IO.foreach with nil as the separator argument yields a single string with entire content
9fails:IO.foreach with nil as the separator argument updates $. with each yield
10fails:IO.foreach with an empty String as the separator argument yields a sequence of paragraphs when the separator is an empty string
10fails:IO.foreach with an empty String as the separator argument yields a sequence of paragraphs when the separator is an empty string
11fails:IO.foreach with an empty String as the separator argument updates $. with each yield
12fails:IO.foreach with an arbitrary String as the separator argument yields a sequence of Strings that were separated by r
shopimporter.php https://github.com/vappelgren/PrestaShop.git | PHP | 1,505 lines
290		//get installed module only
291		foreach($exportModules as $key => $module)
292			if ($module->name == $this->name || !(bool)$module->id)
299		$i = 0;
300		foreach($this->supportedImports as $import)
301		{
337
338		foreach($exportModules as $key => $module)
339			(($module->name != $this->name AND $module->id) ? $html .= '<option value="'.$module->name.'">'.$module->displayName.'</option>' : '' );
355					<div id="importOptionsYesNo">';
356					foreach($this->supportedImports as $key => $import)
357					{
476
477		foreach($fields as $key => $field)
478		{
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21