Monday, May 5. 2008Cinco de Mayo @ JavaOneMay 4thArrived in San Francisco after a smooth flight, this flight is so quick from So Cal, you get a little reading in and before you know it you're on the ground again. Grabbed a shuttle to the hotel, Serrano Hotel, got my room and headed out for a little stroll to find some grub before I get an early start on Monday. Grabbed a tuna melt at TAD's which is a few blocks away. Never been, food wasn't bad and they seemed to have a big breakfast menu. Considerably cheaper than the Ponzuwhich is running about 30.00 a meal (maybe I'll check it out before I leave). I must say, there is something about San Francisco, cool air hitting your face, homeless asking for money every corner, street musicians playing saxophone/guitar and what else they have, After my walk, I headed back to the hotel, prepared myself for the day to come, set the alarm and hit the hay. May 5th - Cinco de Mayo
Headed back, I grab a coffee and a piece of Banana Nut Bread from Starbucks, then it's over to the Intercontinental Hotel (Nice hotel) for the session. Spring Framework by Chris RichardsonSince I've used Spring Framework with uPortal and some of the other projects at work, the first half of this session was simply a reminder of configuration possibilities and reasons why to use the framework, like the removal of DRY (Don't Repeat Yourself) code, easy testing with Mock Objects (Chris used JMock 2), removal of dependancies. Chris also covered xml configuration and annotation based configuration, even covered Java Config for configuring Spring. I guess I must have skipped the Bean Scopes somewhere along the way because Chris' explanation of them eye opening, kind of woke me up (hey you know you can do this?) Bean Scopes
Next, he AOP Basics Joinpoint ● Well-defined point during the execution of your application ● You can insert additional logic at Joinpoint's ● Examples of Jointpoint's – Method invocation – Class initialization Advice ● The code that is executed at a particular joinpoint ● Types of Advice – before advice, which excutes before joinpoint – after advice, which executes after joinpoint Pointcuts ● A collection of joinpoints that you use to define when advice ● By creating pointcuts, you gain fine-grained control over how ● Example – A typical joinpoint is a method invocation. – A typical pointcut is a collection of all method invocations in ● Pointcuts can be composed in complex relationships to further Aspects ● An aspect is the combination of advice and pointcuts For more on Spring AOP see Spring wraps objects with By wrapping objects, your Spring allows programmers to remove tightly coupled, duplicated and tangled code with code that is easier to maintain, test, and develop. Chris did a good job of explain how Spring can help. The AOP/Transaction management was a real eye opener and features that I don’t currently use. The dependency injection part of spring has been something I’ve been using for quite some time. I’m not going to cover every aspect of the session but I’ve tried to highlight some of the key points that Chris when over in the session. Additional projects that Chris is involved with are:http://code.google.com/p/aop-oodhttp://code.google.com/p/projecttrackhttp://code.google.com/p/aridpojoshttp://code.google.com/p/ormunithttp://code.google.com/p/umangitehttp://code.google.com/p/cloudtoolsWeb 2.0 Leveraging the Project jMaki and Google Web Toolkits for jMakiThis session started with http://forums.java.net/jive/forum.jspa?forumID=96 http://weblogs.java.net/blog/carlavmott http://weblogs.java.net/blog/gmurray71 http://weblogs.java.net/blog/arungupta GWTThe real value (for me) in · · · · · · · More on GWT later. You can I’ve been trying finish Really today was jammed with Really today was jammed with material, each session was 3 hours long and we stopped after 8pm. I was toast, tons of information and it's only the beginning. I really hope to finish the blog but I'd like to get some sleep for tomorrow is another day of learning. Friday, May 2. 2008JavaOne - May 5 - May 9thJavaOne 2008
Good News is on the horizon! I'm about to close on a new home with my squeeze, Lisa, and I'm off to JavaOne this week. I know, can't get much better than that! It's been since 05, the last time I went to San Fran to visit Duke and the city by the bay, so I'm going to try to make the most of it. Major changes to Java and other languages based on the JVM have arrived so the goal is to check some of those languages out (Grails, JRuby). Also I want to get more information on JSR 296. I've started a development in that area and I'm curious to see what is going on with that. I will for sure check out some Spring session as it's moving to 2.5 release, so I'm sure there is valuable information there. As I'll need that because I've been messing with the new Spring Web Flow 2.0.0 RC1 release. I also have a session on jMaki, not to sure what to expect, but it should be interesting as I haven't been messing much with the Ajax stuff, so this seem like a good time to check it out of some hot clam chowder. Other notables are a session on JXTA which I haven't seen nor heard much from in years (I did my thesis using this technology). I'm quite interested to see if anything changed there (Wait as I'm getting the link, I see there is a new version 2.5 that has been released in November 07). So as I prepare for my trip, I'm looking forward to all the information I can cram into my brain for the week and feel comfortable knowing that all the paperwork is in place for the new pad, for when I return, we can have a smooth transition from our current location to the new one. (Let's hope these damn gas prices give) Thursday, April 17. 2008MAVEN DEPENDENCIESMAVEN DEPENDENCIES Dependency scope is used to limit the transitivity of a depedency, and also There are 5 scopes available:
Wednesday, April 16. 2008iPhone Totally Rocks
Now for the iPhone, this thing is cool. Really cool! I can tell when people call, leave voicemail, sms, and the internet with the 802.11b/g capability, forget it! This thing rocks! I didn't think one little device would be so much help and distraction all in one little package. I mean I really don't spend that much time away from the computer, and now with this little device, its really difficult to not take it to lunch and dinner and read what's up in the world wide web. I'd really like to write some code for this thing, but I don't own a mac, but this thing may just cause me to breakdown an purchase yet another Apple product. Luminis IV & uPortalRandom Note: Luminis IV is built on top of uPortal 2.5.3. Tuesday, April 15. 2008Log Time No PostForFiles Just a quick note to self, deleting Apache files older than 60 days: forfiles /p f:\Apache\Apache\logs\ /s /m ssl.log /d -60 /c "cmd /c del @file" Oh yeah! Blog more often! Friday, August 24. 2007uPortal 2.6.0Quick Notes for me: Tidy.jar has dom implementations that must be removed. These class file conflict with the dom implementation that is in JDK 1.6. Quick fix to remove the org.w3c.dom class files from the tidy.jar. xml-apis.jar must be removed as well for the same reason. CAS Setup Information Testing remember to generate a cert with name localhost.
Tuesday, March 27. 2007SD West 2007 - Random NotesMarch 21, 2007 – Day One rbodkin@newaspects.com Eclipse with AspectJ Plugin or Spring AOP or JBoss also have tools for eclipse as well. Pointcut defines the join point where we want to call the aspect. public aspect MeteringPolicy { pointcut useTitle() : execution(public void Song.play()) || after() returning : useTitle() { } } Terms: advice method (do the following thing), pointcut Used for tracing, monitoring, handling boiler plate code, used for understanding your system better. call(* Remote+.*(..) throws RemoteException); This example can be used to handle all the RemoteExceptions so the programmer doesn’t have to write the code to handle RemoteExceptions. This removes the boiler plate code of the try/catch in every call that throws a RemoteException. Advice: Start small, only a few should write the aspects. Incremental adoption works best Random Notes: Session2: Crystal Clear: A Human Powered Methodology for Small Teams – Alistair Cockburn Talk about agile coming out well or not well. What’s the difference? Crystal Clear – Questions Nothing written down Techniques for getting max benefit from limited resources Successful projects where listening to the people (people-centric) and constantly modify the methodology. Different people do different things. Can’t drive a methodology down someone’s throat. Different projects and people use different methods (pair programming, uml design, test driven development, etc). happy people ship, happy code! People like to be told what to do, so they won’t do it. Each person has to say what they are going to do. Crystal’s purpose: Keep people from hurting each other, keeping each other informed Six people or less. Give them a whiteboard, let them ship code, and you’re almost done. Thinks of each project as a game. From the seven principles of methodology design Recommended Reading Frequent Delivery Personal Safety Critical technique in Crystal: Slide 20 Reflection Workshop. Discuss and determine what things you’re going to try. Try these are things you can control and do. Sets projects based on color. Clear, Orange, Yellow, etc. Session 3: An Overview of TR1 – Scott Meyers smeyers@aristeia.com Technical Report 1 – Future standard of functionality to be in standard C++ Currently in the std::tr1 eventually maybe in the std namespace. You must have a TR1 conformant library for this to work. New Functionality: C99 Compatibility TR1 is a specification. This is an interface specification not an implementation. To understand the functionality in TR1: http://www.aristeia.com/EC3E/TR1_info.html 10 of the 14 libraries in TR1 are modeled on Boost libraries. Boost will bring its libraries into conformance with TR1. gcc 4.0 – has some of the TR1. To get it, you can use Boost library, it has 11 of the 14. You can also look at Dinkumware. Smart pointers declared in the header <memory>. Check out auto_ptr and shared_ptr. “this” is a raw pointer. Be careful when returning shared pointers to yourself. Operators: static_pointer_cast, dynamic_pointer_cast, const_pointer_cast Output: << auto_ptr solves the problem of exclusive ownship. shared_ptr solves the problem of shared ownship. auto_ptr always deletes its resource. tr1::weak_ptrs can’t keep resources alive. Solve the problem of dangling pointers and cyclic references. TR1 tells you nothing about where these features are thread safe. HashTables Regular Expressions Pete Becker’s Book on TR1. Slide page 54. Session4: Puzzlers Review the slides… Examine - Autoboxing, varargs, generics March 23, 2007 Session1: What’s coming in Java6 – Jason Hunter StaX – pull parse, doesn’t store the whole document in memory, good good. Annotations Java 5 – apt (annotation processor tool) Core HTTP Server New Deque = Double Ended Queue Randomized Skip Lists - http://en.wekepedia.org/wiki/Skip_list Removing feature’s in Java 6 Java 7 Dynamic Languages – new invokedynmaic bytecode NIO 2 – JSR 203 Javadoc Update Non-API features http://java.sun.com/avase/6/docs/api Session2: Extreme Web Caching – Jason Hunter javap -public -classpath jsse.jar java.lang.Class Client Server <html><head><title> Side note: JSPs buffer 8K by default 1. Use “Cache-Control: private” for personalized content Issue with cookies, sending a cookie say from jane back to john. So you should use Cache-Control header. Cache-Control: private Cache-Control: public 2. Implement “Images Never Expire” policy Dictate that images (icons, logos) once published never change Set Expires header 10 years in the future Check – http://use.perl.org/~geoff/journal/22049 3. Cookie-free TLD for Static Use a separate domain for static content A domain without cookies www.server.com for html static.server.net for images, PDFs, etc 4. Apache Defaults for CSS/JS Rely on If-Modified-Since request header How can a server know when servlet content changes? The .class timestamp is meaningless Help the ser with getLastModified() public long getLastModified(HttpServletRequest req) { Return datamodified.getTime(); } Called before doGet(), possibly avoiding doGet() 5. Random URL strings Add javascript to create random url Point all the ad servers to localhost 127.0.0.1, this removes all the adds when browsinghttp://www.everythingisnt.com/hosts.html http://www.mnot.net/cacheability/http://www.mnot.net/cache_docs/ http://www.radwin.org – he’s blog Session3: Java Persistence API Overview – Cay Horstmann San Jose State University There are five requirements for an Entity Persistence context = set of managed entities Need the persistence.xml file. Can’ persist inner classes and final classes With eclipse wait for Dali and WTP. Address issues of refactoring the objects. What happens if we change the foreign key relationship or we modify the way that relationship between entities are modified. What happens with the cache? If we get a result from a query and then modify the table so we have a new entity. If I query again the cache returns the original result set before the insert. How do we get around this? Away around naming objects like “User” this is a sql reserved word. However, Hibernate has a method of getting around this does JPA. Java Persistence Query Language (JPQL) Lazy Fetching To use an EJB container or not? Use annotations to get EJBs and a handle on the EntityManager. Session4: What’s New in XML in Java 5 and 6 – Elliotte Rusty Harold JAXP Java 5 added DOM Level 3 support User Data – a user-defined callback class that is invoked when a node is cloned, imported, etc. Bootstrapping DOMImplementation impl = DOMImplementationImpl.getDOMImplemenation(); To read a document, must import org.w3c.dom.ls.*; Checkout LSParserFilter, org.w3c.dom.ls, for removing parts of the document when reading. Writing LSSerializer serializer = implls.createLSSerializer(); LSOutput output = implls.createLSOutput(); XPath Java Validation API http://www.cafeconleche.org/slides/sd2007west/java5xml/ BOF – Interviewing in Silicon Valley http://www.techsmith.com paultima.blogspot.com Interesting bit of information about interviewing for jobs in Silicon Valley, from Google perspective. Discussion included a log of emphasis on algorithms and Big O runtime for algorithms. How would you sort a collection of A, for example, why? Advice was to focus on some open source projects that are interesting. This helps when potential employers look at your resume they see that you’re interested in the community and making contributions to projects. March 23, 2007 This session was a complete waste of time. The speaker was fumbling around, finished early and started his next presentation on AJAX. In addition, the presentation is available online from Microsoft, so the session was completely unhelpful. Session2: Using Visual C++ To Light Up on Windows Vista – Nikola Dubar Microsoft is trying to make development on Vista easier for C++ developers. Includes WCF, and WPF. The demonstration utilizes Visual C++ Orcas. Second part of the talk will be improvements to MFC. Check the article, Top 10 Ways To Light Up. Orcas is coming out pretty soon. User Access Control Application Recovery and Restart – register callback functions, if the app dies this function is called to restart the application. Function Discovery – enables apps to discover and manage lists of devices or objects sorted by functionality or class. Available before but it is more organized now, a standardize method for retrieving this information. Cancelable I/O – Customer Feedback Loop Windows Quality Online Service, register with ms and get your app dumps when they crash. The apis provide ability to customize reports for your dumps. Check this out! Windows Vista style guidelines New Common Item Dialogs WPF – Rich library of controls – core component of .NET 3.0 Organize and Search WCF – Windows Communication Foundation Mix mode allows you to use native C++ and call the .NET framework for features that use .NET features through C++ CLI. Three modes RSS library Document data Additional libraries for Mobile Devices 10 new features in Vista only 3 are managed code the others are native code VC++ Orcas JPA – possible app rss reader that persists content Session4: How to Build a Scalable Multiplexed Serer With NIO – Ron Hitchens ron.hitchens@marklogic.com How to use NIO to build a server. Lower level i/o that is more sufficient for io than the java.io package. Gives access to some of the lower features that the OS has for I/O. Three ways for multiplexing in a server. Thread-per-socket – this is how java worked before. Overhead of managing many threads. Readiness selection (NIO)selects the sockets that are ready, requires OS and JAVA VM support The Reactor Pattern – Google for Douglas Schmidt* http://www.cs.wustl.edu/~schmidt/patterns-ace.html From the UML PatternDemultiplexer – knows which sockets are ready. This is the object that answers that question. NOTE: buffer bytes and reconstitute the structure. Structured messages will be fragmented across the network. Handler can’t write directly to the socket. This is by design it should only read and write to queues. Handler checks the queue to see if it do something with data. If there isn’t enough data the handler replies back to the Dispatcher, I don’t have enough data. Once all the data is there, the handler will do its thing with it. Old model is thread per socket, bad. This new model is one thread per message. NIO Reactor UML – blue objects are part of the jdk O’Reilly – Ray Lischner’s C++ in a Nutshell Friday, December 1. 2006Gradebook TODO:: What's Next? Now I have a good portion of the Gradebook app working in uPortal. Next I need to add the export in Excel and CSV formats to the instructor view, but before I got that far, I'm going to add data from a live course. I mean the course information with the roster. The student view needs to be tested and examined before I can do anything else. Once I have the course and students loaded I'll return to export features, then I should be ready for demo day... Just wanted to write a quick note to myself, so I remember where I'm at on this. It took me all week to get to work on this, so I didn't want to forget my train of thought.If I get the chance, I'd like to start working on my course material for my C++ course. Well I better find some way to wind down so that I can start another day tomorrow. Gradebook Portlet URL Errors
1) I was receiving Portlet Exceptions on resources. assignmentDetails.jsp and courseGradeDetails.jsp were receiving exceptions when trying to retrieve the dhtmlpopup.css and the dhtmlphpup.js. The jsps use relative links to reference these files. I had to add the portlet context to the references to stop the exception from being thrown. org.apache.pluto.core.impl.PortletResponseImpl.encodeURL() checks for absolute urls. If the resource is reference via a relative url, a PortletException is thrown. 2) Beans defined in the ui project are defined with request scope. These beans had to be modified to use session scope. Since the request is split in an action request and a render request, when the jsps are being rendered, there aren't any request variables in scope. This is solved by changing the bean scope to session and using my RoleListener to handle removing the bean upon new requests. Example, when assignment details are requested for each homework assignment, upon the initial request a session bean is created say for homework #1. Now if we make a new request to view details of homework #2, the session bean exists from the initial request and homework #1 is displayed again. Thus the session bean needs to be removed to create a new bean with the data pertaining to homework #2. Again this works fine if we're using the application as a standalone application, but since the app has been pushed into a portlet framework, uportal, the requests don't work as designed. 3) The popup for gradebook logs doesn't show the close icon due to it being specified as a relative link. I've changed the the following line: closeIconUrl="dhtmlpopup/dhtmlPopClose.gif" to closeIconUrl="${pageContext.request.contextPath}dhtmlpopup/dhtmlPopClose.gif" in the gradingEventLogs.jspf file. I also modified the tag library descriptor, gb-jsp.tld, changing the rtexprvalue to true so that the attribute "closeIconUrl" accepts and evaluates the ${pageContext.request.contextPath} expression. <attribute> Now the eventLogs popup shows correctly in the portal. One minor issue was that the popup was showing up lower than I liked so I removed the dhtmlGetPageYOffset() from the dhtmlPopupShow() function so that it displays the popup where the log image is clicked on (this is located in the dhtmlPopup.js). 4) **** Is another issue with the portlet getting the proper context for tags in the myfaces library. In the addAssignment.jsp, it uses the inputCalendar component. When this component is loaded it initialize the calendar. However, the component needs popcalendar_init.js and the popcalendar.js to initialize the calendar component. I assume that the issue is due to the application being in the portal context while trying to get the js files from that context and not the portlet context. I'll have to look into this later. However, a quick fix is to add the two js files to the js directory in the ui package in the Gradebook, then add references to the to files in the assignmentEditing.jspf file after the description text in the <h:panelGroup/> tag. <f:verbatim><script src="${pageContext.request.contextPath}/js/popcalendar_init.js" type="text/javascript"></script><script src="${pageContext.request.contextPath}/js/popcalendar.js" type="text/javascript"></script></f:verbatim>Tuesday, November 7. 2006Integrating Sakai Gradebook in Uportal |