Steps to get from docbook to fully interactive webhelp..
1. Generate HTMLHELP via Oxygen.
2. (can compile to CHM) or carryon and import HTMLHelp project (hhp) file into Robohelp.
Steps to get from docbook to fully interactive webhelp..
1. Generate HTMLHELP via Oxygen.
2. (can compile to CHM) or carryon and import HTMLHelp project (hhp) file into Robohelp.
This little snippet is a script I have running via Cron, set to execute every 30 minutes. If like me, you have maybe running forum software that isnt so great handling image uploads in posts and find that users complain because they themselves arent too sure how to resize images prior to posting then this may be useful.
What it does is scan a specified folder every 30 minutes(as set by cron) for new uploaded jpg’s that are greater than a specified size. Using the ImageMagick libraries, it then applies compression and resizes proportionally the image if it exceeds a specified height & width. Images which have been uploaded as 2Mb originals have been processed and saved as 20k files, thats 1% of the original size without any real noticable difference in quality. People tend to upload images which are suitable for professional printing and far exceed the quality required for simple website viewing.
This is my code:
#!/bin/bash src_dir="/var/www/ukordinance/images/fbfiles/images" DATETIME=`date +%d-%m-%Y-%H:%M` echo "Looking for files in : $src_dir on $DATETIME" #find $src_dir -iname '*.jp*g' -size +100k -mmin -30 for i in `find $src_dir -iname '*.jp*g' -size +256k` ; do echo "Processing : "$i convert -resize 1024x768\> -quality 80 $i $i; done
This snippet is from a servlet which acts as a generic form posting utility used throughout some of my sites. Irrelevant of the dressing of the JSP, it can be presenting the user a form for any number of reasons, but in each case when submitted the form contents will be emailed to my site admins. The initial problem I encountered whilst writing was that when you iterate the submitted request parameters, the order they come out will be at random. So you can either parse the request query itself OR give your form fields names which when alphabetically sorted will make sense. The latter is the quickest method.. Anyway here is the servlet, It uses collections to first construct a List, which you can then use Collections to sort, and finally use Collections again to create a new Enumeration of the sorted list. Enough babble heres the code :
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException{
StringBuffer sb = new StringBuffer();
sb.append("The following information was posted via the website;\n\n");
// Sort the list
List paramList = Collections.list(request.getParameterNames());
Collections.sort(paramList);
Enumeration sortedList = Collections.enumeration(paramList);
// iterate the list and append to a StringBuffer
for (Enumeration e = sortedList; e.hasMoreElements();) {
String paramName = (String) e.nextElement();
String[] values = request.getParameterValues(paramName);
sb.append(paramName + " = " + values[0] + "\n");
sb.append("\n");
}
// Email admin the sorted form contents
Utils.Send_SMTP("mailer@dbws.net", Utils.adminEmails, "Website Form Submission", sb.toString());
request.getRequestDispatcher("thankyou.jsp").forward(request, response);
}
Welcome to my blog. Here you'll find mainly work related content, a suppository for all my notes which otherwise would end up on a post it note.