Moonic's notes


Monday, October 31, 2005

eps tips

For converting of .eps to .pdf with the scalling to the paper size under Linux (or cygwin under Windows) use command epstopdf *.eps

Friday, October 28, 2005

Figure from Visio to LaTeX

In order to get the Visio figure that will work for LaTeX:

1. To print selection to PDF (requires Adobe Acrobat Pro)

2. Open .pdf and save as .ps or .eps (requires Adobe Acro or Acro Reader)

3. Open .ps (or .eps) and save "ps to eps" to reformat bounded box (requires Ghostviewer)

4. .eps file is ready for use.

Thursday, October 20, 2005

Concurrency vs. Parallelism

Despite the fact that in some contexts the terms concurrency and parallelism are not distinguished, some important differences should be mentioned.
Concurrency in a programming language and parallelism in the underlying hardware are independent concepts. Hardware operations occur in parallel if they overlap in time. Operations in the text of a program are concurrent if they could, but need not be, executed in parallel. Operations that occur one after the other, ordered in time, are said to be sequential. We can have concurrency in a language without parallel hardware, and we can have parallel execution without concurrency in the language. Shortly, concurrency refers to the potential for parallelism.
The Sun’s 'Multithreaded Programming Guide for Solaris' provides good definitions. Parallelism is a condition that arises when at least two threads are executing simultaneously, while concurrency is a condition that exists when at least two threads are making progress. Therefore concurrency is a more generalized form of parallelism that can include time-slicing as a form of virtual parallelism.

Friday, October 14, 2005

SunRay's key tip

Tips for those who have SunRay from Sun Microsystems:

Keys and configuration

• Access Sun Ray configurator
Shift + Props
• Terminate current session (kills X-server)
Ctrl + Alt + BackSpace + Backspace
• Reset Sun Ray (does not reset current session).
Ctrl + Power (the moon in the upper right corner)

LaTeX tip #2

For report document style numbering is chapter.section[.subsection] : : :
Thus, without "/chapter" use of /section will result in numbering 0.1, 0.2, ...
One solution is to use /section* instead of /section.
Another solution is to define own style, which is rather complex for the beginners.
Making the document class 'an article' will also solve the problem, since the section is the first level division.

Thursday, October 13, 2005

LaTeX tip #1

There are several ways to customize paragraph indentation in LaTeX.
First of all, to indent the first paragraph one should use \usepackage{indentfirst} which will do the job.
Moreover, LaTeX ignores extra spaces and line breaks in the middle of a paragraph, so we don't need to worry about having these. To signify the end of a paragraph include a blank line in the input text by pressing Return twice. One can use \\ to force a line break without an indent and use \ / to include an extra space (this is particularly useful when italic text is right next to other text and it looks too close).

Wednesday, October 12, 2005

SQL Aggregate functions

Aggregate functions operate against a collection of values, but return a single, summarizing value. Aggregate functions return a single value based upon a set of other values. If used among many other expressions in the item list of a SELECT statement, the SELECT must have a GROUP BY clause. No GROUP BY clause is required if the aggregate function is the only value retrieved by the SELECT statement. The supported aggregate functions and their syntax are listed in Table 4-1.
Table 4-1: SQL99 Aggregate Functions
---------------------------------------------------------------------------------
Function |Usage
---------------------------------------------------------------------------------
AVG(expression) |Computes the average value of a column by the expression
---------------------------------------------------------------------------------
COUNT(expression)|Counts the rows defined by the expression
---------------------------------------------------------------------------------
COUNT(*) |Counts all rows in the specified table or view
---------------------------------------------------------------------------------
MIN(expression) |Finds the minimum value in a column by the expression
---------------------------------------------------------------------------------
MAX(expression) |Finds the maximum value in a column by the expression
---------------------------------------------------------------------------------
SUM(expression) |Computes the sum of column values by the expression
---------------------------------------------------------------------------------

Technically speaking, ANY, EVERY, and SOME are considered aggregate functions. However, they have been discussed as range search criteria since they are most often used that way. Refer to the SELECT . . . WHERE topic in the previous chapter for more information on these functions.
The number of values processed by an aggregate varies depending on the number of rows queried from the table. This behavior makes aggregate functions different from scalar functions, which require a fixed number and fixed type of parameters.
The general syntax of an aggregate function is:

aggregate_function_name ( [ALL | DISTINCT] expression )

The aggregate function name may be AVG, COUNT, MAX, MIN, or SUM. The ALL clause, which is the default behavior and does not actually need to be specified, evaluates all rows when aggregating the value of the function. The DISTINCT clause uses only distinct values when evaluating the function.

AVG and SUM
The AVG function computes the average of values in a column or an expression. SUM computes the sum. Both functions work with numeric values and ignore NULL values. They also can be used to compute the average or sum of all distinct values of a column or expression.
AVG and SUM are supported by Microsoft SQL Server, MySQL, Oracle, and PostgreSQL.

Example
The following query computes average year-to-date sales for each type of book:

SELECT type, AVG( ytd_sales ) AS "average_ytd_sales"
FROM titles
GROUP BY type;

This query returns the sum of year-to-date sales for each type of book:

SELECT type, SUM( ytd_sales )
FROM titles
GROUP BY type;


COUNT
The COUNT function has three variations. COUNT(*) counts all the rows in the target table whether they include nulls or not. COUNT(expression) computes the number of rows with non-NULL values in a specific column or expression. COUNT(DISTINCT expression) computes the number of distinct non-NULL values in a column or expression.

Examples
This query counts all rows in a table:

SELECT COUNT(*) FROM publishers;

The following query finds the number of different countries where publishers are located:

SELECT COUNT(DISTINCT country) "Count of Countries"
FROM publishers


MIN and MAX
MIN(expression) and MAX(expression) find the minimum and maximum value (string, datetime, or numeric) in a set of rows. DISTINCT or ALL may be used with these functions, but they do not affect the result.
MIN and MAX are supported by Microsoft SQL Server, MySQL, Oracle, and PostgreSQL.
MySQL also supports the functions LEAST() and GREATEST(), providing the same capabilities.

Examples
The following query finds the best and worst sales for any title on record:

SELECT 'MIN' = MIN(ytd_sales), 'MAX' = MAX(ytd_sales)
FROM titles;


Aggregate functions are used often in the HAVING clause of queries with GROUP BY. The following query selects all categories (types) of books that have an average price for all books in the category higher than $15.00:

SELECT type 'Category', AVG( price ) 'Average Price'
FROM titles
GROUP BY type
HAVING AVG(price) > 15



Monday, October 10, 2005

laptop-FC problem

The interesting problem was discovered today - my HP nc4000 under FC4 couldn't control fan. Another related problem is when the FC is restarting it seems not turning off itself as it suppose to do but rather runs windows (the next choisen system) on top. Sounds a bit stupid, but...
Solution is not yet found...

Nickname burden

It is always hard to find an empty/nonused nickname on the network that works for a long time. That's how my nickname Lunatik turned to Moonic one.:)

Happy Birthday to myself



I'm not very selfish person, but I would like to congradulate myself today:) Happy Birthday!

p.s. another test message:)
p.p.s the most funny HB phrase was:
Donnie (19:06:23): s dnem prilunenya!

Thursday, October 06, 2005

First Message

This is my first blog entry and i would like to start it with 'test test'!