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 );
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 }
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!");
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!");
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!");
245 attr_set set1;
testaux.c (https://github.com/PrecipiceGames/craftd.git) C · 405 lines
173 int test5 (void) {
174 struct tagbstring t = bsStatic ("Hello world");
175 bstring b;
176 int ret = 0;
252 int test9 (void) {
253 struct tagbstring t = bsStatic ("Hello world");
254 bstring b, c;
255 int err, ret = 0;
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 *
110 $this->metadata2 = array(
111 'hello' => 'world'
112 );
strrchr.asm (https://github.com/kframework/X86-64-semantics.git) Assembly · 527 lines
strlen.asm (https://github.com/kframework/X86-64-semantics.git) Assembly · 513 lines
markdown.yml (https://github.com/gitlabhq/gitlabhq.git) YAML · 2195 lines
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();
127 String json = _serializer.Serialize(result);
128 json.Should().Be("{\"value\":\"Hello, World!\",\"wasSuccessful\":true}");
129 }
141 public void WriteJson_SuccessWithValueAndObservations_WritesCorrectly()
142 {
143 Result<String, String> result = "Hello, World!".ToResult().ObserveMany("It went well!", "Take a break!");
145 String json = _serializer.Serialize(result);
CACIDiscoveryNonJunitTests.java (https://github.com/societies/SOCIETIES-Platform.git) Java · 209 lines
22 static ICAUITaskManager cauiTaskManager = null;
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;
28 //private static final String SERVICE_SRI2 = "css://requestor.societies.org/HelloWorld";
29 //private static ServiceResourceIdentifier serviceSri2;
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">
697 <SPAN TYPE="MARKUP" DELEGATE="php::PHP">
698 <BEGIN><?php</BEGIN>
700 </SPAN>
702 <SPAN TYPE="MARKUP" DELEGATE="php::PHP">
703 <BEGIN><?</BEGIN>
704 <END>?></END>
README (https://freespeech.svn.sourceforge.net/svnroot/freespeech) Unknown · 5 lines
SimpeTemplateTest.php (https://gitlab.com/php.bjoernbartels.earth/simpletemplate) PHP · 275 lines
205 ->next();
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 }
222 ->next();
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
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
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
3 /*
12 namespace Symfony\Component\HttpFoundation\Tests;
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);
193 public function testCount()
194 {
195 $parameters = ['foo' => 'bar', 'hello' => 'world'];
196 $bag = new ParameterBag($parameters);
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 *
24 /** Zend_Service_Abstract */
25 require_once 'Zend/Service/Abstract.php';
27 /** Zend_Rest_Client_Result */
ItemContainerGeneratorTest.cs (https://github.com/kvervo/HorizontalLoopingSelector.git) C# · 1074 lines
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 })
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
MemoryModelTest.js (https://gitlab.com/0072016/cocos2d-x-2d) JavaScript · 263 lines
BanchaApiTest.php (git://github.com/Bancha/Bancha.git) PHP · 291 lines
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 }
FilesystemTest.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 240 lines
1 <?php
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");
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");
37 json::Array simpleArray;
205 object["d"] = (uint64_t)18446744073709550615U;
206 object["e"] = 246.9;
207 object["f"] = std::string("Hello world");
209 json::Array simpleArray;
273 REQUIRE(d == 18446744073709550615U);
274 REQUIRE(e == Approx(246.9));
275 REQUIRE(f == "Hello world");
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
14 function testStringMatch() {
15 $hello = new EqualExpectation("Hello");
16 $this->assertTrue($hello->test("Hello"));
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 });
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
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');
39 class html_writer_test extends UnitTestCase {
41 public static $includecoverage = array('lib/outputcomponents.php');
43 public function test_start_tag() {
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>
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>
codegen.rst (https://github.com/idris-lang/Idris-dev.git) ReStructuredText · 147 lines
34 ::
36 $ idris --codegen javascript hello.idr -o hello.js
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 ::
98 idris hello.idr --codegen java -o hello.jar
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
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 *
89 $this->metadata2 = array (
90 'hello' => 'world'
91 );
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.
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.
update-object-e2e-test.js (https://gitlab.com/pump.io/pump.io) JavaScript · 218 lines
type_casting.php (https://github.com/ameximes/akelos.git) PHP · 92 lines
1 <?php
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
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';
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 );
ParameterBagTest.php (https://gitlab.com/Pasantias/pasantiasASLG) PHP · 224 lines
1 <?php
3 /*
14 use Symfony\Component\HttpFoundation\ParameterBag;
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);
207 public function testCount()
208 {
209 $parameters = array('foo' => 'bar', 'hello' => 'world');
210 $bag = new ParameterBag($parameters);
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.
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>');
65 // Add class to the second div (first last child)
69 $dom->find('div[id=hello]')->text('foo');
71 echo $dom . "\n"; // Output: <div id="hello">foo</div><div id="world" class="bar">World</div>
72 ```
basics.js (https://bitbucket.org/peixuan/chromium_r197479_base.git) JavaScript · 175 lines
hello.i (https://swig.svn.sourceforge.net/svnroot/swig) Unknown · 25 lines
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';
35 /**
core.clj (https://gitlab.com/BenjaminVanRyseghem/superchat) Clojure · 75 lines
MySQLQueryBuilderTest.php (https://github.com/gwutama/Core.git) PHP · 325 lines
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);
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
29 global $CFG;
30 require_once($CFG->libdir . '/outputcomponents.php');
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
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
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 //---------//---------//---------//---------//---------//---------//---------
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");
90 Assert.False(r1.IsFaulted);
191 {
192 var p = lower;
193 var r = parse(p, "hello");
195 Assert.False(r.IsFaulted);
231 {
232 var p = letter;
233 var r = parse(p, "hello");
235 Assert.False(r.IsFaulted);
272 var p = str("hello");
273 var r = parse(p, "hello world");
275 Assert.False(r.IsFaulted);
MapTests.cs (https://github.com/louthy/language-ext.git) C# · 583 lines
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
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.
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 >>> traceprintf("Hello World")
280 >>> 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
about.controllers.md (https://github.com/samsoir/userguide.git) Markdown · 104 lines
import.php (https://gitlab.com/Blueprint-Marketing/wordpress-unit-tests) PHP · 226 lines
1 <?php
3 /**
16 add_filter( 'import_allow_create_users', '__return_true' );
17 require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php';
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 ) );
141 $post = $posts[6];
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
OfflineTest.php (https://github.com/shevron/zf2.git) PHP · 260 lines
PropelXMLParserTest.php (https://github.com/1989gaurav/Propel.git) PHP · 198 lines
1 <?php
3 /**
9 */
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[<html><body><p style="width:30px;">Hello, World!</p></body></html>]]></a>
socket.test.js (https://github.com/ryooo321/node_websocket_chat_box.git) JavaScript · 331 lines
ParameterBagTest.php (https://github.com/liuggio/symfony.git) PHP · 266 lines
1 <?php
3 /*
14 use Symfony\Component\HttpFoundation\ParameterBag;
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);
246 public function testCount()
247 {
248 $parameters = array('foo' => 'bar', 'hello' => 'world');
249 $bag = new ParameterBag($parameters);
TextureCacheTest.js (https://bitbucket.org/gontamoteam/gontamo-repo.git) JavaScript · 151 lines
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);
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
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> — <span class="dc-title">メソッドが宣言されているクラスを取得する</span></p>
18 </div>
54 <div class="phpcode"><code><span style="color: #000000">
55 <span style="color: #0000BB"><?php<br /></span><span style="color: #007700">class </span><span style="color: #0000BB">HelloWorld </span><span style="color: #007700">{<br /><br /> protected function </span><span style="color: #0000BB">sayHelloTo</span><span style="color: #007700">(</span><span style="color: #0000BB">$name</span><span style="color: #007700">) {<br /> return </span><span style="color: #DD0000">'Hello ' </span><span style="color: #007700">. </span><span style="color: #0000BB">$name</span><span style="color: #007700">;<br /> }<br /><br />}<br /><br /></span><span style="color: #0000BB">$reflectionMethod </span><span style="color: #007700">= new </span><span style="color: #0000BB">ReflectionMethod</span><span style="color: #007700">(new </span><span style="color: #0000BB">HelloWorld</span><span style="color: #007700">(), </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">-></span><span style="color: #0000BB">getDeclaringClass</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?></span>
56 </span>
57 </code></div>
63 object(ReflectionClass)#2 (1) {
64 ["name"]=>
65 string(10) "HelloWorld"
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 *
171 // ------------------------------------ send()
172 $message = 'Hello world'; // never gets boring!
173 $this->assertTrue($this->queue->send($message) instanceof \Zend\Queue\Message);
ApplicationDirectoryMembershipConditionTest.cs (https://github.com/iainlane/mono.git) C# · 224 lines
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'),
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") ),
basename_variation4.php (https://github.com/tstarling/hiphop-php.git) PHP · 102 lines
imagecolorallocate_variation1.php (https://github.com/tstarling/hiphop-php.git) PHP · 105 lines
FunctionsTest.php (https://github.com/arbyte/FLOW3-X-TYPO3.FLOW3.git) PHP · 207 lines
1 <?php
2 namespace TYPO3\FLOW3\Tests\Unit\Utility\Unicode;
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 *
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.
9 .. code-block:: php
11 $response = new Services_Twilio_Twiml();
45 $response = new Services_Twilio_Twiml();
46 $response->say("Hello World");
47 print $response;
51 <?xml version="1.0" encoding="UTF-8"?>
52 <Response><Say>Hello World</Say></Response>
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 */
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 }
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!");
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
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
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.
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> <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> <a href="#Key-value stores basics">Key-value stores basics</a><br> <a href="#Atomic operations">Atomic operations</a><br> <a href="#Beyond key-value stores">Beyond key-value stores</a><br> <a href="#The set data type">The set data type</a><br> <a href="#Prerequisites">Prerequisites</a><br> <a href="#Data layout">Data layout</a><br> <a href="#Following, followers and updates">Following, followers and updates</a><br> <a href="#Authentication">Authentication</a><br> <a href="#Updates">Updates</a><br> <a href="#Paginating updates">Paginating updates</a><br> <a href="#Following users">Following users</a><br> <a href="#Making it horizontally scalable">Making it horizontally scalable</a><br> <a href="#Hashing the key">Hashing the key</a><br> <a href="#Special keys">Special keys</a>
20 </div>
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 "antirez":<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 "??????????"
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] "???? ??????"
34 #: helloworld.cpp:10 helloworld.cpp:16
35 msgctxt ""
36 msgid "Hello World"
40 msgstr[2] "???? ??????"
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
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.
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.
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.
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.
htmlTags.xml (https://bitbucket.org/nbargnesi/idea.git) XML · 3 lines
main.xml (http://softkeyboard.googlecode.com/svn/) XML · 13 lines
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.
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.
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.
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.
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.
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.
ignore_parameter_runme.R (https://swig.svn.sourceforge.net/svnroot/swig) Unknown · 11 lines
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.
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.