Skip to content

Instantly share code, notes, and snippets.

View ashokslsk's full-sized avatar
💻
Developing new generation mobile application

Ashok Kumar S ashokslsk

💻
Developing new generation mobile application
View GitHub Profile
@ashokslsk
ashokslsk / videoProvider.sol
Created February 21, 2020 06:51
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.18+commit.9cf6e910.js&optimize=true&gist=
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;
@ashokslsk
ashokslsk / Election.sol
Last active February 21, 2020 06:48
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.21+commit.dfe3193c.js&optimize=true&gist=
pragma solidity ^0.4.21;
contract Election{
struct Canditate{
string name;
uint voteCount;
}
struct Voter{
bool authorized;
bool voted;
@ashokslsk
ashokslsk / AshokBlockChain.sol
Created February 21, 2020 06:01
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.0+commit.acd334c9.js&optimize=true&gist=
// 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;
}
@ashokslsk
ashokslsk / AshokBlockChain.sol
Created February 21, 2020 05:47
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.0+commit.acd334c9.js&optimize=true&gist=
// 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;
}
@ashokslsk
ashokslsk / AshokBlockChain.sol
Created February 21, 2020 05:18
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.0+commit.acd334c9.js&optimize=true&gist=
// 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;
}
@ashokslsk
ashokslsk / AshokBlockChain.sol
Created February 21, 2020 05:06
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.0+commit.acd334c9.js&optimize=true&gist=
// 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;
}
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);
@ashokslsk
ashokslsk / Shortcuts
Created February 8, 2016 17:15
Android Studio Useful shortcuts.
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)
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">