Instantly share code, notes, and snippets.

View untrusted-lvl5-solution.js
/******************
* minesweeper.js *
******************
*
* So much for Asimov's Laws. They're actually trying to kill
* you now. Not to be alarmist, but the floor is littered
* with mines. Rushing for the exit blindly may be unwise.
* I need you alive, after all.
*
* If only there was some way you could track the positions
View palindrome.php
<?php
class Palindrome
{
public static function isPalindrome($word)
{
$word = strtolower($word);
if ( $word == strrev($word) ) {
return true;
}
return false;
View cloudmusic_sync.py
from subprocess import check_output
import json
import requests
from urllib.parse import urljoin
from hashlib import md5
from os import path
import os
import tempfile
from urllib.request import urlretrieve
import shutil
View untrusted-lvl14-solution.js
/********************
* crispsContest.js *
********************
*
* The Algorithm is almost in our grasp!
* At long last, we will definitively establish
* that 3SAT is solvable in polynomial time. It's
* been a long, strange journey, but it will all be
* worth it.
*
View AndroidPermissionManager.java
import android.app.Activity;
import android.content.pm.PackageManager;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import java.util.Random;
public class AndroidPermissionManager
{
View ViewModelProviderFactory.java
import android.arch.lifecycle.ViewModel;
import android.arch.lifecycle.ViewModelProvider;
/**
* A provider factory that persists ViewModels {@link ViewModel}.
* Used if the view model has a parameterized constructor.
*/
public class ViewModelProviderFactory<V> implements ViewModelProvider.Factory {
private V viewModel;
View run
@Override
public void run() {
Integer i =1;
BigInteger modification , check ;
EntityManager em = Persistence.createEntityManagerFactory("TPGLPU").createEntityManager();
modification = (BigInteger) em.createQuery("Select X.lastChange from DataChange X where X.idChange = :idChange")
.setParameter("idChange",1).getSingleResult();
View jcs.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head profile="http://dublincore.org/documents/2008/08/04/dc-html/">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="robots" content="index,follow">
<meta name="creator" content="rfcmarkup version 1.129b">
<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/">
<link rel="icon" href="" type="image/png">
<link rel="shortcut icon" href="" type="image/png">
<title>draft-rundgren-json-canonicalization-scheme-2.txt - JSON Canonicalization Scheme (JCS)</title>
View inttostring.js
//int型转换成string型
var x=100
a = x.toString()
var x=100;
a = x +""; //JS会自动隐性转换
//将string 变成 int
View untrusted-lvl4-solution.js
/*******************
* multiplicity.js *
*******************
*
* Out of one cell and into another. They're not giving you
* very much to work with here, either. Ah, well.
*
* Level filenames can be hints, by the way. Have I
* mentioned that before?
*