Ваш МакБук уже не очень белый - тогда ацетон идет к Вам :)

November 10th, 2008 vira Posted in mac | 2 Comments »

Как известно, со временем корпус белого МакБука желтеет и не доставляет былого эстетического удовольствия. В моем случае, визуальный дефект еще больше усилился после установки нового аккумулятора - его белая поверхность делала корпус еще желтее.

 Результат от средств, которые советовали на всяческих форумах/блогах и т.п. (а это были средства для чистки дисков и зубной порошок),  меня не удовлетворил… и я решила подойти к вопросу радикально - снять верхний слой пластмассы (благо он довольно толстый)  с помощью растворителя. Эдинственное что было под рукой - жидкость для снятия лака для ногтей - отлично справилось со своей задачей. Корпус стал как новый и аккумулятор его не позорит теперь :-) Эдинственное замечание - надо быть осторожными с  текстом/значками на корпусе… ато у меня уже аудио выход не подписан….

Возможно это не самый щадящий метод очистки, но довольно дешевый, доступный, эффективный и мне помог :) 


WWDC 2008!

June 9th, 2008 vira Posted in mac | No Comments »

Уже началось! Одна из текстовых/фото трансляций на инглише MacRumorsLive. Приятного прочитывания )


True MacCat

June 5th, 2008 vira Posted in All, mac | 5 Comments »

Фотосессия моей кошки Ассы - истинной фанатки “теплой” продукции Apple. Правда рассматривает MacBook  она исключительно как место для сна :-) Отношения Ассы с ноутбуком были исследованы и задокументированы. Фото под катом. Read the rest of this entry »


Using Google Search API from Java

April 25th, 2008 vira Posted in Computer science | 4 Comments »

Recently I’ve discovered ability to search in Google from Java program in a way different from brute “crawling”.

And I’ve found out two options:

Google SOAP API

With this API you can issue search requests to Google’s index of billions of web pages and receive results as structured data, access information in the Google cache, and check the spelling of words. Google SOAP Search API is implemented as a web service and all you need is just get WSDL and call remote methods through SOAP protocol. Usage of this service is limited to 1000 requests per day.

But as you can read on SOAP API site

As of December 5, 2006, we are no longer issuing new API keys for the SOAP Search API. Developers with existing SOAP Search API keys will not be affected.

So you aren’t able to get API key (I found the old one in Internet).
And Google encourages you to use the AJAX Search API, which is described below.

Example of code that perform search request and show obtained results.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import com.google.soap.search.*;
import java.io.*;
 
public class SimpleGoogleDemo {
 
  public static void main(String[] args) {
 
    // Create a Google Search object, set our authorization key
    GoogleSearch s = new GoogleSearch();
    String clientKey="xxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    s.setKey(clientKey);
    s.setQueryString("vera.org.ua");
    GoogleSearchResult result = null;
    // Depending on user input, do search or cache query, then print out result
    try {
 
      	result = s.doSearch();
 
    }
    catch (GoogleSearchFault f) {
      System.out.println("The call to the Google Web APIs failed:");
      System.out.println(f.toString());
    }
 
    // if we made it here, the search went through
    System.out.println("Google Search Results:");
    System.out.println("======================");
    if (result!= null)
	    System.out.println(result.toString());
  }
 
}

To run this code you need to have googleapi.jar in your classpath. This jar file contains very useful and easy-to-use class com.google.soap.search.GoogleSearch, which does all search work.

Google AJAX API

Usage of this unlimited and you can make as many request as you want.
Despite the fact that Google in this API FAQ say “The Google AJAX Search API is currently available only for websites.” ability to use it exists :-)

Example of code that perform search request and show obtained results.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import java.io.*;
import java.net.*;
 
public class GoogleAJAXSearchAPI {
    private static String endpointURL = "http://www.google.com/uds/GwebSearch?"+
          "callback=GwebSearch.Raw" +
          "Completion&context=0&lstkp=0&rsz=small&hl=en&" +
          "sig=8656f49c146c5220e273d16b4b6978b2&q=vera.org.ua&key=xxxxxxxxxxxxxxxxxxxxxxxxxxxx&v=1.0";
 
