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
{{FrontSide}} | |
<hr id="answer"> | |
<span class="replace-back">{{Back}}</span> | |
<script> | |
try { | |
_ref = $('.replace-back'); | |
for (_i = 0, _len = _ref.length; _i < _len; _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
/* xscreensaver, Copyright (c) 1992-2008 Jamie Zawinski <jwz@jwz.org> | |
* | |
* Permission to use, copy, modify, distribute, and sell this software and its | |
* documentation for any purpose is hereby granted without fee, provided that | |
* the above copyright notice appear in all copies and that both that | |
* copyright notice and this permission notice appear in supporting | |
* documentation. No representations are made about the suitability of this | |
* software for any purpose. It is provided "as is" without express or | |
* implied warranty. | |
*/ |
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 random | |
def sort(a, feedback=False): | |
lower_limit = 0 | |
upper_limit = len(a) - 1 | |
steps = 0 | |
while(lower_limit != upper_limit ): | |
i = lower_limit | |
while i < upper_limit - 1: |
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
// this is kind of a hack since App Engine doesn't support OAuth 2, but that's the | |
// only version of OAuth that's natively supported by Android | |
val token = settings.getString("oauth2_token", "") | |
// send OAuth token to appspot login page | |
// response will contain a valid cookie | |
val req = new HttpGet("https://x-allow-oauth-dot-google-showy.appspot.com/_ah/login?continue=http://localhost/&auth=" + token); | |
val client = new DefaultHttpClient() | |
// avoid redirects - we are only interested in the cookie, not any content | |
client.getParams.setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, false) | |
// we are not interested in the result, so no need to save it |
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
:- initialization(solve). | |
solve :- sudoku([_, _, 1, _, _, _, 8, _, _, | |
_, 7, _, 3, 1, _, _, 9, _, | |
3, _, _, _, 4, 5, _, _, 7, | |
_, 9, _, 7, _, _, 5, _, _, | |
_, 4, 2, _, 5, _, 1, 3, _, | |
_, _, 3, _, _, 9, _, 4, _, | |
2, _, _, 5, 7, _, _, _, 4, | |
_, 3, _, _, 9, 1, _, 6, _, |
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
scalaVersion in ThisBuild := "2.10.0" | |
scalacOptions in ThisBuild += "-language:experimental.macros" | |
libraryDependencies in ThisBuild ++= Seq( | |
"org.scala-lang" % "scala-reflect" % "2.10.0" | |
) |
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
#!/usr/bin/python | |
import random | |
try: | |
from termcolor import colored | |
except ImportError: | |
def colored(s, color): | |
return s | |
ERROR = 0 |
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
cmake_minimum_required(VERSION 2.6) | |
project(task1) | |
set(CMAKE_CXX_FLAGS "-g -Wall") | |
add_executable(sdc_client sdc_client.cpp) | |
target_link_libraries(sdc_client boost_program_options) |
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 "zmq.hpp" | |
#include <string> | |
#include <iostream> | |
#include <pthread.h> | |
using namespace std; | |
void *msg_routine(void *arg) { | |
zmq::socket_t *message_source = (zmq::socket_t *) arg; |
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
string ChatManager::newChat(){ | |
Chat c; | |
c.name = "Chat"+(i++); | |
chats[c.name] = c; | |
return c.name; | |
} |
OlderNewer