Archive

Archive for the ‘Heap’ Category

Avatar: we want more!

December 21st, 2009

Yesterday, finally watched Avatar movie. I don’t want to talk on the story line – IMHO, everything was simply great. Hopefully, the story will continue, because ending this whole universe only with one movie would have been a crime!

What about:

  1. It’s year 2154 – how far the humanity went in the Universe?
  2. It’s been just the beginning of the story (aka first Dune movie). What about “they’re coming back” part?
  3. Pandora planet was shown just specifically in one region, what about other tribes and areas?

Heap

Google: recent privacy buzz

December 11th, 2009

Recently, Google CEO Erick Schmidt gave interview on privacy of Google users. Here’s the quote:

If you have something that you don’t want anyone to know, maybe you shouldn’t be doing it in the first place. If you really need that kind of privacy, the reality is that search engines — including Google — do retain this information for some time and it’s important, for example, that we are all subject in the United States to the Patriot Act and it is possible that all that information could be made available to the authorities.

Global and Russian internet communities got nuts about this news, especially when Google published their User Dashboard service. Users got amazed by how much information Google is keeping and tracking about their users. Some of people straight away started crying about moving all their searching activities to Bing and switching from Google Apps to other alternatives. But, hold on, let’s take a closer look!

What’s Patriot act?

The Act increases the ability of law enforcement agencies to search telephone, e-mail communications, medical, financial, and other records; eases restrictions on foreign intelligence gathering within the United States (c) Wikipedia

As any US based company Google either Yahoo, of Bing(aka Microsoft) will never deny this Act. And by any call from “upstairs”, any US company will provide all the information about the user, no matter how strict their privacy policy is. Do you really have something “interesting” for US National Security Agencies to show? Or, you’re worrying about this?

If you don’t like the privacies user agreements that US based companies are offering – you can always switch to your native search engine (i.e. Yandex for Russians), but – I doubt that the company would refuse providing private information of the user by the request of National Agencies from your country – it’s 21th century, and we kinda “fighting the same enemy together”, in other words – if you information has anything violating National security – you’re going to get caught anyway – from this side of the boarder, or the other one.

How do we get data about customers?

As any company whatever it is, has the customer database, whatever you search, watch, read, download. All those “marketing” guys doing research on consumer behavior, and product marketing need the trends to prove that the company “needs” given product they’re about to launch. Banks do the same thing with department stores: they know more then you expect. The whole goal of it: give the customer what he wants! If you’re afraid of searching for something ridiculous official, you can always cover yourself with bunch of proxies – and the data will be kept there, not in Google/Bing/etc.

So, what to use?

Anything you like! No matter what you’re going to use, the twist that “everybody knows that you’re not a dog in the Internet” has come, unless you’re really paranoid about your private searching (hiding the fact that you’re googling how to make an apple pie in microwave!).

If you’re really afraid about the fact that you’ve been searching for something completely out of range/law – then you should really think that “you shouldn’t be doing it in the first place”…

Heap , ,

Cyprus as Regional Centre of Education

October 27th, 2009

Recently, the minister of Education gathered the directors of 3 public and 3 private universities in order to setup a new trend of Cyprus education, which will bring more investments to the Educational system and create a promising basis for making Cyprus the centre of Mediterranean Education.
The news were quite positive: due to huge outflow of local students (55% in Cyprus vs. 3% in EU), the Educational system will get more subsidies in order to develop its infrastructure and increase the level of education.

Work Permit

Past:According to official permissions – foreign students are allowed to work, but most of the fields where you might be sent do not have anything in common with what you’ve been studying. For example, undergraduate BA student might be found in agricultural sector collecting olives.

Future: Now, the Ministry of Education is about to lobby the work permit equally for foreign students as well, as the solution for illegal residence, and working experience. We’ve been hearing these stories for long time, thus a big percentage of scepticism remains about the easiness of making this come true.

Research Centres and Grants

Past: in most of the cases, all the grants, exchange programmes were about the local students, – you weren’t simply told about these activities in the Uni to take part. The highest GPA wasn’t giving you the right of studying for free, comparing with local students.

