This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Speech recognition test</title> | |
</head> | |
<body> | |
<input type="text" x-webkit-speech /> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// boolean-arc.cc | |
// Compile with: g++ -fPIC boolean-arc.cc -o boolean-arc.so -shared –O2 | |
// Make sure boolean-arc.so is on the LD_LIBRARY_PATH | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wstring UTF8ToUTF16(const string& utf8) { | |
wstring utf16; | |
utf16.reserve(utf8.size()); | |
for ( size_t i = 0; i < utf8.size(); ++i ) { | |
unsigned char ch0 = utf8[i]; | |
if ( (ch0 & 0x80) == 0x00 ) { | |
utf16 += ((ch0 & 0x7f)); | |
} else { | |
if ((ch0 & 0xe0) == 0xc0) { | |
unsigned char ch1 = utf8[++i]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class StringEx | |
{ | |
public static String[] SplitOnWhiteSpace(this String s) | |
{ | |
return s.Split(new String[] { " ", "\t", "\f", "\n", "\r", "\v" }, | |
StringSplitOptions.RemoveEmptyEntries); | |
} | |
} |
NewerOlder