flowchart LR;
UI[UI Component - WPF/Web/etc] --> B;
B([Trading Bot APIs]) -- list --> SR[[Strategy Registry]];
SR --x SI[Strategy Implementations...];
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 Inventory { | |
public int getCapacity(); | |
public int getAvailableStorageUnit(); | |
public List<Long> getProductIdList(); | |
public int getQuantity(long productId); | |
public boolean addToStock(long productId, int quantity); | |
public boolean removeFromStock(long productId, int quantity); | |
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
#num of philosopher | |
num_p = 5 | |
# num of meal/philosopher | |
r =1000 | |
Tanenbaum_forks =[Semaphore(0) for i in range(num_p)] | |
t_mutex =Semaphore(1) | |
state=['thinking']*num_p |
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
@Override | |
protected String doInBackground(String... data) { | |
HttpURLConnection urlConnection = null; | |
try { | |
URL url = new URL("http://192.168.1.7:1337/api/doc"); | |
urlConnection = (HttpURLConnection) url.openConnection(); | |
urlConnection.setRequestMethod("POST"); | |
urlConnection.setRequestProperty("Accept", "application/json"); | |
urlConnection.setRequestProperty("Content-type", "application/json"); | |
urlConnection.setRequestProperty("charset", "utf-8"); |
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 Solution { | |
public void solveSudoku(char[][] board) { | |
int rLength = board.length; | |
int cLength = board[0].length; | |
List<Character> candidate = new Arraylist<Character>(); | |
for(int i =1; i < rLength+1, i++){ | |
candidate.add((char)i); | |
} | |
for(int i = 0; i < rLength; i++){ | |
for(int j = 0; j < cLength; j++ ){ |
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.example.miaodonghan.hw3_listview; | |
import android.app.Activity; | |
import android.app.AlertDialog; | |
import android.content.DialogInterface; | |
import android.content.Intent; | |
import android.content.pm.LabeledIntent; | |
import android.os.Bundle; | |
import android.view.Menu; | |
import android.view.MenuItem; |