This file contains hidden or 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<WeakReference<TextView>> toRemove = new HashSet<WeakReference<TextView>>(); | |
| for (WeakReference<TextView> weakRef : textviews) { | |
| TextView textView = weakRef.get(); | |
| if (textView != null) { | |
| // do stuff here | |
| } else { |
This file contains hidden or 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
| <com.hackthenorth.android.ui.component.TextView | |
| android:id="@+id/title" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:layout_marginBottom="16dp" | |
| android:textColor="@color/text_color_primary" | |
| android:fontFamily="sans-serif" | |
| android:textStyle="bold" | |
| android:textSize="18sp" |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/listview_background_shape" > | |
| <item android:drawable="@drawable/card_background" /> | |
| <item> | |
| <shape> | |
| <padding | |
| android:bottom="12dp" | |
| android:left="12dp" | |
| android:top="12dp" |
This file contains hidden or 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
| package com.hackthenorth.android.util; | |
| import android.animation.Animator; | |
| import android.animation.TimeInterpolator; | |
| import android.animation.ValueAnimator; | |
| import android.annotation.SuppressLint; | |
| import android.view.View; | |
| /** | |
| * "Because, honestly, why isn't android.animation.ViewPropertyAnimator an Animator in |
This file contains hidden or 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 static final int ITEM_VIEW_TYPE_LARGE = 0; | |
| public static final int ITEM_VIEW_TYPE_SMALL = 1; | |
| @Override | |
| public int getItemViewType(int position) { | |
| if (isCategoryLarge(categories.get(position)) { | |
| return ITEM_VIEW_TYPE_LARGE; | |
| } else { | |
| return ITEM_VIEW_TYPE_SMALL; |
This file contains hidden or 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 xml.dom import minidom | |
| import json | |
| xmldoc = minidom.parse('changelogs.xml') | |
| items = [] | |
| itemsxml = xmldoc.getElementsByTagName('string-array') | |
| versions = itemsxml[0].getElementsByTagName('item') | |
| dates = itemsxml[1].getElementsByTagName('item') | |
| descs = itemsxml[2].getElementsByTagName('item') |
This file contains hidden or 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
| January 14, 2016 | |
| Thursday | |
| COMPILER CONSTRUCTION | |
| 1. TOKENS AND KINDS | |
| =================== |
This file contains hidden or 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
| #lang racket/base | |
| (require (for-syntax racket/base syntax/parse)) | |
| (define-syntax (error stx) | |
| (syntax-parse stx | |
| [(_ ...) (raise-syntax-error #f "This is an error." stx)])) | |
| ;; The following line will be highlighted in the IDE and say "This is an error." | |
| ;; in DrRacket or racket-xp-mode for emacs. | |
| (error 'hi) |
This file contains hidden or 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
| #lang racket/base | |
| (require racket/list) | |
| (provide report-all-errors | |
| save-error-message) | |
| ;; Taken from Typed Racket codebase tc-util.rkt | |
| (define-struct err (msg stx) #:prefab) | |
| (define delayed-errors null) |
This file contains hidden or 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 json | |
| import traceback | |
| from mitmproxy import ctx, http | |
| def response(flow: http.HTTPFlow) -> None: | |
| assert flow.response is not None | |
| assert flow.response.content is not None | |
| if (flow.request.method, flow.request.host) != ("POST", "gql-fed.reddit.com"): | |
| return |
OlderNewer