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
| deck=matrix(c(rep( c(2:10,"J","Q","K","A"),4),rep(c("C","D","H","S"),rep(13,4))), ncol=2,dimnames=list(NULL,c("rank","suit"))) | |
| deal_hand = function() | |
| { | |
| return( deck[sample(1:52,5,replace=F),]) | |
| } | |
| what_hand = function(hand) | |
| { |
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
| #include <stdio.h> | |
| int get_shrek() | |
| { | |
| asm(".intel_syntax noprefix\n" | |
| "mov eax, 42 \n"); | |
| } | |
| int main() | |
| { |
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
| #include <iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| int toggle; | |
| int counter=1; //remember to initialize this. otherwise junk or null. Most likely junk/garbage...GG. | |
| for(int i = 1; i<= 12; i++) | |
| { |
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
| #include <iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| char array[] = "acdegilmnoprstuw"; | |
| string result; | |
| long long h = 910897038977002; | |
| for(int i=0; i <9;i++) | |
| for(int j=0; j <16;j++) |
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
| #List audio sinks | |
| pacmd list-sinks | |
| #Change default from monitor to USB (0 --> 1) | |
| pacmd set-default-sink 1 | |
| #Get all input streams | |
| pacmd list-sink-inputs | |
| #Move input stream from ex. 5 to 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
| pizza=$(echo "xxx yyy | |
| xxx yyy" | awk '{ if($2 == "yyy") print $2}') | |
| Awk tries to match pattern in every line. Then outputs $2 to variable 'pizza', concatenating the entries. | |
| #!/bin/sh | |
| module="TITS" | |
| device="TITS" |
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
| if ! [[ -z "$1" ]]; then | |
| ps aux | grep $1 | awk {'print $2'} | xargs kill -9 | |
| else | |
| echo "Not set" | |
| fi |
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
| /* free block with user-pointer p (block actually starts at p - TAGSIZE) */ | |
| void freef(char *p) | |
| { | |
| /* you write the code for the freef function here */ | |
| printf("freef called with p=%p\n", (void *) p); | |
| if(p < allocbuf || p > allocbuf + ALLOCSIZE) { | |
| printf("freef: BAD POINTER!, %p\n", (void*)p); | |
| return; |
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.util.*; | |
| import java.lang.*; | |
| import java.io.*; | |
| /* Name of the class has to be "Main" only if the class is public. */ | |
| class 3Sum | |
| { | |
| static HashSet<int[]> res = new HashSet<int[]>(); | |
| public static void main (String[] args) throws java.lang.Exception |
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
| https://cdn-images-1.medium.com/max/660/1*WgROsTKa6diRYTG5K0R5mw.jpeg | |
| http://scruss.com/wordpress/wp-content/uploads/2013/06/random20130606210630.png | |
| https://upload.wikimedia.org/wikipedia/commons/thumb/3/36/Two_red_dice_01.svg/220px-Two_red_dice_01.svg.png | |
| https://cdn-images-1.medium.com/max/1600/1*t_G1kZwKv0p2arQCgYG7IQ.gif | |
| https://vignette.wikia.nocookie.net/austinally/images/1/14/Random_picture_of_shark.png/revision/latest?cb=20150911004230 | |
| http://www.lozano-hemmer.com/image_sets/method_random/method_random2.jpg | |
| https://openclipart.org/download/232694/Pattern20a.svg | |
| https://i.pinimg.com/originals/f5/9b/1b/f59b1b0cc430702e82dea90780d7f87d.gif | |
| https://cdn.dribbble.com/users/815278/screenshots/2375130/random-turtle.gif | |
| https://media.boingboing.net/wp-content/uploads/2016/08/pandyland.jpg |
OlderNewer