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
pragma solidity ^0.4.18; | |
contract VideoProvider { | |
struct UserInfo { | |
uint Age; | |
bool AgeRestriction; | |
} | |
mapping (string => UserInfo) AllUsers; | |
function SetUserInfo(string _Name, uint _Age) public { | |
AllUsers[_Name].Age = _Age; |
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
pragma solidity ^0.4.21; | |
contract Election{ | |
struct Canditate{ | |
string name; | |
uint voteCount; | |
} | |
struct Voter{ | |
bool authorized; | |
bool voted; |
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
// Simple addition with solidity | |
pragma solidity ^0.4.0; | |
contract AddInteger{ | |
uint private result; | |
function addition(uint _operand_1, uint _operand_2)public constant returns(uint){ | |
result = _operand_1+_operand_2; | |
return result; | |
} |
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
// Simple addition with solidity | |
pragma solidity ^0.4.0; | |
contract AddInteger{ | |
uint private result; | |
function addition(uint _operand_1, uint _operand_2)public constant returns(uint){ | |
result = _operand_1+_operand_2; | |
return result; | |
} |
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
// Simple addition with solidity | |
pragma solidity ^0.4.0; | |
contract AddInteger{ | |
uint private result; | |
function addition(uint _operand_1, uint _operand_2)public constant returns(uint){ | |
result = _operand_1+_operand_2; | |
return result; | |
} |
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
// Simple addition with solidity | |
pragma solidity ^0.4.0; | |
contract AddInteger{ | |
uint private result; | |
function addition(uint _operand_1, uint _operand_2)public constant returns(uint){ | |
result = _operand_1+_operand_2; | |
return result; | |
} |
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 MainActivity extends AppCompatActivity { | |
RecyclerView recyclerView; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
recyclerView = (RecyclerView) findViewById(R.id.my_recycler_view); | |
RecyclerAdapter adapter = new RecyclerAdapter(this); |
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
Android Studio Notes | |
=========================== | |
Android Studio keyboard shortcuts I use often. | |
## Keyboard Shortcuts for Mac | |
* `SHIFT + F6` to refactor methods, classes, and variable names | |
* `CTRL + O` to override methods | |
* `COMMAND + N` | |
* Generate getter, setter, and constructor method for a class (when in editor pane) |
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
Step 1: | |
// view_header_layout | |
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="#f9f9f9"> |