This file contains hidden or 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 main | |
| import "fmt" | |
| func var_dump(expression interface{}) { | |
| fmt.Printf("(%v, %T)\n", expression, expression) | |
| } | |
| func var_dump_empty_interface(expression ...interface{}) { | |
| fmt.Printf("(%v, %T)\n", expression, expression) |
This file contains hidden or 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
| /** | |
| * Process in parallel via forking (PHP) | |
| */ | |
| public function processDNSResolutionsParallel(array $hostnames,$ipInfo,&$hostnameMap,$processes=4) { | |
| $hostnameChunks = array_chunk($hostnames,ceil((count($hostnames)/$processes))); | |
| $pid = -1; | |
| $children = array(); | |
| $ip = []; | |
| $resolveChunk=[]; |
This file contains hidden or 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 is_administrator($user_id=0) | |
| { | |
| $user = new WP_User( intval($user_id) ); | |
| $admin = false; | |
| if ( !empty( $user->roles ) && is_array( $user->roles ) ) { | |
| foreach ( $user->roles as $role ) { | |
| if ( strtolower($role) == 'administrator') { | |
| $admin = true; | |
| } |
This file contains hidden or 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
| <fieldset> | |
| <legend>Research Summary</legend> | |
| <label for="science_objective"> | |
| <span class="groups_text">Problem Statement, Scientific Objectives, and Scientific Needs <br/><span>State the key aspect(s) and scientific objective(s) of the task. </span></span> | |
| <span class="metals_text" style="display: none;" >Metals Objectives</span> | |
| </label> |
This file contains hidden or 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
| /* | |
| * Write a program that outputs the string | |
| * representation of numbers from 1 to n. | |
| * But for multiples of three it should output “Fizz” | |
| * instead of the number and for the multiples of five output “Buzz”. | |
| * For numbers which are multiples of both three and five output “FizzBuzz”. | |
| */ | |
| import java.util.ArrayList; | |
| import java.util.List; |
This file contains hidden or 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
| //LeetCode exercise FindComplement | |
| //fastest way to solve it | |
| public class FastComplement { | |
| public int complement(int num) { | |
| return ~num & ((Integer.highestOneBit(num) << 1) - 1); | |
| } | |
| } |
This file contains hidden or 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 java.io.BufferedReader; | |
| import java.io.InputStreamReader; | |
| import java.io.IOException; | |
| /** | |
| * Encodes a string to RLE | |
| **/ | |
| public final class RLEEncoder { | |
| private RLEEncoder() { } |
This file contains hidden or 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 simple Hello World programs | |
| * takes the name as an input and will | |
| * return "Hello, [name]!" or will just | |
| * print "Hello, World" if given nothing. | |
| * | |
| * @author Arpan Ghosh | |
| */ | |
| public class HelloWorld { | |
This file contains hidden or 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 class Acronym { | |
| static String output = ""; | |
| public static String generate(String input) { | |
| output += input.charAt(0); | |
| for (int i = 1; i < input.length(); i++) { | |
| if (Character.isWhitespace(input.charAt(i))) { |