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
// NSLog replacement | |
#define MYLogEnabled NO | |
#define MYLog(format, ...) \ | |
if(MYLogEnabled){NSLog(@"%s: (Ln%i) %@", __PRETTY_FUNCTION__, __LINE__, [NSString stringWithFormat:format, ## __VA_ARGS__]);} |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
body{background: linear-gradient(45deg, #f06, yellow);min-height: 100%;} | |
canvas{width:600px;height:400px;background:#cef;} |
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
// Practices from Object Oriented Javascript | |
// version 0.0.0.11 | |
(function() { | |
function multi() { | |
var n = {}, | |
stuff, j = 0, | |
len = arguments.length; | |
for (j = 0; j < len; j++) { | |
stuff = arguments[j]; | |
for (var i in stuff) { |
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
#--- | |
# iPIN - iPhone PNG Images Normalizer v1.0 | |
# Copyright (C) 2007 | |
# | |
# Author: | |
# Axel E. Brzostowski | |
# http://www.axelbrz.com.ar/ | |
# axelbrz@gmail.com | |
# | |
# References: |
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
@interface Base58Encoder : NSObject { | |
} | |
+ (NSString *)base58EncodedValue:(long long)num; | |
@end |
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
NSBundle *mainBudle=[NSBundle mainBundle]; | |
NSString *hgURL = [mainBudle objectForInfoDictionaryKey:@"HGGuideURL"]; |
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 these 2 attributes to hide secondary y-axis value in mscombidy2d.swf of FusionCharts --> | |
<chart showDivLineSecondaryValue="0" showSecondaryLimits="0"> | |
</chart> |
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 | |
/* | |
Data Access Layer for FansWall(http://fanswall.sinaapp.com) | |
Author: Shiny Zhu(http://t.sina.com.cn/shinyzhu) | |
*/ | |
class DAL{ | |
private $server, $username, $password, $db; | |
private $link; | |
private $result; |
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 | |
#Solution for calculating xy=total, x-y->0. | |
#y is always equal or greater than x | |
#Reference: http://www.wolframalpha.com/input/?i=xy%3D200,+x%3E0 | |
function min_xy($total){ | |
$all_xy = array(); | |
$min = $total;//minimum number | |
$min_idx = -1;//minium number position in $all_xy |
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
/// <summary> | |
/// Solution for calculate xy=total, x-y -> 0. | |
/// Reference: http://www.wolframalpha.com/input/?i=xy%3D200,+x%3E0 | |
/// </summary> | |
/// <param name="total">The integer to calculate.</param> | |
/// <returns>x,y pair, x <= y.</returns> | |
public static KeyValuePair<int, int> MinXPlusY(int total) | |
{ | |
var allXplusY = Enumerable.Range(1, total) | |
.Where(i => total % i == 0 && i <= total / i) |