Future: Concerning the recent news, foreign students will finally get the access for grant and exchange programmes as well, equally with the locals. The problem with campuses will be partially solved as well.

Language Problem

Past: (and Present), mainstream faculties are taught in English, but the other part of them remain in Greek. The opportunity of obtaining PhD degree is owned by the Public University of Cyprus, and of course in Greek. Master programmes are also limited by the number of disciplines, which cuts the time of students staying in Cyprus for obtaining their degrees.

Future: This issue will be solved by switching more faculties to English, and finally giving out the chance of Private Universities provide high degrees of education, like PhD, MsPhil, etc.

Overall

The newspapers, and TV discussing this story shown that the Ministry of Education at least realizes their long-run problems. Hopefully they’ll get at least 30% closer to what they’re planning to do, that will be enough to show all the financial opportunities in investing to Education then in just selling houses.

Heap , ,

CakePHP: jQuery styling of flash messages

January 30th, 2009

CakePHP session flash messages is one of the most useful things for usability, and user notification. Trying to make it more fancy, I came to jQuery framework with its HighlightFade plugin.

Adding just a couple of lines, we can get nice effects, looking the same as Wordpress messages in Posting/Editing:

var $j = jQuery.noConflict(); //I'm using Prototype as well, so we don't need conflicts
$j(document).ready(function() {
if( $j("#flashMessage") ){
$j("#flashMessage").highlightFade({color:'#24F273',speed:2000, iterator:'exponential'});
}
});

Thus, next time you will pass $this->Session->setFlash('Foo');, your flash message with default

flash();?>


will be used with above HighLight effect.

Heap, PHP , , ,

Learning C++ as new language

January 7th, 2009

Quite interesting article from Stroustrup (unfortunately dated by 1999), however still topical. Here is a small list of concepts a person should be considered. The the approach to a new language, which:

– proceeds from the concrete to the abstract,
– presents language features in the context of the programming and design techniques that they exist
to support,
– presents code relying on relatively high-level libraries before going into the lower-level details (nec-
essary to build those libraries),
– avoids techniques that do not scale to real-world applications,
– presents common and useful techniques and features before details, and
– focus on concepts and techniques (rather than language features).

As well, as some interesting comparisons of C and C++ languages in his article.

Heap , ,

CakePHP: complex SELECT queries

September 3rd, 2008

As the project grows I had to work on some more complex queries to provide users with better searching facilities.

In this case, you might use two options:

  • Straightforward find() function from App::Model (where you’ll have to handle the outpu of data yourself, and trying to fit the search results in your websites layout)
  • Use Pagination functionality (which is designed for handling big chunks of data for you)

A simple example: from a small search menu, I need to get the data about item’s price, its type etc, so at this point, find() solution would look like:

$condition = array('OR' => array(
'Item.type' => $this->data['Item']['type'],
'Item.qty' => $this->data['Item']['qty'],
),
array('Item.price BETWEEN ? AND ?' => array($start_price,$end_price))
);
$this->('results', $this->Item->find('all', $condition));

Once you set results array in the view template, it will cause you few hours on how to rearrange data presentation, meanwhile you can use Pagination:


/*
* I'm going to use the same $condition
* the difference will be at the view level and the way of setting the data "results"
*/
$this->set('results', $this->paginate('Item', $condition);

And in the view you might add some code like:

echo $paginator->counter(array(
'format' => __('%page% of %pages%, showing %current%
records out of %count% total, starting on record %start%, ending on %end%', true)
));

foreach($results as $i => $item):
/*
* Items output
*/
endforeach;
?>
prev('<< '.__('Previous Page', true),
array(), null, array('class'=>'disabled'));?>
| numbers();?>
next(__('Next Page', true).' >>',
array(), null, array('class'=>'disabled'));?>

Last lines of the code would manage the results listing for you, which has to be defined in your Controller:

var $paginate = array(
'Item' => array(
'limit' => 5,
'order'=> array('Item.added' => 'ASC')
)
)

Done, now you can easily handle your search outputs. ;)

Heap, Linux , , ,