◦In IE8 click “Tools” | “Internet Options” | and choose the “Advanced” tab.
◦Scroll down one full scrolls worth and uncheck the “Enable visual styles on buttons and controls in webpages“
◦Click “OK” - it will take a few seconds, then your browser should display correctly. You should not have to close/reopen the browser for the change to take effect.
http://www.ejabs.com/2009/03/fix-tiny-forms-in-ie8/
shared items
Sunday, May 10, 2009
Sunday, May 3, 2009
What you do is create a select tag with the “select” method like so: (using the client/project scenario)
f.select(:client_id,
The next value you pass to the select method has to be an array of text/value pairs
like this: [ [ "Jason Johnson", 1], ["Trey Piepmeier", 2], ["Royall", 3] ]
In order to create this array, you do a find on your clients table and use Ruby’s “collect” method.
like so:
Client.find(:all).collect {|c| [ c.name, c.id ]}
So, altogether now:
f.select(:client_id, Client.find(:all).collect {|c| [ c.name, c.id ] })
Reference
f.select(:client_id,
The next value you pass to the select method has to be an array of text/value pairs
like this: [ [ "Jason Johnson", 1], ["Trey Piepmeier", 2], ["Royall", 3] ]
In order to create this array, you do a find on your clients table and use Ruby’s “collect” method.
like so:
Client.find(:all).collect {|c| [ c.name, c.id ]}
So, altogether now:
f.select(:client_id, Client.find(:all).collect {|c| [ c.name, c.id ] })
Reference
Saturday, May 2, 2009
JAXB ignores "@required" fields in validation
Reference Links :
http://www.cowtowncoder.com/blog/archives/cat_java.html
http://kirkwylie.blogspot.com/2008/10/jaxb-2x-and-xmlelementrequiredtrue.html
http://www.nabble.com/JAXB-ingores-@XmlElement(required%3Dtrue)-on-unmarshalling-in-JAX-RS-td22122276.html
http://myarch.com/using-schema-validation-with-jaxb-and-xfire
https://jaxb.dev.java.net/guide/Migrating_JAXB_2_0_applications_to_JavaSE_6.html
http://www.cowtowncoder.com/blog/archives/cat_java.html
http://kirkwylie.blogspot.com/2008/10/jaxb-2x-and-xmlelementrequiredtrue.html
http://www.nabble.com/JAXB-ingores-@XmlElement(required%3Dtrue)-on-unmarshalling-in-JAX-RS-td22122276.html
http://myarch.com/using-schema-validation-with-jaxb-and-xfire
https://jaxb.dev.java.net/guide/Migrating_JAXB_2_0_applications_to_JavaSE_6.html
Thursday, April 9, 2009
WSDL2ruby
1. Download soap4r from SVN.
svn co http://dev.ctor.org/svn/soap4r/trunk/bin soap4r
This will result in two files being downloaded - wsdl2ruby.rb and
xsd2ruby.rb. The one I used was the wsdl2ruby.rb.
2. Generate sample SOAP client file
ruby wsdl2ruby.rb --wsdl http://location_of_WSDL --type client
This will result in the creation of three files - default.rb,
defaultDriver.rb and WSClient.rb. The sample client file is
WSClient.rb. Inside this file, I found all the remote methods and "nil"
arguments being passed to them. For e.g., I had a remote method defined
as follows in my web-service:
string observe (string req_id, string[] names, string[] values);
The second and third argument for this file were vectors of strings.
In the ruby client file, this method was exposed as follows:
obj = WSSoap.new(nil)
parameters = nil
puts obj.observe(parameters)
So, even though my remote method should have three arguments, here
there is only one. According to nahi's email, I needed to construct a
hash table and pass that as the single argument.
3. Pass actual arguments.
name = ['CENTER', 'SPAN', 'SCALE', 'YREF', 'INTERVAL']
val = ['5.18 GHz', '2.95 MHz', '4.00', '-68.70', '30000']
parameters = {
'req_id' => '1',
'names' => {:string => name},
'values' => {:string => val}
}
result = obj.observe(parameters)
puts result.inspect
svn co http://dev.ctor.org/svn/soap4r/trunk/bin soap4r
This will result in two files being downloaded - wsdl2ruby.rb and
xsd2ruby.rb. The one I used was the wsdl2ruby.rb.
2. Generate sample SOAP client file
ruby wsdl2ruby.rb --wsdl http://location_of_WSDL --type client
This will result in the creation of three files - default.rb,
defaultDriver.rb and WSClient.rb. The sample client file is
WSClient.rb. Inside this file, I found all the remote methods and "nil"
arguments being passed to them. For e.g., I had a remote method defined
as follows in my web-service:
string observe (string req_id, string[] names, string[] values);
The second and third argument for this file were vectors of strings.
In the ruby client file, this method was exposed as follows:
obj = WSSoap.new(nil)
parameters = nil
puts obj.observe(parameters)
So, even though my remote method should have three arguments, here
there is only one. According to nahi's email, I needed to construct a
hash table and pass that as the single argument.
3. Pass actual arguments.
name = ['CENTER', 'SPAN', 'SCALE', 'YREF', 'INTERVAL']
val = ['5.18 GHz', '2.95 MHz', '4.00', '-68.70', '30000']
parameters = {
'req_id' => '1',
'names' => {:string => name},
'values' => {:string => val}
}
result = obj.observe(parameters)
puts result.inspect
ruby UUID installation
gem install UUID
create ENVironment variable "HOME" in windows. Set it to any Directory.
require 'UUID'
p UUID.generate
create ENVironment variable "HOME" in windows. Set it to any Directory.
require 'UUID'
p UUID.generate
Wednesday, March 18, 2009
DOM to BLOB to DOM
private void test1() throws ParserConfigurationException {
ByteArrayOutputStream baos = new ByteArrayOutputStream(5120);
DocumentBuilderFactory doc1 = DocumentBuilderFactory.newInstance();
DocumentBuilder doc2 = doc1.newDocumentBuilder();
Document doc = doc2.newDocument();
org.w3c.dom.Element elem1 = doc.createElement("name1");
doc.appendChild(elem1);
org.w3c.dom.Node node = doc.getFirstChild();
TransformerFactory tfact = TransformerFactory.newInstance();
try {
Transformer tf = tfact.newTransformer();
StringWriter sw = new StringWriter();
Result rs = new StreamResult(sw);
Source src = new DOMSource(node);
tf.transform(src, rs);
baos.write(sw.toString().getBytes());
Object a = baos.toByteArray();
baos.flush();
baos.reset();
baos.close();
sw.close();
System.err.println(sw.toString());
System.err.println(a.toString());
String n = new String((byte[])a);
try {
Document doc12 = doc2.parse(new InputSource(new StringReader(n)));
System.err.println(doc12.toString());
} catch (SAXException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.err.println("........."+n);
} catch (TransformerConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (TransformerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Subscribe to:
Posts (Atom)