Pages

Tuesday 26 February 2013

Amber Dog magazine (2008)


 www.amberdog.lv

They invited me to make restyling of their magazine. Before, they used designers from outside their company. As a result, at that moment they didn't have any source files. I had to create everything from a very beginning. It wasn't first time for me. They provided me a good computer with two monitors. In my opinion, it's very convenient for magazine layouting. And my experience included image processing and retouching for a magazine cover as well.


Real Estate Catalogue

When i was a small boy... when i was a magazine designer...

http://www.balthaus.lv/ In 2005 i took a part in producing of a Real Estate Catalogue (twice a year). More than 270 pages. It had a lot of financial articles, tables with important information and so on... I had to create all object's and paragraph styles from a very beginning.
Four designers prepared ads, images for me. I had to compile all of them in one ready-to-print catalogue. Since that catalogue sometimes had to have 3 languages on the same page we had to use OpenType fonts like Myriad Pro and Times New Roman. They handle Unicode characters.

Friday 22 February 2013

Using enum

All in one place. My examples.

package enumtest;
import java.util.Random;

/**
 * @author Alex Pilugin
 */

enum Numbers{
    ONE,
    TWO,
    THREE,
    FOUR,
    FIVE,
    SIX,
    SEVEN
}

enum Deadlines{
    HOUR,
    DAY,
    WEEK,
    MONTH,
    YEAR;
    int count = 0;
    Deadlines(){
        count++;
    }
}

Thursday 21 February 2013

SCJP exam. The most common "Compilation fails" questions-2

no default constructor in a superclass

class One{
    String s;
    One(String s){
        this.s = s;
    }
}
class Two extends One{
    Two(String s){
                   // problem 
        this.s = s;
    }
}
interface implementation (method signature)
class Persons{
    String name;
    Persons(String name){
        this.name = name;
    }
    public String toString() {
        return this.name;
    }
}
interface Personable {
    Persons getPerson(String name);
}
class MyPerson implements Personable{
    Persons getPerson(String name) { // problem (must be public)
        return new Persons(name);
    } 
    public static void main(String[] args){
        List ps = new ArrayList();
        MyPerson m = new MyPerson();
        for (int i = 100; i++ < 102; ps.add(m.getPerson("" + i)));
        for(Object o:ps) System.out.println(o);
    }
}

Wednesday 20 February 2013

SCJP exam. The most common "Compilation fails" questions


Illegal package declaration (looks like import statement).

package com.mypackage.classes.*;  // problem

Out of scope of visibility

class OutOfScopeTest{
    static int x;
    public static void main(String[] args){
        for(int i = 0; i < 10; i++){
            x++;
        }
        System.out.println(x + i); // problem
    }
}

All local variables must be initialized before using.

class LocalVariableTest{
    public static void main(String[] args){
        Boolean b;
        if(b == null){ // problem
            b = false;
        }else{
            b = true;
        }    
    }
}

No enum declaration within any method's scope. 
Enum types must not be local.

class A {
    public static void doStuff(){
        enum Sex {MALE, FEMALE, SHEMALE}; // problem
        Sex sex = Sex.MALE;
    }
}

Wednesday 13 February 2013

London. Artdeco magazine.

ARTDECO magazine
It was an incoming 64 pages mock up made in MicroSoft PowerPoint. But our printing factory accepts only pdf-files. MicroSoft PowerPoint program works with RGB colour system. It's good for presentation but bad for printing.

 I met following problems:
1. Wrong size (U.S. Letter page size, but customer expected A4 size)
2. RGB colour system (not CMYK)
3. There was Image's resolution from 72 ppi to 150 ppi (pixel per inch)
4. No bleed.
4. an RGB Black colour is not a  CMYK BlacK colour. As a result, in pdf-file we had few black colour with different shades) at different places. Sometimes you cannot see the difference on your screen (on your display)  - it depends on your monitor. But you will see this difference on a printed version of your mockup.


 The cover is a face of a magazine.  In order to get a cover of good quality with A4 page size I had to add a missing black area with exactly the same black colour. It wasn't enough. The PowerPoint program supports only rectangular-shape images. As you can see the main image has rounded corners. In fact it was a rectangular image with black areas at the corners. And that black colour differs from surrounded black colour.
Inside of the magazine we had pages with white background what doesn't make any problem to create missing bleed. Where it was possible I replaced low resolution images to good quality pictures.

This is one thing of hundreds of my prepress experience.

price offers (images) for mailing list (my own graphic design)

Tomorrow is the Valentine's Day.
I wish everybody to meet his own Big Love and Happiness!


