July 2011 archive

Scaling Image Using Java

This blog explains how to scale up or down an image using Java Advanced Image (JAI) API.

Permanent link to this article: https://blog.openshell.in/2011/07/scaling-image-using-java/

How to read XML document using JSTL

JSTL allows the JSP developers to use simple logic and iterative code in the form of tags rather than typical Java code in JSP. In this article, you will know about how to parse XML document using JSTL XML tags.

Permanent link to this article: https://blog.openshell.in/2011/07/how-to-read-xml-document-using-jstl/

Read and Write an XML File using PHP

How to read and write xml document with php’s DOMDocument. The DOM extension allows you to operate on XML documents through the DOM API with PHP 5. For better understanding, I have written comment for almost every line of code. XML Code: file name – employee.xml [xml] <?xml version="1.0"?> <employees> <employee id="1" name="Albert"><age>34</age><![CDATA[ Employee details …

Continue reading

Permanent link to this article: https://blog.openshell.in/2011/07/read-and-write-an-xml-file-using-php/

Display first sentence with PHP

To display the first sentence of the paragraph with PHP. Use this code Code [php] function first_sentence($content) { $pos = strpos($content, ‘.’); if($pos === false) { return $content; } else { return substr($content, 0, $pos+1); } } [/php] Invoke the function like [php] echo first_sentence($content); [/php]

Permanent link to this article: https://blog.openshell.in/2011/07/display-first-sentence-with-php/

uninitialized constant Rake::DSL Ruby Windows Solution

rake aborted! uninitialized constant Rake::DSL C:/Ruby192/lib/ruby/1.9.1/rake.rb:2482:in `const_missing’ C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.1/lib/rake/tasklib.rb:8:in `’ Now, the first step I took towards solving this problem is to issue “bundle update rake” command to update my rake. This will update rake to the latest version. An example log for this update is provided below; bundle update rake Fetching source index for http://rubygems.org/ …

Continue reading

Permanent link to this article: https://blog.openshell.in/2011/07/uninitialized-constant-rakedsl-ruby-windows-solution/

Window.open Not Working In IE

If you use window.open to open custom windows with JavaScript, you might encounter problems in Internet Explorer. Even though you can open new windows in other browsers, it doesn’t work in IE. The reason to this is it depends on how you name your JavaScript windows. IE doesn’t allow space here. window.open takes three parameters …

Continue reading

Permanent link to this article: https://blog.openshell.in/2011/07/window-open-not-working-in-ie/