aillusions

10/23/10


New Dictionary Distribution Model

Now Dictionary versions are available via:

http://github.com/aillusions/Dictionary/downloads

First stable version is: Dictionary-0.3.2.zip

You can download last version, unzip it to any location and use without having to bother about tracking of new versions: now Dictionary can update itself.

Try to use Dictionary and enjoy its "open-source-ness" :-)

http://github.com/downloads/aillusions/Dictionary/Dictionary-0.3.2.zip

Take a look into WiKi too: http://github.com/aillusions/Dictionary/wiki

5/31/10


Top Dictionary news



Now small and smart.

Enjoy everybody:

http://fileshare.in.ua/3440430

1/11/10


Top Dictionary Release



Not trendy just handy.
You can download it from:

http://fileshare.in.ua/3104402
http://loadingbox.net/848
http://turbobit.od.ua/9essjwqzvydl.html
http://rapidshare.com/files/333387376/TopDictionary.zip.html

Required Java 1.5

4/15/09


Weblogic Message-Driven Beans

First attempt: one MDB

package com;

import javax.ejb.MessageDrivenBean;
import javax.jms.MessageListener;
import javax.jms.Message;
import weblogic.ejb.GenericMessageDrivenBean;
import weblogic.ejbgen.MessageDriven;


@MessageDriven(ejbName = "MyFirsMDB", destinationJndiName = "MyDefaultQueue", destinationType = "javax.jms.Queue")
public class MyFirsMDB extends GenericMessageDrivenBean implements
MessageDrivenBean, MessageListener {

private Long id = System.currentTimeMillis();

public void onMessage(Message msg) {
try {
Thread.sleep(1000);
System.out.println("->" + id.toString() + " :"+ msg.getStringProperty("msg"));
} catch (Exception e) {
e.printStackTrace();
}
}
}


->1239798602084 :My AA String Message.
->1239798602131 :My AA String Message.
->1239798602147 :My AA String Message.
->1239798602147 :My AA String Message.
->1239798602131 :My AA String Message.
->1239798602084 :My AA String Message.
->1239798602147 :My AA String Message.
->1239798602131 :My AA String Message.
->1239798602131 :My AA String Message.
->1239798602131 :My AA String Message.
->1239798602147 :My AA String Message.
->1239798602131 :My AA String Message.
->1239798602131 :My AA String Message.
->1239798602131 :My AA String Message.
->1239798602131 :My AA String Message.
->1239798602147 :My AA String Message.
->1239798602084 :My AA String Message.
->1239798602131 :My AA String Message.
->1239798602147 :My AA String Message.
->1239798602084 :My AA String Message.
->1239798602131 :My AA String Message.
->1239798602147 :My AA String Message.
->1239798602084 :My AA String Message.
->1239798602131 :My AA String Message.
->1239798795659 :My AA String Message.
->1239798602147 :My AA String Message.
->1239798602147 :My AA String Message.
->1239798795659 :My AA String Message.
->1239798602131 :My AA String Message.
->1239798602084 :My AA String Message.

Next attempt: two MDB on one Destination (queue)
Firs one:

package com;

import javax.ejb.MessageDrivenBean;
import javax.jms.MessageListener;
import javax.jms.Message;
import weblogic.ejb.GenericMessageDrivenBean;
import weblogic.ejbgen.MessageDriven;

@MessageDriven(ejbName = "MyFirsMDB", destinationJndiName = "MyDefaultQueue", destinationType = "javax.jms.Queue")
public class MyFirsMDB extends GenericMessageDrivenBean implements
MessageDrivenBean, MessageListener {

private String id = "A_" + new Long(System.currentTimeMillis()).toString();

public void onMessage(Message msg) {
try {
Thread.sleep(1000);
System.out.println(id +" : "+ msg.getStringProperty("msg"));
} catch (Exception e) {
e.printStackTrace();
}
}
}

Second one:

package com;

import javax.ejb.MessageDrivenBean;
import javax.jms.MessageListener;
import javax.jms.Message;
import weblogic.ejb.GenericMessageDrivenBean;
import weblogic.ejbgen.MessageDriven;

