Sentence Similarity
sentence-transformers
Safetensors
roberta
feature-extraction
Generated from Trainer
dataset_size:33411
loss:BatchAllTripletLoss
text-embeddings-inference
Instructions to use buelfhood/SOCO-Java-UniXcoder-ST with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use buelfhood/SOCO-Java-UniXcoder-ST with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("buelfhood/SOCO-Java-UniXcoder-ST") sentences = [ "\npackage java.httputils;\n\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.Iterator;\nimport java.util.Observable;\nimport java.util.Observer;\n\n\npublic class BruteForceThreadPool extends ThreadGroup implements Observer\n{\n protected String URL = \"http://localhost:8080/secret/index.html\";\n protected int poolSize = 6;\n\n protected Collection threadList = new ArrayList();\n protected String fileName = \"BruteForceReport.txt\";\n protected boolean finished = false;\n protected String userName = \"\";\n \n public BruteForceThreadPool(String name)\n {\n super(name);\n }\n\n \n public BruteForceThreadPool(ThreadGroup parent, String name)\n {\n super(parent, name);\n }\n\n \n public synchronized void update(Observable o, Object arg)\n {\n \n System.out.println(\"Update method called the observer.\");\n RunnableBruteForce rbf = (RunnableBruteForce) o;\n rbf.createReport();\n\n \n \n for (Iterator iter = threadList.iterator(); iter.hasNext();)\n {\n RunnableBruteForce target = (RunnableBruteForce) iter.next();\n target.setStop(true);\n }\n finished = true;\n }\n\n\n \n protected void start(int threads)\n {\n \n \n int load = BruteForce.letters.length / threads;\n int remainder = BruteForce.letters.length % threads;\n\n \n for (int i = 0, end = ( + load);\n end < BruteForce.letters.length;\n i = end, end += load)\n {\n RunnableBruteForce runnable = new RunnableBruteForce();\n runnable.setURL(getURL());\n runnable.setRangeStart();\n runnable.setUserName(userName);\n \n runnable.setRangeEnd(\n end + load > BruteForce.letters.length ?\n BruteForce.letters.length :\n end);\n\n runnable.addObserver(this);\n runnable.setFileName(getFileName());\n \n threadList.add(runnable);\n }\n\n \n for (Iterator iter = threadList.iterator(); iter.hasNext();)\n {\n RunnableBruteForce target = (RunnableBruteForce) iter.next();\n new Thread(target).start();\n }\n\n }\n\n public static void main(String[] args)\n {\n BruteForceThreadPool pool = new BruteForceThreadPool(\"BruteForceThreadGroup\");\n\n if (args.length < 4)\n {\n pool.printUsage();\n return;\n }\n pool.setURL(args[0]);\n pool.userName = args[1];\n pool.setFileName(args[2]);\n\n pool.get(Integer.parseInt(args[3]));\n while (true)\n {\n try\n {\n Thread.currentThread().sleep(100);\n if (pool.finished)\n {\n break;\n }\n }\n catch (InterruptedException e)\n {\n e.printStackTrace();\n }\n }\n\n System.exit(0);\n }\n\n\n public String printUsage()\n {\n StringBuffer s = new StringBuffer();\n\n s.append(\"** BruteForceThreadPool proper usage **\\n\\n\");\n s.append(\n \"java ..httputils.BruteForceThreadPool <URL> <UserName> <OutputFile> < Of Threads = 6>\\n\\n\");\n\n return s.toString();\n }\n\n \n public Collection getThreadList()\n {\n return threadList;\n }\n\n \n public void setThreadList(Collection collection)\n {\n threadList = collection;\n }\n\n\n \n public String getFileName()\n {\n return fileName;\n }\n\n \n public void setFileName(String string)\n {\n fileName = string;\n }\n\n \n public String getURL()\n {\n return URL;\n }\n\n \n public void setURL(String string)\n {\n URL = string;\n }\n\n \n public int getPoolSize()\n {\n return poolSize;\n }\n\n \n public void setPoolSize(int i)\n {\n poolSize = i;\n }\n\n}\n", "\n\nimport java.net.*;\nimport java.io.IOException;\nimport java.util.*;\nimport java.io.*;\npublic class BruteForce {\n \n \n \n String passwordLetters[] ={\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"};\n String password=\" \";\n static int counter;\n static int noOfAttempts;\n static String userName=\"\";\n HttpURLConnection u;\n boolean threadF,threadM;\n String passBase64;\n \n PasswordCrackThreadF passwordCrackThreadF;\n PasswordCrackThreadM passwordCrackThreadM;\n URL url;\n \n \n public BruteForce() {\n breakPassword();\n }\n\n public static void main (String args[]) {\n new BruteForce();\n }\n \n \n \n private void breakPassword() {\n int j;\n \n breakOneLetterPassword();\n \n breakTwoLetterPassword();\n \n \n \n\n passwordCrackThreadF = new PasswordCrackThreadF(0,26,counter++,passwordLetters,userName,this);\n \n passwordCrackThreadM = new PasswordCrackThreadM(26,52,counter++,passwordLetters,userName,this);\n \n passwordCrackThreadF.print();\n passwordCrackThreadM.print();\n }\n \n \n private void breakOneLetterPassword() { \n MyHttpURLConnection httpURLConnection;\n try {\n\t \n\t url = new URL( \"http://sec-crack.cs.rmit.edu./SEC/2/index.php\");\n\t \n\t passBase64 = new url.misc.BASE64Encoder().encode(password.getBytes());\n u = (HttpURLConnection)url.openConnection();\n\t u.setRequestProperty(\"Authorization\", \" \" + passBase64);\n } catch (IOException io) {io.printStackTrace();}\n \n loop: for (int i=0;i<52;i++) {\n password = passwordLetters[i];\n\t\t \n\t\t password =\":\"+ password;\n try {\n \n\t \t u= (HttpURLConnection)url.openConnection();\n\t\t passBase64 = new url.misc.BASE64Encoder().encode(password.getBytes());\n u.setRequestProperty(\"Authorization\", \" \" + passBase64);\n\t\t u.connect();\t\n\t\t noOfAttempts++; \n\t\t if (u.getContentLength() != 0) {\n\t\t \n\t\t if (u.getResponseCode()== HttpURLConnection.HTTP_OK ) {\n\t\t \n\t System.out.println (\"Your User Name : Password is \"+password);\n\t\t\t\t System.out.println(\" \");\n\t\t\t System.out.println(\" of Attempts / Requests \"+ noOfAttempts);\n\t\t\t \n\t\t\t System.exit(0);\n \n\t }\n\t\t }\n\t\t } catch (ProtocolException px) {px.printStackTrace();\n \n } catch ( NoRouteToHostException nr) {nr.printStackTrace();\n\t } catch (BindException e){e.printStackTrace();\n\t } catch (IndexOutOfBoundsException e3){e3.printStackTrace();\n\t } catch (IOException io) {io.printStackTrace();\n\t\t \n\t } finally {u.disconnect();\n\t }\n } \n }\n \n \n private void breakTwoLetterPassword() { \n MyHttpURLConnection httpURLConnection; \n try {\n\t \n\t url = new URL( \"http://sec-crack.cs.rmit.edu./SEC/2/index.php\");\n\t \n\t passBase64 = new url.misc.BASE64Encoder().encode(password.getBytes());\n u = (HttpURLConnection)url.openConnection();\n\t u.setRequestProperty(\"Authorization\", \" \" + passBase64);\n } catch (IOException io) {io.printStackTrace();}\n\n \n loop: for (int i=0;i<52;i++) {\n for (int j=0;j<52;j++) {\n password = passwordLetters[i]+passwordLetters[j];\n\t\t \n\t\t password =\":\"+ password;\n\t\t \n\t\t \n\t \n try {\n\t\t u= (HttpURLConnection)url.openConnection();\n\t\t\t passBase64 = new url.misc.BASE64Encoder().encode(password.getBytes());\n u.setRequestProperty(\"Authorization\", \" \" + passBase64);\n\t\t\tu.connect();\n\t\t\tnoOfAttempts++;\n\t\t\t\n \t if (u.getContentLength() != 0) {\n\t\t if (u.getResponseCode()== HttpURLConnection.HTTP_OK ) {\n\t System.out.println (\"Your User Name : Password is \"+password); \n\t\t\t System.out.println(\" \");\n\t\t\t System.out.println(\" of Attempts / Requests \"+ noOfAttempts);\n\t\t\t \n\t\t\t System.exit(0);\n\t }\n\t\t }\n\t\t \n\t\t\n\t } catch (ProtocolException px) {px.printStackTrace();\n } catch ( NoRouteToHostException nr) {nr.printStackTrace();\n\t } catch (BindException e){e.printStackTrace();\n\t } catch (IndexOutOfBoundsException e3){e3.printStackTrace();\n\t } catch (IOException io) {io.printStackTrace();\n\t\t \n\t } finally {u.disconnect();\n\t }\n } \n }\n\n\n }\n}\n\nclass PasswordCrackThreadF extends Thread {\n \n \n \n private String passwordLetters[] ;\n private String password=\" \";\n private static String userName=\"\";\n private MyHttpURLConnection httpURLConnection;\n private URL url;\n \n BruteForce bruteForce;\n int count; \n String passBase64;\n private HttpURLConnection u;\n \n int start,stop;\n \n static boolean found;\n \n PasswordCrackThreadF(int start,int stop,int counter,String[]\n passwordLetters,String userName,BruteForce bruteForce) {\n this.start = start;\n this.stop = stop;\n this.passwordLetters =passwordLetters;\n this.userName=userName;\n count =counter;\n this.bruteForce=bruteForce; \n bruteForce.threadF=true;\n\t\n \n passBase64 = new bruteForce.misc.BASE64Encoder().encode(password.getBytes());\n try {\n\t \n\t url = new URL( \"http://sec-crack.cs.rmit.edu./SEC/2/index.php\");\n\t \n\n\t u = (HttpURLConnection)url.openConnection();\n \n\t u.setRequestProperty(\"Authorization\", \" \" + passBase64);\n\t \n\n } catch (IOException io) {io.printStackTrace();}\n\n }\n \n public synchronized void run() {\n \n outer : for (int i=0; i<stop;i++) {\n for (int j=0;j<52;j++) {\n for (int k=0;k<52;k++) {\n password = passwordLetters[i]+passwordLetters[j]+passwordLetters[k];\n \t password =\":\"+ password;\n\t\t\t \n\t\t\t\n\t\t\t\n\t\t\t while (!(bruteForce.threadF)) {\n\t\t\t try { wait(1); }\n\t\t\t catch (InterruptedException e){}\n\t\t\t } \n\t\t\t \n\t\t\t if (found)\n\t\t\t System.exit(0);\n try { \n\t\t\t u = (HttpURLConnection)url.openConnection();\n\t\t\t passBase64 = new url.misc.BASE64Encoder().encode(password.getBytes());\n u.setRequestProperty(\"Authorization\", \" \" + passBase64);\n\t\t\t \n\n\t\t\t\n u.connect();\n\t\t\t\t\n\t\t BruteForce.noOfAttempts++;\n\n\t\t if (u.getContentLength() != 0) {\n\n\t\t if (u.getResponseCode() == HttpURLConnection.HTTP_OK ) {\n\t\t\t\t found=true;\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t\n\t\t System.out.println (\"Your User Name : Password is \"+password+ \n\t\t \" \"+ \" Found by Thread \"+count);\n\t\t\t\t\tSystem.out.println(\" \");\n\t\t\t System.out.println(\" of Attempts / Requests \"+ BruteForce.noOfAttempts);\n\t\t\t\t \t \n \t\t System.exit(0);\n\n\t }\n\t\t }\n\t\t \n\t\t \t\t \n\t } catch (ProtocolException px) {px.printStackTrace();\n } catch ( NoRouteToHostException nr){k--; \n\t\t\t nr.printStackTrace();\n } catch (BindException e){e.printStackTrace();\n\t } catch (IndexOutOfBoundsException e3){e3.printStackTrace();\n\t } catch (IOException io) {io.printStackTrace();\n\t\t\t \n\t } finally {u.disconnect();\n\t }\n\t\t\t bruteForce.threadF=false;\n\t\t\t bruteForce.threadM=true;\n\t\t\t\n\t\t\t notifyAll();\n\t\t\t\n }\n\t\t \n }\n System.out.println(\"End\");\n }\n }\n}\n\n\nclass PasswordCrackThreadM extends Thread {\n \n \n \n private String passwordLetters[] ;\n private String password=\" \";\n private static String userName=\"\";\n private MyHttpURLConnection httpURLConnection;\n private URL url;\n String passBase64;\n private URLAuthenticator urlAuthenticator = new URLAuthenticator(userName);\n BruteForce bruteForce;\n int count; \n private HttpURLConnection u;\n \n int start,stop;\n \n static boolean found;\n \n \n \n PasswordCrackThreadM(int start,int stop,int counter,String[]\n passwordLetters,String userName,BruteForce bruteForce) {\n this.start = start;\n this.stop = stop;\n this.passwordLetters =passwordLetters;\n this.userName=userName;\n count =counter;\n this.bruteForce=bruteForce; \n try {\n\t \n\t url = new URL( \"http://sec-crack.cs.rmit.edu./SEC/2/index.php\");\n\t \n u = (HttpURLConnection)url.openConnection();\n\t passBase64 = new url.misc.BASE64Encoder().encode(password.getBytes());\n \n\t u.setRequestProperty(\"Authorization\", \" \" + passBase64);\n\n\t \n\n\t \n\t \n\n } catch (IOException io) {io.printStackTrace();}\n\n }\n \n public synchronized void run() {\n \n outer : for (int i=0; i<stop;i++) {\n for (int j=0;j<52;j++) {\n for (int k=0;k<52;k++) {\n password = passwordLetters[i]+passwordLetters[j]+passwordLetters[k];\n \t password=\":\"+password;\n\t\t\t\n\t \n\t\t\t\n\t\t\t\n\t\t\t while (!(bruteForce.threadM)) {\n\t\t\t try { wait(1); }\n\t\t\t catch (InterruptedException e){}\n\t\t\t }\n\t\t\t \n\t\t\t \n\t\t\t if (found)\n\t\t\t System.exit(0);\n try { u = (HttpURLConnection)url.openConnection();\n\t\t\t \n passBase64 = new url.misc.BASE64Encoder().encode(password.getBytes());\n u.setRequestProperty(\"Authorization\", \" \" + passBase64);\n\t\t\t \n\n\t\t\t\n u.connect();\n BruteForce.noOfAttempts++;\n\t\t \n\t\t if (u.getContentLength() != 0) {\n\t\t\t \n\t\t if (u.getResponseCode() == HttpURLConnection.HTTP_OK ) {\n\t\t\t\t found=true;\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t\n\t\t System.out.println (\"Your User Name : Password is \"+password+ \n\t\t \" \"+ \" Found by Thread \"+count);\n\t\t\t\t \t \n\t\t\t\t\t \n\t\t\t\t\tSystem.out.println(\" \");\n\t\t\t System.out.println(\" of Attempts / Requests \"+ BruteForce.noOfAttempts);\n \t\t System.exit(0);\n\n\t }\n\t\t }\n\t\t \n\t\t \t\t \n\t } catch (ProtocolException px) {px.printStackTrace();\n } catch ( NoRouteToHostException nr){k--; \n\t\t\t nr.printStackTrace();\n } catch (BindException e){e.printStackTrace();\n\t } catch (IndexOutOfBoundsException e3){e3.printStackTrace();\n\t } catch (IOException io) {io.printStackTrace();\n\t\t\t \n\t } finally {u.disconnect();\n\t }\n\t\t\t bruteForce.threadF=true;\n\n\t\t\t \n\t\t\t bruteForce.threadM=false;\n\t\t\t\n\t\t\t notifyAll();\n\t\t\t\n }\n\t\t \n }\n System.out.println(\"End\");\n }\n }\n}\n\n\n\n\n\n\n\nclass URLAuthenticator extends Authenticator {\n private String uName;\n String passwd;\n static char[] password;\n public URLAuthenticator(String uName) {\n\n this.uName = uName;\n }\n\n public void setPassword(String passwd) {\n\n\t this.passwd=passwd;\n\t password=passwd.toCharArray();\n\n }\n \n public PasswordAuthentication getPasswordAuthentication() {\n\n\t\n \t\n\t\n\treturn new PasswordAuthentication(uName,password);\n }\n\n}\n\n\n\n\n \n\nclass MyHttpURLConnection extends HttpURLConnection {\n public MyHttpURLConnection(URL url) {\n super(url);\n }\n public void disconnect() {\n }\n\n public boolean usingProxy() {\n return true;\n }\n public void connect() {\n }\n\n}\n\n", "\nimport java.io.*;\nimport java.util.*;\nimport java.text.*;\nimport java.net.*;\n\n\n\npublic class BruteForce \n{\n \n \n \n private int consonantUpperBound = CrackingConstants.consonantUpperBound;\n private int consonantLowerBound = CrackingConstants.consonantLowerBound;\n private int vowelUpperBound = CrackingConstants.vowelUpperBound;\n private int vowelLowerBound = CrackingConstants.vowelLowerBound;\n \n \n \n \n private int verbose = CrackingConstants.quietMode;\n private int scanType = CrackingConstants.casedScan;\n\n private int passwordsTried = 0;\n \n\t\n\t\n\tpublic static void main(String args[])\n\t{\n\t\t int tStart;\n\t\t int tFinish;\n \t\tDateFormat longTimestamp = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL);\n\t \n\t BruteForce pwForcer = new BruteForce();\n\n\t if(args.length > 0)\n\t {\n\t for(int i = 0; i < args.length; i++)\n\t {\n \t\tif((args[i].indexOf(\"-h\") > -1) || (args[i].indexOf(\"-H\") > -1))\n \t\t {\n \t\t\tSystem.out.println(\"\\n-s -S\\tonly tests lower passwords.\");\n \t\t\tSystem.out.println(\"\\n-v\\tprints the patterns as tried.\");\n \t\t\tSystem.out.println(\"-V\\tprints out the patterns and the passwords as generated. \\n\\tThis option slows the program considerably.\\n\");\n \t\t\treturn;\n \t\t }\t\n \t\telse if(args[i].indexOf(\"-v\") > -1) \n \t\t pwForcer.verbose = CrackingConstants.verboseMode1;\n \t\telse if(args[i].indexOf(\"-V\") > -1)\n \t\t pwForcer.verbose = CrackingConstants.verboseMode2;\n \t\telse if((args[i].indexOf(\"-s\") > -1) || (args[i].indexOf(\"-S\") > -1))\n \t\t pwForcer.scanType = CrackingConstants.simpleScan;\n\t\t }\n\t }\n\n \n\t System.out.println(\"\\n\\n********************************\\n\");\n\t\tSystem.out.println(\"Starting brute force run at \" + \n\t\t longTimestamp.format(new Date()));\n\t\tif(args.length > 0)\n\t\t{\n\t\t\tString arguments = \"\";\n\t\t\tfor( i =0; i < args.length; i++)\n\t\t\t\targuments += args[i] + \" \";\n\t\t\tSystem.out.println(\"\\nOptions: \" + arguments + \"\\n\");\n\t\t}\n\t\tif(pwForcer.scanType == CrackingConstants.simpleScan)\n \t System.out.println(\"Only lower passwords tried.\");\n \telse\n \t System.out.println(\"Both lower and upper passwords tried.\");\n\t System.out.println(\"\\n********************************\\n\");\n\n\t tStart = System.currentTimeMillis();\n\t pwForcer.run();\n\t tFinish = System.currentTimeMillis();\n\t \n if (pwForcer.scanType == CrackingConstants.casedScan)\n {\n\t \n \t \n\t \n\t \n\t System.out.println (\"\\n\\n\" + pwForcer.passwordsTried + \" passwords were generated (out of a possible \" + (26 * 26 * 26 * 8) + \")\");\n\t System.out.println (\"That is \" + pwForcer.passwordsTried/8 + \" unique three letter combinations were tried (out of a possible \" + (26 * 26 * 26) + \")\");\n }\n else\n {\n \t System.out.println (\"\\n\\n\" + pwForcer.passwordsTried + \" passwords were generated (out of a possible \" + (26 * 26 * 26) + \")\\n\");\n }\n \n\t \n\t System.out.println(\"\\n********************************\\n\");\n\t\tSystem.out.println(\"Finished brute force run at \" + \n\t\t longTimestamp.format(new Date()));\n\t\tSystem.out.println(\"Time taken: \" + ((tFinish - tStart)/1000) + \" seconds\");\n\t System.out.println(\"\\n********************************\");\n\t} \n\n\t\n public BruteForce()\n {\n } \n\n\t\n private void run()\n {\n \n \n leftIndex = 0;\n midIndex = 0;\n rightIndex = 0;\n \n \n\t\t\n \n \tif(verbose > CrackingConstants.quietMode)\n \t System.out.println(\"Trying stutters (AAA, aaa, etc.)\");\n for( i = vowelLowerBound; i <= consonantUpperBound; i++)\n {\n leftIndex = i;\n midIndex = i;\n rightIndex = i;\n if(tryLogin(leftIndex, midIndex, rightIndex))\n return;\n }\n \n \n \tif(verbose > CrackingConstants.quietMode)\n \t System.out.println(\"Trying consonant-vowel-consonant patterns.\");\n for(leftIndex = consonantLowerBound; leftIndex <= consonantUpperBound; leftIndex++)\n for(midIndex = vowelLowerBound; midIndex <= vowelUpperBound; midIndex++)\n for (rightIndex = consonantLowerBound; rightIndex <= consonantUpperBound; rightIndex++)\n if(tryLogin(leftIndex, midIndex, rightIndex))\n return;\n \n \n \tif(verbose > CrackingConstants.quietMode)\n \t System.out.println(\"Trying consonant-vowel-vowel patterns.\");\n for(leftIndex = consonantLowerBound; leftIndex <= consonantUpperBound; leftIndex++)\n for(midIndex = vowelLowerBound; midIndex <= vowelUpperBound; midIndex++)\n for (rightIndex = vowelLowerBound; rightIndex <= vowelUpperBound; rightIndex++)\n if(tryLogin(leftIndex, midIndex, rightIndex))\n return;\n \n \n \tif(verbose > CrackingConstants.quietMode)\n \t System.out.println(\"Trying vowel-consonant-vowel patterns.\");\n for(leftIndex = vowelLowerBound; leftIndex <= vowelUpperBound; leftIndex++)\n for(midIndex = consonantLowerBound; midIndex <= consonantUpperBound; midIndex++)\n for (rightIndex = vowelLowerBound; rightIndex <= vowelUpperBound; rightIndex++)\n if(tryLogin(leftIndex, midIndex, rightIndex))\n return;\n \n \n \tif(verbose > CrackingConstants.quietMode)\n \t System.out.println(\"Trying vowel-consonant-consonant patterns.\");\n for(leftIndex = vowelLowerBound; leftIndex <= vowelUpperBound; leftIndex++)\n for(midIndex = consonantLowerBound; midIndex <= consonantUpperBound; midIndex++)\n for (rightIndex = consonantLowerBound; rightIndex <= consonantUpperBound; rightIndex++)\n if(tryLogin(leftIndex, midIndex, rightIndex))\n return;\n \n \n \tif(verbose > CrackingConstants.quietMode)\n \t System.out.println(\"Trying vowel-vowel-consonant patterns.\");\n for(leftIndex = vowelLowerBound; leftIndex <= vowelUpperBound; leftIndex++)\n for(midIndex = vowelLowerBound; midIndex <= vowelUpperBound; midIndex++)\n for (rightIndex = consonantLowerBound; rightIndex <= consonantUpperBound; rightIndex++)\n if(tryLogin(leftIndex, midIndex, rightIndex))\n return;\n \n \n \tif(verbose > CrackingConstants.quietMode)\n \t System.out.println(\"Trying consonant-consonant-vowel patterns.\");\n for(leftIndex = consonantLowerBound; leftIndex <= consonantUpperBound; leftIndex++)\n for(midIndex = consonantLowerBound; midIndex <= consonantUpperBound; midIndex++)\n for (rightIndex = vowelLowerBound; rightIndex <= vowelUpperBound; rightIndex++)\n if(tryLogin(leftIndex, midIndex, rightIndex))\n return;\n \n \n \tif(verbose > CrackingConstants.quietMode)\n \t System.out.println(\"Trying remaining vowel-vowel-vowel patterns.\");\n for(leftIndex = vowelLowerBound; leftIndex <= vowelUpperBound; leftIndex++)\n for(midIndex = vowelLowerBound; midIndex <= vowelUpperBound; midIndex++)\n for (rightIndex = vowelLowerBound; rightIndex <= vowelUpperBound; rightIndex++)\n if((leftIndex == midIndex) && (leftIndex == rightIndex))\n {\n \n }\n else\n {\n if(tryLogin(leftIndex, midIndex, rightIndex))\n return;\n }\n \n \n \tif(verbose > CrackingConstants.quietMode)\n \t System.out.println(\"Trying remaining consonant-consonant-consonant patterns.\");\n for(leftIndex = consonantLowerBound; leftIndex <= consonantUpperBound; leftIndex++)\n for(midIndex = consonantLowerBound; midIndex <= consonantUpperBound; midIndex++)\n for (rightIndex = consonantLowerBound; rightIndex <= consonantUpperBound; rightIndex++)\n if((leftIndex == midIndex) && (leftIndex == rightIndex))\n {\n \n }\n else\n {\n if(tryLogin(leftIndex, midIndex, rightIndex))\n return;\n }\n \n \tif(verbose > CrackingConstants.quietMode)\n \t System.out.println(\"Trying monographs (A, a, etc.)\");\n for ( i = 0; i <= consonantUpperBound; i++)\n {\n leftIndex = i;\n midIndex = -1;\n rightIndex = -1;\n if(tryLogin(leftIndex, midIndex, rightIndex))\n return;\n }\n \n \n \n \tif(verbose > CrackingConstants.quietMode)\n \t System.out.println(\"Trying bigraphs (AA, aa, etc.)\");\n for( i = 0; i <= consonantUpperBound; i++)\n {\n \tfor( j = 0; j <= consonantUpperBound; j++)\n \t{\n \tleftIndex = i;\n \tmidIndex = j;\n \t rightIndex = -1;\n \t if(tryLogin(leftIndex, midIndex, rightIndex))\n\t return;\n }\n }\n \n return;\n } \n\n\t\n private boolean tryLogin( int leftIndex, int midIndex, int rightIndex)\n {\n \n LoginAttempt login = new LoginAttempt();\n LoginAttemptResults results = new LoginAttemptResults();\n\n \n CasePasswords casedPasswords = new CasePasswords(verbose);\n\n \n \n String tail = \"\";\n\n results = login.tryPasswords(casedPasswords.createCasedPasswords(leftIndex, midIndex, rightIndex, tail, CrackingConstants.lowerChars, CrackingConstants.upperChars, scanType), passwordsTried);\n passwordsTried = results.getPasswordsTried();\n return results.getSuccess();\n }\n \n} \n", "\n\n\n\npublic class HoldSharedData\n{\n private int numOfConnections = 0;\n private int startTime;\n private int totalTime = 0;\n private String[] password;\n private int pwdCount;\n\n public HoldSharedData( int time, String[] pwd, int count )\n {\n startTime = time;\n\n password = pwd;\n pwdCount = count;\n }\n\n public int getPwdCount()\n {\n return pwdCount;\n }\n\n public void setNumOfConnections( )\n {\n numOfConnections ++;\n }\n\n public int getNumOfConnections()\n {\n return numOfConnections;\n }\n\n public int getStartTime()\n {\n return startTime;\n }\n\n public void setTotalTime( int newTotalTime )\n {\n totalTime = newTotalTime;\n }\n\n public int getTotalTime()\n {\n return totalTime;\n }\n\n public String getPasswordAt( int index )\n {\n return password[index];\n }\n} \n" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Add new SentenceTransformer model
Browse files- 1_Pooling/config.json +10 -0
- README.md +0 -0
- config.json +28 -0
- config_sentence_transformers.json +10 -0
- merges.txt +0 -0
- model.safetensors +3 -0
- modules.json +14 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +51 -0
- tokenizer.json +0 -0
- tokenizer_config.json +58 -0
- vocab.json +0 -0
1_Pooling/config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"word_embedding_dimension": 768,
|
| 3 |
+
"pooling_mode_cls_token": false,
|
| 4 |
+
"pooling_mode_mean_tokens": true,
|
| 5 |
+
"pooling_mode_max_tokens": false,
|
| 6 |
+
"pooling_mode_mean_sqrt_len_tokens": false,
|
| 7 |
+
"pooling_mode_weightedmean_tokens": false,
|
| 8 |
+
"pooling_mode_lasttoken": false,
|
| 9 |
+
"include_prompt": true
|
| 10 |
+
}
|
README.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
config.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"RobertaModel"
|
| 4 |
+
],
|
| 5 |
+
"attention_probs_dropout_prob": 0.1,
|
| 6 |
+
"bos_token_id": 0,
|
| 7 |
+
"classifier_dropout": null,
|
| 8 |
+
"eos_token_id": 2,
|
| 9 |
+
"gradient_checkpointing": false,
|
| 10 |
+
"hidden_act": "gelu",
|
| 11 |
+
"hidden_dropout_prob": 0.1,
|
| 12 |
+
"hidden_size": 768,
|
| 13 |
+
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 3072,
|
| 15 |
+
"layer_norm_eps": 1e-05,
|
| 16 |
+
"max_position_embeddings": 1026,
|
| 17 |
+
"model_type": "roberta",
|
| 18 |
+
"num_attention_heads": 12,
|
| 19 |
+
"num_hidden_layers": 12,
|
| 20 |
+
"output_past": true,
|
| 21 |
+
"pad_token_id": 1,
|
| 22 |
+
"position_embedding_type": "absolute",
|
| 23 |
+
"torch_dtype": "float32",
|
| 24 |
+
"transformers_version": "4.52.4",
|
| 25 |
+
"type_vocab_size": 10,
|
| 26 |
+
"use_cache": true,
|
| 27 |
+
"vocab_size": 50000
|
| 28 |
+
}
|
config_sentence_transformers.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"__version__": {
|
| 3 |
+
"sentence_transformers": "4.1.0",
|
| 4 |
+
"transformers": "4.52.4",
|
| 5 |
+
"pytorch": "2.6.0+cu124"
|
| 6 |
+
},
|
| 7 |
+
"prompts": {},
|
| 8 |
+
"default_prompt_name": null,
|
| 9 |
+
"similarity_fn_name": "cosine"
|
| 10 |
+
}
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:404ff53e25db4c53ecbb436f0b351a03863c2e03694622ad2a5bb49c5ffdd0d2
|
| 3 |
+
size 499391344
|
modules.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"idx": 0,
|
| 4 |
+
"name": "0",
|
| 5 |
+
"path": "",
|
| 6 |
+
"type": "sentence_transformers.models.Transformer"
|
| 7 |
+
},
|
| 8 |
+
{
|
| 9 |
+
"idx": 1,
|
| 10 |
+
"name": "1",
|
| 11 |
+
"path": "1_Pooling",
|
| 12 |
+
"type": "sentence_transformers.models.Pooling"
|
| 13 |
+
}
|
| 14 |
+
]
|
sentence_bert_config.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"max_seq_length": 512,
|
| 3 |
+
"do_lower_case": false
|
| 4 |
+
}
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<s>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": true,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"cls_token": {
|
| 10 |
+
"content": "<s>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": true,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"eos_token": {
|
| 17 |
+
"content": "</s>",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": true,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
},
|
| 23 |
+
"mask_token": {
|
| 24 |
+
"content": "<mask>",
|
| 25 |
+
"lstrip": true,
|
| 26 |
+
"normalized": true,
|
| 27 |
+
"rstrip": false,
|
| 28 |
+
"single_word": false
|
| 29 |
+
},
|
| 30 |
+
"pad_token": {
|
| 31 |
+
"content": "<pad>",
|
| 32 |
+
"lstrip": false,
|
| 33 |
+
"normalized": true,
|
| 34 |
+
"rstrip": false,
|
| 35 |
+
"single_word": false
|
| 36 |
+
},
|
| 37 |
+
"sep_token": {
|
| 38 |
+
"content": "</s>",
|
| 39 |
+
"lstrip": false,
|
| 40 |
+
"normalized": true,
|
| 41 |
+
"rstrip": false,
|
| 42 |
+
"single_word": false
|
| 43 |
+
},
|
| 44 |
+
"unk_token": {
|
| 45 |
+
"content": "<unk>",
|
| 46 |
+
"lstrip": false,
|
| 47 |
+
"normalized": true,
|
| 48 |
+
"rstrip": false,
|
| 49 |
+
"single_word": false
|
| 50 |
+
}
|
| 51 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"added_tokens_decoder": {
|
| 4 |
+
"0": {
|
| 5 |
+
"content": "<s>",
|
| 6 |
+
"lstrip": false,
|
| 7 |
+
"normalized": true,
|
| 8 |
+
"rstrip": false,
|
| 9 |
+
"single_word": false,
|
| 10 |
+
"special": true
|
| 11 |
+
},
|
| 12 |
+
"1": {
|
| 13 |
+
"content": "<pad>",
|
| 14 |
+
"lstrip": false,
|
| 15 |
+
"normalized": true,
|
| 16 |
+
"rstrip": false,
|
| 17 |
+
"single_word": false,
|
| 18 |
+
"special": true
|
| 19 |
+
},
|
| 20 |
+
"2": {
|
| 21 |
+
"content": "</s>",
|
| 22 |
+
"lstrip": false,
|
| 23 |
+
"normalized": true,
|
| 24 |
+
"rstrip": false,
|
| 25 |
+
"single_word": false,
|
| 26 |
+
"special": true
|
| 27 |
+
},
|
| 28 |
+
"3": {
|
| 29 |
+
"content": "<unk>",
|
| 30 |
+
"lstrip": false,
|
| 31 |
+
"normalized": true,
|
| 32 |
+
"rstrip": false,
|
| 33 |
+
"single_word": false,
|
| 34 |
+
"special": true
|
| 35 |
+
},
|
| 36 |
+
"4": {
|
| 37 |
+
"content": "<mask>",
|
| 38 |
+
"lstrip": true,
|
| 39 |
+
"normalized": true,
|
| 40 |
+
"rstrip": false,
|
| 41 |
+
"single_word": false,
|
| 42 |
+
"special": true
|
| 43 |
+
}
|
| 44 |
+
},
|
| 45 |
+
"bos_token": "<s>",
|
| 46 |
+
"clean_up_tokenization_spaces": false,
|
| 47 |
+
"cls_token": "<s>",
|
| 48 |
+
"eos_token": "</s>",
|
| 49 |
+
"errors": "replace",
|
| 50 |
+
"extra_special_tokens": {},
|
| 51 |
+
"mask_token": "<mask>",
|
| 52 |
+
"model_max_length": 512,
|
| 53 |
+
"pad_token": "<pad>",
|
| 54 |
+
"sep_token": "</s>",
|
| 55 |
+
"tokenizer_class": "RobertaTokenizer",
|
| 56 |
+
"trim_offsets": true,
|
| 57 |
+
"unk_token": "<unk>"
|
| 58 |
+
}
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|