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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.xxx</groupId> | |
<artifactId>Xxxx</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<properties> | |
<java.version>1.8</java.version> |
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
<?php | |
/** | |
* 打印空心菱形 | |
* @param [int] $level [层数] | |
* @return [void] | |
*/ | |
function diamondPrinter($level){ | |
for ($index = 1; $index <= $level; $index++) { | |
currentLevel($index, $level); |
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
<?php | |
/** | |
* 打印金字塔 | |
* @param [int] $level [层数] | |
* @return [void] | |
*/ | |
function pyramidPrinter($level){ | |
for ($index = 1; $index <= $level; $index++) { | |
for ($space = $level; $space > $index; $space--) { |
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
int upperBit(x) | |
{ | |
int count = 0; | |
while(x) | |
{ | |
count++; | |
x = x & (x-1); | |
} | |
return count; | |
} |
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
<?php | |
date_default_timezone_set('PRC'); | |
$filename = 'messages.txt'; | |
$username = $_POST['username'] ?? null; | |
$title = $_POST['title'] ?? null; | |
$content = $_POST['content'] ?? null; | |
if(!is_null($username) && !is_null($title) && !is_null($content)){ |
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
<?php | |
/** | |
* Created by PhpStorm. | |
* User: dailybird | |
* Date: 17/6/1 | |
* Time: 下午11:57 | |
*/ | |
$nodes = [ |
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 com | |
import scala.collection.mutable.ArrayBuffer | |
object CombinationQuestion { | |
def main(args: Array[String]): Unit = { | |
val candidates = ArrayBuffer[Int](1, 3, 7, 5, 9) | |
val count = 3 | |
val container = getAllCombinations(count, candidates) |
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 com; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.logging.Logger; | |
import java.util.regex.Pattern; | |
public class PatternQuestion { |
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 com | |
import scala.collection.mutable.ArrayBuffer | |
object PermutationQuestion { | |
def main(args: Array[String]): Unit = { | |
val candidates = ArrayBuffer[Int](1, 3, 7, 5, 9) | |
val count = 3 | |
val container = getAllPermutations(count, candidates) |
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 com | |
import scala.collection.mutable.ArrayBuffer | |
object MagicSquare { | |
def main(args: Array[String]): Unit = { | |
val target = Array[Array[Int]]( | |
Array[Int](4, 8, 2), |
OlderNewer