Angularjs Directive For Preventing Max And Min Values

I want to implement an AngularJS directive that prevents user from entering some values to an input. This directive has three attributes max, min and decimals. Max attribute defines the maximum value that could be entered to the input, min attribute defines the minimum value that could be entered to the input if it is negative and decimals is the number of decimal point that could be entered in the input. Min attribute has a special functionality, it prevents user only if it has negative values, since preventing positive min values are meaningless.

I could use the jquery or javascript functions that use the keyup, keydown events, or provide a watch on the value of input and decides whether to render a value. However, I decided to use the ngModel and ngModelController life-cycle to implement this functionality.

You could add your custom parsers to ngModelController, so you decide whether render a value or not. I have just add a custom function for that:

In this custom parse function, I have decided whether to display that value or not.

You can find the full source code and demo at my github page:

https://github.com/ozkangokturk/angular-prevent-max-min

Override TransformerFactory in Weblogic Application Servers

If you have a weird exception like this one while using Oracle Weblogic Application server, this is probably the default Services API of Weblogic is used. To overcome this problem, you could specify your TransformerFactoryImpl in the jvm parameters. If you have xalan*.jar in your classpath, you could provide a jvm parameter as follow:

Pycharm run python with root privileges

1) Create a new interpreter for Pycharm. Firstly create a file with the following contents. As it is seen as a comment, your user needs NOPASSWD enabed which is explained in the previous posts.

2) Open PyCharm, go to File->Settings->Project Interpreter->Add Local
pycharm1

3) Then select the file which is created in step 1, and add that interpreter to Pycharm. Now you have a python interpreter which has root privileges.

Create Oracle JDBC Driver as a Module in Wildfly

1. Create a folder under the Wildfly directory:
…/wildfly-8.2.0.Final/modules/system/layers/base/oracle/jdbc/main

2. Create a module.xml file in the directory which is created at step 1 and put the content below.

3. Go to the link http://www.oracle.com/technetwork/database/features/jdbc/jdbc-drivers-12c-download-1958347.html and download ojdbc7.jar and put the jar file in the directory which is created at step 1.

4. Go to administration menu of WildFly 8.2 (http://localhost:9990/console/App.html)

5. Navigate to Configuration->Connector->Datasources and then Add a datasource
datasource

6. Specify the name of the datasource and JNDI name which should be started with java:/

datasource1

7. Select the Oracle Database Driver as seen below:
datasource2

8. Specify the jdbc url, username and password information.
datasource3

9. Finally datasource is created and you have to enable the datasource. After that to check if the connection is valid or not, you could select the datasource in the same page, and then there is a Test Connection button in the connection tab.

Primefaces Column Toggler (Hide specified columns initially)

Primefaces column toggler component is a helper component of datatable to toggle the visibility of columns. On page load, column chooser finds all columns of datatable and generates the ui at the client side. If toggleable option of a column is set to false, these columns are ignored while generating the ui. However, in some cases if you need a datatable which has huge number of columns, you do not want to show them initially, but you want to give the flexibility to users that they can select the columns they want after initial page load.

From this requirement, I want to prepare an example which is based on the primefaces showcase application. (http://www.primefaces.org/showcase/ui/data/datatable/columnToggler.xhtml) All the backend codes (Car, CarService, CarBean) are the same. The tricky part is at the client side which is stated at the bottom.

ColumnToggler.prototype.render() function of Primefaces is overriden in a way that if columns has a styleClass “not-show-at-start” they will be hidden at the client side.

Can not ping name server in Ubuntu

In Ubuntu if you can not ping Host Name but can ping IP, you’re stuck on a broken MS network like this, reconfigure your linux multicast DNS to use a different domain like .alocal.

Solution:

1. Open the /etc/avahi/avahi-daemon.conf file

2. Add the domain-name=.alocal under the [server]. The default value is .local

3. Restart the daemon service