And it's not only that, timer events, and others are really tricky to debug, and you would generally just want to trace expressions, preferrably without changing the underlying code.
How can you then create trace calls, to see various variable states?
Well it's relatively simple, we will add tracer breakpoints:
First we will simple evaluate the previous function in the web console of your favourite browser.
Now we can simply add a conditional breakpoint, with a condition such as:
Since the breakpoint is evaluated in the context of the current stack, variables such as node will be accessible, if they are present in the code.
Also, since the function always returns false, the debugger won't stop there, thus no blur/focus events will be triggered.
If you also need a conditional breakpoint exactly at the line where the log is you can use as expression something along these lines:
Thus the log will take place, and since it's false, it will fallback in evaluating the actual value that you want the debugger to stop.
Have fun debugging.
Whenever you want to add a custom style to your's site CSS, I generally see the general "solution" to add the CSS to the template itself, eventually add some extra custom PHP inside your template from the templates folder. I dislike this solution, because then you need to remember that your template is actually tainted, and you can't just install the template and your CSS, you again need to fiddle with its internals.
Obviously it can be seen that I can add multiple custom CSSes, but generally I preffer only one. Since the node is appended to the head later that the head element that was outputted by Joomla, I also get my custom CSS last, which helps when it comes to CSS rules priorities, since the last rule wins for the same selector precision.
I hope it helps, and have fun designing your Joomla site.
I remember once when we needed to deploy an application to a customer on two nodes using its RedHat Enterprise Linux, using JBoss 5.
Because Java - compile once, run anywhere, right?
The customer comes back at us telling that our application deploys fine on one node, doesn't start on the other node - some really random runtime error deep inside JBoss.
"What the hell!" moment.
Obviously an environment difference, but which one?
Ok, can we get SSH access to investigate?
Ok, we start ping-pong-ing emails with commands to give on the command line. Let's get the environment:
Same RHEL version.
Same exact version.
Working node: OpenJDK. Failing node: GCJ.
I'm baffled. Does the GCJ project still exists? Is anyone else beside Stallman still using it? Why is it installed?
I check their website thriving with news activity:
September 22, 2009
GCJ support on Windows (Cygwin and MinGW) targets has been enhanced with a number of bugfixes, and the option to build libgcj in DLL form for dynamic runtime linking.
Well, isn't that swell? Three years of nothing. Amazing.
I contact their admins and tell them to switch the failing node to OpenJDK.
What's wrong with this Java? they ask. Because it's in the repository, as java-gcj-compat.
A single tear rolls down my face, while I start typing a document explaining why GCJ is not really Java-Java, and how to upgrade it.
It was a bad day overall that day.
I think everyone needs from time to time this hashing method when it gets to work with user databases, for maintenance purposes.
As one who migrated from mysql to postgres - (actually I'm still dual using them) I was surprised to see this very useful function doesn't exist.
Don't worry, it's easy to add it.
On the terminal we first need to add the cryptographic libraries for postgres. The easiest way is to add the postgresql contrib, that contains a lot of goodies, and, of course, our crypto libraries. Also it is in the repository already.
The next step would be exporting the cryptographic methods (except sha1 unfortunatelly) into the template from where each newly created database is derived:
(in case you already have existing databases where you would need these functions, just change template1 to the corresponding database name, e.g.:
Now we need to create our sha1 method (I've used the pgadmin3 tool in order to do that, but you can still use the psql approach for that).
As you can see the actual work is done by the more generic "DIGEST" method - which unfortunatelly returns a bytea, and converted to a string by the "ENCODE" method.
If you want this method to be in every new table from now on, you could put it in some file (let's say sha1.sql) and run it against the template1.
After that, a simple
should return as expected:
Hoping it helps, I'll end here.
After reading Struts 2 in Action (a definite read for people who have no experience at all using struts 2), and after finishing a project and actually delivering it to the customer, and in the middle of the second one, I've decided to write down the best practices that I follow.
The reason why i'm writing this is that I couldn't find real case examples of good patterns to follow in developing a struts2 application, even the best practices from that book are quite slim, and I'm not going to reiterate them here.
A "full" action implementation would be along these lines, so it is imediatelly clear what it does, what validations does it require, and is trivial to test:
That would be it. As usual, I'm extremely interested in your feedback.
Have fun programming with struts 2.
The one to rule them all. The browsers that is.
SharpKnight is an Android chess game.
MagicGroup is an eclipse plugin.