rulururu

post Convert Criteria to SQL string

September 3rd, 2010

Filed under: Symfony, Tip — Alex Bylim @ 9:18 pm

If you wanna get SLQ-string representation of Criteria just use toString() method

post How to stretch sidebar(div) vertically (whole height of site) ?

June 9th, 2010

Filed under: CSS, Tip — Alex Bylim @ 5:22 pm

Hey dudes, I know there are a lot of different approaches make two-columns layout, and to make sidebar stretch vertically. But always there is one problem: side bar should fill vertical side area 1) when content longer then sidebar 2) when content shorter then sidebar. So here is how to solve this with CSS:

/* this will allow sidebar stretch vertically in right way */
html, body {
	min-height:100%;
	position: absolute; 
        width:100%;
}
 
/* stretching our sidebar */
#sidebar{
 width: 300px;
 height: auto;
 min-height:100%;
 position:absolute;
 background-color: #555;
}

To make content block is not to hard and you need is to set margin-left the same width as sidebar width

post Do you have any issues while scrolling/resizing in Flex/AIR app?

June 9th, 2010

Filed under: AIR, Tip — Alex Bylim @ 4:08 pm

Hi, we started making one of the our largest AIR projects with Flex SDK 3.5 version, but we had some problem while scrolling for example with mouse wheel or even more serious bug like: sometimes while resizing window or changing size of some block during runtime(for example HDivideBox) , application stops respond for any user action and we were seeing a wheel of death.  I did not remember exactly why, but tried to compile application with Flex SDK 4, and some bugs are gone. So I recommend you to use Flex SDK 4 with compile option ” -compatibility-version=3.0″, you should use compatible mode with version three to compile your old projects with Flex SDK 4, as version 4 has some new architect structure and you wont wanna  fix whole code by hands to make it works with Flex SDK 4.

post CSS3 box-shadow property?

April 5th, 2010

Filed under: CSS, Tip — Alex Bylim @ 9:03 pm

Hi. You probably know that there is property box-shadow in the CSS3, and many modern browsers day by day supports more CSS3 features. Few days ago I used text-shadow, pretty cool, I like it. Then I wanted to try box-shadow and… it did not work for me, I thought browsers does not support it yet. I was misstaken, to make it works in popular browsers you can use properties: -moz-box-shadow,  -webkit-box-shadow, box-shadow.  More details you can find on the internet, you even can find how to make it under IE.

post New office

April 4th, 2010

Filed under: Events — Alex Bylim @ 11:50 pm

Our company moved to the new office and few new guys joined our team.

post Bad things happens

April 4th, 2010

Filed under: Events, Tip — Alex Bylim @ 11:47 pm

Hi there! Our site was down for about one week. The reason is our hoster hosting.ua had fire in their data-center! About 20% of servers are dead as well as the back-ups. But we are lucky – server with our blog did not receive damages.

Conclusion:

  • whatever your hoster says to you, you should aslo make back-ups by your own
  • you should have some reserved hosting for such cases
  • you should register your domain at another registrant instead of your hoster, to be able manage it by yourself even if your hoster is down
  • you should use some service that will be checking “is your site up or down”, if it’s not – notify you (SMS, E-Mail)
  • and the main one: don’t worry, everything can be fixed :)

post Calculating amount/percentage of unique domains in email addresses with SQL

March 22nd, 2010

Filed under: Advice, Tip — Zinchenko Oleg @ 5:16 pm

Hello, this is my first technical english post so do not read it very criticaly. I want to describe interesting task with SQL which I faced with.

I have a table with next columns: id, email, etc.

id email etc
1 example@yahoo.com
2 example@gmail.com
90000 example@hotmail.com

I need to calculate quantity of each e-mail domain, calculate percent of domain and sort this information.

Solution:

SELECT
    domain,
    total,
    (total / emailscount) * 100 AS domainpercentage
FROM
    (
        SELECT
        SUBSTRING_INDEX(email, '@', -1) AS domain,
        COUNT(contacts_list.id) AS total,
        (
            SELECT COUNT(cl.id)
            FROM contacts_list AS cl
        ) AS emailscount
        FROM contacts_list
        GROUP BY domain
        ORDER BY total DESC
    ) AS result

Explanation:
At first I select all domains and quantity of their entries.

SELECT
    SUBSTRING_INDEX(email, '@', -1) AS domain,
    COUNT(contacts_list.id) AS total,
    (
        SELECT COUNT(cl.id)
        FROM contacts_list AS cl
    ) AS emailscount
FROM contacts_list
GROUP BY domain
ORDER BY total DESC

Also I select amount of all entries in my table via inner query.

(
    SELECT COUNT(cl.id)
    FROM contacts_list AS cl
) AS emailscount

Then I wrap my query where I select inner`s query results and calculate percentage of each domain.

SELECT
    domain,
    total,
    (total / emailscount) * 100 AS domainpercentage
FROM
(...
) AS result
ruldrurd
Next Page »
Powered by WordPress, Web Design by Laurentiu Piron
Entries (RSS) and Comments (RSS)