Difference between build and deploy?

Disclaimer: Defining what build and deploy means is very subjective.


I will start with deploy. Deploy should mean take all of my artifacts and either copy them to a server, or execute them on a server. It should truly be a simple process.

Build means,process all of my code/artifacts and prepare them for deploment. Meaning compile, generate code, package, etc.

That help? Some people do consider deploy as part of the “build process” which I don’t really argue with because generally in order to test or run you have to deploy it somewhere


The rule is generally if it is dynamic code, then you need to do a build/redeploy.

If you are just editing static html, css, images etc.then you can simply just patch (and preferably a server restart).


As always when “patching” there is added risk that you could not be deploying the entire code base, or someone could do it wrong.

Personally I like doing full build/redeploys because you always know you are in-sync with your source control. However there is always risk that deployments go bad, either the build part or the install part. If your builds take a long time, or you are unnecessarily having to deploy a lot of moving parts, then consider either breaking them down into smaller deployable components or create a more complete deployment plan.

As usual there is no silver bullet here.

http://stackoverflow.com/questions/6427679/difference-between-build-and-deploy

EJB Timer when redepolyed in a cluster environement of Websphere Application Server

EJB timers are not removed when the application is removed. Some options:

  1. Use the WAS_HOME/bin/cancelEJBTimers command to remove them
  2. Add startup logic to your application to cancel/recreate timers as needed.
  3. Use automatic timers (@Schedule) in 8.0+. In this case, the server automatically creates the timer when the application is first started, and it will attempt to remove them when the application is uninstalled. See the InfoCenter for more information:

http://stackoverflow.com/questions/20217355/ejb-timer-when-redepolyed-in-a-cluster-environement-of-websphere-application-ser

Is there a way to configure the directory SQL Developer uses to save SQL scripts?

When you go to save your sql file you can change where the save defaults to. Change it in Tools>Preferences>Database>Worksheet Parameters. You can browse to a new location under “Select default path to look for scripts”

Can also change the Export Data so that it defaults to somewhere else. Go to Tools>Preferences>Database>Export and Browse to the location you want to export to for “Directory”

This used to annoy me bad before I changed it. Now all my saves and exports default to a folder I actually use.

http://superuser.com/questions/397523/is-there-a-way-to-configure-the-directory-sql-developer-uses-to-save-sql-scripts

Knockout observable field not updating on input value change

By default knockout updates the value of the observables on the change event (e.g when the focus of the textbox is lost).

If you want instant update you need to specify the valueUpdate option where the possible events are: keyup, keypress, afterkeydown see more info in the documentation.

So change your value binding:

<input type="text" data-bind="value: Name, valueUpdate: 'afterkeydown'"></input>

Demo JSFiddle.

http://stackoverflow.com/questions/14545935/knockout-observable-field-not-updating-on-input-value-change

Opening the Internet Explorer Developer Tools Dialog on Modal Windows

As you may have noticed, Internet Explorer’s Developer Tools window (press F12 to get there) cannot be opened for modal windows.  Here’s a quick workaround:

  1. Open Internet Explorer
  2. Click the “Tools” gear (Alt+X)
  3. Select “Internet options”
  4. Select the “Security” tab
  5. Click the “Custom level…” button
  6. Disable the “Allow websites to open windows without address or status bars” option
  7. Hit OK
  8. Hit OK
  9. Now find a modal window and press F12

http://blogs.msdn.com/b/kurlak/archive/2012/08/27/opening-the-internet-explorer-developer-tools-dialog-on-modal-windows.aspx

Polymorphism vs Overriding vs Overloading

The clearest way to express polymorphism is via an abstract base class (or interface)

public abstract class Human{
   ...
   public abstract void goPee();
}

This class is abstract because the goPee() method is not definable for Humans. It is only definable for the subclasses Male and Female. Also, Human is an abstract concept — You cannot create a human that is neither Male nor Female. It’s got to be one or the other.

So we defer the implementation by using the abstract class.

public class Male extends Human{
...
    @Override
    public void goPee(){
        System.out.println("Stand Up");
    }
}

and

public class Female extends Human{
...
    @Override
    public void goPee(){
        System.out.println("Sit Down");
    }
}

Now we can tell an entire room full of Humans to go pee.

public static void main(String args){
    ArrayList<Human> group = new ArrayList<Human>();
    group.add(new Male());
    group.add(new Female());
    // ... add more...

    // tell the class to take a pee break
    for (Human person : group) person.goPee();
}

Running this would yield:

Stand Up
Sit Down
...

http://stackoverflow.com/questions/154577/polymorphism-vs-overriding-vs-overloading

How to sort HashMap based on Date?

Use a TreeMap instead of HashMap. As Date already implements Comparable, it will be sorted automatically on insertion.

Map<Date, ArrayList> m = new TreeMap<Date, ArrayList>();

Alternatively, if you have an existing HashMap and want to create a TreeMap based on it, pass it to the constructor:

Map<Date, ArrayList> sortedMap = new TreeMap<Date, ArrayList>(m);

See also:

http://stackoverflow.com/questions/8298290/how-to-sort-hashmap-based-on-date