noshot 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- noshot/__init__.py +1 -0
- noshot/data/AIDS CN NLP/AIDS/1. Implement Basic Search Strategies/(A) Breadth First Search.ipynb +112 -0
- noshot/data/AIDS CN NLP/AIDS/1. Implement Basic Search Strategies/(B) Depth First Search.ipynb +111 -0
- noshot/data/AIDS CN NLP/AIDS/1. Implement Basic Search Strategies/(C) Uniform Cost Search.ipynb +134 -0
- noshot/data/AIDS CN NLP/AIDS/1. Implement Basic Search Strategies/(D) Depth Limites Search.ipynb +115 -0
- noshot/data/AIDS CN NLP/AIDS/1. Implement Basic Search Strategies/(E) Iterative Deepening DFS.ipynb +123 -0
- noshot/data/AIDS CN NLP/AIDS/10. ANOVA/2_ANOVA.csv +769 -0
- noshot/data/AIDS CN NLP/AIDS/10. ANOVA/One Way ANOVA (Repeated Measure).ipynb +126 -0
- noshot/data/AIDS CN NLP/AIDS/10. ANOVA/One Way ANOVA.ipynb +134 -0
- noshot/data/AIDS CN NLP/AIDS/10. ANOVA/Sample 1 Way ANOVA Test.ipynb +119 -0
- noshot/data/AIDS CN NLP/AIDS/10. ANOVA/Two Way ANOVA.ipynb +138 -0
- noshot/data/AIDS CN NLP/AIDS/10. ANOVA/reaction_time.csv +5 -0
- noshot/data/AIDS CN NLP/AIDS/10. ANOVA/sample_data.csv +16 -0
- noshot/data/AIDS CN NLP/AIDS/10. ANOVA/sleep_deprivation.csv +4 -0
- noshot/data/AIDS CN NLP/AIDS/11. Linear Regression/3_Linear.csv +4802 -0
- noshot/data/AIDS CN NLP/AIDS/11. Linear Regression/Linear Regression LAB.ipynb +113 -0
- noshot/data/AIDS CN NLP/AIDS/11. Linear Regression/Linear Regression New- sklearn.ipynb +118 -0
- noshot/data/AIDS CN NLP/AIDS/11. Linear Regression/Linear Regression.ipynb +148 -0
- noshot/data/AIDS CN NLP/AIDS/11. Linear Regression/house_rate.csv +22 -0
- noshot/data/AIDS CN NLP/AIDS/12. Logistic Regression/Logistic Regression New- sklearn.ipynb +128 -0
- noshot/data/AIDS CN NLP/AIDS/12. Logistic Regression/Logistic Regression.ipynb +145 -0
- noshot/data/AIDS CN NLP/AIDS/12. Logistic Regression/default.csv +1001 -0
- noshot/data/AIDS CN NLP/AIDS/12. Logistic Regression/hours_scores_records.csv +101 -0
- noshot/data/AIDS CN NLP/AIDS/2. Implement A Star And MA Star/(A) Astar.ipynb +256 -0
- noshot/data/AIDS CN NLP/AIDS/2. Implement A Star And MA Star/(B) IDAstar.ipynb +157 -0
- noshot/data/AIDS CN NLP/AIDS/2. Implement A Star And MA Star/(C) SMAstar.ipynb +178 -0
- noshot/data/AIDS CN NLP/AIDS/3. Genetic Algorithm/Genetic.ipynb +95 -0
- noshot/data/AIDS CN NLP/AIDS/4. Simulated Annealing/Simulated Annealing.ipynb +74 -0
- noshot/data/AIDS CN NLP/AIDS/4. Simulated Annealing/Sudoku Simulated Annealing.ipynb +103 -0
- noshot/data/AIDS CN NLP/AIDS/5. Alpha Beta Pruning/AlphaBetaPruning.ipynb +182 -0
- noshot/data/AIDS CN NLP/AIDS/6. Consraint Satisfaction Problems (CSP)/(A) CSP House Allocation.ipynb +120 -0
- noshot/data/AIDS CN NLP/AIDS/6. Consraint Satisfaction Problems (CSP)/(B) CSP Map Coloring.ipynb +125 -0
- noshot/data/AIDS CN NLP/AIDS/7. Random Sampling/Random Sampling.ipynb +73 -0
- noshot/data/AIDS CN NLP/AIDS/7. Random Sampling/height_weight_bmi.csv +8389 -0
- noshot/data/AIDS CN NLP/AIDS/8. Z Test/Z Test Hash Function.ipynb +141 -0
- noshot/data/AIDS CN NLP/AIDS/8. Z Test/Z Test.ipynb +151 -0
- noshot/data/AIDS CN NLP/AIDS/8. Z Test/height_weight_bmi.csv +8389 -0
- noshot/data/AIDS CN NLP/AIDS/9. T Test/1_heart.csv +304 -0
- noshot/data/AIDS CN NLP/AIDS/9. T Test/Independent T Test.ipynb +119 -0
- noshot/data/AIDS CN NLP/AIDS/9. T Test/Paired T Test.ipynb +118 -0
- noshot/data/AIDS CN NLP/AIDS/9. T Test/T Test Hash Function.ipynb +142 -0
- noshot/data/AIDS CN NLP/AIDS/9. T Test/T Test.ipynb +158 -0
- noshot/data/AIDS CN NLP/AIDS/9. T Test/height_weight_bmi.csv +8389 -0
- noshot/data/AIDS CN NLP/AIDS/9. T Test/iq_test.csv +0 -0
- noshot/data/AIDS CN NLP/AIDS/Others (AllinOne)/All In One.ipynb +4581 -0
- noshot/data/AIDS CN NLP/CN/1. Chat Application/chat.java +81 -0
- noshot/data/AIDS CN NLP/CN/1. Chat Application/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/1. Chat Application/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/10. Ethernet LAN IEEE 802.3/LAN.tcl +65 -0
- noshot/data/AIDS CN NLP/CN/10. Ethernet LAN IEEE 802.3/analysis.awk +44 -0
- noshot/data/AIDS CN NLP/CN/10. Ethernet LAN IEEE 802.3/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/10. Ethernet LAN IEEE 802.3/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/11. Wireless LAN IEEE 802.11/complexdcf.tcl +229 -0
- noshot/data/AIDS CN NLP/CN/11. Wireless LAN IEEE 802.11/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/11. Wireless LAN IEEE 802.11/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/2. File Transfer/file_to_send.txt +2 -0
- noshot/data/AIDS CN NLP/CN/2. File Transfer/filetransfer.java +119 -0
- noshot/data/AIDS CN NLP/CN/2. File Transfer/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/2. File Transfer/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/3. RMI (Remote Method Invocation)/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/3. RMI (Remote Method Invocation)/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/3. RMI (Remote Method Invocation)/rmi.java +56 -0
- noshot/data/AIDS CN NLP/CN/4. Wired Network/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/4. Wired Network/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/4. Wired Network/wired.awk +25 -0
- noshot/data/AIDS CN NLP/CN/4. Wired Network/wired.tcl +81 -0
- noshot/data/AIDS CN NLP/CN/5. Wireless Network/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/5. Wireless Network/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/5. Wireless Network/wireless.awk +27 -0
- noshot/data/AIDS CN NLP/CN/5. Wireless Network/wireless.tcl +153 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/analysis.awk +27 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/sack.tcl +86 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/vegas.tcl +86 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/analysis.awk +28 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/reno.tcl +78 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/tahoe.tcl +79 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Flow Control/analysis.awk +27 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Flow Control/flow.tcl +163 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Flow Control/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/7. Link State And Distance Vector Routing/DV.tcl +111 -0
- noshot/data/AIDS CN NLP/CN/7. Link State And Distance Vector Routing/LS.tcl +106 -0
- noshot/data/AIDS CN NLP/CN/7. Link State And Distance Vector Routing/analysis.awk +36 -0
- noshot/data/AIDS CN NLP/CN/7. Link State And Distance Vector Routing/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/7. Link State And Distance Vector Routing/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/8. Multicast And Broadcast Routing/analysis.awk +20 -0
- noshot/data/AIDS CN NLP/CN/8. Multicast And Broadcast Routing/broadcast.tcl +76 -0
- noshot/data/AIDS CN NLP/CN/8. Multicast And Broadcast Routing/multicast.tcl +103 -0
- noshot/data/AIDS CN NLP/CN/8. Multicast And Broadcast Routing/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/8. Multicast And Broadcast Routing/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/9. DHCP/DHCP.java +125 -0
- noshot/data/AIDS CN NLP/CN/9. DHCP/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/9. DHCP/procedure.png +0 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/1-Prereqs.py +18 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/2-Chi2test.py +83 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/2-T-test.py +79 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/3-WSD-nb.py +53 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/4-Hindle-Rooth.py +53 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/5-HMM-Trellis.py +82 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/6-HMM-Viterbi.py +16 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/7-PCFG-parsetree.py +15 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/Chi2test.ipynb +285 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/Hindle-Rooth.ipynb +179 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/Lab 10 - Text generator using LSTM.ipynb +1461 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/Lab 11 NMT.ipynb +2307 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/PCFG.ipynb +134 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/Prereqs.ipynb +131 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/T test.ipynb +252 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/TFIDF BOW.ipynb +171 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/Trellis.ipynb +244 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/WSD.ipynb +645 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/Word2Vec.ipynb +93 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab01(tokenizer)/tokenizer.ipynb +370 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab01(tokenizer)/training_tokenizer.txt +6 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab02(stemming)/exp0.ipynb +274 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab02(stemming)/lab2.ipynb +905 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab02(stemming)/test.txt +1 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab02(stemming)/tokenizing.ipynb +272 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab03(parse-tree)/collocation.ipynb +332 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab03(parse-tree)/lab3.ipynb +549 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab03(parse-tree)/nlp.txt +1 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab04(collocation)/Lab4-NLP-Exp-2.ipynb +817 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab04(collocation)/collocation.ipynb +332 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab05(WSD)/NLP-Lab-5-Exp3.ipynb +231 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab05(WSD)/word-sense-disambiguation.ipynb +507 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab06(additional-exercise)/lab6.ipynb +134 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab07(HMM,Viterbi)/NLP Exp 4.ipynb +255 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab07(HMM,Viterbi)/NLP_Exp_5.ipynb +159 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab08(PCFG)/PCFG.ipynb +282 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab09-Hindle-rooth&MLP/Lab 9 - MLP classifier.ipynb +670 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab09-Hindle-rooth&MLP/MLP-alternative-code.ipynb +613 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab09-Hindle-rooth&MLP/hindle-rooth-algorithm.ipynb +74 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab10(LSTM)/Lab_10_Text_generator_using_LSTM.ipynb +480 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/Machine-translation.ipynb +445 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/Viterbi-PCFG.ipynb +105 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/corpora_tools.py +87 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/data_utils.py +11 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/train_translator.py +83 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab12(Information-Extraction)/Information_Extraction.ipynb +201 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/Backtrack-without-Verbitri.ipynb +185 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/Backward-Procedure.ipynb +597 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/Bag_of.ipynb +1422 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/CYK-algorithm.ipynb +1067 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/Forward-Procedure.ipynb +477 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/LSTM.ipynb +1290 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/Lab 10 - Text generator using LSTM.ipynb +1461 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/Lab 11 NMT.ipynb +2307 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/NLP-LAB-4.ipynb +216 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/NLP-LAB-5.ipynb +216 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/abc.txt +6 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/ex-1-nltk.ipynb +711 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/ex-2-nlp.ipynb +267 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/exp8&9.ipynb +305 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/hind.ipynb +287 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/lab66.ipynb +752 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/leb_3.ipynb +612 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/naive_bayes_classifier.pkl +0 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/nlp_leb_1.ipynb +3008 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/nlp_leb_2.ipynb +3095 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/nlplab-9.ipynb +295 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/nltk-ex-4.ipynb +506 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/text1.txt +48 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/text2.txt +8 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/text3.txt +48 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/translation-rnn.ipynb +812 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/word2vector.ipynb +173 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Backward Procedure Algorithm.ipynb +179 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Chi Square Collocation.ipynb +208 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Collocation (T test).ipynb +188 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Experiment 1.ipynb +437 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Forward Procedure Algorithm.ipynb +132 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Hindle Rooth.ipynb +414 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/MachineTranslation.ipynb +368 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Multi Layer Perceptron using MLPClassifier.ipynb +86 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Multi Layer Perceptron using Tensorflow.ipynb +112 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/PCFG Inside Probability.ipynb +451 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Text Generation using LSTM.ipynb +297 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Viterbi.ipynb +310 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Word Sense Disambiguation.ipynb +335 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/10.Text Generation using LSTM.ipynb +316 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/11.Machine Translation.ipynb +868 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/2.T and Chi2 Test.ipynb +204 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/3.Word Sense Diambiguation.ipynb +234 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/4.Hinddle and Rooth.ipynb +128 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/5.Forward and Backward.ipynb +149 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/6.Viterbi.ipynb +111 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/7.PCFG Parse Tree.ipynb +134 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/7.PCFG using cyk.ipynb +101 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/8.Bag of words and TF-IDF.ipynb +310 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/9.Word2Vector.ipynb +78 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/NLP ALL In One.ipynb +2619 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/sample1.txt +15 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/sample2.txt +4 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/word2vec_model.bin +0 -0
- noshot/data/AIDS CN NLP/NLP/NLP 6/1. Tokenize, Tagging, NER, Parse Tree.ipynb +312 -0
- noshot/data/AIDS CN NLP/NLP/NLP 6/2. T Test and Chi2 Test.ipynb +185 -0
- noshot/data/AIDS CN NLP/NLP/NLP 6/3. Naive Bayes WSD.ipynb +199 -0
- noshot/data/AIDS CN NLP/NLP/NLP 6/4. Hinddle and Rooth.ipynb +151 -0
- noshot/data/AIDS CN NLP/NLP/NLP 6/5 and 6 FWD, BWD, Viterbi.ipynb +164 -0
- noshot/data/AIDS CN NLP/NLP/NLP 6/7. PCFG using CYK.ipynb +383 -0
- noshot/data/AIDS CN NLP/NLP/NLP 6/8. BOW and TF-IDF.ipynb +252 -0
- noshot/data/AIDS CN NLP/Ubuntu CN Lab.iso +0 -0
- noshot/main.py +47 -0
- noshot-0.1.0.dist-info/LICENSE.txt +21 -0
- noshot-0.1.0.dist-info/METADATA +65 -0
- noshot-0.1.0.dist-info/RECORD +210 -0
- noshot-0.1.0.dist-info/WHEEL +5 -0
- noshot-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,81 @@
|
|
1
|
+
/*
|
2
|
+
How to run
|
3
|
+
==========
|
4
|
+
save the file as chat.java (filename can be anything)
|
5
|
+
Command Prompt 1 (go to the location the file is saved)
|
6
|
+
javac *.java
|
7
|
+
java Server
|
8
|
+
|
9
|
+
Command Prompt 2 (go to the location the file is saved)
|
10
|
+
java Client
|
11
|
+
*/
|
12
|
+
|
13
|
+
import javax.swing.*;
|
14
|
+
import java.awt.*;
|
15
|
+
import java.awt.event.*;
|
16
|
+
import java.io.*;
|
17
|
+
import java.net.*;
|
18
|
+
|
19
|
+
class Client extends JFrame{
|
20
|
+
JTextField jt;
|
21
|
+
JButton send;
|
22
|
+
JLabel lbl;
|
23
|
+
public static void main(String[] args) {
|
24
|
+
new Client();
|
25
|
+
}
|
26
|
+
Client(){
|
27
|
+
setTitle("Client");
|
28
|
+
setSize(400, 200);
|
29
|
+
setVisible(true);
|
30
|
+
setLayout(new FlowLayout());
|
31
|
+
lbl = new JLabel("Enter a string:");
|
32
|
+
jt = new JTextField(20);
|
33
|
+
send = new JButton("Send");
|
34
|
+
add(lbl);
|
35
|
+
add(jt);
|
36
|
+
add(send);
|
37
|
+
validate();
|
38
|
+
send.addActionListener(new ActionListener(){
|
39
|
+
public void actionPerformed(ActionEvent ae) {
|
40
|
+
try{
|
41
|
+
Socket s = new Socket("localhost", 1234);
|
42
|
+
DataOutputStream out = new DataOutputStream(s.getOutputStream());
|
43
|
+
out.writeUTF(jt.getText());
|
44
|
+
jt.setText("");
|
45
|
+
s.close();
|
46
|
+
}catch(Exception e){System.out.println(e);}
|
47
|
+
}
|
48
|
+
});
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
class Server extends JFrame{
|
53
|
+
JTextArea jta;
|
54
|
+
String newline = System.lineSeparator();
|
55
|
+
public static void main(String[] args) {
|
56
|
+
new Server();
|
57
|
+
}
|
58
|
+
Server(){
|
59
|
+
setTitle("Server");
|
60
|
+
setSize(400, 200);
|
61
|
+
setVisible(true);
|
62
|
+
jta = new JTextArea("Waiting for message..."+newline);
|
63
|
+
add(jta);
|
64
|
+
validate();
|
65
|
+
try{
|
66
|
+
ServerSocket ss = new ServerSocket(1234);
|
67
|
+
while(true){
|
68
|
+
Socket s = ss.accept();
|
69
|
+
DataInputStream in = new DataInputStream(s.getInputStream());
|
70
|
+
String msg = in.readUTF();
|
71
|
+
jta.append("Received: "+msg+" ("+check(msg)+")"+newline);
|
72
|
+
s.close();
|
73
|
+
}
|
74
|
+
}catch(Exception e){System.out.println(e);}
|
75
|
+
}
|
76
|
+
String check(String msg){
|
77
|
+
StringBuffer rmsg = new StringBuffer(msg);
|
78
|
+
rmsg.reverse();
|
79
|
+
return msg.equalsIgnoreCase(new String(rmsg)) ? "It is a palindrome" : "It is not a palindrome";
|
80
|
+
}
|
81
|
+
}
|
Binary file
|
Binary file
|
@@ -0,0 +1,65 @@
|
|
1
|
+
#How to run
|
2
|
+
#==========
|
3
|
+
#save this file as LAN.tcl in desktop folder
|
4
|
+
#also save analysis.awk file in the same location
|
5
|
+
#open desktop right-click and choose 'Open in Terminal'
|
6
|
+
#run this command
|
7
|
+
#ns LAN.tcl
|
8
|
+
|
9
|
+
#both nam and awk file will be executed automatically
|
10
|
+
|
11
|
+
set ns [new Simulator]
|
12
|
+
|
13
|
+
set tr [open "LAN.tr" w]
|
14
|
+
$ns trace-all $tr
|
15
|
+
|
16
|
+
set nam [open "LAN.nam" w]
|
17
|
+
$ns namtrace-all $nam
|
18
|
+
|
19
|
+
set n1 [$ns node]
|
20
|
+
set n2 [$ns node]
|
21
|
+
set n3 [$ns node]
|
22
|
+
set n4 [$ns node]
|
23
|
+
set n5 [$ns node]
|
24
|
+
set n6 [$ns node]
|
25
|
+
|
26
|
+
$ns make-lan "$n1 $n2 $n3 $n4 $n5 $n6" 0.2Mb 20ms LL Queue/DropTail Mac/802_3
|
27
|
+
|
28
|
+
set tcpsendagent1 [new Agent/TCP]
|
29
|
+
set tcpsendagent2 [new Agent/TCP]
|
30
|
+
|
31
|
+
set tcprecvagent1 [new Agent/TCPSink]
|
32
|
+
set tcprecvagent2 [new Agent/TCPSink]
|
33
|
+
|
34
|
+
$ns attach-agent $n1 $tcpsendagent1
|
35
|
+
$ns attach-agent $n2 $tcpsendagent2
|
36
|
+
|
37
|
+
$ns attach-agent $n6 $tcprecvagent1
|
38
|
+
$ns attach-agent $n6 $tcprecvagent2
|
39
|
+
|
40
|
+
set app1 [new Application/FTP]
|
41
|
+
set app2 [new Application/FTP]
|
42
|
+
|
43
|
+
$app1 attach-agent $tcpsendagent1
|
44
|
+
$app2 attach-agent $tcpsendagent2
|
45
|
+
|
46
|
+
|
47
|
+
$ns connect $tcpsendagent1 $tcprecvagent1
|
48
|
+
$ns connect $tcpsendagent2 $tcprecvagent2
|
49
|
+
|
50
|
+
$ns at 0.1 "$app1 start"
|
51
|
+
$ns at 0.4 "$app2 start"
|
52
|
+
|
53
|
+
proc finish { } {
|
54
|
+
global ns tr nam
|
55
|
+
$ns flush-trace
|
56
|
+
close $tr
|
57
|
+
close $nam
|
58
|
+
exec nam LAN.nam &
|
59
|
+
exec awk -f analysis.awk LAN.tr &
|
60
|
+
exit 0
|
61
|
+
}
|
62
|
+
|
63
|
+
$ns at 10 "finish"
|
64
|
+
|
65
|
+
$ns run
|
@@ -0,0 +1,44 @@
|
|
1
|
+
BEGIN{
|
2
|
+
drop=0
|
3
|
+
recv=0
|
4
|
+
starttime1=0
|
5
|
+
endtime1=0
|
6
|
+
latency1=0
|
7
|
+
filesize1=0
|
8
|
+
starttime2=0
|
9
|
+
endtime2=0
|
10
|
+
latency2=0
|
11
|
+
filesize2=0
|
12
|
+
flag0=0
|
13
|
+
flag1=0
|
14
|
+
bandwidth1=0
|
15
|
+
bandwidth2=0
|
16
|
+
}
|
17
|
+
|
18
|
+
{
|
19
|
+
|
20
|
+
if($1=="r" && $3==6)
|
21
|
+
{
|
22
|
+
if(flag1=0)
|
23
|
+
{
|
24
|
+
flag1=1
|
25
|
+
starttime1=$2
|
26
|
+
}
|
27
|
+
filesize1+=$6
|
28
|
+
endtime1=$2
|
29
|
+
latency=endtime1-starttime1
|
30
|
+
bandwidth1=filesize1/latency
|
31
|
+
printf "%f %f\n", endtime1, bandwidth1 >> "file.xg"
|
32
|
+
|
33
|
+
}
|
34
|
+
|
35
|
+
}
|
36
|
+
END{
|
37
|
+
bandwidth1 = filesize1/latency
|
38
|
+
latency = endtime1-starttime1
|
39
|
+
print("")
|
40
|
+
print("Final Values..")
|
41
|
+
print("Filesize:",filesize1)
|
42
|
+
print("Latency:",latency)
|
43
|
+
print("Throughput(Mbps):",bandwidth1/1000000)
|
44
|
+
}
|
Binary file
|
Binary file
|
@@ -0,0 +1,229 @@
|
|
1
|
+
#How to run
|
2
|
+
#==========
|
3
|
+
#save this file as complexdcf.tcl in desktop folder
|
4
|
+
#open desktop right-click and choose 'Open in Terminal'
|
5
|
+
#run this command
|
6
|
+
#ns complexdcf.tcl
|
7
|
+
|
8
|
+
#nam file will be executed automatically
|
9
|
+
|
10
|
+
Mac/802_11 set dataRate_ 1Mb
|
11
|
+
set val(chan) Channel/WirelessChannel ;# channel type
|
12
|
+
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
|
13
|
+
|
14
|
+
set val(ant) Antenna/OmniAntenna ;# Antenna type
|
15
|
+
set val(ll) LL ;# Link layer type
|
16
|
+
set val(ifq) Queue/DropTail/PriQueue ;# Interface queue type
|
17
|
+
set val(ifqlen) 50 ;# max packet in ifq
|
18
|
+
set val(netif) Phy/WirelessPhy ;# network interface type
|
19
|
+
set val(mac) Mac/802_11 ;# MAC type
|
20
|
+
set val(nn) 15 ;# number of mobilenodes
|
21
|
+
set val(rp) AODV ;# routing protocol
|
22
|
+
set val(x) 800
|
23
|
+
set val(y) 800
|
24
|
+
|
25
|
+
# Creating simulation object
|
26
|
+
set ns [new Simulator]
|
27
|
+
|
28
|
+
#creating Output trace files
|
29
|
+
set f [open complexdcf.tr w]
|
30
|
+
$ns trace-all $f
|
31
|
+
|
32
|
+
set namtrace [open complexdcf.nam w]
|
33
|
+
$ns namtrace-all-wireless $namtrace $val(x) $val(y)
|
34
|
+
|
35
|
+
set f0 [open complexdcf_AT.tr w]
|
36
|
+
|
37
|
+
set topo [new Topography]
|
38
|
+
$topo load_flatgrid 800 800
|
39
|
+
# Defining Global Variables
|
40
|
+
create-god $val(nn)
|
41
|
+
set chan_1 [new $val(chan)]
|
42
|
+
# setting the wireless nodes parameters
|
43
|
+
$ns node-config -adhocRouting $val(rp) \
|
44
|
+
-llType $val(ll) \
|
45
|
+
-macType $val(mac) \
|
46
|
+
-ifqType $val(ifq) \
|
47
|
+
-ifqLen $val(ifqlen) \
|
48
|
+
-antType $val(ant) \
|
49
|
+
-propType $val(prop) \
|
50
|
+
-phyType $val(netif) \
|
51
|
+
-topoInstance $topo \
|
52
|
+
-agentTrace OFF \
|
53
|
+
-routerTrace ON \
|
54
|
+
-macTrace ON \
|
55
|
+
-movementTrace OFF \
|
56
|
+
-channel $chan_1
|
57
|
+
|
58
|
+
proc finish {} {
|
59
|
+
global ns namtrace f f0
|
60
|
+
$ns flush-trace
|
61
|
+
close $namtrace
|
62
|
+
close $f0
|
63
|
+
puts "Executing nam..."
|
64
|
+
exec nam -r 5m complexdcf.nam &
|
65
|
+
exit 0
|
66
|
+
}
|
67
|
+
# Defining a procedure to calculate the througpout
|
68
|
+
proc record {} {
|
69
|
+
global sink1 sink3 sink7 sink10 sink11 f0
|
70
|
+
set ns [Simulator instance]
|
71
|
+
set time 0.5
|
72
|
+
set bw0 [$sink3 set bytes_]
|
73
|
+
set bw3 [$sink3 set bytes_]
|
74
|
+
set bw7 [$sink7 set bytes_]
|
75
|
+
set bw10 [$sink10 set bytes_]
|
76
|
+
set bw11 [$sink11 set bytes_]
|
77
|
+
set now [$ns now]
|
78
|
+
puts $f0 "$now [expr ($bw0+$bw3+$bw7+$bw10+$bw11)/$time*8/1000000]"
|
79
|
+
# Calculating the average throughput
|
80
|
+
|
81
|
+
$sink1 set bytes_ 0
|
82
|
+
$sink3 set bytes_ 0
|
83
|
+
$sink7 set bytes_ 0
|
84
|
+
$sink10 set bytes_ 0
|
85
|
+
$sink11 set bytes_ 0
|
86
|
+
$ns at [expr $now+$time] "record"
|
87
|
+
}
|
88
|
+
#Creating the wireless Nodes
|
89
|
+
for {set i 0} {$i < $val(nn) } {incr i} {
|
90
|
+
set n($i) [$ns node]
|
91
|
+
$n($i) random-motion 0 ;
|
92
|
+
}
|
93
|
+
#setting the initial position for the nodes
|
94
|
+
for {set i 0} {$i < $val(nn)} {incr i} {
|
95
|
+
$ns initial_node_pos $n($i) 30+i*100
|
96
|
+
}
|
97
|
+
for {set i 0} {$i < $val(nn)} {incr i} {
|
98
|
+
$n($i) set X_ 0.0
|
99
|
+
$n($i) set Y_ 0.0
|
100
|
+
$n($i) set Z_ 0.0
|
101
|
+
}
|
102
|
+
# making some nodes move in the topography
|
103
|
+
$ns at 0.0 "$n(0) setdest 100.0 100.0 3000.0"
|
104
|
+
$ns at 0.0 "$n(1) setdest 200.0 200.0 3000.0"
|
105
|
+
$ns at 0.0 "$n(2) setdest 300.0 200.0 3000.0"
|
106
|
+
$ns at 0.0 "$n(3) setdest 400.0 300.0 3000.0"
|
107
|
+
$ns at 0.0 "$n(4) setdest 500.0 300.0 3000.0"
|
108
|
+
$ns at 0.0 "$n(5) setdest 600.0 400.0 3000.0"
|
109
|
+
$ns at 0.0 "$n(6) setdest 600.0 100.0 3000.0"
|
110
|
+
$ns at 0.0 "$n(7) setdest 600.0 200.0 3000.0"
|
111
|
+
|
112
|
+
$ns at 0.0 "$n(8) setdest 600.0 300.0 3000.0"
|
113
|
+
$ns at 0.0 "$n(9) setdest 600.0 350.0 3000.0"
|
114
|
+
$ns at 0.0 "$n(10) setdest 700.0 100.0 3000.0"
|
115
|
+
$ns at 0.0 "$n(11) setdest 700.0 200.0 3000.0"
|
116
|
+
$ns at 0.0 "$n(12) setdest 700.0 300.0 3000.0"
|
117
|
+
$ns at 0.0 "$n(13) setdest 700.0 350.0 3000.0"
|
118
|
+
$ns at 0.0 "$n(14) setdest 700.0 400.0 3000.0"
|
119
|
+
$ns at 2.0 "$n(5) setdest 100.0 400.0 500.0"
|
120
|
+
$ns at 1.5 "$n(3) setdest 450.0 150.0 500.0"
|
121
|
+
$ns at 50.0 "$n(7) setdest 300.0 400.0 500.0"
|
122
|
+
$ns at 2.0 "$n(10) setdest 200.0 400.0 500.0"
|
123
|
+
$ns at 2.0 "$n(11) setdest 650.0 400.0 500.0"
|
124
|
+
#Creating receiving sinks with monitoring ability to monitor the incoming bytes
|
125
|
+
# LossMonitor objects are a subclass of agent objects that implement a traffic sink.
|
126
|
+
set sink1 [new Agent/LossMonitor]
|
127
|
+
set sink3 [new Agent/LossMonitor]
|
128
|
+
set sink7 [new Agent/LossMonitor]
|
129
|
+
set sink10 [new Agent/LossMonitor]
|
130
|
+
set sink11 [new Agent/LossMonitor]
|
131
|
+
$ns attach-agent $n(1) $sink1
|
132
|
+
$ns attach-agent $n(3) $sink3
|
133
|
+
$ns attach-agent $n(7) $sink7
|
134
|
+
$ns attach-agent $n(10) $sink10
|
135
|
+
$ns attach-agent $n(11) $sink11
|
136
|
+
# setting TCP as the transmission protocol over the connections
|
137
|
+
set tcp0 [new Agent/TCP]
|
138
|
+
$ns attach-agent $n(0) $tcp0
|
139
|
+
set tcp2 [new Agent/TCP]
|
140
|
+
$ns attach-agent $n(2) $tcp2
|
141
|
+
set tcp4 [new Agent/TCP]
|
142
|
+
|
143
|
+
$ns attach-agent $n(4) $tcp4
|
144
|
+
set tcp5 [new Agent/TCP]
|
145
|
+
$ns attach-agent $n(5) $tcp5
|
146
|
+
set tcp9 [new Agent/TCP]
|
147
|
+
$ns attach-agent $n(9) $tcp9
|
148
|
+
set tcp13 [new Agent/TCP]
|
149
|
+
$ns attach-agent $n(13) $tcp13
|
150
|
+
set tcp6 [new Agent/TCP]
|
151
|
+
$ns attach-agent $n(6) $tcp6
|
152
|
+
set tcp14 [new Agent/TCP]
|
153
|
+
$ns attach-agent $n(14) $tcp14
|
154
|
+
set tcp8 [new Agent/TCP]
|
155
|
+
$ns attach-agent $n(8) $tcp8
|
156
|
+
set tcp12 [new Agent/TCP]
|
157
|
+
$ns attach-agent $n(12) $tcp12
|
158
|
+
# Setting FTP connections
|
159
|
+
set ftp9 [new Application/FTP]
|
160
|
+
$ftp9 attach-agent $tcp9
|
161
|
+
$ftp9 set type_ FTP
|
162
|
+
set ftp13 [new Application/FTP]
|
163
|
+
$ftp13 attach-agent $tcp13
|
164
|
+
$ftp13 set type_ FTP
|
165
|
+
set ftp6 [new Application/FTP]
|
166
|
+
$ftp6 attach-agent $tcp6
|
167
|
+
$ftp6 set type_ FTP
|
168
|
+
set ftp14 [new Application/FTP]
|
169
|
+
$ftp14 attach-agent $tcp14
|
170
|
+
$ftp14 set type_ FTP
|
171
|
+
set ftp8 [new Application/FTP]
|
172
|
+
$ftp8 attach-agent $tcp8
|
173
|
+
|
174
|
+
$ftp8 set type_ FTP
|
175
|
+
set ftp12 [new Application/FTP]
|
176
|
+
$ftp12 attach-agent $tcp12
|
177
|
+
$ftp12 set type_ FTP
|
178
|
+
#connecting the nodes
|
179
|
+
$ns connect $tcp0 $sink3
|
180
|
+
$ns connect $tcp5 $sink3
|
181
|
+
$ns connect $tcp2 $sink1
|
182
|
+
$ns connect $tcp4 $sink1
|
183
|
+
$ns connect $tcp9 $sink7
|
184
|
+
$ns connect $tcp13 $sink7
|
185
|
+
$ns connect $tcp6 $sink10
|
186
|
+
$ns connect $tcp14 $sink10
|
187
|
+
$ns connect $tcp8 $sink11
|
188
|
+
$ns connect $tcp12 $sink11
|
189
|
+
# Defining CBR procedure with the required parametes
|
190
|
+
proc attach-CBR-traffic { node sink size interval } {
|
191
|
+
set ns [Simulator instance]
|
192
|
+
set cbr [new Agent/CBR]
|
193
|
+
$ns attach-agent $node $cbr
|
194
|
+
$cbr set packetSize_ $size
|
195
|
+
$cbr set interval_ $interval
|
196
|
+
$ns connect $cbr $sink
|
197
|
+
return $cbr
|
198
|
+
}
|
199
|
+
set cbr0 [attach-CBR-traffic $n(0) $sink3 1000 .015]
|
200
|
+
set cbr1 [attach-CBR-traffic $n(5) $sink3 1000 .015]
|
201
|
+
set cbr2 [attach-CBR-traffic $n(2) $sink1 1000 .015]
|
202
|
+
set cbr3 [attach-CBR-traffic $n(4) $sink1 1000 .015]
|
203
|
+
# Setting the begining and ending time of each connection
|
204
|
+
|
205
|
+
$ns at 0.0 "record"
|
206
|
+
$ns at 20.0 "$cbr0 start"
|
207
|
+
$ns at 20.0 "$cbr2 start"
|
208
|
+
$ns at 800.0 "$cbr0 stop"
|
209
|
+
$ns at 850.0 "$cbr2 stop"
|
210
|
+
$ns at 30.0 "$cbr1 start"
|
211
|
+
$ns at 30.0 "$cbr3 start"
|
212
|
+
$ns at 850.0 "$cbr1 stop"
|
213
|
+
$ns at 870.0 "$cbr3 stop"
|
214
|
+
$ns at 25.0 "$ftp6 start"
|
215
|
+
$ns at 25.0 "$ftp14 start"
|
216
|
+
$ns at 810.0 "$ftp6 stop"
|
217
|
+
$ns at 860.0 "$ftp14 stop"
|
218
|
+
$ns at 35.0 "$ftp9 start"
|
219
|
+
$ns at 35.0 "$ftp13 start"
|
220
|
+
$ns at 830.0 "$ftp9 stop"
|
221
|
+
$ns at 889.0 "$ftp13 stop"
|
222
|
+
$ns at 40.0 "$ftp8 start"
|
223
|
+
$ns at 40.0 "$ftp12 start"
|
224
|
+
$ns at 820.0 "$ftp8 stop"
|
225
|
+
$ns at 890.0 "$ftp12 stop"
|
226
|
+
$ns at 900.0 "finish"
|
227
|
+
# Runnning the simulation
|
228
|
+
puts "Start of simulation.."
|
229
|
+
$ns run
|
Binary file
|
Binary file
|
@@ -0,0 +1,119 @@
|
|
1
|
+
/*
|
2
|
+
How to run
|
3
|
+
==========
|
4
|
+
save the file as filetransfer.java (filename can be anything)
|
5
|
+
Command Prompt 1 (go to the location the file is saved)
|
6
|
+
javac *.java
|
7
|
+
java Server
|
8
|
+
|
9
|
+
Command Prompt 2 (go to the location the file is saved)
|
10
|
+
java Client
|
11
|
+
|
12
|
+
select file_to_send.txt which will be there in the file location
|
13
|
+
(any file can be sent)
|
14
|
+
*/
|
15
|
+
|
16
|
+
import java.io.*;
|
17
|
+
import java.net.*;
|
18
|
+
import javax.swing.*;
|
19
|
+
import java.awt.event.*;
|
20
|
+
|
21
|
+
class Client extends JFrame {
|
22
|
+
JTextArea jta;
|
23
|
+
JButton send;
|
24
|
+
JFileChooser jc;
|
25
|
+
static String newline = System.lineSeparator();
|
26
|
+
Client(){
|
27
|
+
setTitle("File Client");
|
28
|
+
setSize(400, 300);
|
29
|
+
setVisible(true);
|
30
|
+
jta = new JTextArea();
|
31
|
+
send = new JButton("Send File");
|
32
|
+
jc = new JFileChooser();
|
33
|
+
send.addActionListener(new ActionListener(){
|
34
|
+
public void actionPerformed(ActionEvent e){
|
35
|
+
int op = jc.showOpenDialog(null);
|
36
|
+
if(op == JFileChooser.APPROVE_OPTION)
|
37
|
+
sendFile(jc.getSelectedFile());
|
38
|
+
}
|
39
|
+
});
|
40
|
+
add(new JScrollPane(jta), "Center");
|
41
|
+
add(send, "South");
|
42
|
+
validate();
|
43
|
+
}
|
44
|
+
void sendFile(File f) {
|
45
|
+
try{
|
46
|
+
Socket s = new Socket("localhost", 5000);
|
47
|
+
jta.setText("Connected to server"+newline);
|
48
|
+
FileInputStream fin = new FileInputStream(f);
|
49
|
+
OutputStream out = s.getOutputStream();
|
50
|
+
|
51
|
+
byte[] buffer = new byte[1024];
|
52
|
+
int bytesRead;
|
53
|
+
while ((bytesRead = fin.read(buffer)) != -1){
|
54
|
+
for (int i = 0; i < bytesRead; i++){
|
55
|
+
byte plainByte = buffer[i];
|
56
|
+
byte cipherByte = (byte) ((plainByte + 3) % 256);
|
57
|
+
jta.append("Plain Text: " + plainByte + " (" + (char) plainByte + ") -> Cipher Text: " + cipherByte + " (" + (char) cipherByte + ")"+newline);
|
58
|
+
buffer[i] = cipherByte;
|
59
|
+
}
|
60
|
+
out.write(buffer, 0, bytesRead);
|
61
|
+
}
|
62
|
+
fin.close();
|
63
|
+
out.close();
|
64
|
+
s.close();
|
65
|
+
jta.append("File encrypted and sent successfully"+newline);
|
66
|
+
}catch(Exception e){System.out.println(e);}
|
67
|
+
}
|
68
|
+
public static void main(String[] args){
|
69
|
+
try{
|
70
|
+
FileWriter fout = new FileWriter("file_to_send.txt");
|
71
|
+
fout.write("Hello World"+newline+"Hello To JAVA");
|
72
|
+
fout.close();
|
73
|
+
new Client();
|
74
|
+
}catch(Exception e){System.out.println(e);}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
class Server extends JFrame{
|
79
|
+
JTextArea jta;
|
80
|
+
String newline = System.lineSeparator();
|
81
|
+
Server(){
|
82
|
+
setTitle("File Server");
|
83
|
+
setSize(400, 300);
|
84
|
+
setVisible(true);
|
85
|
+
jta = new JTextArea();
|
86
|
+
add(new JScrollPane(jta));
|
87
|
+
validate();
|
88
|
+
try{
|
89
|
+
ServerSocket ss = new ServerSocket(5000);
|
90
|
+
jta.append("Server is listening on port 5000"+newline);
|
91
|
+
for(int n=1;n<=10;n++){
|
92
|
+
Socket s = ss.accept();
|
93
|
+
jta.setText("Client connected"+newline);
|
94
|
+
InputStream in = s.getInputStream();
|
95
|
+
FileOutputStream fout = new FileOutputStream("received_file_"+n+".txt");
|
96
|
+
|
97
|
+
byte[] buffer = new byte[1024];
|
98
|
+
int bytesRead;
|
99
|
+
while ((bytesRead = in.read(buffer)) != -1){
|
100
|
+
for (int i = 0; i < bytesRead; i++){
|
101
|
+
byte cipherByte = buffer[i];
|
102
|
+
byte plainByte = (byte) ((cipherByte - 3 + 256) % 256);
|
103
|
+
jta.append("Cipher Text: " + cipherByte + " (" + (char) cipherByte + ") -> Plain Text: " + plainByte + " (" + (char) plainByte + ")"+newline);
|
104
|
+
buffer[i] = plainByte;
|
105
|
+
}
|
106
|
+
fout.write(buffer, 0, bytesRead);
|
107
|
+
}
|
108
|
+
fout.close();
|
109
|
+
in.close();
|
110
|
+
s.close();
|
111
|
+
jta.append("File received and decrypted successfully"+newline);
|
112
|
+
}
|
113
|
+
ss.close();
|
114
|
+
}catch(Exception e){System.out.println(e);}
|
115
|
+
}
|
116
|
+
public static void main(String[] args){
|
117
|
+
new Server();
|
118
|
+
}
|
119
|
+
}
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,56 @@
|
|
1
|
+
/*
|
2
|
+
How to run
|
3
|
+
==========
|
4
|
+
save the file as rmi.java (filename can be anything)
|
5
|
+
Command Prompt 1 (go to the location the file is saved)
|
6
|
+
javac *.java
|
7
|
+
start rmiregistry
|
8
|
+
java Server
|
9
|
+
|
10
|
+
Command Prompt 2 (go to the location the file is saved)
|
11
|
+
java Client localhost
|
12
|
+
|
13
|
+
Note: If version error occurs, Compile following way:
|
14
|
+
javac --release 8 *.java
|
15
|
+
*/
|
16
|
+
|
17
|
+
import java.net.*;
|
18
|
+
import java.rmi.*;
|
19
|
+
import java.rmi.server.*;
|
20
|
+
|
21
|
+
interface MyServerIntf extends Remote{
|
22
|
+
String add(double a, double b) throws RemoteException;
|
23
|
+
}
|
24
|
+
|
25
|
+
class MyServerImpl extends UnicastRemoteObject implements MyServerIntf{
|
26
|
+
MyServerImpl()throws RemoteException{}
|
27
|
+
public String add(double a, double b)throws RemoteException{
|
28
|
+
return a+" + "+b+" = "+(a+b);
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
class Client{
|
33
|
+
public static void main(String[] arg){
|
34
|
+
try{
|
35
|
+
String name;
|
36
|
+
if(arg.length == 0)
|
37
|
+
name = "rmi://localhost/RMServer";
|
38
|
+
else
|
39
|
+
name = "rmi://"+arg[0]+"/RMServer";
|
40
|
+
MyServerIntf asif = (MyServerIntf)Naming.lookup(name);
|
41
|
+
System.out.println("Addition: "+asif.add(1200,1300));
|
42
|
+
}catch(Exception e){System.out.println("Exception: "+e);}
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
|
47
|
+
class Server{
|
48
|
+
public static void main(String[] arg){
|
49
|
+
try {
|
50
|
+
MyServerImpl asi = new MyServerImpl();
|
51
|
+
Naming.rebind("RMServer",asi);
|
52
|
+
System.out.println("Server Started...");
|
53
|
+
}
|
54
|
+
catch(Exception e){System.out.println("Exception: "+e);}
|
55
|
+
}
|
56
|
+
}
|
Binary file
|
Binary file
|
@@ -0,0 +1,25 @@
|
|
1
|
+
BEGIN{
|
2
|
+
r1=r2=d1=d2=total=0
|
3
|
+
ratio=tp1=tp2=0.0
|
4
|
+
}
|
5
|
+
|
6
|
+
{
|
7
|
+
if($1 =="r" && $4 == 3 && $5=="cbr")r1++
|
8
|
+
if($1 =="d" && $4 == 3 && $5=="cbr")d1++
|
9
|
+
if($1 =="r" && $4 == 5 && $5=="tcp")r2++
|
10
|
+
if($1 =="d" && $4 == 5 && $5=="tcp")d2++
|
11
|
+
}
|
12
|
+
|
13
|
+
END{
|
14
|
+
total = r1+r2+d1+d2
|
15
|
+
ratio = (r1+r2)*100/total
|
16
|
+
tp1 = (r1+d1)*8/1000000
|
17
|
+
tp2 = (r2+d2)*8/1000000
|
18
|
+
print("")
|
19
|
+
print("Wired-Network")
|
20
|
+
print("Packets Received:",r1+r2)
|
21
|
+
print("Packets Dropped :",d1+d2)
|
22
|
+
print("Packets Delivery Ratio:",ratio,"%")
|
23
|
+
print("UDP Throughput:",tp1,"Mbps")
|
24
|
+
print("TCP Throughput:",tp2,"Mbps")
|
25
|
+
}
|