View reseved.proto
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
syntax = "proto3"; | |
message Person{ | |
//string name =1; <-- reserve both tag and name to deprecate a field | |
reserved 1; | |
reserved "name"; | |
string first_name = 2; | |
string last_name = 3; | |
} |
View duration.proto
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
syntax = "proto3"; | |
import "google/protobuf/duration.proto"; | |
message MyMessage { | |
google.protobuf.Duration duration = 1; | |
} |
View timestamp.proto
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
syntax = "proto3"; | |
import "google/protobuf/timestamp.proto"; | |
message MyMessage { | |
google.protobuf.Timestamp time_stamp = 1; | |
} |
View maps
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
syntax = "proto3"; | |
message SimpleMap{ | |
map<string, Project> projects = 3; | |
} |
View one_of.proto
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
message SampleMessage { | |
oneof test_oneof { | |
string name = 4; | |
SubMessage sub_message = 9; | |
} | |
} |
View simple_proto.proto
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
syntax = "proto3"; | |
message Person{ | |
string first_name = 1; | |
string last_name = 2; | |
int32 age = 3; | |
float weight = 4; | |
repeated string addresses = 5; | |
enum Gender{ | |
Unknown = 0; |
View StateMachineDataStructure.kt
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
data class StateMachine(val states: Set<State>) | |
data class State(val name:String, val transitions:Set<Transition>) | |
data class Transition(val event:Event,val nextState:String) | |
data class Event(val eventName: String) |
View dotCommand.bash
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
dot -Tpng matterStateMachine.dot -o matterStateMachine.png |
View matterStateMachine.dot
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
digraph matterStateMachine { | |
Solid -> Liquid [label="OnMelted"] | |
Liquid -> Solid [label="OnFrozen"] | |
Liquid -> Gas [label="OnVaporized"] | |
Gas -> Liquid [label="OnCondensed"] | |
} |
View sample test
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
package com.nvinayshetty.refresher; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
NewerOlder