Google Swiffy extension exports Flash to HTML5, ActionScript fans rejoice originally appeared on Engadget on Fri, 18 Nov 2011 21:08:00 EDT. Please see our terms for use of feeds.
PermalinkSent from my iPhone
This blog is meant for my personal reference and keeping track of what I have learnt. Most articles are found through search engines, if you are the author of the article and would like to remove from this blog, please contact me.
Google Swiffy extension exports Flash to HTML5, ActionScript fans rejoice originally appeared on Engadget on Fri, 18 Nov 2011 21:08:00 EDT. Please see our terms for use of feeds.
PermalinkA Web server exclusively handles HTTP requests, whereas an application server serves business logic to application programs through any number of protocols.
Return Type Method Description InputStream getBinaryStream() Retrieves the blob value designated by this blob value as a stream byte[] getBytes(long pos, int length) Retrieve all or part of the blob value that this blob represents as an array of bytes. long length() Returns the no of bytes in the Blob value designated by this Blob object OutputStream setBinaryStream(long pos) Retrieves a stream that can be used to write to the Blob value int setBytes(long pos, byte[] bytes) Write the given array of bytes to the Blob value that this Blob object represent starting at position pos, and returns the no of bytes written void truncate(long len) Truncates the blob value that this blob object represents to be len bytes in len |
<%@ page import="java.sql.*"%> <%@ page import="java.io.*"%> <% Blob image = null; Connection con = null; byte[ ] imgData = null ; Statement stmt = null; ResultSet rs = null; try { Class.forName("com.mysql.jdbc.Driver"); con = DriverManager.getConnection("jdbc:mysql://192.168.10.13:3306/ankdb","root","root"); stmt = con.createStatement(); rs = stmt.executeQuery("select image from inimage where id = '6'"); if (rs.next()) { image = rs.getBlob(1); imgData = image.getBytes(1,(int)image.length()); } else { out.println("Display Blob Example"); out.println("image not found for given id>"); return; } // display the image response.setContentType("image/gif"); OutputStream o = response.getOutputStream(); o.write(imgData); o.flush(); o.close(); } catch (Exception e) { out.println("Unable To Display image"); out.println("Image Display Error=" + e.getMessage()); return; } finally { try { rs.close(); stmt.close(); con.close(); } catch (SQLException e) { e.printStackTrace(); } } %> |
Exam Trivia:
We need to be careful while using the paths. If the path begins with a “/”, it is interpreted as relative to the current context root. You will get a null if the servlet container cannot return a RequestDispatcher. Be sure to use the correct path name and to spot inconsistencies in the code in case the exam puts one in front of you.
Exam Trivia:
ServletContext.getRequestDispatcher()— This method uses absolute paths.
ServletRequest.getRequestDispatcher(String path)— The path may be relative, but cannot extend outside current servlet context.
ServletRequest.getNamedDispatcher(String name)— This name is the name of the servlet for which a dispatcher is requested, and is in the web.xml file
Designing a product is keeping five thousand things in your brain and fitting them all together in new and different ways to get what you want. And every day you discover something new that is a new problem or a new opportunity to fit these things together a little differently.
And it's that process that is the magic.
—Steve Jobs (via Daring Fireball)
Inspiring stuff. Related SvN posts: The first step is to start and Four tips for learning how to program
Over the past few years the number of fonts available for use in web design has dramatically increased. It wasn't long ago that we all knew not to stray further than the basic Arial, Helvetica, Times, Georgia mix, but now there's a range of services that allow the use of almost any font imaginable in your website design. This post rounds up the various custom web font solutions and looks at the pros and cons of each.
The most basic solution out of the lot is the CSS3 @font-face property. I'm sure we're all familiar with @font-face by now, it allows you to load a font file from your CSS and apply that font to the styling of your HTML text.
Since Google launched its Google Web Fonts API the service has grown to include hundreds of freely available fonts for use in your designs. The service was a hit from the start even with its small introductory collection, but now there's a whole library of styles available it's certainly one of the best custom font solutions.
For those needing professional or classic fonts in their designs for corporate branding, Typekit is definitely the best solution. Unlike other free services, Typekit allows the embedding of popular premium fonts such as Futura, Meta and Cocon.
Nowadays Cufon is overshadowed by the larger custom web font services, but it was a pretty useful resource when it was first launched. Cufon is Javascript powered which makes it great for compatibility across older browsers that don't support @font-face, but it comes with a few disadvantages of its own.
When sIFR was first introduced many years ago it was a groundbreaking addition to the web designer's toolbox. Nowadays the Flash technology behind sIFR just isn't up to par accessibility and performance wise when compared to the newer alternative soltuions.
Typeface.js was released as a viable alternative to sIFR and FLIR as it didn't require any additional technologies such as Flash or PHP with it being entirely Javascript based.
Looking forward, the majority of Internet use will come from mobile devices (its already happened in some places). But even today some services are beginning to see more of their traffic come from mobile devices than desktops and laptops. Here's a few examples.
It's quite likely these numbers are just the start. Japan has been ahead of the World in mobile for many years. Mixi, the top social networking site in Japan is an indicator of how far things can go. Four and a half years ago, 14% of Mixi's page views were on mobile. Today, 85% of page views are on mobile. When your numbers look like that, mobile first thinking makes a ton of sense.
Tags: mobile, mobilefirst, metrics
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>jQuery 二级联动</title> <script src="http://wlog.cn/lib/jquery/jquery-1.3.2.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $("#province").change(function(){ $("#province option").each(function(i,o){ if($(this).attr("selected")) { $(".city").hide(); $(".city").eq(i).show(); } }); }); $("#province").change(); }); </script> </head> <body> <select id="province"> <option>----请选择省份----</option> <option>北京</option> <option>上海</option> <option>江苏</option> </select> <select class="city"> <option>----请选择城市----</option> </select> <select class="city"> <option>东城</option> <option>西城</option> <option>崇文</option> <option>宣武</option> <option>朝阳</option> </select> <select class="city"> <option>黄浦</option> <option>卢湾</option> <option>徐汇</option> <option>长宁</option> <option>静安</option> </select> <select class="city"> <option>南京</option> <option>镇江</option> <option>苏州</option> <option>南通</option> <option>扬州</option> </select> </body> </html>
Adobe confirms Flash Player is dead for mobile devices originally appeared on Engadget on Wed, 09 Nov 2011 09:47:00 EDT. Please see our terms for use of feeds.
Permalink |$ cd Library $ hdiutil create -size 2g -srcfolder Mail -format SPARSE -encryption -stdinpass Mail Enter disk image passphrase: .................................... created: /Users/ahknight/Library/Mail.sparseimage
Library/Mail
folder to the side rather than deleting it outright. Rename it to Mail-old or something. Then, open the image you just made (if you did the above, it’s in ~/Library/Mail.sparseimage) and then do the following:$ ln -s /Volumes/Mail ~/Library/Mail
<%-- Declare the core library --%> <%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> <%-- Save data in scoped variables --%> <c:set var="name1" value="value1" scope="page" /> <c:set var="com_mycompany_name2" value="value2" scope="request" /> <c:set var="com_mycompany_name3" value="value3" scope="session" /> <c:set var="com_mycompany_name4" value="value4" scope="application" /> <%-- Show the saved values --%> <c:out value='${pageScope.name1}' /> <c:out value='${requestScope.com_mycompany_name2}' /> <c:out value='${sessionScope.com_mycompany_name3}' /> <c:out value='${applicationScope.com_mycompany_name4}' />
<%-- Show the saved values without a specific scope --%> <c:out value='${name1}' /> <c:out value='${com_mycompany_name2}' /> <c:out value='${com_mycompany_name3}' /> <c:out value='${com_mycompany_name4}' />
<%-- Save data using body content --%> <c:set var="name1" scope="page"> value 1 in body </c:set> <c:set var="com_mycompany_name2" scope="request" > value 2 in body </c:set> <c:set var="com_mycompany_name3" scope="session" > value 3 in body </c:set> <c:set var="com_mycompany_name4" scope="application"> value 4 in body </c:set>
<c:set var="name1" scope="page"> line 1 line 2 </c:set>
"line 1\n line 2"