Wednesday, February 22, 2023

Just Make It

Just make it; Learn on the way. Learing something is a roadblock of many creative people. The idea that you need to learn what you want to do before you create or what you create wont be good as someone elses creation to you. Your work of art is creative and will have many in awe! It's all in your mind. You are so unique and the way you put things together separates you from another person. 

Wednesday, October 30, 2019

Is this the new Mac Book Pro Touch Bar?


Everyone would buy this Mac Book Pro if configured with this Touch Bar! The keyboard itself should be refined and use the 2015 Mac Book Pro keyboard. You know the one.. nice travel, backlit and error free. With a touch of Touch Bar love, and you have the Mac Book Pro that won't require any website comparison tool. It will just work. The Mac Book Pros with out the escape key and very low profile keys are not choose anymore, they are only given. This means, people are not buying the laptop because they want it. We need to get back to loving this again. This new keyboard will be the answer to all your problems. Sales will be great again . Pro will be professional again! You can also put that SD card reader slot back on the side too.

Tuesday, May 3, 2016

bash recursive folder delete

#!/bin/bash
# recursive delete to base folder
#recrmdir /base/sub1/sub2/subN
# Example:
# rm -f /base/sub1/sub2/subN
# rm -f /base/sub1/sub2
# rm -f /base/sub1
recrmdir()
{
  rm -f $1
  if [ "$1" = '/base' ] ;
  then
    return 0
  fi
  recrmdir ${1%/*}
}

Friday, July 11, 2014

Printing out a linked list in reverse using recursion

Define the class for the linked list node:
class LinkedList {
public:
    int value;
    LinkedList *next;
};

populate the linked list:
void populate(int N)
{
    top = ll;
    for (int i=0 ; i< N; ++i)
    {
      ll->value = i;
      cout << ll->value;
      if( i!=N-1 ) {
        ll->next = new LinkedList;
        ll = ll->next;
     }
      else ll->next = (LinkedList *)0;
    }
    ll=top;
}

Print it out:
void print_ll()
{
    while(ll != (LinkedList *)0 ){
        cout << ll->value;
        ll = ll->next;
    }
    cout << endl;
    ll = top;
}

Reverse it:
void reverse_ll(LinkedList *node)
{
 
    if( node->next != (LinkedList *)0 ) {
        reverse_ll(node->next);
    }
    cout << node->value;
}

Please leave comments.

Thank you,
Christopher

Wednesday, January 22, 2014

Media Query parse issue

A media query running on Chrome in the following format will not work:

@media screen and (min-width:100px)and (max-width:199px){ ... }

but this will work in Chrome, Safari and FireFox:


@media screen and (min-width:100px) and (max-width:199px){ ... }

Notice the space between the closed parenthesis and 'and';  this is a parse error.  a space between these two symbols shouldn't invalidate the query.


The version of Chrome I found this in is Chrome 32.0.1700.77 Running on Mac OS X 10.9.1

If I remove the spaces then this query and have the following form:

@media screen and (min-width:100px)and(max-width:199px){ ... }

Only Safari will work.


To prevent this from happening, make sure you have spaces in your media queries.


Wednesday, February 4, 2009

Brainstorm

I recently had the opportunity to present a topic on Brainstorming at the Northeastern Conference Youth Ministries Convention in Stamford, CT. January 15-18, 2009

The audience included a mix of youth leaders from many different Northeastern Seventh-Day Adventist Churches, looking for different ideas to take back to their respective churches and communities.

The slide text is given here:

Brainstorm
Seminar Session II: 11:00 -1pm
Facilitated by:
Christopher M. Logan
Noreen Buckley


definition
• a group problem-solving technique that involves the spontaneous contribution
of ideas from all members of the group ; also : the mulling over of ideas by
one or more individuals in an attempt to devise or find a solution to a
problem
– How can we apply this technique
– Have you ever participated in a brainstorming session?


useful technique
• Brainstorming is a Tool
• Used for developing creative solutions to a problem
• Helpful when you need to break out of stale, established patterns of thinking
– Are your existing techniques achieving the results you expected?


useful technique…
• Encourages full team participation
– Individual experience adds to the creativity of the solution
• Increases the richness of the solution
• You can find better solutions; make better decisions
• Get buy in from team members
– Afterall, they helped create the solution!


lateral thinking
• Accepting all input from team players
• Brainstorming encourages the exploration of “shocking” or “crazy” ideas
• Thinking out of the box
• Change the ideas to improve them into useful solutions
• come up with stunningly original ideas!


encouragement
• During the session all ideas should be accepted
• Don’t criticize an idea
– Too early; this will only slow the process down and limit idea generation
• If the ideas start to get stale you can seed it with random input phrase or
word to encourage the session to progress.


types of brainstorming
• Individual brainstorming
– When you brainstorm on your own you will tend to produce a wider range of
ideas than with group brainstorming
– you do not have to worry about other people's egos or opinions, and can
therefore be more freely creative.
– You may not, however, develop ideas as effectively as you do not have the
experience of a group to help you.
– Use mind map diagrams to help document your thought progress


types of brainstorming…
• Group brainstorming
– can be very effective
– uses the experience and creativity of all members of the group.
– tends to develop ideas in more depth than individual brainstorming.
– risky for creative individuals
• Uncreativity can’t see the value and will leave creative members
humiliated


types of brainstorming…
• Visual Brainstorming
– Instead of speaking use crafts to represent real world objects
– Encourage every team member to participate
– Very few distractions


how to use the tool
• Define who will do what
– Facilitator: guides the session and enforces the rules of the tool and
encourages free, unrestricted flow of ideas
– Note taker: primary responsibility is to document the ideas in a non-visual
brainstorm
– Contributor: all the members of the group


how to use the tool…
• Define the problem you want solved clearly, and lay out any criteria to be
met.
– Should do…
• Keep the session focused on the problem.
• Define the idea goal for the session
– 50-100 ideas
• Encourage people to develop other people's ideas, or to use other ideas to
create new ones.


how to use the tool…
• Ensure that ideas that come out of the session are documented. A good way of
doing this is to use a flip chart. This should be studied and evaluated after
the session.
• Ensure that no train of thought is followed for too long. 4-5min on a thought;
25-30mins for the idea collection part of a session


how to use the tool…
• Ensure that no one criticizes or evaluates ideas during the session. Criticism
introduces an element of risk for group members when putting forward an idea.
This stifles creativity and cripples the free running nature of a good
brainstorming session.
• Encourage an enthusiastic, uncritical attitude among members of the group. Try
to get everyone to contribute and develop ideas, including the quietest
members of the group.


how to use the tool…
• Encourage people to come up with as many ideas as possible, from solidly
practical ones to wildly impractical ones. Welcome creativity.
• Encourage people to develop other people's ideas, or to use other ideas to
create new ones.


how to use the tool…
• Evaluate the ideas at the end of the idea collection session
• Rate each idea as a team on a scale of 0-5.
• The idea with the highest score will best solve your problem. There might be
ties.
• Keep a record of all of your best ideas and their scores in case your best
idea turns out not to be workable.


how to use the tool…
• Have Fun!!
– The best ideas will flow in an environment that encourages it.


Brainstorm
• Brainstorm session
• Q&A
Thank you

Sunday, December 7, 2008

Jackrabbit Repository Server on JBoss


Updated for jackrabbit 1.5.2



Dependencies:

Jboss 4.2.3

Jackrabbit 1.5.2

Mysql 5.x

jcr-1.0.jar

Maven 2


I'm running JBoss as 4.2.3 on my local PC and I would like to deploy jackrabbit
as a standalone JCR server to create the Repository Server.



In order to have two JBoss servers running on the same box you have to change
the ports of the second server.


Before I updated the ports for the default jboss configuration, I made a copy
of the default directory and called it default-jcr.
I then changed all the ports in default-jcr by appending a 1 in front of the
port name. I used This Document to help identify all the ports.


GOAL: To have a jcr repository server


Get a copy of Jackrabbit. The current version is 1.5.2. Download the source
file and un jar it.



jar -xvf jackrabbit-1.5.2-src.jar
this will create a directory named jackrabbit-1.5.2. I will use to refer to
this directory.

change directory to

modify the following files:

1. /jackrabbit-jcr-rmi/src/main/resources/jackrabbit-rmi-service.xml
and update the RemoteAddress to match the RMI port you changed in the
default-jar jboss configuration.

2. /jackrabbit-jca/deploy/jboss4.x/jcr-ds.xml

jcr/local

jackrabbit-jca-1.5.2.rar

javax.jcr.Repository
/jcr/poc-1.5
/jcr/poc-1.5/repository.xml
true


3. /jackrabbit-jca/target/repository/repository.xml
in this file change the PersistenceManager to use mysql in both places

Repository/PersistenceManager

and

Repository/Versioning/PersistenceManager

In both locations above, be sure that you created an empty database and
created a user in MySQL

build jackrabbit
cd
mvn clean
mvn install

create the directory specified in the jcr-ds.xml above

copy /jackrabbit-jca/target/repository/repository.xml to /jcr/poc-1.5/

copy the following files to the default-jcr configuration

jcr-1.0.jar to default-jcr/lib

mysql-connector-java--bin.jar to default-jcr/lib

jackrabbit-jca-1.5.2.rar to default-jcr/deploy

jackrabbit-jcr-rmi-1.5.0.jar to default-jcr/deploy

jcr-ds.xml to default-jcr/deploy

start Jboss to create the content repository in the directory you specified
above in jcr-ds.xml
run -c default-jcr



Some issues I had in the past


ISSUE


23:26:23,093 WARN [ServiceController] Problem starting service
Jackrabbit.services:RMIServer = JCR RMI Server
javax.naming.CommunicationException: Could not obtain connection to any of
these urls: localhost:1099 and discovery failed with
error: javax.naming.CommunicationException: Receive timed out [Root
exception is java.net.SocketTimeoutException: Receive timed out] [Root
exception is javax.naming.CommunicationException: Failed to connect to
server localhost:1099 [Root exception is
javax.naming.ServiceUnavailableException: Failed to connect to server
localhost:1099 [Root exception is java.net.ConnectException: Connection
refused: connect]]]


SOLUTION


Change C:\jackrabbit-1.4\jackrabbit-jcr-rmi\src\main\resources\jackrabbit-rmi-service.xml
then recompile jackrabbit
cd c:\
cd c:\jackrabbit-1.4
mvn clean
mvn install

replace jackrabbit-jcr-rmi.jar in the deploy-jcr directory with the new file
that was just built.


ISSUE


Issue Using Derby even though I changed the PersistentManager:

here is the portion of the Jboss log that is specific to the start up of
jackrabbit:
00:50:47,906 INFO [RepositoryImpl] Starting repository...
00:50:47,921 INFO [LocalFileSystem] LocalFileSystem initialized at path c:\jackrabbit\poc\repository
00:50:48,046 INFO [NodeTypeRegistry] no custom node type definitions found
00:50:48,046 INFO [LocalFileSystem] LocalFileSystem initialized at path c:\jackrabbit\poc\version
00:50:49,000 INFO [ConnectionRecoveryManager] Database: Apache Derby / 10.2.1.6 - (452058)
00:50:49,000 INFO [ConnectionRecoveryManager] Driver: Apache Derby Embedded JDBC Driver / 10.2.1.6 - (452058)
00:50:50,312 INFO [RepositoryImpl] initializing workspace 'default'...
00:50:50,312 INFO [LocalFileSystem] LocalFileSystem initialized at path c:\jackrabbit\poc\workspaces\default
00:50:50,593 INFO [ConnectionRecoveryManager] Database: MySQL / 5.0.51b-community-nt
00:50:50,593 INFO [ConnectionRecoveryManager] Driver: MySQL-AB JDBC Driver / mysql-connector-java-5.0.8 ( Revision: ${svn.Revision} )
00:50:50,765 INFO [RepositoryImpl] workspace 'default' initialized
00:50:50,953 INFO [LocalFileSystem] LocalFileSystem initialized at path c:\jackrabbit\poc\repository\index
00:50:51,046 INFO [SearchIndex] Index initialized: c:/jackrabbit/poc/repository/index Version: 2
00:50:51,046 INFO [LocalFileSystem] LocalFileSystem initialized at path c:\jackrabbit\poc\workspaces\default\index
00:50:51,046 INFO [SearchIndex] Index initialized: c:\jackrabbit\poc\workspaces\default/index Version: 2
00:50:51,046 INFO [RepositoryImpl] Repository started
00:50:51,046 INFO [jcr/local] Created repository (org.apache.jackrabbit.core.RepositoryImpl@110b205)
00:50:51,046 INFO [jcr/local] Created repository handle (org.apache.jackrabbit.jca.JCARepositoryHandle@10f3801)
00:50:51,062 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=jc
r/local' to JNDI name 'java:jcr/local'
00:50:51,218 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=Jm
sXA' to JNDI name 'java:JmsXA'
00:50:51,343 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=PortalDS'
to JNDI name 'java:PortalDS'
00:50:51,437 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=wikiDatas
ource' to JNDI name 'java:wikiDatasource'


SOLUTION


after correcting the repository.xml file: I have achieved using mysql for both
the repository and workspace.

Repository/PersistenceManager

and

Repository/Versioning/PersistenceManager

the schemaObjectPrefix should be different and also the database if you are
using mysql like I am.

Here is the jboss startup log: i'm using Mysql for both repository and
workspace now
01:04:42,203 INFO [RepositoryImpl] Starting repository...
01:04:42,218 INFO [LocalFileSystem] LocalFileSystem initialized at path c:\jackrabbit\poc\repository
01:04:42,375 INFO [NodeTypeRegistry] no custom node type definitions found
01:04:42,375 INFO [LocalFileSystem] LocalFileSystem initialized at path c:\jackrabbit\poc\version
01:04:42,640 INFO [ConnectionRecoveryManager] Database: MySQL / 5.0.51b-community-nt
01:04:42,640 INFO [ConnectionRecoveryManager] Driver: MySQL-AB JDBC Driver / mysql-connector-java-5.0.8 ( Revision: ${svn.Revision} )
01:04:42,796 INFO [RepositoryImpl] initializing workspace 'default'...
01:04:42,796 INFO [LocalFileSystem] LocalFileSystem initialized at path c:\jackrabbit\poc\workspaces\default
01:04:42,796 INFO [ConnectionRecoveryManager] Database: MySQL / 5.0.51b-community-nt
01:04:42,812 INFO [ConnectionRecoveryManager] Driver: MySQL-AB JDBC Driver / mysql-connector-java-5.0.8 ( Revision: ${svn.Revision} )
01:04:42,937 INFO [RepositoryImpl] workspace 'default' initialized
01:04:43,093 INFO [LocalFileSystem] LocalFileSystem initialized at path c:\jackrabbit\poc\repository\index
01:04:43,218 INFO [SearchIndex] Index initialized: c:/jackrabbit/poc/repository/index Version: 2
01:04:43,218 INFO [LocalFileSystem] LocalFileSystem initialized at path c:\jackrabbit\poc\workspaces\default\index
01:04:43,234 INFO [SearchIndex] Index initialized: c:\jackrabbit\poc\workspaces\default/index Version: 2
01:04:43,234 INFO [RepositoryImpl] Repository started
01:04:43,234 INFO [jcr/local] Created repository (org.apache.jackrabbit.core.RepositoryImpl@1e5ebbf)
01:04:43,234 INFO [jcr/local] Created repository handle (org.apache.jackrabbit.jca.JCARepositoryHandle@8edb84)
01:04:43,234 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=jc
r/local' to JNDI name 'java:jcr/local'
01:04:43,343 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=Jm
sXA' to JNDI name 'java:JmsXA'
01:04:43,406 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=wikiDatas
ource' to JNDI name 'java:wikiDatasource'



ISSUE


Security manager not active


SOLUTION


client.policy & server.policy need to be specifed.
client.policy for the client

server.policy for the JBoss server, set this in the run.bat file


ISSUE


retrieving properties from a RemoteNode class doesn't exist:


SOLUTION


the node Value should be serialized and exist on the server so it
can be unmarshelled before storing to the database. Just include the jar file
containing the extended Value class from when you build the client and
paste it into the JBoss default / lib directory the restart your JBoss server.


ISSUE


Using the JCA connector sessions are not closing properly


SOLUTION


need to add: to the jcr-ds.xml
file (or whatever you called it)