skip to main | skip to sidebar

worknotes

Wednesday, November 28, 2012

oracle - password life time


SQL> connect system/***
ERROR:
ORA-28002: the password will expire within 7 days

???
----------
SQL> select profile from dba_users where username='SYSTEM';

PROFILE
------------------------------
DEFAULT

SQL> select resource_name, limit from dba_profiles where profile = 'DEFAULT';

RESOURCE_NAME                    LIMIT
-------------------------------- ----------------------------------------
...
PASSWORD_LIFE_TIME               180
...

16 rows selected.

SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
Posted by Childish at 5:18 AM 1 comment:

Sunday, November 25, 2012

Dr Dobb's http://www.bullhornreach.com/sites/HireMinds/article/view/44691?referer=www.linkedin.com&shortlink=1490340

http://www.bullhornreach.com/sites/HireMinds/article/view/44691?referer=www.linkedin.com&shortlink=1490340
Posted by Childish at 1:23 PM No comments:

Friday, November 23, 2012

cloudflare

http://www.cloudflare.com/
Posted by Childish at 8:46 AM No comments:

Wednesday, November 14, 2012

JVM thread dump

creating a thread dump of JVM
when the application is running in the console:
Control + Break in the console

http://www.webnms.com/webnms/help/developer_guide/troubleshooting_tips/creating_threaddump.html
Posted by Childish at 8:05 AM No comments:

Monday, November 12, 2012

UAC on Windows7

problem:
when starting an application - the UAC are used; when starting a service is run under LocalSystem;
so, when the application is started as a service, then it does not see the mapped devices of the user

some links

http://technet.microsoft.com/en-us/library/cc709691%28v=ws.10%29.aspx#BKMK_S2
http://stackoverflow.com/questions/182750/how-to-map-a-network-drive-to-be-used-by-a-service
http://msdn.microsoft.com/en-us/library/windows/desktop/ms684272%28v=vs.85%29.aspx


http://testdrive.mapinfo.com/TECHSUPP/MIPROD.NSF/59d125f456480edb852562b5004f2c33/57b881cce9518053852577450048dee1?OpenDocument

http://technet.microsoft.com/en-us/library/ee844140(v=ws.10).aspx

http://www.codeproject.com/Articles/18367/Launch-your-application-in-Vista-under-the-local-s
Posted by Childish at 12:20 AM No comments:

Tuesday, November 6, 2012

semaphores

to have a look later

http://javapapers.com/core-java/semaphores-using-java/

http://www.javacodegeeks.com/2011/09/java-concurrency-tutorial-semaphores.html

what I am going to use
is
java.util.concurrent.locks.Lock

with tryLock() and lock()
Posted by Childish at 5:04 AM No comments:

Tuesday, July 24, 2012

java - copy directory


surprisingly copy file in Java <7 copies a file, not a directory

    // Copies all files under srcDir to dstDir.
    // If dstDir does not exist, it will be created.
    public void copyDirectory(File srcDir, File dstDir)
        throws IOException
    {
        if (srcDir.isDirectory())
        {
            if (!dstDir.exists())
            {
                dstDir.mkdir();
            }

            String[] children = srcDir.list();
            for (int i = 0; i < children.length; i++)
            {
                copyDirectory(new File(srcDir, children[i]), new File(dstDir, children[i]));
            }
        }
        else
        {
            // This method is implemented in Copying a File
            // copyFile(srcDir, dstDir);
        }
    }

Posted by Childish at 3:56 AM No comments:

java - Arrays.asList returns not modifiable AbstractList


Arrays.asList: Returns a fixed-size list backed by the specified array.
so, when calling add() or remove() to the result of Arrays.asList - java.lang.UnsupportedOperationException is thrown


to convert an array to a modifiable List use:
T[] data;

List<T> list = new LinkedList<T>(Arrays.asList(data));
Posted by Childish at 12:46 AM No comments:

Thursday, April 19, 2012

Solr

http://lucene.apache.org/solr/
Posted by Childish at 9:39 PM No comments:

Thursday, April 5, 2012

unit tests

ant+junit

https://docs.google.com/viewer?a=v&q=cache:O-kAlII3y2gJ:java.sun.com/developer/Books/javaprogramming/ant/ant_chap04.pdf+&hl=bg&gl=bg&pid=bl&srcid=ADGEESigWanupUAOJYWZ3l11DpR1AW7WjHtNflblUSANKOswbUDXHwRVeYPhRETSNbj-rFa9MWrwWNFOc-gqDZORxobDPvLi3rq33UVRQ-VUn_8Z2_Df8FWRwdgYth1W6l1g9rLg0H7f&sig=AHIEtbTXt04xfhTM9yNep09IqsY_1YGl-Q&pli=1
Posted by Childish at 6:41 AM No comments:

concurrency utils

edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean
Posted by Childish at 5:27 AM No comments:

Wednesday, March 21, 2012

some sites on design patterns

http://www.vincehuston.org/dp/
http://www.cmcrossroads.com/bradapp/javapats.html
http://dotnet.zcu.cz/NET_2006/Papers_2006/short/B31-full.pdf
http://zone.ni.com/devzone/cda/tut/p/id/3024
http://www.javacodegeeks.com/2011/02/state-pattern-domain-driven-design.html
http://nurkiewicz.blogspot.com/2009/09/state-pattern-introducing-domain-driven.html

factory
http://chaoticjava.com/posts/factory-design-pattern-made-simple-using-enums/
Posted by Childish at 6:33 AM No comments:

Wednesday, February 29, 2012

Dynamic Class Loading + Reloading

http://tutorials.jenkov.com/java-reflection/dynamic-class-loading-reloading.html


an article:

Recoverable Class Loaders for a Fast Restart of Java Applications

Vladimir Nikolov, RĂ¼diger Kapitza and Franz J. Hauck



related:

HOW TO: Bootstrap Java programs in isolated classloaders

http://blog.markturansky.com/archives/21

Watching a Directory for Changes

http://docs.oracle.com/javase/tutorial/essential/io/notification.html
Posted by Childish at 10:11 PM No comments:

Saturday, February 25, 2012

Burkley Online Courses

http://www.coursera.org/

Natural Language Processing

http://www.cs.colorado.edu/~martin/slp.html
http://nlp.stanford.edu/IR-book/
http://nlp.stanford.edu/fsnlp/
http://www.nltk.org/book
Posted by Childish at 5:37 AM No comments:

Saturday, February 18, 2012

Regular Expressions and CC numbers

http://www.regular-expressions.info/creditcard.html
Posted by Childish at 1:45 AM No comments:

Wednesday, January 11, 2012

JAXB

old pieces of code:

public static com.harrods.hrc.ws.client.mapping.getDetails.Member parseGetDetailsResult(String resultFromWS)
throws JAXBException
{
if ( resultFromWS == null ) return null;
resultFromWS = "" + resultFromWS + "";
JAXBContext jaxbContext = JAXBContext.newInstance( "com.harrods.hrc.ws.client.mapping.getDetails" );
ByteArrayInputStream input = new ByteArrayInputStream (resultFromWS.getBytes());
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
com.harrods.hrc.ws.client.mapping.getDetails.Member getDetailsResult =
(com.harrods.hrc.ws.client.mapping.getDetails.Member)
unmarshaller.unmarshal(input);
return getDetailsResult;
}

//another impl
if ( memberAsString == null ) throw new Exception("member is null");
memberAsString = "" + memberAsString + "";

JAXBContext jaxbContext = JAXBContext.newInstance( com.harrods.hrc.ws.client.mapping.enrol.response.Member.class );

Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
StringReader stringReader = new StringReader(memberAsString);
return
(com.harrods.hrc.ws.client.mapping.enrol.response.Member)
unmarshaller.unmarshal(stringReader);


//
JAXBContext jaxbContext = JAXBContext.newInstance(
com.harrods.hrc.ws.client.mapping.enrol.request.RequestData.class
);

Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshaller.setProperty(Marshaller.JAXB_ENCODING , "UTF-8");
//setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);

StringWriter stringWriter = new StringWriter();
marshaller.marshal(enrolRequestData, stringWriter);
return stringWriter.toString();


//
EndpointReference targetEPR = new EndpointReference(
wsEndpoint
);

Options options = new Options();
//GRIPS MX Web Service endpoint
options.setTo(targetEPR);
// Increase the time out when sending large attachments
options.setTimeOutInMilliSeconds(timeout);
options.setTo(targetEPR);
//GRIPS MX Web Service IssueCheque operation
options.setAction("http://jetsystems.com/GRIPSMX/IssueCheque");

ServiceClient sender = new ServiceClient(); //default context
sender.setOptions(options);
OperationClient mepClient = sender
.createClient(ServiceClient.ANON_OUT_IN_OP);

MessageContext messageContext = new MessageContext();

SOAPFactory soapFactory = OMAbstractFactory.getSOAP11Factory();
SOAPEnvelope soapEnvelope = soapFactory.getDefaultEnvelope();

SAXOMBuilder saxomBuilder = new SAXOMBuilder();
JAXBContext jaxbContext =
JAXBContext.newInstance("com.jetsystems.gripsmx.ws");
Marshaller marshaller = jaxbContext.createMarshaller();

marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper",
new NamespacePrefixMapperImpl());

com.jetsystems.gripsmx.ws.ChequeRequest chequeRequest =
generateChequeRequest(
country,
shop,
tillId,
operatorId,
posBasket,
dataEntry,
basketWsProperties
);
marshaller.marshal(chequeRequest, saxomBuilder);
OMElement issueChequeRequest = saxomBuilder.getRootElement();
issueChequeRequest.setLocalName("issueChequeRequest");

soapEnvelope.getBody().addChild(issueChequeRequest);

messageContext.setEnvelope(soapEnvelope);

mepClient.addMessageContext(messageContext);
mepClient.execute(true);
MessageContext response = mepClient
.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
SOAPBody soapBody = response.getEnvelope().getBody();

//try to unmarshal the response
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();

JAXBElement jaxbElement =
(JAXBElement)unmarshaller.unmarshal(
soapBody.getFirstElement().getXMLStreamReader());
com.jetsystems.gripsmx.ws.Cheque cheque =
(com.jetsystems.gripsmx.ws.Cheque)
jaxbElement.getValue();

logger.debug("issued cheque = " + cheque);
return cheque;

//
Posted by Childish at 1:41 PM No comments:

Monday, January 9, 2012

BPEL

http://www.theserverside.com/news/1364554/BPEL-and-Java
Posted by Childish at 12:20 PM No comments:

Saturday, January 7, 2012

Java Networking and Cryptography

books:
1)

Beginning Cryptography with Java

David Hook
Wiley Publishing, Inc.
recommended by bouncycastle
2) Esmond Pitt - Fundamental Networking in Java, Springer 2006 - great book
Posted by Childish at 8:38 AM No comments:

Qarbon ViewletBuilder

http://www.qarbon.com/presentation-software/viewletbuilder/
Posted by Childish at 8:36 AM No comments:

maverick plugin

"a Model-View-Controller (aka "Model 2") framework for web publishing using Java and J2EE" :
http://mav.sourceforge.net/
Posted by Childish at 8:08 AM No comments:

Sunday, January 1, 2012

GUI design guidelines from Year 2000

Constantine & Lockwood, Ltd
http://foruse.com

From Abstraction to Realization:
Canonical Abstract Prototypes for User Interface Design

http://www.foruse.com/articles/canonical.pdf
Posted by Childish at 6:49 AM No comments:
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Followers

Blog Archive

  • ►  2020 (1)
    • ►  October (1)
  • ►  2017 (3)
    • ►  August (1)
    • ►  July (1)
    • ►  June (1)
  • ►  2015 (5)
    • ►  June (2)
    • ►  May (2)
    • ►  April (1)
  • ►  2014 (3)
    • ►  December (1)
    • ►  July (1)
    • ►  March (1)
  • ►  2013 (4)
    • ►  December (1)
    • ►  November (1)
    • ►  August (1)
    • ►  March (1)
  • ▼  2012 (21)
    • ▼  November (6)
      • oracle - password life time
      • Dr Dobb's http://www.bullhornreach.com/sites/HireM...
      • cloudflare
      • JVM thread dump
      • UAC on Windows7
      • semaphores
    • ►  July (2)
      • java - copy directory
      • java - Arrays.asList returns not modifiable Abstra...
    • ►  April (3)
      • Solr
      • unit tests
      • concurrency utils
    • ►  March (1)
      • some sites on design patterns
    • ►  February (3)
      • Dynamic Class Loading + Reloading
      • Burkley Online Courses
      • Regular Expressions and CC numbers
    • ►  January (6)
      • JAXB
      • BPEL
      • Java Networking and Cryptography
      • Qarbon ViewletBuilder
      • maverick plugin
      • GUI design guidelines from Year 2000
  • ►  2011 (31)
    • ►  October (3)
    • ►  August (8)
    • ►  July (2)
    • ►  June (3)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
    • ►  February (6)
    • ►  January (6)
  • ►  2010 (51)
    • ►  December (8)
    • ►  November (11)
    • ►  October (8)
    • ►  September (6)
    • ►  August (13)
    • ►  July (4)
    • ►  January (1)
  • ►  2009 (6)
    • ►  November (2)
    • ►  October (1)
    • ►  July (1)
    • ►  June (2)

About Me

My photo
Childish
View my complete profile