Skip to content

Instantly share code, notes, and snippets.

public class AnimationActivily extends Activity {
private Bitmap log_imgs[];
private Bitmap tempBitmap;
private Handler uiHandler;
private ImageView logo_view;
int img_cnt = 1;
protected int _splashTime = 91;
Thread splashTread;
@SlyNet
SlyNet / http.cs
Last active November 20, 2015 15:12
public class HttpImageView : ImageView
{
private readonly MvxDynamicImageHelper<Bitmap> _imageHelper;
public HttpImageView(Context context, IAttributeSet attrs)
: base(context, attrs)
{
this._imageHelper = new MvxDynamicImageHelper<Bitmap>();
this._imageHelper.ImageChanged += this.ImageHelperOnImageChanged;
var typedArray = context.ObtainStyledAttributes(attrs, MvxAndroidBindingResource.Instance.ImageViewStylableGroupId);
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res-auto"
style="@style/Interview_Question_Answer_Option_Background"
android:stretchColumns="0"
local:MvxBind="BackgroundStyle ViewOptionStyleBackground(LayoutBackgroundStyle(QuestionState.Validity.IsInvalid, QuestionState.IsAnswered));">
<TableRow>
<RadioButton
style="@style/Interview_Question_Answer_Option_Input"
local:MvxBind="HideKeyboardOnClick .; Text Title; Checked Selected; Bold Selected" />
<ImageButton style="@style/Interview_Question_OptionRemoveAnswer"
<?xml version="1.0" encoding="utf-8" ?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle" >
<solid android:color="@android:color/white" />
</shape>
</item>
$batchSize = 128
$questionnaireId = '205d67e524-e29b-4641-b581-f6d460ac4f22'
$databaseUrl = 'http://localhost:8080/databases/HeadquartersViews'
$eventStoreUrl = 'http://127.0.0.1:2114/streams'
$skip = 0
do {
$interviewsBatch = Invoke-RestMethod "$databaseUrl/indexes/InterviewsSearchIndex?query=QuestionnaireId%3A%$questionnaireId&start=$skip&pageSize=$batchSize"
@SlyNet
SlyNet / Mondads
Last active August 29, 2015 14:00
public static class Monads
{
/// <summary>
/// Returns the value of an expression, or <c>default(T)</c> if any parts of the expression are <c>null</c>.
/// </summary>
/// <typeparam name="T">The type of the Expression</typeparam>
/// <param name="expression">A parameterless lambda representing the path to the value.</param>
/// <returns>The value of the expression, or <c>default(T)</c> if any parts of the expression are <c>null</c>.</returns>
public static T Maybe<T>(Expression<Func<T>> expression)
{
@SlyNet
SlyNet / gist:5919806
Created July 3, 2013 16:03
right way to deserialize in .net. Json.net lib is used
public static T Deserialize<T>(this XDocument xDocument)
{
string serializeXNode = JsonConvert.SerializeXNode(xDocument.Root);
return JsonConvert.DeserializeObject<T>(serializeXNode);
}
@SlyNet
SlyNet / hbmToCs.xslt
Created May 30, 2013 07:25
XSLT to transfrom hbm.xml mappings to code
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0"
xmlns:string="http://symphony-cms.com/functions"
xmlns:func="http://exslt.org/functions"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
extension-element-prefixes="func">
<xsl:output method="text"/>
<xsl:variable name="accessDict">
@SlyNet
SlyNet / ActiveRecordMapper
Created May 29, 2013 12:48
Mapper class with the ability to store XML
public static class ActiveRecordMapper
{
public static void GenerateMappings(global::NHibernate.Cfg.Configuration config, IEnumerable<Assembly> modelAssemblies, Type baseDomainEntityType)
{
var xmlVisitor = new XmlGenerationVisitor();
ActiveRecordModelCollection models = BuildModels(modelAssemblies, baseDomainEntityType);
var connectorVisitor = new GraphConnectorVisitor(models);
connectorVisitor.VisitNodes(models);
@SlyNet
SlyNet / gist:5465634
Last active December 16, 2015 16:49
xslt to transform hbm.xml mappings to code
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0"
xmlns:string="http://symphony-cms.com/functions"
xmlns:func="http://exslt.org/functions"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
extension-element-prefixes="func">
<xsl:output method="text"/>
<xsl:variable name="accessDict">