Netbeans is really becoming "the only IDE you need", with an amazing PHP support, try it:
http://www.netbeans.org/downloads/
Don't Eclipse the Sun: Netbeans is easier to use and powerfull.
Tuesday, June 30, 2009
Netbeans 6.7 Released!
Posted by
rastrano
at
1:09 AM
0
comments
Labels: java ide, opensource, php editor, php ide, rails ide, ruby ide
Friday, June 26, 2009
Hibernate Search and Class Inheritance Mapping - HowTo
Today tutorial is on two arguments: Implementing Class Inheritance Mapping with Hibernate and applying Hibernate Search Indexing on it.
Prefaction:
The Class Inheritance Strategy selected is Joined Sublcass and the dbms used for the demo is mysql (yes, inheritance in mysql is possible thanks to hibernate obviously! :P)
1) Database Structure:CREATE TABLE `NetworkAsset` (
`dbId` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
`inventoryNo` varchar,
`macAddress` varchar,
`vendor` varchar,
`model` varchar
)
CREATE TABLE `PresonalComputer` (
`employee` varchar,
`operativeSystem` varchar,
`ipAddress` varchar
`dbId` int NOT NULL PRIMARY KEY
CONSTRAINT `PCInheritanceLaze` FOREIGN KEY (`dbId`) REFERENCES `NetworkAsset` (`dbId`)
(Note: this way is the best way to implement a joined-subclass constraint on a DBMS that
doesn't supports native inheritance)
)
CREATE TABLE `Switch` (
`portCount` int NOT NULL,
`managmentIpAddress` varchar NOT NULL,
`LanDescription` varchar NULL,
`dbId` int NOT NULL PRIMARY KEY,
CONSTRAINT `SWInheritanceLaze` FOREIGN KEY (`dbId`) REFERENCES `NetworkAsset` (`dbId`)
)
2) Hibernate CTI Mapping POJOs (with Annotations)
Note: the used annotations import is:
import javax.persistence.*
@Entity
@Table(name="NetworkAsset"
,catalog="CreativeProgrammingDemoDB"
)
@Inheritance(strategy=InheritanceType.JOINED)
public class NetworkAsset implements java.io.Serializable {
private int dbId;
private String inventoryNo
...other filelds...
@Id
@Column(name="db_id", unique=true, nullable=false)
@GeneratedValue
public int getDbId() {
return this.dbId;
}
public void setDbId(int dbId) {
this.dbId = dbId;
}
...other getter and setters...
}
@Entity
@Table(name="PersonalComputer"
,catalog="CreativeProgrammingDemoDB"
)
public class PersonalComputer extends NetworkAsset {
//private int dbId; Note: don't add the id field in subclass POJO: it's inherited!
private String ipAddress;
private String employee;
...other filelds...
@Id
@Column(name="employee", unique=true, nullable=false)
public int getEmployee() {
return this.dbId;
}
public void setEmployee(String employee) {
this.employee = employee;
}
...other getter and setters...
}
That's all for mapping joined sublass inheritance with annotations...
isn't easy? :)
3) Hibernate Search
Posted by
rastrano
at
7:06 AM
0
comments
Labels: class table inheritanche, dbms inheritance, ereditarieta mysql, hibernate, hibernate search inheritance, table inheritance mapping hibernate
Friday, June 12, 2009
Java Browser API
I found this interesting web browser enterly written in java:
http://lobobrowser.org/
it is GPL, supports HTML 4,CSS2, JavaFX and Javascript* (with AJAX support)
http://lobobrowser.org/browser/api-info.jsp
*Javascript support is limited, for instance some dojo and extjs apps doesn't works with the browser..
Posted by
rastrano
at
4:53 AM
0
comments
Labels: 2.0 html parser, ajax browser api, css bot, java browser, java browser api, javascrip enabled, javascript bot, javascript enabled browser, library
Wednesday, June 10, 2009
Redmine - project managment and bug tracking made simple
Looking for an open source project managment tool?
Redmine is an evolved an easy to use multi-project managment environment
Looking for enterprise collaborative teaming tool with activity reports?
Redmine does it, and integrates LDAP for authentication.
Looking for an integrated svn or mercurial extention more simple and powerfull than trac?
Redimine manages repository in an awesome way, for instance the following svn commit:
svn commit -m "this patch closes #245"
closes the ticket and relates the diffs to the ticket history.
Your system support team has planned to kill you at your next request?
Redmine is entireley configurable by his web interface: no system support effort is required after installation.
Installation is a "next request" and you want to live enough see redmine working?
download the cross-platform bundled installer
(provided by bitnami.org - Open Soruce. Simplified. )
Issues with subversion repository LDAP authentication?
I'm going to write an how to on this. stay tuned!
Posted by
rastrano
at
3:10 AM
0
comments
Labels: bug tracking, gantt, issue tracker, ldap, mercurial, mercurial web interface, open source project managment, open source teaming, subversion, svn, svn web interface, teaming, trac alternative
Wednesday, June 3, 2009
javascript is evolving!
Posted by
rastrano
at
12:22 PM
0
comments
Thursday, October 16, 2008
Save the forest: don't destroy() dijit.Trees!
Some messages in various ajax forums ask for a solution to reload the whole content of a dojo tree with a dynamic item store.
No one has proposed a good response:
Someone said: destroy the tree and re-make it! Sure.. but what will happen to my dojo connects on the tree nodes? and the dojo tree status (opened folders ecc.)? a bloodshed! no one of my connected widgets will survive after this brutal operation..
Some other said: use a ContentPane to embed the tree and reload its href: Fantastic.. ^_^ This is the same to destroy and recreate the tree but with an extra overhead due to the contentPane.
Some other other said: Use my customized reload() function.. good.! i'm just sorry to see that non one of these solutions works..
Some infidels said: This is not possible.
I say: you can save a dijit.Tree.. don't cut it: prune it! and it'll re-grow wonderfully
This is my reload function that works:
dojo.extend(dijit.Tree, {
refresh: function(){
var root=this._getRootOrFirstNode();
while((node=this._getNextNode(root))!=null){
var parent = node.getParent();
if(parent){
parent.removeChild(node);
}
node.destroyRecursive();
}
this._itemNodeMap={};
this.store._loadFinished = false;
this.store.fetch();
this._store2model();
this._load();
var parent = root.getParent();
if(parent){
parent.removeChild(root);
}
root.destroyRecursive();
}
});
that you can simply use in this way:
dijit.byId('mytree').refresh();
good dojing to all!
Bye.
Posted by
rastrano
at
4:28 AM
2
comments
Labels: ajax, ajax store, dojo 1.1.1, dojo 1.1.2, how to dynamically update a dijit tree, how to update dojo tree, ItemFileReadStore, javascript, refresh dojo tree, refreshing tree content, web 2.0
Thursday, August 21, 2008
How to lookup SNMP Textual-Conventions in Perl (Net-SNMP)
For the series: Demystifing SNMP
if you need to programmatically convert a value of a varbind that is defined in the mib file with a textual-convention here you can find a perl code that works:
use SNMP; #pay attention this isn't Net::SNMP!!
&SNMP::addMibDirs("/yourpathtomibfiles/mibs");
$SNMP::save_descriptions=1;
&SNMP::initMib();
&SNMP::loadModules('ALL');
...
...
my $obj = $SNMP::MIB{$the_varbind_oid};
$TextConvention_To_IntegerValue_HashTable = $obj->{enum};
#now enjoy with this hash table and your integer value
For example ifAdminStatus is an INTEGER, but this integer means:
(1)->up
(2)->down
whit TextConvention_To_IntegerValue_HashTable hash table you can lookup numbers to associated string values..
but attention: you need to invert keys and values in the hash table.
here is it one example that shows how hard is to manually parse mib files:
jnxCmCfgChgEventSource OBJECT-TYPE
SYNTAX JnxCmCfChgSource
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The source of the configuration event."
::= { jnxCmCfgChgEventEntry 4 }
JnxCmCfChgSource ::= TEXTUAL-CONVENTION
STATUS current
DESCRIPTION "Identifies the source of config event."
SYNTAX INTEGER {
other (1),
cli (2),
junoscript (3),
synchronize (4),
snmp (5),
button (6),
autoinstall (7),
unknown (8)
}
Net-SNMP rocks!
Posted by
rastrano
at
8:59 AM
0
comments
Labels: mib, mib file, mib parsing, net-snmp, perl, snmp, textual-convention

