Thursday, May 29, 2008
Automatic page refreshes are so 1998
To eliminate any confusion, the type of page refresh I'm talking about includes those in <meta ...> tags and javascript setTimeout() and setInterval() calls that unceremoniously reload the entire page you are viewing. Why in this day and age of RSS, AJAX, Flash, and hell, even iframes would you still use auto-refreshes? I will concede that there might continued value for mobile versions of websites where timely delivery of information is key (think live sports scores and stock prices), as there are still a great number of mobile devices that do not support Flash (iPhone anyone?). But taking away a reader's choice in the age of Web 2.0 and ubiquitous connectivity tells me that you just don't get it.
Wednesday, April 16, 2008
Process for generating Netsuite java files, compiling stub classes, and creating jar file
Someone recently wrote me with some questions about this process, and I thought I would post this for everyone's benefit. Or at least I hope it's for your benefit and not your additional confusion. *grin*
Oh, and a couple of notes. I have not done any development in ColdFusion 8, so some of the steps and issues below may not apply. In fact, this entire process may not be necessary at all for all I know. Also I'm quite green when it comes to ANT and Ivy, so as with everything else I post here, if there is a more efficient way to any of these steps, I'd love to hear from you.
Assumptions for this process (modify as necessary for your environment):
- [Netsuite WSDL version] = 2_6_0
- [CF install path] = C:\CFusionMX7
- You are using ColdFusion MX 7 (Notes for ColdFusion 8 will be given where necessary)
- [java install path] = C:\j2sdk1.4.2_12
- [major java version that your CF installation uses] = 1.4
- [stub class target] = C:\netsuiteclasses\2_6_0
- [Apache Axis version] = 1.2.1
Prerequisites:
- You have Apache ANT 1.7.0 or higher installed and have all environment variables set per its installation documentation. (Download binaries and see documentation at http://ant.apache.org/)
- You have Apache Ivy 2.0.0 beta 2 or higher installed and have all environment variables set per its installation documentation. (Download binaries and see documentation at http://ant.apache.org/ivy/)
- A version of the java jdk compatible with the java runtime version of your ColdFusion installation.
- NOTE: This item is only for ColdFusion MX7 and likely does not apply to ColdFusion 8. A modified version of the Apache Axis 1.2 jar file (axis.jar) (distributed by Netsuite to fix a login issue caused by how cookies are passed by Axis in the HTTP header) was copied into [CF install path]\lib, and the ColdFusion server was restarted afterward.
Generate and Compile Process:
1. Generate java class source code (windows dos window).
[java install path]\bin\java -cp [CF install path]\runtime\lib\wsdl2java.jar org.apache.axis.wsdl.WSDL2Java -v -O 120 -a -o [stub class target] https://webservices.netsuite.com/wsdl/[Netsuite WSDL version]/netsuite.wsdl
2. Create Apache ANT build file.
Create a file named build.xml in [stub class target] with the following contents (pay attention to bracketed areas that you will need to modify accordingly):
<?xml version="1.0" encoding="UTF-8"?>
<project name="netsuite_[Netsuite WSDL Version]" default="init" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<description>
Build file for Netsuite [Netsuite WSDL Version] WSDL.
</description>
<property name="classes.dir" location="classes" />
<property name="dist.dir" location="dist" />
<property name="dist.jarfile" value="netsuite_[Netsuite WSDL Version].jar" />
<target name="resolve" description="--> retrieve dependencies with ivy">
<ivy:retrieve pattern="${lib.dir}/[type]/[artifact]-[revision].[ext]" conf="runtime"/>
</target>
<target name="clean" description="Clean up output directories.">
<delete dir="${classes.dir}" />
</target>
<target name="compile" depends="-init" description="Compile all sources.">
<mkdir dir="${classes.dir}" />
<javac srcdir="." destdir="${classes.dir}" debug="true" deprecation="true">
<compilerarg line="-source [major java version that your CF installation uses]" /> <!—NOTE: The “-source” option may not be necessary for CF8 -->
<compilerarg line="-classpath [CF install path]\lib\axis.jar; [CF install path]\lib\jaxrpc.jar" />
</javac>
</target>
<target name="rebuild" depends="clean,compile" description="Cleanly compiles all sources." />
<target name="-init">
<!-- Create the time stamp. -->
<tstamp>
<format property="TODAY_US" pattern="dd MMM yyyy HH.mm" locale="en_US" />
</tstamp>
</target>
<target name="dist" depends="rebuild" description="Creates the binary distribution.">
<mkdir dir="${dist.dir}/${TODAY_US}" />
<jar basedir="${classes.dir}" destfile="${dist.dir}/${TODAY_US}/${dist.jarfile}" />
</target>
</project>
3. Create Apache Ivy config file.
Create a file named ivy.xml in [stub class target] with the following contents (pay attention to bracketed areas that you will need to modify accordingly):
<ivy-module version="2.0">
<info organisation="apache" module="hello-ivy"/>
<dependencies>
<dependency org="apache" name="axis" rev="[Apache Axis version]"/>
</dependencies>
</ivy-module>
4. Compile files and generate jar file.
Open a Command Prompt window and change directories to your [stub class target] directory and run the following command:
ant dist
You may see multiple warning messages throughout the compile process, but as long as you see a BUILD SUCCESSFUL message upon completion, there shouldn’t be any problems. Copy the generated jar file (the output of the ant command should indicate the filename and location of the jar file) to [CF install path]\lib and restart your ColdFusion Application Server service.
Wednesday, March 12, 2008
Jeremy to Microsoft Live "quality" bot: you're doing it wrong
Wednesday, February 27, 2008
Save yourself the effort of defining the same code for multiple javascript events
e.g.
// define the onchange event and call the same code for onmouseover, onmouseout, and onclick
// Now if you make changes to onchange, you don't need to copy those changes to the other events.
<input ... onchange="myFunctionDoYouLikeIt(this, 'valueadded', false, 0); compareSomeValues('placeholder', false, true, 'the google webz');"
onmouseover = "eval(this.onchange + '\;anonymous()\;');"
onmouseout = "eval(this.onchange + '\;anonymous()\;');"
onclick = "eval(this.onchange + '\;anonymous()\;');" />
Friday, February 22, 2008
Combine multiple Twitter feeds on Blogger
Configure and add the widget here.
I promise to post more documentation for this feature later, as there are other nifty things you can do to control the style of the output, including creating a "mask" to define the format of your output, and inclusion of data like the user profile, user homepage link, user profile image, etc.
Caveats: The number you are defining in the form does NOT mean that only the last n posts from your pool of users will appear. It means that the last n posts from each user will be shown. For example, you've set the twitter number to 3. User1 posted a single twitter 4 days ago, but User2 posted 4 twitters today alone. You will see the last 3 posts from User1 and the last 3 posts from User2.
Tuesday, February 12, 2008
A warning regarding calculating sales commissions in NetSuite
Tuesday, November 06, 2007
Screensaver won't start in Windows XP
Finally last weekend, I had enough. I had googled this issue half-heartedly when it first started happening, but this time google yielded immediate results. Users in several forums having similar problems had wireless USB mice like my Logitech laser mouse. The suggested solution? Shut down the computer, unplug the mouse, attach a USB to PS/2 connector, and plug it into the PS/2 mouse port. After one false start where I wasn't paying attention and plugged my Logitech webcam into the PS/2 port instead of my mouse ("Why isn't my webcam working? Durrrrrrr..."), I plugged her in, booted up, and lo and behold, it worked. My screen saver has been consistently working for the last several days with no issues whatsoever. I suspect that using the PS/2 port instead of USB will mean I'll lose nifty features like low battery warning messages from the Logitech monitoring software, but I can live with that if it prolongs the life of my monitor.
