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
const string placeQuery = "http://api.v3.factual.com/t/places?geo={\"$point\":[38.544401,-121.742229]}"; | |
using (var client = new HttpClient()) | |
{ | |
var header = OAuthUtil.GenerateHeader(new Uri(placeQuery), "KEY", | |
"SECRET", null, null, "GET"); | |
client.DefaultRequestHeaders.Add("Authorization", header); | |
var res = client.GetAsync(placeQuery).Result; | |
res.EnsureSuccessStatusCode(); |
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
public class FactualPlaceResponseContainer | |
{ | |
public string Status { get; set; } | |
public FactualPlaceResponse Response { get; set; } | |
} | |
public class FactualPlaceResponse | |
{ | |
[JsonProperty("included_rows")] | |
public int IncludedRows { get; set; } |
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
WITH a AS | |
( | |
SELECT | |
rt.GiftID, | |
rt.ActedDate, | |
rt.Status, | |
rt.Description, | |
ROW_NUMBER() OVER(ORDER BY rt.GiftID, rt.ActedDate) AS RN | |
FROM Histories rt | |
) |
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
var refurl = obj.ValueForKey(UIImagePickerController.ReferenceUrl) as NSUrl; | |
//TODO: refurl is null on newly taken images | |
var lib = new ALAssetsLibrary(); | |
lib.AssetForUrl(refurl, (ALAsset asset) => { | |
var loc = asset.Location; | |
}, (NSError error) => { | |
}); |
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
SELECT name, OBJECT_NAME(a.object_id), avg_fragmentation_in_percent, | |
'ALTER INDEX ' + b.name + ' ON ' + OBJECT_NAME(a.object_id) +' REBUILD WITH (STATISTICS_NORECOMPUTE = ON)' as command | |
FROM sys.dm_db_index_physical_stats ( | |
DB_ID(N'PrePurchasing') | |
, OBJECT_ID('PrePurchasing') | |
, NULL | |
, NULL | |
, NULL) AS a | |
JOIN sys.indexes AS b | |
ON a.object_id = b.object_id AND a.index_id = b.index_id |
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
SELECT | |
avg(avg_cpu_percent) AS 'Average CPU Percentage Used', | |
max(avg_cpu_percent) AS 'Maximum CPU Percentage Used', | |
avg(avg_physical_data_read_percent) AS 'Average Physical IOPS Percentage', | |
max(avg_physical_data_read_percent) AS 'Maximum Physical IOPS Percentage', | |
avg(avg_log_write_percent) AS 'Average Log Write Percentage', | |
max(avg_log_write_percent) AS 'Maximum Log Write Percentage', | |
--avg(avg_memory_percent) AS 'Average Memory Used Percentage', | |
--max(avg_memory_percent) AS 'Maximum Memory Used Percentage', | |
avg(active_worker_count) AS 'Average # of Workers', |
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
SELECT name, avg_fragmentation_in_percent | |
FROM sys.dm_db_index_physical_stats ( | |
DB_ID(N'PrePurchasing') | |
, OBJECT_ID('PrePurchasing') | |
, NULL | |
, NULL | |
, NULL) AS a | |
JOIN sys.indexes AS b | |
ON a.object_id = b.object_id AND a.index_id = b.index_id; |
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
var status = AVCaptureDevice.GetAuthorizationStatus (AVMediaType.Video); | |
if (status == AVAuthorizationStatus.Authorized) { | |
//yay | |
} else if (status == AVAuthorizationStatus.NotDetermined) { | |
AVCaptureDevice.RequestAccessForMediaType (AVMediaType.Video, (bool accessGranted) => { | |
if (accessGranted) { | |
//yay | |
} else { | |
//boo |
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
var pulseAnimation = CABasicAnimation.FromKeyPath ("transform.scale"); | |
pulseAnimation.Duration = 0.15; | |
pulseAnimation.To = NSNumber.FromFloat(1.5f); | |
pulseAnimation.TimingFunction = CAMediaTimingFunction.FromName(CAMediaTimingFunction.EaseInEaseOut); | |
pulseAnimation.AutoReverses = true; | |
pulseAnimation.RepeatCount = 2; | |
_upvoteView.Layer.AddAnimation (pulseAnimation, "scalepulse"); |
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
var centerImg = new UIImageView (UIImage.FromBundle ("findme_fab")); | |
centerImg.Frame = new RectangleF ( | |
centerX - (centerImg.Frame.Width / 2) , | |
centerY - centerImg.Frame.Height - 20 , | |
centerImg.Frame.Width , | |
centerImg.Frame.Height); | |
var animation = CABasicAnimation.FromKeyPath("transform.rotation.z"); | |
animation.From = NSNumber.FromFloat (0.0f); | |
animation.To = NSNumber.FromFloat (2f * (float)Math.PI); | |
animation.Duration = 1f; |