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
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
NSMutableString* nameList = [[NSMutableString alloc] init]; | |
for (UIView *subview in [self.view subviews]) { | |
NSString* name = NSStringFromClass([subview class]); | |
if ([nameList length] > 0) | |
[nameList appendString:@", "]; | |
[nameList appendString:name]; | |
} |
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 <QuartzCore/QuartzCore.h> | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
for (UIView *subview in [self.view subviews]) { | |
subview.layer.cornerRadius = 10; | |
if ([subview isKindOfClass:UIButton.class]) | |
[subview setBackgroundColor:[UIColor colorWithRed:0.33 green:0.33 blue:0.9 alpha:1.0]]; |
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
// This function reads the stored value from a file on the device | |
void openCount() { | |
try { | |
// Open a file and data stream | |
FileInputStream out = openFileInput("count.bin"); | |
DataInputStream data = new DataInputStream(out); | |
// Read the binary value from the stream and store in the integer | |
_count = data.readInt(); |
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
AnimationSet set = new AnimationSet(true); | |
Animation animation = new AlphaAnimation(0.0f, 1.0f); | |
animation.setDuration(100); | |
set.addAnimation(animation); | |
animation = new TranslateAnimation( | |
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, | |
Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f | |
); | |
animation.setDuration(2000); | |
set.addAnimation(animation); |
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
long start = SystemClock.uptimeMillis(); | |
for (int i = 0; i < 1000; i++) { | |
String x = Integer.toString(i); | |
} | |
long total = SystemClock.uptimeMillis() - start; | |
Log.i("time", String.format("Total for toString is %d", total)); | |
start = SystemClock.uptimeMillis(); | |
for (int i = 0; i < 1000; i++) { | |
String x = String.valueOf(i); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Issue 3</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> | |
<script src="http://mikeplate.github.com/jquery-drag-drop-plugin/jquery.drag-drop.plugin.js"></script> | |
<style> | |
.whileDragging { | |
background-color: yellow; | |
} |
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
; Set some variables we'll need later | |
SysGet, DeskW, 16 | |
SysGet, DeskH, 62 | |
SysGet, WinBorderH, 46 | |
DeskH := DeskH - WinBorderH*8 | |
; Create the window group EXPLORER so we can treat all such windows as a group further down | |
GroupAdd,EXPLORER, ahk_class CabinetWClass | |
#WinActivateForce | |
return |
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 | |
# | |
# This script is used to set up vsftpd for multiple virtual users with predefined passwords | |
# fetched from a text file. The vsftpd configuration file that is outputted enforces | |
# FTP Explicit TLS for all client connections. | |
# | |
# The text file with predefined users and passwords must have the following format: | |
# <username>:<password> | |
# | |
userfile=users.txt |
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 | |
if [ "$(whoami)" != "root" ]; then | |
echo "Run as root!" | |
exit 1 | |
fi | |
apt-get -y install curl git build-essential bison openssl libreadline5 libreadline-dev | |
apt-get -y install zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 | |
apt-get -y install libreadline-dev libxml2-dev autoconf libtool | |
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer ) |
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
$user_list = "SPS_INSTALL", "SQL_SERVICE", "SPS_FARM", "SPS_APP_POOL1", "SPS_MYSITE", "SPS_SERVICES", "SPS_SEARCH", "SPS_CRAWL", "SPS_PROFILE", "SPS_CACHEADM", "SPS_CACHERD" | |
function Gen-Password([int]$length) { | |
$assembly = Add-Type -AssemblyName System.Web | |
[System.Web.Security.Membership]::GeneratePassword($length, 2) | |
} | |
function Get-ScriptDirectory() { | |
$invocation = (Get-Variable MyInvocation -Scope 1).Value | |
Split-Path $invocation.MyCommand.Path |
OlderNewer