accretive
adj.
the process of growth or enlargement by a gradual buildup
Source: m-w.com
Archive for June, 2007
WOTD: accretive
A trick with dojo.editor in jMaki
When I tried to use jMaki’s dojo.editor, I first thought “Hay this is dojo, so I can just use it the way dojo related documentation stated it, right?” No. jMaki created a wrapper for dojo and the configuration argument doesn’t match 100%. So, After reading across several documentations, here is one trick for configure dojo.editor with medium pre-set tool bar. The default is small. Beyond that, there isn’t too much more you can configure. So, dojo.editor in jMaki isn’t as configurable as dojo.editor by itself. This simplification is fine if the presets are good enough for your needs.
<a:widget name="dojo.editor" value="edit me." args="{toolbar:\"medium\"}" />
Sources: Object Literal (for defining the parameters for args), jMaki’s dojo.editor documentation
Implementing my own rating AJAX widget
It’s amazing that I was able to implement my very own rating AJAX widget. It certainly helped me to better understand what kind of work is needed to make this simple widget work. You can certainly study other existing implementations by click on view source on your favorite browser. Here is one implementation that I know:
The execution flow starts with the definition of the img tag. You will need to define onclick action to call a submission JavaScript function, onmouseover action to call a JavaScript function to show appropriate number of stars when mouse over, and onmouseout action to call a JavaScript function to show appropriate number of dim stars or selected stars when mouse out. For the function that get called on onclick event, it just needs to make an AJAX call back to the server to submit rating value for a particular item. For the function that receives a call on onmouseover, it needs to change the src property of each img node based on which image the user moused over. You may need to label each star img node with a class property so you can check for it while iterating through star nodes and their peers on the same level in the DOM tree. For the function that receives a call on onmouseout, it needs to either reset all star image to dim version or reset the image to show the selection that the user submitted during the same page load. This means that once a user click on a star, that star and the stars left of it will remain lit after mouse out.
WOTD: goggle
goggle
verb
to stare with wide or protuberant eyes
Source: www.m-w.com
1. To stare with wide and bulging eyes.
2. To roll or bulge. Used of the eyes.
Source: dictionary.reference.com
SQL: LEFT JOIN tables
Today, I found a need to show all rows in a table and add associated information from another table. After reading a SQL reference manual on LEFT JOIN, I gave it a try and it met my needs. Here is the general format: SELECT field1, field2 FROM table1 LEFT JOIN table2 ON condition1 WHERE condition2 According to the documentation, the ON condition tells the database how to join the tables while the WHERE condition tells the database to return what row(s) as part of result set.
xpilot
I didn’t realize what xpilot really is until I play it. It is a 2-D space shooter action game. The controls are simple, turn left or right, thrust forward, and shoot bullets. It reminded me another game called SubSpace, which is equally fun. I know this is so 1990s. Hay! These classics can still deliver a lot of fun! By the way, this type of games have the most fun factor when you are playing with a bunch of friends.
Howto install Wine on Ubuntu 7.04
It’s weird that I actually find a need to run a Windows application. So, I found this howto and it worked perfectly for me.
It didn’t occur to me that WINE does not exist in binary form on Ubuntu 7.04 for AMD64. I actually don’t mind compile from source. I wonder why is that?
Howto SSH without a password
The links that I included on this topic earlier are broken. So, here is a new one and it worked for me.
Notes from Sustainable Software Development
Here are my notes from Kevin Tate’s “Sustainable Software Development: An Agile Perspective”
Introduction
- “Sustainable development is a pace that can be maintained indefinitely.”
- “Sustainable development requires a singular focus on a form of technical excellence that regularly provides useful software to customers while keeping the cost of change low.”
- “Balancing the short and long term requires projects to be more driven by a vision than tracked against a plan.”
Chapter 1
- “Key indicators of sustainable development are an ability to keep the number of defects relatively constant over time while recognizing that the software must be modified to keep the cost of change under control.”
- “Working harder (more hours) results in declining capability over time. Working smarter, with an emphasis on continual improvement, leads to increasing capability”
- “Companies need people who treasure the contribution they make when at work and who are passionate about the success of the company. This has no correlation with the number of hours worked. . . ”
Chapter 2
- “Technical debt is caused by an accumulation of poor decisions over timedecisions that often seem right at the time but are usually made in the interests of a short-term quick fix to the software.”
Chapter 3
- “The most common response to flailing around is to apply bureaucracy, to define a set of strict rules and milestones that cannot be deviated from. But bureaucracy stifles innovation and is most often misguided, leading to unintended side effects. It is also inflexible and change-intolerant.”
- Great teams recognize that what they are trying to achieve is more important than how they achieve it
-
Three elements of sustainable development:
- A vision
- “Practices that are consistent with the principles.”
- A feedback loop that leads to enhances to practices.
-
Sustainable software development principles:
- “Continual refinement of the product and project practices.”
- “A working product at all times.”
- “A continual investment in and emphasis on design.”
- “Valuing defect prevention over defect detection.”
- “Effective teams strive for the optimal balance between being visionary (thinking about the long term) and tactical (focusing on today’s problems), and this balance changes over the course of the project.”
- “Great cultures recognize talents and skills as separate from each other. Too many companies are focused on skill alone and recruit only for skills. But skills can be taught, whereas talent can’t.”
Chapter 4: Working Product
- Practice 1; No “Broken Windows” — “no hacks or ugly workarounds”
- Practice 2: Be Uncompromising about Defects — Preventing and addressing defects and put a closure (fix it or close it with a reason) before moving on.
- Practice 3: “Barely Sufficient” Documentation
- Practice 4: Continuous Integration
- Practice 5: Nightly Builds
- Practice 6: Prototyping — In addition to the traditional concept of prototyping with code, a “whiteboard and paper” approach is another quick way to gain insights from the customer(s).
- Practice 7: Don’t Neglect Performance
- Practice 8: Zero Tolerance for Memory and Resource Leaks
- Practice 9: Coding Standards and Guidelines
- Practice 10: Adopt Standards (Concentrate on Your Value-Add)
- Practice 11: Internationalize from Day One
- Practice 12: Isolate Platform Dependencies
-
Chapter 5
- Practice 1: Ruthless Testing — Use unit tests, mock objects, integration testing (when using 3rd party libraries), system testing (that simulate real user loads), performance testing, Resource-usage testing,
- Practice 2: Use Available Tools — Source code analyzer such as PMD.
- Practice 3: Pair Programming and Code Reviews
- Practice 4: Lightweight Root-Cause Analysis — 1. What cause the defect? 2. What would have caught this defect? 3. How can we prevent this from happening again?
Chapter 6
- Practice 1: Design Vision
- Practice 2: Guiding Principles
- Practice 3: Simple Design – If you see an opportunity to design for a future need, do it and make that architecture work visible to users. The goal is to avoid costly refactor work.
- Practice 4: Refactoring
- Practice 5: Design Patterns — Watch out potential over use of patterns that could be solved with simipler implementations. Sometimes pattern implementations might vary greatly or even have different behaviors.
- Practice 6: Frequent Rapid Design Meetings
- Practice 7: Commitment to Rearchitecture – Use existing tests to check for regression.
- Practice 8: Design for Reuse
Chapter 7
- “the challenge with agile methods is to rely on both adaptability and anticipation and to have a team that knows when and how to apply each, and in what measure.”
- Practice 1: Iterative Development
-
Practice 2: Release Planning
“as with any project, you can either change the date, the feature set, or the resources. You can’t expect to fix all three.” - Practice 3: Daily Standup Meetings — What you did? What are you doing? What is stopping you?
- Practice 4: Retrospectives — “What worked well?” “What needs to be improved?” “What should we do differently?”
- Practice 5: Coaching and Team Development — It’s important that developers understand what’s important to the customers, which will infer how the customers use the product. Note that how the customers use the product (i.e. what they really asking for) maybe differ from what they asking for. “If the only value you provide to an organization is writing code, then your job can be outsourced (i.e., worked on by cheaper labor).”
- Practice 6: Make Key Metrics Visible
Chapter 8
- Required Change factors: Leadership, a sense of urgency, and executive support
- Change enablers: persistence, training, continual wins, positive reinforcement of desired behaviors, communication, vision, and strategy.
How to enable scroll on a DIV?
For a while, I was trying to figure out how to make a div scroll. Thanks to Lissa for her tip on this exact topic. Now I can scroll in style.
