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 org.shelajev.throwaway.defmeth; | |
public class Main { | |
public static void main(String[] args) { | |
// what does this program produce? | |
B b = new B(); | |
b.m1(); | |
b.callM1(); | |
b.callSuperM1(); | |
} |
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
# http://bramp.github.io/js-sequence-diagrams/ | |
DSU solution->Genrih: notifies about upcoming update | |
Genrih->>DSU solution: request changed classes | |
DSU solution->Genrih: provides changed classes | |
Genrih->Diff tool: old code, new code | |
Diff tool->>Genrih: list of changes | |
Note right of Genrih: changes => potential phenomena | |
Genrih->Oracle: list of phenomena | |
Oracle->Runtime: queries state | |
Runtime->>Oracle: state information |
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
@RestController | |
class ThisWillActuallyRun { | |
@RequestMapping("/") | |
String home() { | |
return "Hello World!" | |
} | |
} |
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 Foo { | |
private String bar; | |
private int number; | |
public Foo() { | |
// Do some stuff | |
} | |
public String getBar() { return this.bar; } |
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
class ExampleActor extends AbstractActor { | |
// this child will be destroyed and re-created upon restart by default | |
final ActorRef other = getContext().actorOf(new Props(OtherActor.class), "childName"); | |
public ExampleActor() { | |
receive(ReceiveBuilder | |
.match(Request1.class, r -> | |
other.tell(r.getMsg(), self()) | |
) | |
.match(Request2.class, r -> |
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
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); | |
fab.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View view) { | |
Snackbar.make(view, “Super fast hello world”, Snackbar.LENGTH_LONG) | |
.setAction(“Action”, null).show(); | |
} | |
}); |
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 Contributor { | |
String login; | |
String html_url; | |
int contributions; | |
@Override | |
public String toString() { | |
return login + " (" + contributions + ")"; |
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 interface GitHubService { | |
@GET(“repos/{owner}/{repo}/contributors”) | |
Call<List<Contributor>> repoContributors( | |
@Path(“owner”) String owner, | |
@Path(“repo”) String repo); | |
} |
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
interface GitHubService { | |
@GET("repos/{owner}/{repo}/contributors") | |
Call<List<Contributor>> repoContributors( | |
@Path("owner") String owner, | |
@Path("repo") String repo); | |
public static final Retrofit retrofit = new Retrofit.Builder() | |
.baseUrl("https://api.github.com/") | |
.addConverterFactory(GsonConverterFactory.create()) |
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
GitHubService gitHubService = GitHubService.retrofit.create(GitHubService.class); | |
Call<List<Contributor>> call = gitHubService.repoContributors(“square”, “retrofit”); | |
List<Contributor> result = call.execute().body(); |
OlderNewer