Friday, 9 August 2013

Setting up postgresql server connection with pgadmin3 fails with Exception

Setting up postgresql server connection with pgadmin3 fails with Exception

I have installed postgresql database on Fedora 17.
When I create a new server connection through pgadmin3, I get this Error
in a popup window:
postgresql The server doesn't accept the current user: The server report
Ident authentication failed
The server doesn't accept the current user: The server reports
FATAL: Ident authentication failed for user "pgadmin"
If this message appears, the pg_hba.conf entry found for your
client / user / database combination is set to "ident" authentication.
Some distributions, e.g. Debian, have this by default. To perform ident
based authentication successfully, you need additional setup; see the
PostgreSQL help for this. For a beginner, it might be more appropriate
to use a different authentication method; MD5 encrypted passwords are
a good choice, which can be configured by an entry in pg_hba.conf like
this:
host all all 192.168.0.0/24 md5
This example grants MD5 encrypted password access to all databases to
all users on the private network 192.168.0.0/24.
You can use the pg_hba.conf editor that is built into pgAdmin III to
edit the pg_hba.conf configuration file. After changing pg_hba.conf,
you need to trigger a server configuration reload using pg_ctl or by
stopping and restarting the server process.
I have made the change mentioned in the error message, I added host all
all 192.168.0.0/24 md5 to the pg_hba.conf. But I still get the same error.
What am I doing wrong?

multiselect box will not populate without alert

multiselect box will not populate without alert

I can't post all my code but I try to get the important pieces in here.
The problem I have is that I populate a multiselect box from the database
then I get the already selected items and add those to the selected
attribute. This all works in IE 7 which is what my testers are using,
unfortunately I'm on IE 9 and most of my users are on IE 9. This code
doesn't work on IE 9 or on firefox. The very weird thing is it will work
if I stick an alert just after the call to the function that populates the
multiselect.
after getting the selected values from the database through an ajax call I
use
var oldValues.push($(this).find("Value_ID).text());
I do an alert of oldValues they are there 31,32,45 then I use
$("drop2-input").val(oldValues);
If I put an alert after this line it works.
I have spent the majority of the day checking every line of code there are
no missing semicolons, no curly brackets out of place, and no parentheses
out of place. Does anyone know of a way to make this work. Oh I already
tried using a timeout to pause the code that just stoped the rest of the
page from loading.

How to get extra vertical space before group in pgfgantt?

How to get extra vertical space before group in pgfgantt?

Using the pgfgantt package, one can uniformly set vertical spacing using
the y unit chart key. However, i would like to add extra vertical space
before certain groups, but the package does not seem to provide for this.
Is this possible? How?

Getting java.lang.NoClassDefFoundError: org/apache/xerces/dom/ElementNSImpl with Apache ODF Toolkit

Getting java.lang.NoClassDefFoundError:
org/apache/xerces/dom/ElementNSImpl with Apache ODF Toolkit

I am trying to read an ods file using Apache ODF Toolkit. I am getting
java.lang.NoClassDefFoundError error while while trying to load the
Spreadsheet using below code-
SpreadsheetDocument data = SpreadsheetDocument.loadDocument(file);
Below is the error trace-
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/xerces/dom/ElementNSImpl
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at test.read.ODSFile.ReadODS.main(ReadODS.java:33)
Caused by: java.lang.ClassNotFoundException:
org.apache.xerces.dom.ElementNSImpl
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 25 more
Below is the project structure, which shows the classpath-
Is there any dependencies missing?

Designing many to many relationship between three entities

Designing many to many relationship between three entities

I'm having trouble modelling this situation. I'm designing a
location-based coupon system. A user can define zones and offers and then
associate each offer to multiple zones. Also each zone can have more than
one offer. So zone and offer have a many to many relationship. The user
entity owns both entities. A zone and an offer can only be associated if
the same user owns both of them. A diagram can be very helpful. Thanks.

Html tags hidden attributes

Html tags hidden attributes

I have a problem that all people have when they do html on different
browsers. It doesn't render as expected in all browsers.
I notice that it will render the same in all browsers if you specified
some of the attributes. Some browsers adjust attributes of the elements,
but other don't. So, my question is
Is there any tool that will give you all element attributes, which I don't
specified in css ? This way, I won't depend on browser render algorithms I
will just see in what browsers in best render and copy attributes in css
:) Thx in advance

Thursday, 8 August 2013

Decimal limit jQuery

Decimal limit jQuery

Anyone know how I can get the following to limit the decimals to 2 places?
There's also a problem that it displays NaN when there are no values in
the two fields (I'd rather it just show nothing). Can anyone help fix
these problems?
HTML
<td class="grade">
<input type="text" value="28" class="numerator" /> / <input
type="text" value="30" class="denominator" />
<div class="result"></div>
</td>
jQuery
function update($ele) {
var n = Number($ele.find('.numerator')[0].value);
var d = Number($ele.find('.denominator')[0].value);
$ele.find('.result').text(n / d * 100);
}
$('.grade').each(function() {
update($(this));
});
$('.grade input').on('keyup', function() {
update($(this).closest('.grade'));
});