^
title
talk is cheap show me your code
for your time
|
-
06-06-2013, 08:31 PM #1
-
06-06-2013, 08:34 PM #2
-
06-06-2013, 08:36 PM #3
-
06-06-2013, 08:39 PM #4
-
-
06-06-2013, 08:39 PM #5
-
06-06-2013, 08:40 PM #6
-
06-06-2013, 08:41 PM #7
-
06-06-2013, 08:42 PM #8
-
-
06-06-2013, 08:42 PM #9
-
06-06-2013, 08:43 PM #10
-
06-06-2013, 08:44 PM #11
-
06-06-2013, 08:46 PM #12
-
-
06-06-2013, 08:49 PM #13
-
06-06-2013, 08:49 PM #14
- Join Date: May 2013
- Location: San Diego, California, United States
- Posts: 744
- Rep Power: 0
Some Java for you...
//package netwatch;
import java.util.Vector;
import jpcap.JpcapCaptor;
/**
*
* @author unseen
*/
public class NetWatchWrapper {
// private int NW_NIC;
private Vector<String> NW_DEV;
private jpcap.NetworkInterface[] NW_DEVS;
private JpcapCaptor NW_CAP;
private static NetWatchThread NW_THR;
private boolean NW_SCANOPT = false;
private boolean NW_LOG = false;
public NetWatchWrapper(){
NW_DEVS = JpcapCaptor.getDeviceList();
}
public void start_scan(int i){
NW_THR = NetWatchThread.getInstance(i);
if(!NW_THR.isAlive()){
NW_THR.setContinue(true);
NW_THR.start();
System.out.println("Scan Started...");}
else if (NW_THR.isAlive()){
System.out.println("Already Scanning : \n"+NW_THR.get_interfaceData());
}
}
public void stop_scan(int i){
NW_THR = NetWatchThread.getInstance(i);
if(NW_THR.isAlive()){
NW_THR.setContinue(false);
System.out.println("Scan stopped, waiting for final thread loop.");}
else{System.out.println("No Active Scan.");}
}
public void log_scan(int i, boolean b){
NetWatchThread.getInstance(i).setLog(b);
}
public boolean logging(int i){ return NetWatchThread.getInstance(i).logStat(); }
public Vector<String> loadInterfaceList()
{
NW_DEV = new Vector<>();
for(int i=0;i < NW_DEVS.length; i++)
{NW_DEV.add(i, NW_DEVS[i].name);}
return NW_DEV;
}
}
-->>>>>>-----
/////<<<<<!!!!!!!
package Chapter14_2;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class JSP14_Serv extends HttpServlet {
private SQL_Handler dbTool; //dbTool SQL_Handler object connects to database via
//ConnectionPool and Initialization Parameters within
//the startSQL function of this class
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
//Parameter "Command" is used to direct the servlet to a course of action
String command = request.getParameter("command");
RequestDispatcher reply;
//Possible "Command" Paramaters..
//search -- Forwards Operator to Display.jsp (SELECT)
//add -- Forwards Operator to Add.jsp
//addUser -- Uses the SQL_Handler class to Add a user to the database (INSERT)
//update -- Forwards Operator to Update.jsp to edit
//updateUser -- Uses the SQL_Handler class to Update user in database (UPDATE)
//delete -- Uses the SQL_Handler class to Delete user from database (DELETE)
//SEARCH COMMAND
//Command Paramter "Search" to call the SQL_Handler to retrieve an
//formatted html table set in the request object and forwards user
//to Display.jsp
if(command.equalsIgnoreCase("search"))
{ dbTool = startSQL();
request.setAttribute("users", dbTool.selectUsers()); //Returns ArrayList of Users
request.setAttribute("table", dbTool.selectUsersTable()); //Returns an Html table of all Users
reply = getServletContext().getRequestDispatcher("/Display.jsp");
reply.forward(request, response);
}
//ADD COMMAND
//Command parameter "Add" to Forward Operator to Add.jsp
else if (command.equalsIgnoreCase("add"))
{ reply = getServletContext().getRequestDispatcher("/Add.jsp");
reply.forward(request, response);} //Simply forwards Operator to Add.jsp
//ADD USER COMMAND
//Command parameter "AddUser" retrieves User object from request and validates its content.
//If it Passes, the user will be added to database; else forward back to Add.jsp
else if (command.equalsIgnoreCase("addUser"))
{ if(!User.Validate(loadUser_add(request))) //If User object does not contain empty strings
{ dbTool = startSQL(); //start SQL_Handler and..
dbTool.addUser(loadUser_add(request)); //call the addUser method from User inside request
reply = getServletContext().getRequestDispatcher("/serv?command=search");
reply.forward(request, response);} //Then Forward Operator back to Display.sjp
else //Else send User object back to Add.jsp to fix empty Strings with helpful Message
{ request.setAttribute("user", loadUser_add(request));
reply = getServletContext().getRequestDispatcher("/Add.jsp");
reply.forward(request, response);}}
//UPDATE COMMAND
//Command Parameter 'Update" will get and set a User object from request
//and Forward it to Update.jsp.
else if(command.equalsIgnoreCase("update"))
{ request.setAttribute("user", loadUser_upd(request)); //Pass the User inside the request to Update.jsp
reply = getServletContext().getRequestDispatcher("/Update.jsp");
reply.forward(request, response);}
//UPDATE USER COMMAND
//Command Parameter "UpdateUser" called the SQL_Handler to update a user
//based on user id. Then Forwards operator to what will be Display.jsp.
else if(command.equalsIgnoreCase("updateUser"))
{ if(!User.Validate(loadUser_upd(request))) //If request Object returns a User and contains no empty string,
{ dbTool = startSQL(); //start SQL_Handler and call updateUser passing the private loadUser
dbTool.updateUser(loadUser_upd(request)); //Method using the request object as parameters.
reply = getServletContext().getRequestDispatcher("/serv?command=search");
reply.forward(request, response);} //The Forward Operator back to Display.jsp
else //Else forward Operator back to Update.jsp to fix empty Strings with a helpful message
{ reply = getServletContext().getRequestDispatcher("/serv?command=update");
reply.forward(request, response);}}
//DELETE COMMAND
//Command Parameter "Delete" to call the SQL_Handler to delete a User based on
//User ID from the 'att' paramater and forwards operator back to a "Search" command.
else if (command.equalsIgnoreCase("delete")){
dbTool = startSQL(); //start SQL_Handler and call deleteUser by passing the User
dbTool.deleteUser(loadUser_upd(request)); //Object within the request
reply = getServletContext().getRequestDispatcher("/serv?command=search");
reply.forward(request, response);
}
//ELSE IF NO COMMAND
//If no command is issued to the servlet, takes operator to UserManagement.html
else{
reply = getServletContext().getRequestDispatcher("/UserManagement.html");
reply.forward(request, response);}}
//Method to construct a single SQL_Handler instance.
private SQL_Handler startSQL()
{
return new SQL_Handler(this.getServletConfig().getInitParamet er("database"),
this.getServletConfig().getInitParameter("login"),
this.getServletConfig().getInitParameter("key"));
}
//Method returns a new User object from each request
private User loadUser_upd(HttpServletRequest request) //For Update & Delete commands where UserId is needed
{ return new User(Integer.parseInt(request.getParameter("userId ")),
request.getParameter("firstName"),
request.getParameter("lastName"),
request.getParameter("emailAddress"));}
private User loadUser_add(HttpServletRequest request) //For Add commands where no UserId is issued yet.
{ return new User( request.getParameter("firstName"),
request.getParameter("lastName"),
request.getParameter("emailAddress"));}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP
* <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP
* <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
//Powered By:
//ImmaculateDesign
Some Perl for you...
#!/usr/bin/perl
# This script will read Hexadecimal bits from a file passed as the first
# aurgument using a '/' as a delimiter and print the corresponding ASCII
# character.
if($ARGV[0])
{
chomp($file = $ARGV[0]);
open(File, $file) or die "Can't open File: $file : $!\n";
print "\nParsing Hex File[$file].\n";
print "------------------------------------------------------\n\n";
while($line = <File>)
{
@currentLine = split('/', $line);
foreach $hexVal(@currentLine)
{
print chr(hex $hexVal);
}
<STDIN>
}
print "\n\n------------------------------------------------------";
print "\nHexadecimal Parsing Complete.\n\n";
}Fapping is like food... It shouldn't be enjoyed as a reward, but rather a means to not kill yourself.
Progress Not Perfection
Clean Eating: The premise to success, for the occult of the aesthetic.
Clean Eating: When you cook your own meals, because you care about the specifics of your diet.
Garlic, is as good as ten mothers.
Hit Me Up (Contact me)
Instagram: ModelTreyJacques
www.********.com/ModelTreyJacques
Haters click here -> www.youtube.com/watch?v=8Zs-7md3MTA
-
06-06-2013, 08:49 PM #15
-
06-06-2013, 08:52 PM #16
-
-
06-06-2013, 09:05 PM #17
-
06-06-2013, 09:06 PM #18
- Join Date: May 2013
- Location: San Diego, California, United States
- Posts: 744
- Rep Power: 0
Surely my name is not jeff.
Fapping is like food... It shouldn't be enjoyed as a reward, but rather a means to not kill yourself.
Progress Not Perfection
Clean Eating: The premise to success, for the occult of the aesthetic.
Clean Eating: When you cook your own meals, because you care about the specifics of your diet.
Garlic, is as good as ten mothers.
Hit Me Up (Contact me)
Instagram: ModelTreyJacques
www.********.com/ModelTreyJacques
Haters click here -> www.youtube.com/watch?v=8Zs-7md3MTA
-
06-06-2013, 09:11 PM #19
-
06-06-2013, 09:12 PM #20
- Join Date: May 2013
- Location: San Diego, California, United States
- Posts: 744
- Rep Power: 0
Fapping is like food... It shouldn't be enjoyed as a reward, but rather a means to not kill yourself.
Progress Not Perfection
Clean Eating: The premise to success, for the occult of the aesthetic.
Clean Eating: When you cook your own meals, because you care about the specifics of your diet.
Garlic, is as good as ten mothers.
Hit Me Up (Contact me)
Instagram: ModelTreyJacques
www.********.com/ModelTreyJacques
Haters click here -> www.youtube.com/watch?v=8Zs-7md3MTA
-
-
06-06-2013, 09:13 PM #21
-
06-06-2013, 09:16 PM #22
- Join Date: May 2013
- Location: San Diego, California, United States
- Posts: 744
- Rep Power: 0
class Node
{
public:
Node *previousNode;
Node *nextNode;
int index;
void displayData();
};
class NodeList
{
public:
Node *lead;
Node *end;
void addNode(Node*current);
};Fapping is like food... It shouldn't be enjoyed as a reward, but rather a means to not kill yourself.
Progress Not Perfection
Clean Eating: The premise to success, for the occult of the aesthetic.
Clean Eating: When you cook your own meals, because you care about the specifics of your diet.
Garlic, is as good as ten mothers.
Hit Me Up (Contact me)
Instagram: ModelTreyJacques
www.********.com/ModelTreyJacques
Haters click here -> www.youtube.com/watch?v=8Zs-7md3MTA
-
06-06-2013, 09:17 PM #23
-
06-06-2013, 09:18 PM #24
-
-
06-06-2013, 09:20 PM #25
-
06-06-2013, 09:21 PM #26
-
06-06-2013, 09:23 PM #27
-
06-06-2013, 09:25 PM #28
-
-
06-06-2013, 09:29 PM #29
-
06-06-2013, 09:33 PM #30
Similar Threads
-
***The Official Affiliate Marketing/Make Money Online Thread Part 4***
By BigAnf in forum Misc.Replies: 9046Last Post: 05-26-2011, 09:40 PM
Bookmarks