@MessageDriven(ejbName = "MySecondMDB", destinationJndiName = "MyDefaultQueue", destinationType = "javax.jms.Queue")
public class MySecondMDB extends GenericMessageDrivenBean implements
MessageDrivenBean, MessageListener {

private String id = "B_" + new Long(System.currentTimeMillis()).toString();

public void onMessage(Message msg) {
try {
Thread.sleep(1000);
System.out.println(id +" : "+ msg.getStringProperty("msg"));
} catch (Exception e) {
e.printStackTrace();
}
}
}


B_1239799361946 : My AA String Message.
B_1239799361946 : My AA String Message.
B_1239799366712 : My AA String Message.
B_1239799366993 : My AA String Message.
B_1239799367274 : My AA String Message.
B_1239799367274 : My AA String Message.
B_1239799366993 : My AA String Message.
B_1239799366712 : My AA String Message.
B_1239799361946 : My AA String Message.
B_1239799367274 : My AA String Message.
B_1239799366993 : My AA String Message.
B_1239799366712 : My AA String Message.
B_1239799367274 : My AA String Message.
B_1239799366712 : My AA String Message.
B_1239799367274 : My AA String Message.
B_1239799366712 : My AA String Message.
A_1239799377978 : My AA String Message.
A_1239799378290 : My AA String Message.
A_1239799378290 : My AA String Message.
A_1239799377978 : My AA String Message.
A_1239799383931 : My AA String Message.
A_1239799384197 : My AA String Message.
A_1239799378290 : My AA String Message.
A_1239799377978 : My AA String Message.
A_1239799377978 : My AA String Message.
A_1239799378290 : My AA String Message.
A_1239799377978 : My AA String Message.
A_1239799378290 : My AA String Message.
A_1239799377978 : My AA String Message.
A_1239799378290 : My AA String Message.
A_1239799377978 : My AA String Message.
A_1239799384197 : My AA String Message.
B_1239799366712 : My AA String Message.
B_1239799366712 : My AA String Message.
B_1239799367274 : My AA String Message.
B_1239799366712 : My AA String Message.
B_1239799367274 : My AA String Message.
B_1239799367274 : My AA String Message.
B_1239799367274 : My AA String Message.
B_1239799366712 : My AA String Message.
B_1239799366993 : My AA String Message.
B_1239799367274 : My AA String Message.
B_1239799361946 : My AA String Message.
B_1239799367274 : My AA String Message.
B_1239799361946 : My AA String Message.
B_1239799367274 : My AA String Message.
B_1239799366993 : My AA String Message.
B_1239799366993 : My AA String Message.
A_1239799384197 : My AA String Message.
A_1239799377978 : My AA String Message.
A_1239799378290 : My AA String Message.
A_1239799384197 : My AA String Message.
A_1239799377978 : My AA String Message.
A_1239799378290 : My AA String Message.
A_1239799384197 : My AA String Message.
A_1239799384197 : My AA String Message.
A_1239799378290 : My AA String Message.
A_1239799377978 : My AA String Message.
A_1239799383931 : My AA String Message.
A_1239799377978 : My AA String Message.

4/14/09


Point-to-Point Messaging Configuration


The point-to-point (PTP) messaging model enables one application to send a message to another. PTP messaging applications send and receive messages using named queues.

Weblogic JMS Queues

Receiving Messages Synchronously:

import javax.servlet.http.HttpSession;
import org.apache.beehive.netui.pageflow.PageFlowController;
import org.apache.beehive.netui.pageflow.annotations.Jpf;
import org.apache.beehive.netui.pageflow.Forward;
import org.apache.log.format.Formatter;
import org.apache.log.output.jms.TextMessageBuilder;

import javax.jms.*;
import javax.mail.search.MessageIDTerm;
import javax.naming.*;
import weblogic.jndi.*;
import javax.transaction.UserTransaction;
import weblogic.jms.extensions.*;


@Jpf.Controller(simpleActions = { @Jpf.SimpleAction(name = "begin", path = "index.jsp") })
public class Controller extends PageFlowController {

@Jpf.Action(forwards = { @Jpf.Forward(name = "success", path = "index.jsp") })
public Forward newAction1() throws NamingException, JMSException {

InitialContext ic = new InitialContext();
QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) ic.lookup("weblogic.jms.ConnectionFactory");

QueueConnection qc = queueConnectionFactory.createQueueConnection();
QueueSession qSession = qc.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);