    public static void main(String[] args) throws Exception {
        URLConnection uc = new URL(endpointURL).openConnection();
        HttpURLConnection connection = (HttpURLConnection) uc;
        connection.setDoOutput(true);
        connection.setRequestMethod("GET");
        connection.connect();
 
        String line;
        InputStream inputStream = null;
        try {
            inputStream = connection.getInputStream();
        } catch (IOException e) {
            inputStream = connection.getErrorStream();
        }
        BufferedReader rd = new BufferedReader(new InputStreamReader(inputStream));
        while ((line = rd.readLine()) != null) {
            System.out.println(line);
        }
    }
}

To run this code you just need to get API key here.
So, have fun :)


Fun with Macbook’s accelerometer :)

March 30th, 2008 vira Posted in Science | 1 Comment »

Недавно обнаружила, что в моем Макбуке присутсвует такой датчик, как SMS - sudden motion sensor - т.е. датчик внезапного перемещения ноутбука. Базируется он на акселерометре, который меряет проекцию (на свою ось чувствительности) суммы всех сил, приложенных к его корпусу, кроме силы тяжести. Во как :-)

С практической точки зрения этот датчик может измерить наклон предмета, к которому он прикреплен относительно какой-то оси. А если разместить их по нескольким осям, то и таких наклонов больше можно определить.

Read the rest of this entry »


Leopard’s Spotlight еще и математик :)

February 23rd, 2008 vira Posted in Science | No Comments »

Порой надо что-то сложнее 2+2 быстро посчитать. Не тратя для этого время на запуск калькуляторов и более серьезных вещей. Для простых операций можно воспользоваться виджетом “Калькулятор” в Dashboard-е, но оказывается есть более быстрый и мощный метод - воспользоваться Spotlight-ом.В строку поиска нужно ввести необходимое математическое выражение, причем можно использовать тригонометрические функции (cos, sin, tan, atan, acos, asin), логарифмы, возведение в степень (pow(что, показатель степени), sqrt - корень квадратный)

Например, проверим известную со школы истину cos^2(x)+sin^2(x)=1 :

  

spotlight_calcul.jpg

 Как видите, Apple решил согласиться с этой формулой :-)


MacWorld 2008 keynote by Steve Jobs

January 18th, 2008 vira Posted in Science | No Comments »

После часовых поисков ежегодного доклада Стива Джобса (не в виде потокового видео) решила выложить его у себя на сайте. Думаю авторские права я сильно не нарушаю (а на самом деле нарушаю :) ). Но выгоды мне с этого никакой нету, а Эйплу я думаю тоже только польза с этого - еще больше людей посмотрит на их продукты.

Итак, вот и она, ссылка :) - MacWorld 2008 keynote (формат mp4).

Have fun :)


MacBook Air - thinner than the the thinnest part of a Sony TZ series laptop

January 16th, 2008 vira Posted in mac | 1 Comment »

Умеет Apple интриговать - люди ждут их релизов, как второго пришествия :) На моей памяти - iPhone, Leopard и теперь вести из ключевого доклада Стива Джобса, разгадка загадки “There is something in the air” - This is MacBook Air. И он действительно буквально парит в воздухе.

MacBook Air

Read the rest of this entry »


iTunes store - forever :-)

January 8th, 2008 vira Posted in internet, mac | No Comments »

This time I want to write about one wonderfull service from Apple - iTunes store. Yeah, it’s old but I begin to use it relatively recently because I used to think that there isn’t any free stuff.

You can’t even imagine how many good things are in iTunes for free. In fact, you can find more videos/music/podcasts in Internet but with iTunes you get this materials more easily and conveniently. Because this is Apple :-)

And now small offtopic - The main reason for this article is that I’ve found cool videos from Radiohead at iTunes store today. And as their fan I was very happy and decided to share this information with community. You can downloaded it also from this site.

Another good thing I want to tell you about is iTunes U - a lot of eucational video from top universities of the the world like Stanford, MIT, Yale, Berkeley and etc. Here you can download for free various lectures or whole cources. BTW, I’ve found here Donald Knuth lectures on computer algrorithms.

itunesu.jpg

So, wish you nice surfing :-)


Happy New Year for Mac users

December 21st, 2007 vira Posted in Science | No Comments »

Пришла рассылка от магазина MacHouse. Хотя сам магазин мне не нравиться (дорого :( ), но новогоднее поздравление порадовало.

Так что,

Ваши маки и айподы

Поздравляем с Новым годом!

HappyMac