Archive

Archive for the ‘Tech tips’ Category

List the content of a folder in Mac OS X

April 14th, 2011 No comments

The little utility I used to “print” the content of a folder or volume into a text file (for instance to save the list of all movies in a folder) didn’t work in Snow Leopard (Mac OS X 10.6) anymore, so I looked for an other way of doing it.

While not as complete as the utility (PrintFinder, no longer available or supported) this one was self made and works 🙂

Instead of writing how it works, a quick video of creating the service is easier:

Creating a “Print to file” folder service with Automator

Categories: Tech tips Tags:

Internet bandwidth cap…

September 13th, 2010 3 comments

I just made the following quick math:

I have a 95 GB bandwidth monthly cap with my current ISP (Rogers) Internet contract (which was added over the time, along with removing other services and increasing the price…).

95 GB is a lot you might say. This cap includes both uploads and downloads.

Here are 2 things I think makes it not so big:

  • If I was to use my current “10 Mbps” connection at 100% for downloading only, I would reach this limit in just over 24 hours. That’s less than 1 hour of 100% usage per day in a month. For just downloading.
  • As I ditched the cable TV, and don’t trust Blu-Ray DRM so I won’t buy a Blu-ray reader soon, I like to get content for my HD TV from either DVD or from the Internet. High Definition movies are about 1 GB per hour. Downloading only 4 movies, 2 hours each would already use 10% of my bandwidth. Add a weekly TV series (4 episodes) for another 8Gb… and you get the picture on how we can soon reach the cap in less than a month, all perfectly legally.

This is surely something Rogers would like to prevent me from doing as they would rather have me pay for their cable or “pay-per-view” offering instead of using internet, which of course I’m not going to do

All that to say that my ISP (Rogers) is selling me a so called monthly service that I need to carefully manage if I want to be able to see the content I chose, and use it during the entire course of a month.

This is not even considering the fact that the ISP wouldn’t be able to provide this service if all their clients in a given area would start using their Internet bandwidth at 100% capacity…

Here is for instance our family usage history for the past 6 months… and I should add here that we almost never turn torrents on 🙂

This is something we can manage now, but I just wait for two things before I switch to another provider:

  • Competition readiness (for instance, Teksavvy already provides DSL in my area, but is expecting to also provide cable in a near future)
  • Receiving my first bill from Rogers with charges for additional bandwidth…

After writing this rant, I checked the current plans on Rogers, and my plan has changed to 15 Mbps download speed and 80 GB cap… so make the 24 hours 21 now… It seems that my cap to 95 GB was grandfathered, but I don’t see the speed bump either…

Categories: Humor, Tech tips Tags:

Open Source DM: Nuxeo 5.3 on Mac OS X

November 12th, 2009 1 comment

As my former colleague and still friend @CherylMcKinnon is now working with Nuxeo, I thought I’d give their latest Document Management solution a try on my Mac.

Let say that I’m a newbie at this kind of exercise, as I’m not a Linux programmer, but I’m still able to follow some instructions…

Here is what I did on my old headless Power Mac G4 MDD running Mac OS X 10.5.8 (Leopard):

  • I picked up the JBoss based package for Mac OS X, and copied the unzipped content in:

~home/Sites/nuxeo-5.3.0

  • I made sure that Web Sharing was turned on in “System Preferences / Sharing”, although I don’t think this is required as this only start the built in Apache server on port 80…
  • Using the terminal, in navigated to:

~home/Sites/nuxeo-5.3.0/bin

  • Then ran the following command to start Nuxeo DM 5.3:

./jbossctl start

  • This didn’t work: the complain was that my JAVA_HOME environment variable wasn’t set. So, I did a little bit of googling, to find where  and how this variable needed to be set, knowing that Java is also part of the Mac OS system, so nothing needed to be installed there. I therefore ran the following command which seems to work and is supposed to work for any version of Java or Mac OS X:

