100+ results for 'hello world php'

Not the results you expected?

HttpResponseTest.class.php (https://github.com/treuter/xp-framework.git) PHP · 373 lines

1 <?php

2 /* This class is part of the XP framework

3 *

350 #[@test]

351 public function headerStringDoesNotIncludeContent() {

352 $response= $this->newResponse(array('HTTP/1.1 200 OK', 'Content-Type: application/json', 'Content-Length: 21'), '{ "hello" : "world" }');

353 $this->assertEquals(

354 "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\nContent-Length: 21\r\n\r\n",

ConsoleInputDefinitionTest.php (https://github.com/Proudio-Interactive/phpUnderControl.git) PHP · 316 lines

103 $definition = new phpucConsoleInputDefinition();

104 $definition->addCommand(

105 'mapi0', 'Hello World.', phpucConsoleInputDefinition::MODE_HIDDEN

106 );

107 $definition->addCommand(

108 'mapi1', 'Hello World.', phpucConsoleInputDefinition::MODE_NORMAL

109 );

110

150 $definition = new phpucConsoleInputDefinition();

151 $definition->addCommand( 'manuel', 'Hello World.' );

152 $definition->addArgument( 'manuel', 'pichler', 'Hello World 1.' );

170 $definition->addCommand( 'manuel', 'Hello World.' );

171 $definition->addArgument( 'manuel', 'pichler', 'Hello World.', null );

172 }

173

attr_attribute_set.cpp (https://bitbucket.org/liflg/library-boost.git) C++ · 280 lines

37 attrs::constant< int > attr1(10);

38 attrs::constant< double > attr2(5.5);

39 attrs::constant< std::string > attr3("Hello, world!");

40

41 attr_set set1;

135 attrs::constant< int > attr1(10);

136 attrs::constant< double > attr2(5.5);

137 attrs::constant< std::string > attr3("Hello, world!");

138

139 attr_set set1;

241 attrs::constant< int > attr1(10);

242 attrs::constant< double > attr2(5.5);

243 attrs::constant< std::string > attr3("Hello, world!");

244

245 attr_set set1;

testaux.c (https://github.com/PrecipiceGames/craftd.git) C · 405 lines

172

173 int test5 (void) {

174 struct tagbstring t = bsStatic ("Hello world");

175 bstring b;

176 int ret = 0;

251

252 int test9 (void) {

253 struct tagbstring t = bsStatic ("Hello world");

254 bstring b, c;

255 int err, ret = 0;

312

313 int test12 (void) {

314 struct tagbstring t = bsStatic ("Hello world");

315 struct bStream * s;

316 bstring b;

OfflineTest.php (https://github.com/ajgarlag/zf1.git) PHP · 358 lines

1 <?php

2 /**

3 * Zend Framework

7 * This source file is subject to the new BSD license that is bundled

8 * with this package in the file LICENSE.txt.

9 * It is also available through the world-wide-web at this URL:

10 * http://framework.zend.com/license/new-bsd

11 * If you did not receive a copy of the license and are unable to

12 * obtain it through the world-wide-web, please send an email

13 * to license@zend.com so we can send you a copy immediately.

14 *

109

110 $this->metadata2 = array(

111 'hello' => 'world'

112 );

113

strrchr.asm (https://github.com/kframework/X86-64-semantics.git) Assembly · 527 lines

389 .section .rodata

390 LC0:

391 .string "hi world"

392 .data

393 bar:

398 .section .rodata

399 LC1:

400 .string "hello world"

401 .text

402 .globl main_test

strlen.asm (https://github.com/kframework/X86-64-semantics.git) Assembly · 513 lines

339 .section .rodata

340 LC0:

341 .string "hello world"

342 .text

343 .globl main_test

markdown.yml (https://github.com/gitlabhq/gitlabhq.git) YAML · 2195 lines

408 <table><tr><td>

409 <pre>

410 **Hello**,

411

412 _world_.

425 04_06__leaf_blocks__html_blocks__003: |2

426 <div>

427 *hello*

428 <foo><a>

429 04_06__leaf_blocks__html_blocks__004: |

508 // JavaScript example

509

510 document.getElementById("demo").innerHTML = "Hello JavaScript!";

511 </script>

512 okay

ResultJsonConverterTests.cs (https://github.com/iSynaptic/iSynaptic.Core.git) C# · 277 lines

123 public void WriteJson_SuccessWithValueAndNoObservations_WritesCorrectly()

124 {

125 Result<String, String> result = "Hello, World!".ToResult();

126

127 String json = _serializer.Serialize(result);

128 json.Should().Be("{\"value\":\"Hello, World!\",\"wasSuccessful\":true}");

129 }

130

141 public void WriteJson_SuccessWithValueAndObservations_WritesCorrectly()

142 {

143 Result<String, String> result = "Hello, World!".ToResult().ObserveMany("It went well!", "Take a break!");

144

145 String json = _serializer.Serialize(result);

CACIDiscoveryNonJunitTests.java (https://github.com/societies/SOCIETIES-Platform.git) Java · 209 lines

22 static ICAUITaskManager cauiTaskManager = null;

23

24 private static final String SERVICE_SRI1 = "css://requestor.societies.org/HelloWorld";

25 private static final String SERVICE_TYPE = "radio_service";

26 private static ServiceResourceIdentifier serviceSri1;

27

28 //private static final String SERVICE_SRI2 = "css://requestor.societies.org/HelloWorld";

29 //private static ServiceResourceIdentifier serviceSri2;

30

writing-modes.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 790 lines

157 (crazy-p)

158 (bar baz ()))

159 (print "hello world")</programlisting>

160 </listitem>

161 <listitem>

690 </para>

691 <para>

692 Here is an example from the PHP mode, which extends the inline JavaScript highlighting to support embedded PHP:

693 </para>

694 <programlisting>

695 <![CDATA[<RULES SET="JAVASCRIPT+PHP">

696

697 <SPAN TYPE="MARKUP" DELEGATE="php::PHP">

698 <BEGIN>&lt;?php</BEGIN>

700 </SPAN>

701

702 <SPAN TYPE="MARKUP" DELEGATE="php::PHP">

703 <BEGIN>&lt;?</BEGIN>

704 <END>?&gt;</END>

README (https://freespeech.svn.sourceforge.net/svnroot/freespeech) Unknown · 5 lines

1

2 This is GnomeHello, an example program for my book about Gnome development.

3

4

SimpeTemplateTest.php (https://gitlab.com/php.bjoernbartels.earth/simpletemplate) PHP · 275 lines

205 ->next();

206

207 $template = "... {MY-VAR} <?php echo 'hello world'; ?> <!-- BEGIN:BLOCK --> {MY-DYN-VAR} <!-- END:BLOCK -->...";

208 $generatedContent = $tpl->generate($template, true);

209 $this->assertContains("my-value", $generatedContent);

210 $this->assertContains("value-1", $generatedContent);

211 $this->assertContains("value-2", $generatedContent);

212 $this->assertContains("<?php echo 'hello world'; ?>", $generatedContent);

213 }

214

222 ->next();

223

224 $template = "... {MY-VAR} ... i18n('hello world') ... <!-- BEGIN:BLOCK --> {MY-DYN-VAR} <!-- END:BLOCK --> translate('good bye world') ...";

225 $generatedContent = $tpl->generate($template, true);

226 $this->assertContains("my-value", $generatedContent);

BilingualAlignerTest.php (https://gitlab.com/ElvisAns/tiki) PHP · 557 lines

109 {

110

111 $l1_sentence = "Hello world.";

112 $l2_sentence = "Bonjour le monde.";

113 $this->assertSentenceLengthDeltaIs(

127 );

128

129 $l1_sentence = "Hello world.";

130 $l2_sentence = "";

131 $this->assertSentenceLengthDeltaIs(

154 );

155

156 $l1_sentence = "Hello world.";

157 $l2_sentence = null;

158

BaseTest.php (https://github.com/ewandor/horde.git) PHP · 246 lines

1 <?php

2 /**

3 * Copyright 2007-2008 Maintainable Software, LLC

156 public function testRenderPartialObject()

157 {

158 $this->_view->myObject = (object)array('string_value' => 'hello world');

159 $expected = '<div><p>hello world</p></div>';

164 public function testRenderPartialLocals()

165 {

166 $expected = '<div><p>hello world</p></div>';

167 $this->assertEquals($expected, $this->_view->render('testPartialLocals'));

168 }

174 (object)array('string_value' => 'world'));

175 $expected = '<div><p>hello</p><p>world</p></div>';

176 $this->assertEquals($expected, $this->_view->render('testPartialCollection'));

177 }

commontypes.php (https://bitbucket.org/Dal-Papa/is-340-publish-base.git) PHP · 634 lines

27 function Zend_Soap_TestAsset_TestFunc2()

28 {

29 return "Hello World";

30 }

31

283 * @var string

284 */

285 public $string = "Hello World";

286

287 /**

550 public function testFunc1()

551 {

552 return "Hello World";

553 }

554

SyntaxAnnotationTests.cs (https://gitlab.com/sharadag/TestProject2) C# · 872 lines

46 public void TestCopyAnnotationToNullSyntaxNode()

47 {

48 var fromNode = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot();

49 var toNode = default(SyntaxNode);

50 var annotatedNode = fromNode.CopyAnnotationsTo(toNode);

55 public void TestCopyAnnotationOfZeroLengthToSyntaxNode()

56 {

57 var fromNode = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot();

58 var toNode = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot();

65 {

66 var fromToken = default(SyntaxToken);

67 var toToken = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot().DescendantTokens().First();

68 var annotatedToken = fromToken.CopyAnnotationsTo(toToken);

69 Assert.True(annotatedToken.IsEquivalentTo(toToken));

73 public void TestCopyAnnotationToNullSyntaxToken()

74 {

75 var fromToken = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot().DescendantTokens().First();

76 var toToken = default(SyntaxToken);

77 var annotatedToken = fromToken.CopyAnnotationsTo(toToken);

ParameterBagTest.php (https://github.com/jordscream/symfony.git) PHP · 210 lines

1 <?php

2

3 /*

12 namespace Symfony\Component\HttpFoundation\Tests;

13

14 use PHPUnit\Framework\TestCase;

15 use Symfony\Component\HttpFoundation\Exception\BadRequestException;

16 use Symfony\Component\HttpFoundation\ParameterBag;

179 public function testGetIterator()

180 {

181 $parameters = ['foo' => 'bar', 'hello' => 'world'];

182 $bag = new ParameterBag($parameters);

183

193 public function testCount()

194 {

195 $parameters = ['foo' => 'bar', 'hello' => 'world'];

196 $bag = new ParameterBag($parameters);

197

Client.php (https://bitbucket.org/kudutest1/moodlegit.git) PHP · 258 lines

1 <?php

2 /**

3 * Zend Framework

7 * This source file is subject to the new BSD license that is bundled

8 * with this package in the file LICENSE.txt.

9 * It is also available through the world-wide-web at this URL:

10 * http://framework.zend.com/license/new-bsd

11 * If you did not receive a copy of the license and are unable to

12 * obtain it through the world-wide-web, please send an email

13 * to license@zend.com so we can send you a copy immediately.

14 *

23

24 /** Zend_Service_Abstract */

25 require_once 'Zend/Service/Abstract.php';

26

27 /** Zend_Rest_Client_Result */

ItemContainerGeneratorTest.cs (https://github.com/kvervo/HorizontalLoopingSelector.git) C# · 1074 lines

179 public virtual void GetContainerFromItemWithReferenceTypes()

180 {

181 string[] source = new string[] { "Hello", "World" };

182 HeaderedItemsControl items = new HeaderedItemsControl { ItemsSource = source };

183 TestAsync(

expression.test.ts (https://github.com/Siubaak/sval.git) TypeScript · 370 lines

177 interpreter.run(`

178 const re = /\\/\\*<([^>]+?)>\\*\\/([\\s\\S]*?)\\/\\*<\\/([^>]+?)>\\*\\//g

179 exports.a = '/*<add>*//*hello*//*</add>*/ /*<add>*//*world*//*</add>*/'

180 .replace(re, (_, start, content, end) => {

181 expect(start).toBe('add')

184 })

185 `)

186 expect(interpreter.exports.a).toBe('hello world')

187 })

188

xml_htmlsax_test.php (https://github.com/durand54/sitellite.git) PHP · 219 lines

126 }

127 function testAllPi() { // Not correct on whitespace.

128 $this->listener->expectOnce('piHandler', array('*', 'php', ' print "Hello"; '));

129 $this->listener->expectNever('dataHandler');

130 $this->listener->expectNever('startHandler');

192 $this->listener->expectNever('startHandler');

193 $this->listener->expectNever('endHandler');

194 $this->parser->parse('<' . '% document.write("Hello World");%>');

195 }

196 function testNasty() {

208 $this->listener->expectOnce(

209 'jaspHandler',

210 array('*', ' document.write("Hello World");'));

211 $this->listener->expectNever('piHandler');

212 $this->listener->expectNever('escapeHandler');

tests_examples.js (https://gitlab.com/vprihogenko/cr) JavaScript · 455 lines

140 "userName": "any name",

141 "serverSecret": key,

142 "code": "import java.awt.*; \n import java.util.*; Class<> \n import java.util.Scanner; \npublic class Main {public static void main(String[] args) {System.out.println(\"Hello world\");}",

143 "language":"java",

144 "testCases":[]

MemoryModelTest.js (https://gitlab.com/0072016/cocos2d-x-2d) JavaScript · 263 lines

81

82 // add random property

83 sprite.randomProperty = "hello world";

84

85 sprite = this.getChildByTag(tag);

86

87 // should print "hello world"

88 this.log(sprite.randomProperty);

89 },

BanchaApiTest.php (git://github.com/Bancha/Bancha.git) PHP · 291 lines

255

256 // test app controller

257 $this->assertContains('HelloWorld', array_keys($remotableMethods));

258 $this->assertCount(2, $remotableMethods['HelloWorld']);

259 $this->assertEquals('hello', $remotableMethods['HelloWorld'][0]['name']);

260 $this->assertEquals(0, $remotableMethods['HelloWorld'][0]['len']);

261 $this->assertEquals('helloyou', $remotableMethods['HelloWorld'][1]['name']);

262 $this->assertEquals(2, $remotableMethods['HelloWorld'][1]['len']);

266 $this->assertCount(1, $remotableMethods['TestPlugin.PluginTest']);

267 $this->assertEquals('exposedTestMethod', $remotableMethods['TestPlugin.PluginTest'][0]['name']);

268 $this->assertEquals(0, $remotableMethods['HelloWorld'][0]['len']);

269 }

270

FilesystemTest.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 240 lines

1 <?php

2

3 /*

119 * @group GH-1339

120 */

121 public function testRemoveDirectoryPhp()

122 {

123 $tmp = sys_get_temp_dir();

124 @mkdir($tmp . "/composer_testdir/level1/level2", 0777, true);

125 file_put_contents($tmp . "/composer_testdir/level1/level2/hello.txt", "hello world");

126

127 $fs = new Filesystem;

128 $this->assertTrue($fs->removeDirectoryPhp($tmp . "/composer_testdir"));

129 $this->assertFalse(file_exists($tmp . "/composer_testdir/level1/level2/hello.txt"));

JsonRpcTests.cpp (git://github.com/rstudio/rstudio.git) C++ · 357 lines

33 object["d"] = (uint64_t) 18446744073709550615U;

34 object["e"] = 246.9;

35 object["f"] = std::string("Hello world");

36

37 json::Array simpleArray;

205 object["d"] = (uint64_t)18446744073709550615U;

206 object["e"] = 246.9;

207 object["f"] = std::string("Hello world");

208

209 json::Array simpleArray;

273 REQUIRE(d == 18446744073709550615U);

274 REQUIRE(e == Approx(246.9));

275 REQUIRE(f == "Hello world");

276

277 REQUIRE(g[0].getInt() == 100);

test_asian_codecs.py (https://github.com/albertz/CPython.git) Python · 81 lines

26 j = Charset(jcode)

27 g = Charset(gcode)

28 h = Header("Hello World!")

29 jhello = str(b'\xa5\xcf\xa5\xed\xa1\xbc\xa5\xef\xa1\xbc'

31 ghello = str(b'Gr\xfc\xdf Gott!', gcode)

32 h.append(jhello, j)

33 h.append(ghello, g)

38 # encoded word.

39 eq(h.encode(), """\

40 Hello World! =?iso-2022-jp?b?GyRCJU8lbSE8JW8hPCVrJUkhKhsoQg==?=

41 =?iso-8859-1?q?Gr=FC=DF_Gott!?=""")

42 eq(decode_header(h.encode()),

43 [(b'Hello World! ', None),

44 (b'\x1b$B%O%m!<%o!<%k%I!*\x1b(B', 'iso-2022-jp'),

45 (b'Gr\xfc\xdf Gott!', gcode)])

expectation_test.php (https://github.com/billfox3/ThinkUp.git) PHP · 299 lines

13

14 function testStringMatch() {

15 $hello = new EqualExpectation("Hello");

16 $this->assertTrue($hello->test("Hello"));

72

73 function testStringMismatch() {

74 $not_hello = new NotEqualExpectation("Hello");

75 $this->assertTrue($not_hello->test("Goodbye"));

76 $this->assertFalse($not_hello->test("Hello"));

77 }

78 }

213 $pattern = new PatternExpectation('/hello/i');

214 $this->assertTrue($pattern->test("Hello world"));

215 $this->assertFalse($pattern->test("Goodbye world"));

219 $pattern = new NoPatternExpectation('/hello/i');

220 $this->assertFalse($pattern->test("Hello world"));

221 $this->assertTrue($pattern->test("Goodbye world"));

mergeCells.spec.js (https://github.com/handsontable/jquery-handsontable.git) JavaScript · 1402 lines

283 handsontable({

284 data: [

285 ['<b>Hello world</b>', 123, 'secret'],

286 ['Hello!', 'not numeric', 'secret too']

301 });

302

303 expect($(getHtCore()).find('td')[0].innerHTML).toBe('<b>Hello world</b>');

304 expect($(getHtCore()).find('td')[1].innerText).toBe('123');

305 expect($(getHtCore()).find('td')[2].innerText).toBe('******');

testhtmlwriter.php (https://github.com/Matthew1/moodle.git) PHP · 94 lines

1 <?php

2

3 // This file is part of Moodle - http://moodle.org/

28 die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page

29 }

30 require_once($CFG->libdir . '/outputcomponents.php');

31

32

39 class html_writer_test extends UnitTestCase {

40

41 public static $includecoverage = array('lib/outputcomponents.php');

42

43 public function test_start_tag() {

69

70 public function test_nonempty_tag_with_content() {

71 $this->assertEqual('<div>Hello world!</div>',

72 html_writer::nonempty_tag('div', 'Hello world!'));

RestClient.php (https://github.com/jtai/zf2.git) PHP · 294 lines

1 <?php

2 /**

3 * Zend Framework

7 * This source file is subject to the new BSD license that is bundled

8 * with this package in the file LICENSE.txt.

9 * It is also available through the world-wide-web at this URL:

10 * http://framework.zend.com/license/new-bsd

11 * If you did not receive a copy of the license and are unable to

12 * obtain it through the world-wide-web, please send an email

13 * to license@zend.com so we can send you a copy immediately.

14 *

244 * method (post, get, delete, put):

245 * <code>

246 * $response = $rest->sayHello('Foo', 'Manchu')->get();

247 * </code>

248 *

removeformat.html (https://gitlab.com/gricelya/test) HTML · 76 lines

17 <body>

18

19 <form method="post" action="http://www.tinymce.com/dump.php?example=true">

20 <div>

21 <h3>Full featured example</h3>

64 <a href="javascript:;" onmousedown="alert(tinymce.get('elm1').selection.getContent({format : 'text'}));">[Get selected text]</a>

65 <a href="javascript:;" onmousedown="alert(tinymce.get('elm1').selection.getNode().nodeName);">[Get selected element]</a>

66 <a href="javascript:;" onmousedown="tinymce.execCommand('mceInsertContent',false,'<b>Hello world!!</b>');">[Insert HTML]</a>

67 <a href="javascript:;" onmousedown="tinymce.execCommand('mceReplaceContent',false,'<b>{$selection}</b>');">[Replace selection]</a>

68

codegen.rst (https://github.com/idris-lang/Idris-dev.git) ReStructuredText · 147 lines

34 ::

35

36 $ idris --codegen javascript hello.idr -o hello.js

37

38

39 Idris can produce big chunks of JavaScript code (hello world weighs in at about

40 60 lines). However, the generated code can be minified using the

41 `closure-compiler <https://developers.google.com/closure/compiler/>`__ from

96 ::

97

98 idris hello.idr --codegen java -o hello.jar

99

100

Question_ChoiceTest.php (https://github.com/kodeplay/kodelearn.git) PHP · 92 lines

15 ),

16 'explain' => array(

17 'hello world',

18 'hello kodelearn'

26 'attribute_value' => 'question1',

27 'correctness' => '1',

28 'explanation' => 'hello world'

29 ),

30 1 => array(

43 'attribute_value' => 'question1',

44 'correctness' => '1',

45 'explanation' => 'hello world'

46 ),

47 1 => array(

59 'attribute_value' => 'question1',

60 'correctness' => '1',

61 'explanation' => 'hello world'

62 ),

63 1 => array(

about.controllers.md (https://bitbucket.org/alvinpd/monsterninja.git) Markdown · 102 lines

31 public function action_index()

32 {

33 echo 'Hello World!';

34 }

35 }

37 完成上面代码之后,在浏览器敲入 yoursite.com/article(或没有使用 URL 重写的地址 yoursite.com/index.php/article),你就能看到:

38 ~~~

39 Hello World

40 ~~~

41 这个控制器就是这么简单。里面包含了上面所提到的所有约定。

55 public function action_index()

56 {

57 echo 'Hello World!';

58 }

59

OfflineTest.php (https://github.com/necrogami/zf2.git) PHP · 273 lines

1 <?php

2 /**

3 * Zend Framework

7 * This source file is subject to the new BSD license that is bundled

8 * with this package in the file LICENSE.txt.

9 * It is also available through the world-wide-web at this URL:

10 * http://framework.zend.com/license/new-bsd

11 * If you did not receive a copy of the license and are unable to

12 * obtain it through the world-wide-web, please send an email

13 * to license@zend.com so we can send you a copy immediately.

14 *

88

89 $this->metadata2 = array (

90 'hello' => 'world'

91 );

92

test-irregex-mosh.ss (git://github.com/higepon/mosh.git) Scheme · 329 lines ✨ Summary

This Scheme code tests and implements a regular expression library, irregex. It checks various aspects of the library, including pattern matching, submatch extraction, replacement, and folding (aggregation) of matches. The tests cover different scenarios, such as simple patterns, email addresses, and more complex cases like chunked folding. The output indicates whether each test passes or fails, providing a snapshot of the library’s functionality.

308 (test "h*llo world"

309 (irregex-replace "[aeiou]" "hello world" "*"))

310 (test "h*ll* w*rld"

311 (irregex-replace/all "[aeiou]" "hello world" "*"))

update-object-e2e-test.js (https://gitlab.com/pump.io/pump.io) JavaScript · 218 lines

107 },

108 objectType: "note",

109 content: "Hello, world!"

110 }

111 };

135 assert.isObject(act);

136 assert.isObject(act.object);

137 assert.equal(act.object.content, "Hello, world!");

138 }

139 },

166 object: {

167 objectType: "note",

168 content: "Hello, world."

169 }

170 };

type_casting.php (https://github.com/ameximes/akelos.git) PHP · 92 lines

1 <?php

2

3 require_once(dirname(__FILE__).'/../config.php');

28 //'title' => 'Hello',

29 //'body' => 'Hello world!',

30 'posted_on(1i)' => '2005',

31 'posted_on(2i)' => '6',

44 $params = array(

45 'title' => 'Expiring salutation',

46 'body' => 'Expiring Hello world!',

47 'expires_at(1i)' => '2007',

48 'expires_at(2i)' => '10',

strncpy-chk.c (https://bitbucket.org/pizzafactory/pf-gcc.git) C · 227 lines

27 test1 (void)

28 {

29 const char *const src = "hello world";

30 const char *src2;

31 char dst[64], *dst2;

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

24 public void testClonePortlet() throws RemoteException {

25 RegistrationContext rC = registrationOperationsInterface.register(registrationData);

26 PortletContext pC = fillPortletContext("hello/HelloWorld");

27 ClonePortletRequest clonePortlet = new ClonePortletRequest();

28 clonePortlet.setRegistrationContext(rC);

37 RegistrationContext rC = new RegistrationContext();

38 rC.setRegistrationHandle("dummy_handle");

39 PortletContext pC = fillPortletContext("hello/HelloWorld");

40 try {

41 ClonePortletRequest clonePortlet = new ClonePortletRequest();

67 public void testCloneAlreadyClonedPortlet() throws RemoteException {

68 RegistrationContext rC = registrationOperationsInterface.register(registrationData);

69 PortletContext pC = fillPortletContext("hello/HelloWorld");

70 ClonePortletRequest clonePortlet = new ClonePortletRequest();

71 clonePortlet.setRegistrationContext(rC);

NoteTest.php (https://github.com/ksecor/civicrm.git) PHP · 302 lines

1 <?php

2 /*

3 +--------------------------------------------------------------------+

27 require_once 'api/v2/Note.php';

28 require_once 'tests/phpunit/CiviTest/CiviUnitTestCase.php';

29

30 /**

61 'entity_table' => 'civicrm_contact',

62 'entity_id' => $this->_contactID,

63 'note' => 'Hello!!! m testing Note',

64 'contact_id' => $this->_contactID,

65 'modified_date' => date('Ymd'),

233 'entity_table' => 'civicrm_contribution',

234 'note' => 'Note1',

235 'subject' => 'Hello World'

236 );

237

ParameterBagTest.php (https://gitlab.com/Pasantias/pasantiasASLG) PHP · 224 lines

1 <?php

2

3 /*

14 use Symfony\Component\HttpFoundation\ParameterBag;

15

16 class ParameterBagTest extends \PHPUnit_Framework_TestCase

17 {

18 public function testConstructor()

193 public function testGetIterator()

194 {

195 $parameters = array('foo' => 'bar', 'hello' => 'world');

196 $bag = new ParameterBag($parameters);

197

207 public function testCount()

208 {

209 $parameters = array('foo' => 'bar', 'hello' => 'world');

210 $bag = new ParameterBag($parameters);

211

SerializationTests.cs (https://github.com/Tornhoof/SpanJson.git) C# · 274 lines

110 public void SerializeDeserializePartialChinesePropertyNameUtf16()

111 {

112 var wpn = new PartialChinesePropertyName {你好 = "Hello", 你好你好 = "World"};

113 var serialized = JsonSerializer.Generic.Utf16.Serialize(wpn);

114 Assert.NotNull(serialized);

122 public void SerializeDeserializePartialChinesePropertyNameUtf8()

123 {

124 var wpn = new PartialChinesePropertyName {你好 = "Hello", 你好你好 = "World"};

125 var serialized = JsonSerializer.Generic.Utf8.Serialize(wpn);

126 Assert.NotNull(serialized);

182 [InlineData("😷Hello\t칱칳칶칹칼캠츧\t칱칳칶칹칼캠츧\nWorld😷")]

183 [InlineData("칱칳칶칹칼캠츧😁칱칳칶칹칼캠츧")]

184 [InlineData("Hello 😁 World")]

185 [InlineData("😷Hello 😁 World😷")]

195 [InlineData("칱칳칶칹칼캠츧\t칱칳칶칹칼캠츧")]

196 [InlineData("칱칳칶칹칼캠츧😁칱칳칶칹칼캠츧")]

197 [InlineData("Hello 😁 World")]

198 [InlineData("😷Hello 😁 World😷")]

README.md (https://github.com/amal/CDom.git) Markdown · 118 lines

6 CDom is a simple HTML/XML/BBCode DOM component.

7 It provides a parser for HTML-like markup language in the DOM-like structure and support searching through the DOM with full strength of CSS3 selectors and any manipulations.

8 CDom is based on [PHP Simple HTML DOM Parser](http://simplehtmldom.sourceforge.net/) and licensed under the MIT License.

9

10 Main features and possibilites:

61 ```php

62 // Create DOM from string

63 $dom = CDom::fromString('<div id="hello">Hello</div><div id="world">World</div>');

64

65 // Add class to the second div (first last child)

69 $dom->find('div[id=hello]')->text('foo');

70

71 echo $dom . "\n"; // Output: <div id="hello">foo</div><div id="world" class="bar">World</div>

72 ```

73

basics.js (https://bitbucket.org/peixuan/chromium_r197479_base.git) JavaScript · 175 lines

97

98 function permissionWarnings() {

99 var manifest_str = "{ \"name\": \"Hello World!\", \"version\": \"1.0\", " +

100 "\"permissions\": [\"http://api.flickr.com/\", " +

101 "\"bookmarks\", \"geolocation\", " +

hello.i (https://swig.svn.sourceforge.net/svnroot/swig) Unknown · 25 lines

1 #ifndef subdir2_hello_i_

2 #define subdir2_hello_i_

22

23

24 #endif //subdir2_hello_i_

25

ClassFrontendTest.php (https://github.com/WebTricks/WebTricks-CMS.git) PHP · 280 lines

1 <?php

2 /**

3 * Zend Framework

7 * This source file is subject to the new BSD license that is bundled

8 * with this package in the file LICENSE.txt.

9 * It is also available through the world-wide-web at this URL:

10 * http://framework.zend.com/license/new-bsd

11 * If you did not receive a copy of the license and are unable to

12 * obtain it through the world-wide-web, please send an email

13 * to license@zend.com so we can send you a copy immediately.

14 *

31 * PHPUnit test case

32 */

33 require_once 'PHPUnit/Framework/TestCase.php';

34

35 /**

core.clj (https://gitlab.com/BenjaminVanRyseghem/superchat) Clojure · 75 lines

9 {:status 200

10 :headers {"Content-Type" "text/plain"}

11 :body "Hello World"})

12

13 (def clients (atom #{}))

MySQLQueryBuilderTest.php (https://github.com/gwutama/Core.git) PHP · 325 lines

24

25 $q = Builder::insert("students", array("foo" => "bar", "baz" => "blah"), array(

26 "on duplicate key update" => "`hello` = 'world'"

27 ));

28 $this->assertEquals("INSERT INTO `students`(`foo`, `baz`) VALUES(:foo, :baz) ON DUPLICATE KEY UPDATE `hello` = 'world'", $q);

164 "fields" => array("id", "name", "lorem", "ipsum"),

165 "conditions" => Op::bAnd(

166 Op::eq("hello", "world"),

167 Op::eq("foo", "bar")

168 ),

169 "limit" => 3

170 ));

171 $this->assertEquals("SELECT `id`, `name`, `lorem`, `ipsum` FROM `people` WHERE (`hello` = :hello AND `foo` = :foo) LIMIT :core_query_limit", $q);

172

173 $q = Builder::select("people", array(

htmlwriter_test.php (https://bitbucket.org/kudutest1/moodlegit.git) PHP · 172 lines

1 <?php

2 // This file is part of Moodle - http://moodle.org/

3 //

20 *

21 * @package core

22 * @category phpunit

23 * @copyright 2010 Tim Hunt

24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

28

29 global $CFG;

30 require_once($CFG->libdir . '/outputcomponents.php');

31

32

67

68 public function test_nonempty_tag_with_content() {

69 $this->assertEquals('<div>Hello world!</div>',

70 html_writer::nonempty_tag('div', 'Hello world!'));

commontypes.php (https://github.com/zucchi/zf2.git) PHP · 636 lines

29 function TestFunc2()

30 {

31 return "Hello World";

32 }

33

285 * @var string

286 */

287 public $string = "Hello World";

288

289 /**

552 public function testFunc1()

553 {

554 return "Hello World";

555 }

556

005_variation.php (https://github.com/tstarling/hiphop-php.git) PHP · 170 lines

1 <?php

2 /*

3 Prototype: int fileatime ( string $filename );

73 echo "\n-- Checking different times, after writing into the file --\n";

74 $file_write_handle = fopen($file_name, "w");

75 fwrite($file_write_handle, "Hello, world");

76 fclose($file_write_handle);

77 stat_fn($file_name);

145 echo "Done\n";

146 ?>

147 <?php

148 $file_path = dirname(__FILE__);

149 if(file_exists($file_path."/005_variation_softlink.tmp")) {

FilesystemTest.php (https://bitbucket.org/mikebosire/framework.git) PHP · 110 lines

7 public function testGetRetrievesFiles()

8 {

9 file_put_contents(__DIR__.'/file.txt', 'Hello World');

10 $files = new Filesystem;

11 $this->assertEquals('Hello World', $files->get(__DIR__.'/file.txt'));

17 {

18 $files = new Filesystem;

19 $files->put(__DIR__.'/file.txt', 'Hello World');

20 $this->assertEquals('Hello World', file_get_contents(__DIR__.'/file.txt'));

25 public function testDeleteRemovesFiles()

26 {

27 file_put_contents(__DIR__.'/file.txt', 'Hello World');

28 $files = new Filesystem;

29 $files->delete(__DIR__.'/file.txt');

36 {

37 mkdir(__DIR__.'/foo');

38 file_put_contents(__DIR__.'/foo/file.txt', 'Hello World');

39 $files = new Filesystem;

40 $files->deleteDirectory(__DIR__.'/foo');

controller.blog.php (https://github.com/MilkZoft/www.git) PHP · 445 lines

1 <?php

2 /**

3 * Access from index.php:

334 $post .= __("and when you add a new post this post will be disappear automatically, enjoy it!");

335

336 $vars["hello"] = __("Hello World");

337 $vars["date"] = now(1);

338 $vars["post"] = $post;

template.php (https://bitbucket.org/matyhaty/senses-thwaites.git) PHP · 216 lines

1 <?php

2 if (!defined('BASEPATH'))

3 exit('No direct script access allowed');

22 | Typically this file will contain a full XHTML skeleton that outputs your

23 | full template or region per region. Include the file extension if other

24 | than ".php"

25 | ['regions'] Places within the template where your content may land.

26 | You may also include default markup, wrappers and attributes here

44 | $template['default']['regions'] = array(

45 | 'header' => array(

46 | 'content' => array('<h1>Welcome</h1>','<p>Hello World</p>'),

47 | 'name' => 'Page Header',

48 | 'wrapper' => '<div>',

213 //---------//---------//---------//---------//---------//---------//---------

214

215 /* End of file template.php */

216 /* Location: ./system/application/config/template.php */

ParsecTests.cs (https://github.com/louthy/language-ext.git) C# · 785 lines

86 {

87 var p = anyChar;

88 var r1 = parse(p, "Hello");

89

90 Assert.False(r1.IsFaulted);

191 {

192 var p = lower;

193 var r = parse(p, "hello");

194

195 Assert.False(r.IsFaulted);

231 {

232 var p = letter;

233 var r = parse(p, "hello");

234

235 Assert.False(r.IsFaulted);

272 var p = str("hello");

273 var r = parse(p, "hello world");

274

275 Assert.False(r.IsFaulted);

MapTests.cs (https://github.com/louthy/language-ext.git) C# · 583 lines

16 {

17 var m1 = Map<int, string>();

18 m1 = add(m1, 100, "hello");

19 Assert.True(m1.Count == 1 && containsKey(m1,100));

20 }

25 Map<int, string> m2 = ((1, "a"), (2, "b"), (3, "c"));

26

27 m2 = add(m2, 100, "world");

28

29 var res = match(

33 );

34

35 Assert.True(res == "world");

36 }

37

transparency.rb (https://github.com/darrikmazey/finance.git) Ruby · 99 lines

18 # # both the fill and stroke will be at 50% opacity

19 # pdf.transparent(0.5) do

20 # pdf.text("hello world")

21 # pdf.fill_and_stroke_circle_at([x, y], :radius => 25)

22 # end

25 # # be at 75% opacity

26 # pdf.transparent(0.5, 0.75) do

27 # pdf.text("hello world")

28 # pdf.fill_and_stroke_circle_at([x, y], :radius => 25)

29 # end

41 # # both the fill and stroke will be at 50% opacity

42 # pdf.transparent(0.5) do

43 # pdf.text("hello world")

44 # pdf.fill_and_stroke_circle_at([x, y], :radius => 25)

45 # end

NamespacedAttributeBagTest.php (https://gitlab.com/techniconline/kmc) PHP · 183 lines

1 <?php

2

3 /*

34 {

35 $this->array = array(

36 'hello' => 'world',

37 'always' => 'be happy',

38 'user.login' => 'drak',

131 public function testRemove()

132 {

133 $this->assertEquals('world', $this->bag->get('hello'));

134 $this->bag->remove('hello');

163 {

164 return array(

165 array('hello', 'world', true),

166 array('always', 'be happy', true),

167 array('user.login', 'drak', true),

SyntaxAnnotationTests.cs (https://github.com/dotnet/roslyn.git) C# · 874 lines

48 public void TestCopyAnnotationToNullSyntaxNode()

49 {

50 var fromNode = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot();

51 var toNode = (SyntaxNode)null;

52 var annotatedNode = fromNode.CopyAnnotationsTo(toNode);

57 public void TestCopyAnnotationOfZeroLengthToSyntaxNode()

58 {

59 var fromNode = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot();

60 var toNode = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot();

67 {

68 var fromToken = default(SyntaxToken);

69 var toToken = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot().DescendantTokens().First();

70 var annotatedToken = fromToken.CopyAnnotationsTo(toToken);

71 Assert.True(annotatedToken.IsEquivalentTo(toToken));

75 public void TestCopyAnnotationToNullSyntaxToken()

76 {

77 var fromToken = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot().DescendantTokens().First();

78 var toToken = default(SyntaxToken);

79 var annotatedToken = fromToken.CopyAnnotationsTo(toToken);

Varargs.html (https://swig.svn.sourceforge.net/svnroot/swig) HTML · 942 lines ✨ Summary

This HTML code outputs a technical documentation page for SWIG, a software development tool. It provides information on how to wrap variable-length argument functions in C++ using various techniques, including the %varargs directive and typemaps. The content explains the challenges of wrapping varargs, discusses different approaches, and offers guidance on how to implement them.

167 <div class="code">

168 <pre>

169 printf("Hello %s. Your number is %d\n", name, num);

170 </pre>

171 </div>

277 <div class="targetlang">

278 <pre>

279 &gt;&gt;&gt; traceprintf("Hello World")

280 &gt;&gt;&gt; traceprintf("Hello %s. Your number is %d\n" % (name, num))

825 <p>

826 Doing anything more advanced than this is likely to involve a serious

827 world of pain. In order to use a library like libffi, you will need

828 to know the underlying calling conventions and details of the C++ ABI. For

829 instance, the details of how <tt>this</tt> is passed to member

JGithubPackageActivityEventsTest.php (https://github.com/pjwiseman/joomla-cms.git) PHP · 349 lines

1 <?php

2 /**

3 * @package Joomla.UnitTest

15 * @since 12.3

16 */

17 class JGithubPackageActivityEventsTest extends PHPUnit_Framework_TestCase

18 {

19 /**

48 "repo": {

49 "id": 3,

50 "name": "octocat/Hello-World",

51 "url": "https://api.github.com/repos/octocat/Hello-World"

about.controllers.md (https://github.com/samsoir/userguide.git) Markdown · 104 lines

33 public function action_index()

34 {

35 echo 'Hello World!';

36 }

37 }

39 完成上面代码之后,在浏览器敲入 yoursite.com/article(或没有使用 URL 重写的地址 yoursite.com/index.php/article),你就能看到:

40 ~~~

41 Hello World

42 ~~~

43 这个控制器就是这么简单。里面包含了上面所提到的所有公约。

57 public function action_index()

58 {

59 echo 'Hello World!';

60 }

61

import.php (https://gitlab.com/Blueprint-Marketing/wordpress-unit-tests) PHP · 226 lines

1 <?php

2

3 /**

15

16 add_filter( 'import_allow_create_users', '__return_true' );

17 require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php';

18

19 global $wpdb;

137 $this->assertEquals( 'publish', $post->post_status );

138 $this->assertEquals( 0, $post->post_parent );

139 $this->assertEquals( 'onecolumn-page.php', get_post_meta( $post->ID, '_wp_page_template', true ) );

140

141 $post = $posts[6];

176

177 $post = $posts[10];

178 $this->assertEquals( 'Hello world!', $post->post_title );

179 $this->assertEquals( 'hello-world', $post->post_name );

PITCHME.md (https://gitlab.com/zautre/curriculum) Markdown · 176 lines

56 #HSLIDE

57 ```c

58 string str = "Hello World";

59 char x = str[4];

60 Console.WriteLine(x);

OfflineTest.php (https://github.com/shevron/zf2.git) PHP · 260 lines

1 <?php

2 /**

3 * Zend Framework (http://framework.zend.com/)

26 * @group Zend\Service\Rackspace\Files

27 */

28 class OfflineTest extends \PHPUnit_Framework_TestCase

29 {

30 /**

75

76 $this->metadata2 = array (

77 'hello' => 'world'

78 );

79

PropelXMLParserTest.php (https://github.com/1989gaurav/Propel.git) PHP · 198 lines

1 <?php

2

3 /**

9 */

10

11 require_once dirname(__FILE__) . '/../../../../runtime/lib/parser/PropelParser.php';

12 require_once dirname(__FILE__) . '/../../../../runtime/lib/parser/PropelXMLParser.php';

19 * @package runtime.parser

20 */

21 class PropelXMLParserTest extends PHPUnit_Framework_TestCase

22 {

23 public static function arrayXmlConversionDataProvider()

46 </data>

47 ", 'associative array with strings'),

48 array(array('a' => '<html><body><p style="width:30px;">Hello, World!</p></body></html>'), "<?xml version=\"1.0\" encoding=\"UTF-8\"?>

49 <data>

50 <a><![CDATA[&lt;html&gt;&lt;body&gt;&lt;p style=&quot;width:30px;&quot;&gt;Hello, World!&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;]]></a>

socket.test.js (https://github.com/ryooo321/node_websocket_chat_box.git) JavaScript · 331 lines

317

318 socket.emit('tobi', 1, 2, function (a) {

319 a.should().eql({ hello: 'world' });

320 socket.disconnect();

321 next();

ParameterBagTest.php (https://github.com/liuggio/symfony.git) PHP · 266 lines

1 <?php

2

3 /*

14 use Symfony\Component\HttpFoundation\ParameterBag;

15

16 class ParameterBagTest extends \PHPUnit_Framework_TestCase

17 {

18 /**

229 public function testGetIterator()

230 {

231 $parameters = array('foo' => 'bar', 'hello' => 'world');

232 $bag = new ParameterBag($parameters);

233

246 public function testCount()

247 {

248 $parameters = array('foo' => 'bar', 'hello' => 'world');

249 $bag = new ParameterBag($parameters);

250

TextureCacheTest.js (https://bitbucket.org/gontamoteam/gontamo-repo.git) JavaScript · 151 lines

45

46 // load textrues

47 cc.TextureCache.getInstance().addImageAsync("res/Images/HelloWorld.png", this, this.loadingCallBack);

48 cc.TextureCache.getInstance().addImageAsync("res/Images/grossini.png", this, this.loadingCallBack);

49 cc.TextureCache.getInstance().addImageAsync("res/Images/grossini_dance_01.png", this, this.loadingCallBack);

70

71 // create sprites

72 var bg = cc.Sprite.create("res/Images/HelloWorld.png");

73 bg.setPosition(cc.p(size.width / 2, size.height / 2));

74 //bg.setScale(1.7);

RegexMatchValueTests.cs (https://github.com/EricWhiteDev/corefx.git) C# · 226 lines

57 iCountTestcases++;

58 rgx1 = new Regex(@"\s*(.*?)\s*$");

59 strInput = " Hello World ";

60 mtch1 = rgx1.Match(strInput);

61 if (mtch1.Success)

reflectionmethod.getdeclaringclass.html (https://github.com/cue-taro/emacs-setting-files.git) HTML · 89 lines

10 <div class="next" style="text-align: right; float: right;"><a href="reflectionmethod.getmodifiers.html">ReflectionMethod::getModifiers</a></div>

11 <div class="up"><a href="class.reflectionmethod.html">ReflectionMethod</a></div>

12 <div class="home"><a href="index.html">PHP Manual</a></div>

13 </div><hr /><div id="reflectionmethod.getdeclaringclass" class="refentry">

14 <div class="refnamediv">

15 <h1 class="refname">ReflectionMethod::getDeclaringClass</h1>

16 <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">ReflectionMethod::getDeclaringClass</span> &mdash; <span class="dc-title">メソッドが宣言されているクラスを取得する</span></p>

17

18 </div>

54 <div class="phpcode"><code><span style="color: #000000">

55 <span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">HelloWorld&nbsp;</span><span style="color: #007700">{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;protected&nbsp;function&nbsp;</span><span style="color: #0000BB">sayHelloTo</span><span style="color: #007700">(</span><span style="color: #0000BB">$name</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #DD0000">'Hello&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$name</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />}<br /><br /></span><span style="color: #0000BB">$reflectionMethod&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">ReflectionMethod</span><span style="color: #007700">(new&nbsp;</span><span style="color: #0000BB">HelloWorld</span><span style="color: #007700">(),&nbsp;</span><span style="color: #DD0000">'sayHelloTo'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$reflectionMethod</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getDeclaringClass</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?&gt;</span>

56 </span>

57 </code></div>

63 object(ReflectionClass)#2 (1) {

64 [&quot;name&quot;]=&gt;

65 string(10) &quot;HelloWorld&quot;

66 }

67 </pre></div>

QueueBaseTest.php (https://github.com/leerbag/zf2.git) PHP · 249 lines

1 <?php

2 /**

3 * Zend Framework

7 * This source file is subject to the new BSD license that is bundled

8 * with this package in the file LICENSE.txt.

9 * It is also available through the world-wide-web at this URL:

10 * http://framework.zend.com/license/new-bsd

11 * If you did not receive a copy of the license and are unable to

12 * obtain it through the world-wide-web, please send an email

13 * to license@zend.com so we can send you a copy immediately.

14 *

170

171 // ------------------------------------ send()

172 $message = 'Hello world'; // never gets boring!

173 $this->assertTrue($this->queue->send($message) instanceof \Zend\Queue\Message);

174

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

122 ApplicationMembershipCondition app = new ApplicationMembershipCondition ();

123 SecurityElement se = app.ToXml ();

124 se.Attributes ["class"] = "Hello world";

125 app.FromXml (se);

126 }

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

139 ApplicationDirectoryMembershipCondition ad = new ApplicationDirectoryMembershipCondition ();

140 SecurityElement se = ad.ToXml ();

141 se.Attributes ["class"] = "Hello world";

142 ad.FromXml (se);

143 }

vfprintf_variation4_64bit.php (https://github.com/tstarling/hiphop-php.git) PHP · 78 lines

1 <?php

2 /* Prototype : int vfprintf ( resource $handle , string $format , array $args )

3 * Description: Write a formatted string to a stream

34 array(" ", ' ', 'hello',

35 '123hello', "123hello", '-123hello', '+123hello',

36 "\12345678hello", "-\12345678hello", '0123456hello', 'h123456ello',

37 "1234hello", "hello\0world", "NULL", "true",

38 "3", "4", '1', '2'),

39

42 array("123"), array('123'), array('-123'), array("-123"),

43 array(true), array(false), array(TRUE), array(FALSE),

44 array("123hello"), array("1", "2"), array('123hello'), array(12=>"12twelve"),

45 array("3"), array("4"), array("1"), array("2") ),

46

array_intersect_key_variation3.php (https://github.com/tstarling/hiphop-php.git) PHP · 99 lines

1 <?php

2 /* Prototype : array array_intersect_key(array arr1, array arr2 [, array ...])

3 * Description: Returns the entries of arr1 that have keys which are present in all the other arguments.

32 // heredoc string

33 $heredoc = <<<EOT

34 hello world

35 EOT;

36

basename_variation4.php (https://github.com/tstarling/hiphop-php.git) PHP · 102 lines

1 <?php

2 /* Prototype : string basename(string path [, string suffix])

3 * Description: Returns the filename component of the path

38 // heredoc string

39 $heredoc = <<<EOT

40 hello world

41 EOT;

42

imagecolorallocate_variation1.php (https://github.com/tstarling/hiphop-php.git) PHP · 105 lines

1 <?php

2 /* Prototype : int imagecolorallocate(resource im, int red, int green, int blue)

3 * Description: Allocate a color for an image

34 // heredoc string

35 $heredoc = <<<EOT

36 hello world

37 EOT;

38

FunctionsTest.php (https://github.com/arbyte/FLOW3-X-TYPO3.FLOW3.git) PHP · 207 lines

1 <?php

2 namespace TYPO3\FLOW3\Tests\Unit\Utility\Unicode;

3

4 /* *

5 * This script belongs to the FLOW3 package "PHP6". *

6 * *

7 * It is free software; you can redistribute it and/or modify it under *

13

14 /**

15 * Testcase for the PHP6 Functions backport

16 *

17 */

45 */

46 public function substrWorksWithLatinCharacters() {

47 $testString = 'I say "hello world".';

48 $this->assertEquals('hello world', \TYPO3\FLOW3\Utility\Unicode\Functions::substr($testString, 7, 11), 'substr() with latin characters did not return the expected string.');

twiml.rst (https://github.com/cj/twilio-php.git) ReStructuredText · 132 lines

7 TwiML creation begins with the :class:`Services_Twilio_Twiml` verb. Each succesive verb is created by calling various methods on the response, such as :meth:`say` or :meth:`play`. These methods return the verbs they create to ease the creation of nested TwiML.

8

9 .. code-block:: php

10

11 $response = new Services_Twilio_Twiml();

44

45 $response = new Services_Twilio_Twiml();

46 $response->say("Hello World");

47 print $response;

48

50

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

52 <Response><Say>Hello World</Say></Response>

53

54 Play

Client.php (https://github.com/MontmereLimited/ZendFramework-v1.git) PHP · 258 lines

1 <?php

2 /**

3 * Zend Framework

7 * This source file is subject to the new BSD license that is bundled

8 * with this package in the file LICENSE.txt.

9 * It is also available through the world-wide-web at this URL:

10 * http://framework.zend.com/license/new-bsd

11 * If you did not receive a copy of the license and are unable to

12 * obtain it through the world-wide-web, please send an email

13 * to license@zend.com so we can send you a copy immediately.

14 *

18 * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)

19 * @license http://framework.zend.com/license/new-bsd New BSD License

20 * @version $Id: Client.php 24274 2011-07-28 09:25:31Z mcleod@spaceweb.nl $

21 */

22

ArrayAccessTest.class.php (https://github.com/ghiata/xp-framework.git) PHP · 410 lines

24 public function hashTableReadElement() {

25 $c= new HashTable();

26 $world= new String('world');

27 $c->put(new String('hello'), $world);

28 $this->assertEquals($world, $c[new String('hello')]);

29 }

30

100 public function hashTableRemoveElement() {

101 $c= new HashTable();

102 $c->put(new String('hello'), new String('world'));

103 $this->assertTrue(isset($c[new String('hello')]));

203 #[@test]

204 public function vectorIsUsableInForeach() {

205 $values= array(new String('hello'), new String('world'));

206 foreach (new Vector($values) as $i => $value) {

207 $this->assertEquals($values[$i], $value);

macro-basics.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 786 lines

143 <sect1 id="first-example" ><title>The Mandatory First Example</title>

144 <informalexample><!-- <title>A first one-line macro</title> -->

145 <programlisting>Macros.message(view, "Hello world!");</programlisting>

146 </informalexample>

147 <para>

546 <informalexample><!-- <title>Using <function>Macros.error()</function> and

547 <function>Macros.input()</function></title> -->

548 <programlisting>Macros.error(view, "Goodbye, cruel world!");

549

550 String result = Macros.input(view, "Type something here.");

NavigatorPlugin.props (https://jedit.svn.sourceforge.net/svnroot/jedit) MSBuild · 71 lines

34 # this is the text that will be shown on the jEdit plugin

35 # menu. It is read by jEdit via the createMenuItems method in

36 # HelloPlugin. This line must start with the string passed to

37 # the GUIUtilities.loadMenu method in createMenuItems.

38 navigator.menu.label=Navigator

47

48 # the next three items are the labels to add to a submenu on

49 # the plugins menu for the HelloPlugin. The plugins menu will have

50 # a menu item labeled "Hello!" that has a submenu with "Show", "Hide",

text-edit.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 1246 lines

929 <para>Selecting the <guibutton>Ignore case</guibutton> check box

930 makes the search case insensitive - for example, searching for

931 <quote>Hello</quote> will match <quote>hello</quote>,

932 <quote>HELLO</quote> and <quote>HeLlO</quote>.</para>

TwitterAlikeExample.html (http://redis.googlecode.com/svn/trunk/) HTML · 253 lines ✨ Summary

This HTML code outputs a blog post about Redis, a popular in-memory data store. The content explains how to implement a Twitter-like clone using Redis, including setting up followers and posting messages. It also discusses horizontal scaling of the system, including hashing keys, distributing user data across servers, and handling special cases like incrementing IDs and retrieving timeline data.

17 <div class="index">

18 <!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->

19 <b>TwitterAlikeExample: Contents</b><br>&nbsp;&nbsp;<a href="#A case study: Design and implementation of a simple Twitter clone using only the Redis key-value store as database and PHP">A case study: Design and implementation of a simple Twitter clone using only the Redis key-value store as database and PHP</a><br>&nbsp;&nbsp;<a href="#Key-value stores basics">Key-value stores basics</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Atomic operations">Atomic operations</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Beyond key-value stores">Beyond key-value stores</a><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#The set data type">The set data type</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Prerequisites">Prerequisites</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Data layout">Data layout</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Following, followers and updates">Following, followers and updates</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Authentication">Authentication</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Updates">Updates</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Paginating updates">Paginating updates</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Following users">Following users</a><br>&nbsp;&nbsp;<a href="#Making it horizontally scalable">Making it horizontally scalable</a><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Hashing the key">Hashing the key</a><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Special keys">Special keys</a>

20 </div>

21

27

28 <div class="narrow">

29 <h1><a name="A case study: Design and implementation of a simple Twitter clone using only the Redis key-value store as database and PHP">A case study: Design and implementation of a simple Twitter clone using only the Redis key-value store as database and PHP</a></h1>In this article I'll explain the design and the implementation of a <a href="http://retwis.antirez.com" target="_blank">simple clone of Twitter</a> written using PHP and <a href="http://code.google.com/p/redis/" target="_blank">Redis</a> as only database. The programming community uses to look at key-value stores like special databases that can't be used as drop in replacement for a relational database for the development of web applications. This article will try to prove the contrary.<br/><br/>Our Twitter clone, <a href="http://retwis.antirez.com" target="_blank">called Retwis</a>, is structurally simple, has very good performances, and can be distributed among N web servers and M Redis servers with very little efforts. You can find the source code <a href="http://code.google.com/p/redis/downloads/list" target="_blank">here</a>.<br/><br/>We use PHP for the example since it can be read by everybody. The same (or... much better) results can be obtained using Ruby, Python, Erlang, and so on.

30 <h1><a name="Key-value stores basics">Key-value stores basics</a></h1>

31 The essence of a key-value store is the ability to store some data, called <i>value</i>, inside a key. This data can later be retrieved only if we know the exact key used to store it. There is no way to search something by value. So for example I can use the command SET to store the value <b>bar</b> at key <b>foo</b>:<br/><br/><pre class="codeblock python" name="code">

79 </pre>Ok I think we are ready to start coding!

80 <h2><a name="Prerequisites">Prerequisites</a></h2>

81 If you didn't download it already please <a href="http://code.google.com/p/redis/wiki/README" target="_blank">grab the source code of Retwis</a>. It's a simple tar.gz file with a few of .php files inside. The implementation is very simple. You will find the PHP library client inside (redis.php) that is used to talk with the Redis server from PHP. This library was written by <a href="http://qix.it" target="_blank">Ludovico Magnocavallo</a> and you are free to reuse this in your own projects, but for updated version of the library please download the Redis distribution.<br/><br/>Another thing you probably want is a working Redis server. Just get the source, compile with make, and run with ./redis-server and you are done. No configuration is required at all in order to play with it or to run Retwis in your computer.

82 <h2><a name="Data layout">Data layout</a></h2>

83 Working with a relational database this is the stage were the database layout should be produced in form of tables, indexes, and so on. We don't have tables, so what should be designed? We need to identify what keys are needed to represent our objects and what kind of values this keys need to hold.<br/><br/>Let's start from Users. We need to represent this users of course, with the username, userid, password, followers and following users, and so on. The first question is, what should identify an user inside our system? The username can be a good idea since it is unique, but it is also too big, and we want to stay low on memory. So like if our DB was a relational one we can associate an unique ID to every user. Every other reference to this user will be done by id. That's very simple to do, because we have our atomic INCR operation! When we create a new user we can do something like this, assuming the user is callled &quot;antirez&quot;:<br/><br/><pre class="codeblock python python python python python python python python python python python python" name="code">

uk.po (git://pkgs.fedoraproject.org/pingus) Unknown · 64 lines

25 msgstr "??????????"

26

27 #: helloworld.cpp:8 helloworld.cpp:14

28 msgid "Hello World"

29 msgid_plural "Hello Worlds"

30 msgstr[0] "???? ??????"

31 msgstr[1] "???? ??????"

32 msgstr[2] "???? ??????"

33

34 #: helloworld.cpp:10 helloworld.cpp:16

35 msgctxt ""

36 msgid "Hello World"

40 msgstr[2] "???? ??????"

41

42 #: helloworld.cpp:11 helloworld.cpp:17

43 msgctxt "console"

44 msgid "Hello World"

GppFunctionalTest.groovy (https://bitbucket.org/nbargnesi/idea.git) Groovy · 616 lines

505 @Trait

506 class Some {

507 public void doSmth() { println "hello" }

508 }

509 Some s

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

This Java code is a graphical user interface (GUI) for editing syntax styles, specifically font and color settings, in a text editor. It provides a dialog box with checkboxes and color selection buttons to customize the appearance of text in the editor. The changes are saved when the “OK” button is clicked, allowing users to apply their preferred style to the editor’s text rendering.

259 setOpaque(true);

260 setBorder(SyntaxHiliteOptionPane.noFocusBorder);

261 setText("Hello World");

262 } //}}}

263

ccache.c (https://swig.svn.sourceforge.net/svnroot/swig) C · 1389 lines ✨ Summary

This C code implements a caching system for compilers and other build tools. It allows users to specify a directory where cached results can be stored, and provides options for managing cache limits, clearing caches, and setting verbosity levels. The program also handles errors and networking issues, such as duping stderr to prevent caching of error messages.

506 }

507

508 /* ~/hello.c -> tmp.hello.123.i

509 limit the basename to 10

510 characters in order to cope with filesystem with small

htmlTags.xml (https://bitbucket.org/nbargnesi/idea.git) XML · 3 lines

1 <resources>

2 <string name="hello_world"><b><<caret></b></string>

3 </resources>

main.xml (http://softkeyboard.googlecode.com/svn/) XML · 13 lines

8 android:layout_width="fill_parent"

9 android:layout_height="wrap_content"

10 android:text="@string/hello"

11 />

12 </LinearLayout>

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

This C++ code tests the functionality of the Boost.Phoenix library, specifically its argument handling and value extraction capabilities. It creates various variables and constants, then uses Phoenix functions to extract values from them, testing for correctness and compile-time errors. The test results are reported using BOOST_TEST macros.

37 cout << val("Hello,")() << val(' ')() << val("World")() << endl;

38 BOOST_TEST(val(3)() == 3);

39 BOOST_TEST(val("Hello, world")() == std::string("Hello, world"));

40 BOOST_TEST(val(_1)(i1) == i1);

41

director_string_runme.php (https://swig.svn.sourceforge.net/svnroot/swig) PHP · 35 lines ✨ Summary

This PHP code tests a set of functions, classes, and global variables to ensure they are working as expected. It creates an instance of class B, which extends class A, and calls various methods on it to verify their behavior. The test checks for equality with expected results, indicating that the code passes the tests successfully.

1 <?php

2

3 require "tests.php";

4 require "director_string.php";

5

6 // No new functions

13 class B extends A {

14 function get_first() {

15 return parent::get_first() . " world!";

16 }

17

25

26 $b->get(0);

27 check::equal($b->get_first(),"hello world!", "get_first failed");

28

29 $b->call_process_func();

runme.d (https://swig.svn.sourceforge.net/svnroot/swig) D · 72 lines ✨ Summary

This D code demonstrates global variable access and manipulation, showcasing how variables can be accessed and modified from different scopes. It prints out the values of various global variables, including integers, floats, strings, and a custom Point structure, before attempting to modify some read-only variables and update a structure variable. The output shows the results of these operations.

18 example.fvar = 3.14159f;

19 example.dvar = 2.1828;

20 example.strvar = "Hello World";

21 example.iptrvar = example.new_int(37);

22 example.ptptr = example.new_Point(37,42);

ignore_parameter_runme.R (https://swig.svn.sourceforge.net/svnroot/swig) Unknown · 11 lines

4 cacheMetaData(1)

5

6 unittest(jaguar(1, 1.0), "hello")

7 q(save="no")

8

448329-1.html (git://github.com/zpao/v8monkey.git) HTML · 72 lines ✨ Summary

This HTML code creates an iframe and tests its functionality by simulating user interactions, such as selecting text with a specific color. It uses JavaScript to manipulate the iframe’s content and test how the browser handles different commands like “backcolor” and “hilitecolor”. The test is likely used to identify bugs in the browser’s behavior when handling these commands.

49 doc.queryCommandIndeterm(cmd);

50

51 var text = doc.createTextNode("Hello Kitty");

52 body.insertBefore(text, null)

53