Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Developing new generation mobile application

Ashok Kumar S ashokslsk

💻
Developing new generation mobile application
View GitHub Profile
@ashokslsk
ashokslsk / videoProvider.sol
Created Feb 21, 2020
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=
View videoProvider.sol
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 Feb 21, 2020
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=
View Election.sol
pragma solidity ^0.4.21;
contract Election{
struct Canditate{
string name;
uint voteCount;
}
struct Voter{
bool authorized;
bool voted;
@ashokslsk
ashokslsk / AshokBlockChain.sol
Created Feb 21, 2020
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=
View AshokBlockChain.sol
// 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 Feb 21, 2020
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=
View AshokBlockChain.sol
// 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 Feb 21, 2020
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=
View AshokBlockChain.sol
// 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 Feb 21, 2020
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=
View AshokBlockChain.sol
// 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;
}
View MainActivity
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 Feb 8, 2016
Android Studio Useful shortcuts.
View 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)
View CollapseAndExpandActivity
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">
You can’t perform that action at this time.