export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home

  • Then ran the start command again, which worked just well this time. I was able to log on my new Nuxeo DM 5.3 instance locally.
  • The last bit was to make it accessible from other computers on my home network. For this, as described in the readme.html file, I edited the “bind.conf” file found under the “bin” folder of my Nuxeo folder with the following unique line (note that I removed the # used to comment a line):

BINDHOST=0.0.0.0

  • This last change (followed by a restart of Nuxeo DM 5.3) allowed me to reach my newly installed instance from anywhere on my home network with the following url, and start discovering the features of this open source document management solution:

http://g4mdd.local:8080/nuxeo/

Categories: ECM, Tech tips Tags: , ,

Crystal Reports XI and Open Text BI 8.5.1 pros and cons

April 23rd, 2009 2 comments

I’ll revise this post regularly based on my findings and experience.

Items in this list may only show my inability to perform a specific action with one solution, which at least means that there is a usability issue with it 🙂

Crystal Reports XI:

  • + Formula Editor
  • – No permanent data model: a new data model needs to be recreated each time I create a new report
  • – No ability to work on results and combine them together
  • No ability to aggregate on the server: I didn’t find for instance how to create the following statement: With the help of Paul’s comment, I was able to find how this works in Crystal: you need to turn the “Perfrom Grouping on Server”  option for both the report AND the general option. [cc lang=”sql”]select count(my_field) from my_table[/cc]

Open Text BI 8.5.1:

  • – Doesn’t support multiple outer joins with SQL ODBC connection
  • – Can’t report on a table named “users”  with SQL ODBC
  • + Can work with results and create complex “super queries”
Categories: BI thoughts, Tech tips Tags:

Real life experience: displaying DM access control list in Crystal Report

April 17th, 2009 1 comment

A good thing about consulting is that I’m now exposed to real life report requests and different technologies to create them.

This let me compare these technologies in situations outside of the “demo database boundaries”.

Here is an example of useful feature found in Crystal Report XI:

Crystal Report has a powerful formula workshop, which allows the creation of complex fields based on business rules that are not necessarily included in the database.

For instance, our Document Management system stores the access control information about a document in a single numeric field. Creating a report that shows “45”  or “63” as the only information about the access control is quite meaningless for a business user.

The only place I could find some information about the meaning of this numbers was in the DM database documentation:

The ACL is a combination of basic controls which each have a number (1, 2, 4, 8, 16, 32, 64, 128, 256 and 512): substract from the actual ACL number the list value just bellow it until you reach 0 in order to rebuild a list of these basic controls:

for instance, “45” = “32” + “8” + “4” + “1”, so an ACL value of “45” means that the specified user has the combination of these basic controls (1, 4, 8 and 32) on the document.

SQL doesn’t provide the ability to rebuild this kind of logic with its set of functions, and creating a calculated field in the database is not often an option.

Using the Crystal Reports editor, I easily added a formula with a simple VB code (I had no previous experience of VB):

[cc lang=”vb” theme=”default” width=”560″]
‘ Declaring array variables: aMsg for the actual basic controls, and aID for the control numbers.
‘ This is not really necessary, but I thought this would make the code cleaner,
‘ and somehow thought I could automate this loop a bit more 🙂
Dim aMsg(10) As String
aMsg(1) = ” View Profile |”

aMsg(10) = ” View Only Published |”

Dim aID(10) As Number
aID(1) = 1

aID(10) = 512

‘ Declaring the working variables:
‘ – the actual ACL for the document is initialized with the value from the database
‘ – the actual meaning of this number is initialized as a blank message.

Dim aCurrentID As Number
aCurrentID = {SECURITY.ACCESSRIGHTS}
Dim aCurrentMsg As String
aCurrentMsg = “”

‘ In some odd cases, someone specifically “denies access”  to a document, which is a different logic.
‘ As this is quite uncommon in our set up,
‘ and as the logic is not described in the documentation, I avoid checking these values.

if aCurrentID > 1023 Then aCurrentMsg = “More investigation required – Deny applied” : aCurrentID = 0

‘ Start of the loop to rebuild the full access control list: the actual ACL value will be compared to the regular list
‘ and when it’s value is bellow a regular item, we add this regular control to the list, and decrease the ACL value
‘ until we reach 0.
‘ Note: the “:” separates the 2 actions in one line.

While aCurrentID > 0

if aCurrentID < aID(10) Then _

if aCurrentID < aID(1) Then _
aCurrentMsg = aCurrentMsg _
else _
aCurrentMsg = aCurrentMsg & aMsg(1) : aCurrentID = aCurrentID – aID(1) _

else _
aCurrentMsg = aCurrentMsg & aMsg(10) : aCurrentID = aCurrentID – aID(10)

wend

‘ The resulting aCurrentMsg is the combination of all the controls included in the original ACL value
‘ and passed as the result of the formula
formula = aCurrentMsg
[/cc]

Categories: Tech tips Tags:

Date functions

March 15th, 2009 3 comments

Almost every time I write a report, I face some date formating and calculation issues.

For once, dates stored in databases usually are in full “date” format, including year, month, day, hour, minutes and seconds, and are associated with a single action or event, such as creation, update, etc…

Then, the reports usually need the information aggregated by month, quarter and/or year, and often with a sliding begin and end date (i.e. count of the number of logged calls per month for the last 6 months).

On to top of this, the dates are not necessarily following a calendar year but often follows a fiscal year instead, and the reporting tools do not feature an easy way to provide “today’s fiscal quarter” for instance.

In order to help with this, I created 3 simple SQL Server user based functions:

The first function returns the fiscal year from any date (including today()):

[cc lang=”tsql” width=”560″]
CREATE FUNCTION FYear (@input_date varchar(255))
RETURNS int AS
BEGIN
DECLARE @CYear int
DECLARE @offset int
SELECT @CYear = Year( @input_date )
IF ( (CAST(YEAR(@input_date) as varchar(2))+ ‘/’ + (CAST((MONTH(@input_date)) as varchar(2)) + ‘/’ + CAST((DAY(@input_date)) as varchar(2)))) > (CAST(YEAR(@input_date) as varchar(2)) + ’06/30/’))
SELECT @offset =1
ELSE
SELECT @offset = 0
RETURN (@CYear + @offset)
END
[/cc]

Simply replace ’06/30/’ in the code by the end of your fiscal year, and this function will compare the date with the end of the fiscal year and return the current year or the current year + 1 based on that end.

The second function returns the fiscal quarter of a date:

[cc lang=”tsql” width=”560″]
CREATE FUNCTION FQuarter (@input_date varchar(255))
RETURNS varchar(255) AS
BEGIN
DECLARE @FQuarter varchar (255)
IF (Month(@input_date) < 4)
SELECT @FQuarter =  ‘Q3’
ELSE
IF (Month(@input_date) < 7)
SELECT @FQuarter =   ‘Q4’
ELSE
IF (Month(@input_date) < 10)
SELECT @FQuarter =   ‘Q1’
ELSE
SELECT @FQuarter =  ‘Q2’
RETURN @FQuarter
END
[/cc]

In this one, simply replace the ‘4’, ‘7’ and ’10’ values by the actual end of your fiscal quarters in order to assign the proper Qx to the result.

The last function returns a formated date as a string with a “YYY/MM/DD” format instead of a date field:

[cc lang=”tsql” width=”560″]
CREATE FUNCTION castyear (@input_date varchar(255))
RETURNS varchar(255) AS
BEGIN
DECLARE @CYear varchar(255)
SELECT @CYear = (CAST(YEAR(@input_date) as varchar(4)) + ‘/’ + CAST(MONTH(@input_date) as varchar(2)) + ‘/’ + CAST(DAY(@input_date) as varchar(2)) )
RETURN @CYear
END
[/cc]

Adding these function as user defined functions with proper access right to the database users can be useful to further chop the dates and easily extract the month and day of a date in order to create calculated fields and aggregate other facts based on dates.

Categories: Tech tips Tags: