27. sep. 2006

Fire onChange in Javascript programmatically

I want to fire onChange method on an object programmatically in Javascript.

FireFox and Internet Explorer handles this very differently.
If you for example sets the value on an object you might expect that the onChange method is fired, but sorry... no firering...

The solution is this in Javascript:
function newValueForObject {
var myObject = document.getElementById(nameOfObject);
myObject.value = 'a new value';

if (myObject.hasAttribute) { // Firefox
if(myObject.hasAttribute("onchange")){
myObject.onchange();
}
} else if (myObject.onchange) { // IE
var newEvt = document.createEventObject();
myObject.fireEvent("onchange", newEvt);
}
}

23. aug. 2006

WindowsDevCenter.com -- How to Remove Startup Programs

This article tells you how to remove Windows Startup programs.
Please help me speed up my Windows startup time!


For example look into:
%userprofile%\Start Menu\Programs\Startup
%allusersprofile%\Start Menu\Programs\Startup
Or in the registry:
HKLM\Software\Microsoft\Windows\CurrentVersion\Run
HKCU\Software\Microsoft\Windows\CurrentVersion\Run
HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce
HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnceEx
HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce
HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnceEx

16. jun. 2006

HOWTO: Pick an open source license

This article is about how to choose an open source license.
It can be boiled down to this decisiontree, but check the link to see examples.
How should I choose an open source license?

Do you want to release any control over how your code is used and distributed?
  • YES: Don't copyright it. Put it in the public domain, and you're done.

  • NO: Copyright the code (paste copyright notices all over it)

    Do you want to allow people to use your code in non open-source programs?
    • NO: Release your code under the GPL licence

    • YES: If somebody uses your code in their program and sells their program for money, do you want some of that money?
      • YES: Two choices:
        1. Don't release it as open source

        2. Dual license

      • NO: "Commercial friendly" license

        If somebody uses your code and improves it (fixes bugs or adds features) do you want to make them give you the improvements back so you can use them too?
        • YES: Use a "reciprocal" license.

        • NO: Use a "non-reciprocal" license.



See:
HOWTO: Pick an open source license (part 1) | Ed Burnette's Dev Connection | ZDNet.com
http://www.opensource.org/licenses

24. apr. 2006

Regular Expression Examples

When using regular expressions (a very brief description):
  • .* = (any character)
  • $ = end of line
  • ^ = start of line
  • \1 first group in replacement.
Example:
Text: Hello my friend
Search for: (.*) my (.*)
Replace with: \2 is \1
Result: friend is hello

    18. apr. 2006

    Javascript: Show all properties for an object

    I would like to see all the properties of a given object.

    OK - Here you go:
         function popUpProperties(inobj) {
    op = window.open();
    op.document.open('text/plain');
    for (objprop in inobj) {
    op.document.write(objprop + ' => ' + inobj[objprop] + '\n');
    }
    op.document.close();
    }
    Ex.:
    popUpProperties(document.forms[0]);

    Nice...

    Agile Testing: Should acceptance tests be included in the continuous build process?

    The article discusses what kind of test that's needed in a project, and what the differences are between the different kind of tests.


    Here's some hightlights:

    Unit tests run fast. If they don't run fast, they aren't unit tests.


    Other kinds of tests often masquerade as unit tests. A test is not a unit test if:
    • It talks to a database.
    • It communicates across a network.
    • It touches the file system.
    • You have to do special things to your environment (such as editing configuration files) to run it.
    Read the complete article.

    Secure your SOA

    Enterprise-grade SOAs require a plan for addressing diverse security needs


    Summary
    This article is part of a series of short articles that introduce readers to the industry's various Web services standards. These articles provide a quick introduction to these standards, their backgrounds, underlying architectures, benefits, status, and industry adoption. As some of the content may be a depiction of the authors' viewpoints, readers are encouraged to refer to the links provided in Resources to gain a deeper understanding of a particular standard. This article focuses on the XML and Web services security standards that influence a service-oriented architecture. (3,200 words; April 10, 2006)"

    5. apr. 2006

    Wireless Cracking Tools - IT Observer

    Wireless Cracking Tools - IT Observer
    By Bradley Morgan
    Wednesday, 29 March 2006 10:44 EST

    By familiarizing yourself with following software, you will not only have a better understanding of the vulnerabilities inherent in 802.11 networks, but you will also get a glimpse at how a hacker might exploit them. These tools can even be used when auditing your own network as we will see later.

    Another list of wardriving tools

    (For a detailed description - click the link)

    25. jan. 2006

    The Joel Test: 12 Steps to Better Code - Joel on Software

    The quick way to check how good a software team is.

    The Joel Test
    1. Do you use source control?
    2. Can you make a build in one step?
    3. Do you make daily builds?
    4. Do you have a bug database?
    5. Do you fix bugs before writing new code?
    6. Do you have an up-to-date schedule?
    7. Do you have a spec?
    8. Do programmers have quiet working conditions?
    9. Do you use the best tools money can buy?
    10. Do you have testers?
    11. Do new candidates write code during their interview?
    12. Do you do hallway usability testing?
    For every yes you get a point.
    12 points: Perfect!
    11 points: Tolerable...
    10 points or lower: Get startet!!!

    Joel has a good description to every item, so check it out.

    Ajax: A New Approach to Web Applications

    This article gives you a brief introduction on how-to use AJAX.

    The author (Eric Pascarello) has kindly zipped the example:
    http://radio.javaranch.com/pascarello/files/BasicAjaxExample.zip

    Of course a good place to start is by this book:
    Ajax in Action
    See two sample chapters: http://www.manning.com/books/crane/chapters

    2. nov. 2005

    Set classpath the smart way

    Original: http://mindprod.com/jgloss/classpath.html

    Isn't it annoying you have to specify all the jar files needed to run a javaprogram?


    Nomally you would make a:
      SET CLASSPATH=jar1.jar;jar2.jar;jar3.jar...


    But in stead you can simply specify the directory where you have all your jar files:
      javac.exe -Djava.ext.dirs=usualextdir;anotherdir... 

    and
      java.exe -Djava.ext.dirs=usualextdir;anotherdir...


    See the original page for more tips.

    13. okt. 2005

    Diagnostic Tests with Ant

    Diagnostic Tests with Ant

    Suppose you have developed your Java application and distributed it to your users. If all goes well, the application just works on every computer. But if there's a problem, you have to begin troubleshooting. Users will call for all sorts of installation problems, expecting you to fix them. Moreover, the same problems will often come back: the wrong version of Java, a deleted file, too-restrictive file permissions, etc. Most of these problems can be solved by creating a checklist. However, instead of wasting time asking new users the same questions on the checklist over and over, you can create a diagnostic test that goes through the checklist, providing users with the information they need to solve the problem. If users can't solve the problem themselves, they can show you a clear checklist, so you can take a look at what's going wrong without asking a bunch of questions first.

    What problems can users expect? First, things can already go wrong during the installation process if the user doesn't follow the installation instructions accurately. Even if the installation succeeds, problems can appear later. Changes in configuration (like the JAVA_HOME environment variable) or changes in the directory structure can indeed break things. In this article, we will develop an Ant script to run diagnostic tests for a Java application. We will look at a list of possible problems and how to deal with them. For our approach to work, Ant has to be installed on the user's machine. This may mean that your installer will have to provide Ant.

    The article gets you through all kinds of environmenttest:

    • Write out a checklist of the systemenvironment

    • Check nessesary folders and required classes

    • Task for checking minimum JDK-version

    • MD5-checksum for configurationfiles and classes

    • Restore original configuration

    11. aug. 2005

    The VoipBuster! Free phone to 24 countries in Europe

    Download the beta version of The VoipBuster!, and get free phone calls all around the world.



    (You must pay 1 Euro for unlimited call
    s)

    18. maj 2005

    How to free up Windows XP system resources

    How to free up Windows XP system resources
    Situation:
    You are having performance problems or conflicts on a Windows XP computer. You want to know what programs or services you can safely stop from loading when you start Windows.
    Symantec gives here a list of recommondations.

    17. maj 2005

    A neural network for Java Lego robots

    A neural network for Java Lego robots
    Learn to program intelligent Lego Mindstorms robots with Java
    The Lego Mindstorms Robotics Invention System lets you design and program real robots that do what you want them to. By using artificial neural networks, you can build intelligent robots that can learn and show emergent behavior. This article describes the backpropagation algorithm, a basic neural network, and its implementation on a Lego Roverbot with Java.

    Developers can build intelligent robots with Java, as it provides APIs for programming systems that can see, hear, speak, move, and even learn, using neural networks, which are algorithms that mimic our brain.

    This article shows how to develop a robot that can learn by using the backpropagation algorithm, a basic neural network, and implementing it on a Lego Roverbot. Using both the algorithm and Java, the Roverbot?a Lego robot vehicle?can learn some basic rules for moving forward, backward, left, and right.

    In this article, we use the Lego Mindstorms Robotics Invention System 2.0 for building the Lego robot; leJOS 2.1.0, a little Java operating system for downloading and running Java programs inside the Roverbot; and J2SE for compiling the Java programs under leJOS.

    18. apr. 2005

    Automatically implement design guidelines in your code.
    Add Hammurapi, a design-compliance solution, to your toolbox

    Design guidelines represent mere intent; for success however, implementing these guidelines is essential. The traditional way of implementing them is via code reviews. Hammurapi, a design-compliance tool, provides an automated and consistent way of implementing design guidelines, thereby making design reviews effective and painless. In this tutorial, author Sidharth Sankar introduces Hammurapi, compares it with similar tools, and gives a quick peek under the hood to illustrate how it works.

    3. feb. 2005

    Java Platform Migration Guide from 1.3 to 5.0

    http://java.sun.com/j2se/JM_White_Paper_R6A.pdf

    This guide helps developers migrate Java applets, standalone applications, Java Web Start applications, and development tools from version 1.3 of the Java platform to version 5.0.
    While many 1.3 applications run without change, compatibility issues do exist, as described in this guide. The first three sections cover issues that are of interest to all application developers. The fourth section covers issues that are primarily of interest to platform implementers and tool developers.

    19. jan. 2005

    WindowsDevCenter.com: Disk Cleanup Hacks

    WindowsDevCenter.com: Disk Cleanup Hacks.

    This article gives you an idea how to clean up your harddisk reguarly via creating a cleanupset.
    cleanmgr /sageset:1

    And then create a scheduled task with:
    cleanmgr /sagerun:1