I made them for a Creative Printer. This is my own graphic design (mock-ups) for a company in London which one i worked for. 

Sunday 10 February 2013

Technical Test for PPS applicants. (My own solution)

This is only a task from a recruitment agency.

Technical Test for PPS applicants.

The PPS processor is a simple processing engine that takes a list of numeric instructions processing them and manipulating a stack. The engine processes a list of instructions which form a PPS task. The engine will execute the program and place the results on the stack. The PPS team is very interested in performance so the PPS engine can perform multiple tasks in parallel and has some special instructions to facilitate this.

Instruction Code Number Arguments Description
PUSH 1 1 Pushes the single argument onto the stack
POP 2 0 Removes the value at the top of the stack
DUP 3 0 Duplicates the value at the top of the stack
ADD 4 0 Removes the top two numbers from the stack, adds them and places the result on the stack.
SUBTRACT 5 0 Removes the top two numbers from the stack , Subtracts the top number on the stack from the second number on the stack, placing the result on the stack.
MULTIPLY 6 0 Removes the top two numbers from the stack, multiplies them and places the result on the stack.
DIVIDE 7 0 Removes the top two numbers from the stack , Divides the top number on the stack from the second number on the stack, placing the result on the stack.
ASSIGN_ID 8 0 Take the top value on the stack, removes it and assigns it as an ID to the whole routine. Once given an ID other tasks can reference the result.
PUSH_TASK 9 0 Takes the top number on the stack, removes it and uses it as an identifier to retrieve the result of the task with that identifier, waiting if necessary for the dependant task to complete if not already complete.


Examples
Code sequence gives 
the result
1 2 1 3 4 5
1 5 1 3 5 2
1 20 1 30 6 600
1 20 1 5 7 4

Instruction sequences like the above examples can be batched as parallel tasks and should execute in parallel. This is accomplished by naming tasks with a numeric identifier and referencing them from another task via this identifier. So one sequence or task can take the result of another. It should be possible for a task that uses the output from another to be submitted before its dependency such that it will have to wait until its dependant task is complete before completing.

Parallel Example 
Code sequence gives 
the result
1 100 8 1 2 1 3 4 5
1 200 8 1 4 1 5 4 9
1 100 9 1 200 4 14

Write an implementation of the PPS Engine in Java. Your solution should easy to extend as we plan to add new instructions in the future.

 

My solution

According to requirement of good OO design calls to high cohesion i had to create my own classes hierarchy to fulfil this task. It means each class should fulfil its own particular task.

Friday 8 February 2013

MasterExam (SCJP 6). Sorting with a Comparator

From first attempt I didn't answer correctly. I leave this question for my memories.
Original code example:

package mastertest.sort;
import java.util.Arrays;
import java.util.Comparator;

public class Sort {

    public static void main(String[] args) {
        String [] words = {"Good","Bad", "Ugly"};
        java.util.Comparator<String> best = new Comparator<String>(){
            public int compare(String s1, String s2){
                return s2.charAt(1) - s1.charAt(1);
            }
        };
        Arrays.sort(words,best);
        System.out.println(words[0]);
    }
}

Wednesday 6 February 2013

My own TableModel (swing)

I think every java beginner encounters with this problem. How to create and to edit a JTable instance. I met this challenge as well. My first approach was simple. It was easy to choose DefaultTableModel 

 
   private static void createTable(){
       DefaultTableModel model = new DefaultTableModel();
       JTable table = new JTable(model);  
       //#1st - table constructor with a TableModel argument 
       //table = new JTable();  
       //#2 - i can add a TableModel later  
       //using setModel(model) method
       //table.setModel(model);

       Vector column1 = new Vector(); /Vector as a table column
       column1.add("data1");
       column1.add(" "); //column1 has two rows
       
       Vector column2 = new Vector();
       column2.add("data2"); //column2 has two rows
       
       model.addColumn("First", column1); 
       //model has maximum number of columns (two) 
       model.addColumn("Second", column2); 
       model.setValueAt("Change", 1, 1);
       
       table.setAutoCreateRowSorter(true); //autosorting
       //table.setSelectionMode(0);
       
   }
 
 

Friday 1 February 2013

A few of my works (Fine Art. Acrylic)

A few of my works. Acrylic on canvas. (first one and second one is 24x20 inches).

I love Sunset. I love light reflection on the water. 
One my friend said to me: until people see the Sun they have the hope.
The hope on the future. The hope on the brighter future. 
Our Sun gives us the light, the warm, the life.
When i have anxious depression and feel myself alone i paint the sunset.