Skip to content

Instantly share code, notes, and snippets.

@Shywim
Shywim / CursorRecyclerAdapter.java
Last active February 27, 2024 13:42
A custom Adapter for the new RecyclerView, behaving like the CursorAdapter class from previous ListView and alike. Now with Filters and updated doc.
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Matthieu Harlé
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@skyfishjy
skyfishjy / CursorRecyclerViewAdapter.java
Last active December 16, 2023 08:55
CursorRecyclerViewAdapter
/*
* Copyright (C) 2014 skyfish.jy@gmail.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@pallavahooja
pallavahooja / APIHelper.java
Last active November 9, 2020 16:48
Retrofit Retry
package app.goplus.in.v2.network;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/**
* Created by pallavahooja on 16/05/16.
*/
public class APIHelper {

Proof-of-power, using a swarm to select miners through majority consensus

Johan Nygren, Bitnation, 2017

In 2008, Craig Wright published the Bitcoin whitepaper, and the idea to use proof-of-work as a trusted authority, provably distributed. This Nakamoto consensus allowed the Bitcoin ledger to extend itself in a way that was resilient to censorship as well as to servers being shut down, and in a way where as the security of the network grew, the number of users and therefore the value of the network also grew following Metcalfe´s Law. Bitcoin was the beginning of what can be broadly defined as “network-states”, successors to the nation-state consensus.

The next generation of a distributed authority for a “network-state” was developed in 2014 by Vlad Zamfir, with the Casper protocol and “consensus-by-bet”, an evolution of the idea of proof-of-stake. With consensus-by-bet, validators would stake their capital in a betting game, and converge on a block, in a way that was also resilient to being shut down,