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
#include <iostream> | |
#include <optional> | |
std::optional<std::string> Speak() | |
{ | |
return { "Excellent!" }; | |
} | |
int main() | |
{ |
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
#include <iostream> | |
#include <string> | |
using namespace std; | |
class Robot | |
{ | |
public: | |
void spune (string propozitie) |
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
package parallelStreamsOfIntegers; | |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; |
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
class MyClass { | |
MyClass() { | |
System.out.println("MyClass"); | |
} | |
MyClass(String id) { | |
System.out.println("MyClass " + id); | |
} | |
} |
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
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | |
PrintWriter out = response.getWriter(); | |
String button1 = request.getParameter("smile"); | |
String button2 = request.getParameter("wait"); | |
if (button1 != null) { | |
out.println("<html><body>"); | |
out.println("<h1>Smile!!!</h1>"); | |
out.println("</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
<div> | |
<h2>Windy Afternoon</h2> | |
<p>Windy afternoon</p> | |
<p>Your smile</p> | |
<p>On a stranger's face</p> | |
<form action=http://votemyhaiku.azurewebsites.net/VoteMyHaiku/vote method=Get> | |
<input type=Submit name="smile" value="Like" class="my_button"/> |
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
// import does not work in Codepen | |
// using const instead | |
const {Component, Inject} = ng.core; | |
const {bootstrap} = ng.platform.browser; | |
const {HTTP_PROVIDERS, Http, Response} = ng.http; | |
@Component({ | |
selector: 'my-app', | |
template: '<h1>{{ quote }}</h1>' | |
}) |
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
{ "quotes": | |
[ | |
{ | |
"quote": "It is only with the heart that one can see rightly.", | |
"author": "Antoine de Saint-Exupery", | |
"tags": [ "inspiration", "success" ], | |
"category": "StExupery", | |
"title": "My Favourite Quote", | |
"id": "" | |
} |
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
package enums; | |
enum CardTypes { | |
CLUBS, // ♣ | |
DIAMONDS,//♦ | |
HEARTS, //♥ | |
SPADES // ♠ | |
} | |
public class playingCards { |
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
function end(str, target) { | |
// "Never give up and good luck will find you." | |
// -- Falcor | |
//find position of first character of target in str | |
var last = lastMatch(str, target); | |
if ((last >= 0) && (target.length == str.length-last)){ | |
for (var i=last+1; i<target.length-1; i++){ | |
if (str[i] !== target [i-last]) { |
NewerOlder