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
# You will need to make this file executable (chmod u+x) and run it with sudo | |
apt-get update | |
apt-get --fix-missing -y install build-essential m4 libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev libwxgtk2.8-dev libglu1-mesa-dev fop xsltproc default-jdk | |
mkdir -p /src/erlang | |
cd /src/erlang | |
wget http://www.erlang.org/download/otp_src_R16B03-1.tar.gz | |
tar -xvzf otp_src_R15B01.tar.gz | |
chmod -R 777 otp_src_R15B01 | |
cd otp_src_R15B01 | |
./configure |
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
/** | |
* Align image to bottom, fill width. and crop top if needed. | |
* | |
* http://stackoverflow.com/questions/6330084/imageview-scaling-top-crop | |
* https://gist.github.com/arriolac/3843346 | |
*/ | |
import android.content.Context; | |
import android.graphics.Matrix; | |
import android.util.AttributeSet; | |
import android.widget.ImageView; |
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
All the changes that are fit to print. Droppin’ Mo’ Science 52 All Your IOPS Are Belong To Us: Ernie Souhrada, Database Engineer @ Pinterest - Percona Live MySQL Conference & Expo 2015 Full list of customizations / changes deployed: | |
- Linux kernel 3.18.7 | |
- irqbalance 1.0.8 | |
- RPS enabled | |
- Jemalloc instead of Glibc | |
- Disk IO scheduler = noop | |
- XFS + 64K RAID block size | |
- Mount options: - noatime,nobarrier,discard,inode64,logbsize=256k | |
- my.cnf changes: | |
innodb_max_dirty_pages_pct = 75 |
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
import android.util.SparseArray; | |
import android.widget.AbsListView; | |
/** | |
* Helper class for calculating relative scroll offsets in a ListView or GridView by tracking the | |
* position of child views. | |
*/ | |
public class ListViewScrollTracker { | |
private AbsListView mListView; | |
private SparseArray<Integer> mPositions; |
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 | |
$dblink1=mysqli_connect('[server ip1]', '[username]', '[password]'); // connect server 1 | |
mysqli_select_db($dblink1,'[db name]'); // select database 1 | |
$dblink2=mysqli_connect('[server ip2]', '[username]', '[password]'); // connect server 2 | |
mysqli_select_db($dblink2,'[db name]'); // select database 2 | |
$tables = mysqli_fetch_array(mysqli_query($dblink1,"SHOW TABLES ")); |
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
from flask import Flask | |
from flask import request | |
import simplejson as json | |
from decimal import Decimal | |
import numpy as np | |
import os | |
import sys |
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
import android.app.Activity; | |
import android.content.Intent; | |
import android.media.MediaPlayer; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.TextView; | |
import com.mklimek.framevideoview.FrameVideoView; | |
import com.mklimek.framevideoview.FrameVideoViewListener; |
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
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
VideoCell *videoCell = (VideoCell *)[self.tableView dequeueReusableCellWithIdentifier:@"VideoCell"]; | |
NSString *urlString = @"streaming://download.wavetlan.com/SVV/Media/HTTP/MOV/ConvertedFiles/MediaCoder/MediaCoder_test11_36s_H263_VBR_590kbps_176x144_25fps_MPEG1Layer3_CBR_160kbps_Stereo_22050Hz.mov"; | |
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul); | |
// Configure Video Cell Here: | |
NSURL *url = [NSURL URLWithString:urlString]; | |
videoCell.contentView.backgroundColor = [UIColor clearColor]; | |
videoCell.backgroundColor = [UIColor clearColor]; |
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
// Author - Santosh Rajan | |
import Foundation | |
let jsonObject: [AnyObject] = [ | |
["name": "John", "age": 21], | |
["name": "Bob", "age": 35], | |
] | |
func JSONStringify(value: AnyObject, prettyPrinted: Bool = false) -> String { |
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
#!/bin/bash | |
echo "*****************************************" | |
echo " Based on information from Google" | |
echo " http://dev.chromium.org/spdy/spdy-best-practices" | |
echo "*****************************************" | |
sudo su | |
yum –y update | |
echo "*****************************************" | |
echo " Changing initcwnd and initrwnd" | |
echo " Step 1: check route settings." |
OlderNewer