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
| #/bin/bash | |
| #-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password | |
| REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'` | |
| if [ -z "$REPO_URL" ]; then | |
| echo "-- ERROR: Could not identify Repo url." | |
| echo " It is possible this repo is already using SSH instead of HTTPS." | |
| exit | |
| 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
| #!/usr/bin/python2 | |
| import time | |
| from collections import deque | |
| TIME_QUEUE_LENGTH = 5 | |
| HIGH_ACTIVITY_THRESHOLD = 2 | |
| def calc_rolling_avg(queue): | |
| """ |
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
| @SuppressWarnings({ "unchecked" }) | |
| public PostSet getAllPosts(){ | |
| PostSet postSet= new PostSet(); | |
| PersistenceManager pm = getPersistenceManager(); | |
| Query q = pm.newQuery(Post.class); | |
| try{ | |
| List<Post> posts = (List<Post>)q.execute(); | |
| for(Post p : posts){ |
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> | |
| void function (int a, int b, int c) | |
| { | |
| char buffer1[5]; | |
| char buffer2[10]; | |
| int *ret; | |
| ret = buffer1 + 24; | |
| (*ret) += 7; |
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> | |
| void function (int a, int b, int c) | |
| { | |
| char buffer1[5]; | |
| char buffer2[10]; | |
| //int *ret; | |
| //ret = buffer1 + ?; | |
| //(*ret) += ?; |
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
| sub $0x60,%rsp | |
| lea -0x4(%rbp),%rdx | |
| lea -0x60(%rbp),%rcx |
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 main() { | |
| int cookie; | |
| char buf[80]; | |
| printf("buf: %08x cookie: %08x\n", &buf, &cookie); | |
| gets(buf); | |
| if (cookie == 0x000d0a00) | |
| printf("you win!\n"); |
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 main() { | |
| int cookie; | |
| char buf[80]; | |
| printf("buf: %08x cookie: %08x\n", &buf, &cookie); | |
| gets(buf); | |
| if (cookie == 0x41424344) | |
| printf("you win!\n"); |
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
| === test2 === | |
| No Filler: | |
| N % misses time | |
| 1000000 0.55 0.329 | |
| 1000000 0.55 0.329 | |
| 1000000 0.54 0.331 | |
| 1000000 0.45 0.353 | |
| 1000000 0.55 0.330 | |
| 1000000 0.52 0.334 | |
| 1000000 0.55 0.330 |
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 program exploits Nehalem's L2 data cache bandwidth of 64 bytes by using | |
| // two threads to increment a test variable, allocating memory in both a single | |
| // 64 byte slice and in two separate slices. To ensure 8 byte variables, long | |
| // int is used for test variables. Changing the filler length from 56 to 48 | |
| // bytes places both test variables in the same 64 byte slice and testing | |
| // confirms the 64 byte bandwidth of the L1 data cache (via increased cache | |
| // misses). | |
| // | |
| // When run without the filler, the test variables are in the same 64 byte slice | |
| // and performance suffers in both cache misses and running time. With the |
NewerOlder