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
#include <iostream> | |
#include <string> | |
#define OVERFLOW 2 | |
#define ROW b_len | |
#define COL a_len+b_len+OVERFLOW | |
using namespace std; | |
int getCarry(int num) { | |
int carry = 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
tail -f file.log |perl -e 'while (<>) {$l++;if (time > $e) {$e=time;print "$l\n";$l=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
#!/usr/bin/env bash | |
set -e | |
convert_to_alac() { | |
flac="$1" | |
aiff="${flac%.*}.aiff" | |
alac="${flac%.*}.m4a" | |
flac -s -d --force-aiff-format -o "$aiff" "$flac" | |
afconvert -f m4af -d alac "$aiff" "$alac" |
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 java.io.UnsupportedEncodingException; | |
import java.util.Map; | |
import org.simpleframework.xml.Serializer; | |
import org.simpleframework.xml.core.Persister; | |
import com.android.volley.AuthFailureError; | |
import com.android.volley.NetworkResponse; | |
import com.android.volley.ParseError; | |
import com.android.volley.Request; |
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 -e | |
IFADDR="192.168.3.1/24" | |
if [[ ! ip link show docker0 ]]; then | |
ip link add docker0 type bridge | |
ip addr add "$IFADDR" dev docker0 | |
ip link set docker0 up | |
iptables -t nat -A POSTROUTING -s "$IFADDR" ! -d "$IFADDR" -j MASQUERADE | |
fi |
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
/* | |
PLIKI - ZADANIE 1 | |
Napisz program kopiujący zawartośćpliku o nazwie podanej jako pierwszy | |
parametr do pliku którego nazwa podana jest jako drugi parametr | |
Użycie: ./ex1 f1 f2 | |
Kopiowanie zawartości pliku f1 do pliku f2. | |
*/ |
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 org.simpleframework.xml.Attribute; | |
import org.simpleframework.xml.Element; | |
import org.simpleframework.xml.ElementList; | |
import org.simpleframework.xml.Namespace; | |
import org.simpleframework.xml.NamespaceList; | |
import org.simpleframework.xml.Root; | |
import org.simpleframework.xml.Text; | |
import java.util.List; |
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 android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener { | |
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName(); | |
private int previousTotal = 0; // The total number of items in the dataset after the last load | |
private boolean loading = true; // True if we are still waiting for the last set of data to load. | |
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more. | |
int firstVisibleItem, visibleItemCount, totalItemCount; |
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 android.content.Context; | |
import android.support.v7.widget.Toolbar; | |
import android.text.TextUtils; | |
import android.util.AttributeSet; | |
import android.widget.TextView; | |
import java.lang.reflect.Field; | |
public class MarqueeToolbar extends Toolbar { |
OlderNewer