Queue queue = (Queue) ic.lookup("MyDefaultQueue");

QueueReceiver qReceiver = qSession.createReceiver(queue);
qReceiver = qSession.createReceiver(queue);
//qReceiver.setMessageListener(this);

//QueueSender qSender = qSession.createSender(queue);
//Message msg = qSession.createMessage();
//msg.setStringProperty("msg", "My AA String Message.");
//qSender.send(msg);

qc.start();
System.out.println(qReceiver.receive().getStringProperty("msg"));
qc.close();

Forward forward = new Forward("success");
return forward;
}


@Override
protected void onCreate() {
}

@Override
protected void onDestroy(HttpSession session) {
}
}


--------------------------------------------------------

Receiving Messages Asynchronously:

import javax.servlet.http.HttpSession;
import org.apache.beehive.netui.pageflow.PageFlowController;
import org.apache.beehive.netui.pageflow.annotations.Jpf;
import org.apache.beehive.netui.pageflow.Forward;
import org.apache.log.format.Formatter;
import org.apache.log.output.jms.TextMessageBuilder;

import javax.jms.*;
import javax.mail.search.MessageIDTerm;
import javax.naming.*;
import weblogic.jndi.*;
import javax.transaction.UserTransaction;
import weblogic.jms.extensions.*;


@Jpf.Controller(simpleActions = { @Jpf.SimpleAction(name = "begin", path = "index.jsp") })
public class Controller extends PageFlowController implements javax.jms.MessageListener{

public void onMessage(Message message) {
try {
System.out.println("---------->> " + message.getStringProperty("msg"));
} catch (JMSException e) {
e.printStackTrace();
}
}

@Jpf.Action(forwards = { @Jpf.Forward(name = "success", path = "index.jsp") })
public Forward newAction1() throws NamingException, JMSException {

InitialContext ic = new InitialContext();
QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) ic.lookup("weblogic.jms.ConnectionFactory");

QueueConnection qc = queueConnectionFactory.createQueueConnection();
QueueSession qSession = qc.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);

Queue queue = (Queue) ic.lookup("MyDefaultQueue");

QueueReceiver qReceiver = qSession.createReceiver(queue);
qReceiver = qSession.createReceiver(queue);
qReceiver.setMessageListener(this);
qc.start();

QueueSender qSender = qSession.createSender(queue);
Message msg = qSession.createMessage();
msg.setStringProperty("msg", "My BB String Message.");
qSender.send(msg);

Forward forward = new Forward("success");
return forward;
}


@Override
protected void onCreate() {
}

@Override
protected void onDestroy(HttpSession session) {
}
}

9/5/08


ORACLE tips

FONT -- Lucida Console !!!
chcp 1251

RUSSIAN_CIS.CL8MSWIN1251
chcp 1251

для клиента виндовс NLS_LANG=AMERICAN_AMERICA.CL8MSWIN1251
для клиента линукс NLS_LANG=AMERICAN_AMERICA.CL8KOI8R

sqlplus sys/querty@xe AS SYSDBA

SELECT table_name FROM user_tables;

select to_char(to_date('19-SEP-2008','dd-mon-yyyy'),'day') from dual;
select user from dual;
select sysdate from dual;
select current_user from dual;

set ARRAYSIZE 1000;
set LINESIZE 1000;
set PAGESIZE 1000;


select level from dual connect by level < 10;
select level a from dual connect by 1 = 1;


ALTER SYSTEM SET TIMED_STATISTICS = TRUE;
ALTER SESSION SET SQL_TRACE = TRUE;

-- Created d:\oracle\product\10.2.0\admin\xe\udump\xe_ora_4916.trc

select test_connect_by.parent from persons inner join test_connect_by on persons.id = test_connect_by.child group by test_connect_by.parent;

select spid, osuser, s.program from v$process p, v$session s where p.addr=s.paddr order by 2;
alter system kill session(sid, serial#);

show parameters processes
show parameters sessions

alter system set sessions=250 scope=spfile;
alter system set processes=200 scope=spfile;

select count(*) from v$session
select count(*) from v$process

quit;

orakill xe 4072