воскресенье, 21 октября 2012 г.

delete fileName.* from host


<?php
   $mask
= "sample.*"
   array_map
( "unlink", glob( $mask ) );
?>

Отблагодарить можно через форму справа "Donate" ... )

To reward you via the form on the right "Donate" ... )

:)

Zend File Transfer Rename Multiple

При мульти загрузке требуется переименовывание файла "на ходу".

Пример

$upload = new Zend_File_Transfer();

$upload->setDestination("upload/);

foreach ($upload->getFileInfo() as $k => $v){

   $newname = rand();

   $upload->addFilter('Rename', $newname, $k);

   if ($upload->receive($k)) {

      //GOOD Все файлы залиты с новыми именами

   }

}

Вот и все.

Отблагодарить можно через форму справа "Donate" ... )

To reward you via the form on the right "Donate" ... )

:)

среда, 17 октября 2012 г.

Выводим деньги с PayPal на карту: Инструкция для чайников

Потребовалось мне вывести деньги с PayPal в России, только вот через посредников работать не хотелось. 
Пришлось получить карту Payoneer для вывода PayPal на эту карту. Сколько не искал, так и не нашел полноценной, пошаговой инструкции. 
Поэтому пишу сам. 



ВНИМАНИЕ! Все ниженаписанное является де-юре нарушением законодательства РФ и Украины, и вообще выдумкой автора и плодом работы в фотошопе. Применяя описанное на практике, вы действуете на свой страх и риск, и ни автор, на администрация сайта не несет ответственности за ваши действия.

  1. Идем на Payoneer, и нажимаем большую кнопку Sing Up!. Там все просто, и я не буду расписывать по шагам.

    Последуйте совету на страничке, и вводите полные имя и фамилию, чтоб не получить карту на Vlad Zaytsev, вместо Vladislav которую теперь не принимает пейпал и пара магазинов.
  2. Ждем карту. Мне пришла с украины за две недели. Приходит в обычном конверте. Отправка карты бесплатна. В бумажке раза 3 написано что карту надо активировать, не будем возражать. Идем наPayoneer, нажимаем Activate your Card:

    Логинимся, вбиваем номер карты. Придумываем пин-код. Все, карта активна. Но толку от этого мало.
  3. Пишем на почту support.ru@payoneer.com письмо следующего содержания(можно на русском):
    Прошу включить на аккаунте (ваша почта) карта (номер) US Payment Service
    Вам ответят стандартным письмом о возможностях, и попросят прислать:
    1. Какие услуги или товары Вы предлагаете (пожалуйста, если имеются, предоставьте ссылки на соответствующие веб-сайты)?
      Я писал продажа на Ebay.
    2. Пожалуйста, предоставьте нам ссылки на веб-сайты, показывающие образцы товаров, ресурсов в Интернете, либо услуг, предлагаемых Вами. Пожалуйста, убедитесь, что предоставляемые Вами ссылки упоминают Ваше имя или демонстрируют Ваше отношение к предлагаемым товарам/услугам.
      Дал ссылку на пару лотов.
    3. Пожалуйста, пришлите нам скриншоты Вашего счёта на сайте компании от которой Вы намереваетесь получать платежи (например, PayPal, Amazon, Skrill и т.д.). На скриншоте должны присутствовать Ваше имя и баланс на счету.
      Прислал скриншот пейпала с суммой.
    4. Пожалуйста, предоставьте копию удостоверения личности с фотографией. Это могут быть Ваши водительские права, общегражданский паспорт или загранпаспорт. Если документы не на английском языке, то мы предпочитаем копию загранпаспорта. Вы можете отсканировать / сфотографировать Ваше удостоверение личности и приложить полученный скан/снимок к Вашему ответу на данное сообщение. Пожалуйста, там где необходимо, присылайте копии обеих сторон документа. Мы предпочитаем файлы в формате JPEG размером до 1 MB.
      Российский паспорт подошел, один разворот.

    Ответы дублировал на английском.
  4. Через некоторое время(пара дней), если все сделали правильно, на почту свалится вот такое письмо:

    Это означает, что у вас теперь есть счет в банке США, привязанный к вашей карте.
    ACCOUNT #: 4013435566876 ABA #: 062120184
    Вот два этих номера — и есть ваш аккаунт.
  5. Логинимся в аккаунт PayPal, нажимаем «Снять средства»(Withdraw), в дальнейшем я буду писать английскую версию.
    Предлагают добавить Bank Account, соглашаемся. Заполняем по образцу:

    Номера должны быть ваши, но если вы заполните мои, я не обижусь. Имя банка — First Century Bank, Account Type —
    Checking
    (расчетный счет). Я выбрал savings, и все работает, но все же — в письме выше указан тип.
    Некоторые компании, например Odesk спрашивает название города — «Commerce»
    Если потеряли реквизиты из письма, их всегда можно найти Services — US Payment Service на сайте Payoneer.
  6. Все, в палке нажимаете Withdraw — Withdraw funds to your bank account, вводите сумму,Continue.
    3-4 Business Days означает именно 3-4 дня, не больше и не меньше. За исключением нерабочих дней, но их в году всего 10. Мы на новый год больше отдыхаем.
    С пейпала деньги уйдут:
  7. Ждем 3-4 дня, после этого деньги придут на Payoneer, а на почту свалится письмо:

  8. На счет, правда, попадет меньше: из $1018 на счету оказалось $978, $40 потерялись.
    Из них $30 — годовое обслуживание карты, которое списывается при первом пополнении, а $10 — комиссия payoneer. Это всего 1%:

  9. После этого идем в любой банкомат, и снимаем деньги. Каждый запрос(на снятие, даже если денег нет, или проверка баланса) стоит $1, и $2.15 само снятие денег.
    Т.е. если вы запросите неверную сумму, то с вас спишут $1, а если верную — то $3.15, учитывайте это, и снимайте чуть меньше.
    Снимайте в тех банкоматах, где есть доллары, потом их можно поменять в банке с наиболее выгодным курсом, а не по курсу банкомата с рублями. А еще при снятии в валюте, отличной от официальной валюты страны банк имеет право взымать комиссию. Лучше проверить на маленькой сумме, или позвонить в банк, если это критично.
    Кстати, покупки с карты бесплатны, но при оплате в рублях конвертация осуществляется банком — владельцем терминала.

Отблагодарить можно через форму справа "Donate" ... )

To reward you via the form on the right "Donate" ... )

:)

Android Widget Design Guidelines - Widget Sizes


Widget Design Guidelines


Widgets are a feature introduced in Android 1.5. A widget displays an application's most important or timely information at a glance, on a user's Home screen. The standard Android system image includes several examples of widgets, including widgets for Analog Clock, Music, and other applications.

Users pick the widgets they want to display on their Home screens by touching & holding an empty area of the Home screen, selecting Widgets from the menu, and then selecting the widget they want.



This document describes how to design a widget so it fits graphically with other widgets and with the other elements of the Android Home screen. It also describes some standards for widget artwork and some widget graphics tips and tricks from the Android team.



For information about developing widgets, see the AppWidgets section of the Developer's Guide and the AppWidgets blog post.
Standard widget anatomy

Typical Android widgets have three main components: A bounding box, a frame, and the widget's graphical controls and other elements. Well-designed widgets leave some padding between the edges of the bounding box and the frame, and between the inner edges of the frame and the widget's controls. Widgets designed to fit visually with other widgets on the Home screen take cues from the other elements on the Home screen for alignment; they also use standard shading effects. All of these details are described in this document.

Standard Widget Sizes in Portrait Orientation




Standard Widget Sizes in Landscape Orientation

Designing a widget
Select a bounding box size for your widget.

The most effective widgets display your application's most useful or timely data in the smallest widget size. Users will weigh the usefulness or your widget against the portion of the Home screen it covers, so the smaller the better.

All widgets must fit within the bounding box of one of the six supported widget sizes, or better yet, within a pair of portrait and landscape orientation sizes, so your widget looks good when the user switches screen orientations.

Standard widget sizes illustrates the bounding dimensions of the six widget sizes (three in portrait and three in landscape orientation).
Select a matching frame.

Standard widget frames illustrates the standard frames for the six widget sizes, with links so you can download copies for your own use. You don't have to use these frames for your widget, but if you do, your widgets are more likely to fit visually with other widgets.
Apply standard shadow effect to your graphics.

Again, you don't have to use this effect, but Standard widget shadows shows the Photoshop settings used for standard widgets.
If your widget includes buttons, draw them in three states (default, pressed, and selected).

You can download a Photoshop file that contains the three states of the Play button, taken from the Music widget, to analyze the Photoshop settings used for the three standard button effects.


Finish drawing your artwork and then scale and align it to fit.

Widget alignment tips and tricks describes some techniques for aligning your widget's graphics inside the standard frames, along with a few other widget graphics tricks.
Save your widget with the correct graphics file settings.

Windows graphics file format describes the correct settings for your widget graphics files.
Standard widget sizes

There are six standard widget sizes, based on a Home screen grid of 4 x 4 (portrait) or 4 x 4 (landscape) cells. These dimensions are the bounding boxes for the six standard widget sizes. The contents of typical widgets don't draw to the edge of these dimensions, but fit inside a frame withing the bounding box, as described in Designing a widget.

In portrait orientation, each cell is 80 pixels wide by 100 pixels tall (the diagram shows a cell in portrait orientation). The three supported widget sizes in portrait orientation are:


CellsPixels
4 x 1 320 x 100
3 x 3 240 x 300
2 x 2 160 x 200






In landscape orientation, each cell is 106 pixels wide by 74 pixels tall. The three supported widget sizes in landscape orientation are:
CellsPixels
4 x 1 424 x 74
3 x 3 318 x 222
2 x 2 212 x 148



Standard widget frames

For each of the six standard widget sizes there is a standard frame. You can click the images of the frames in this section to download a Photoshop file for that frame, which you can use for your own widgets.




4x1_Widget_Frame_Portrait.psd


3x3_Widget_Frame_Portrait.psd


2x2_Widget_Frame_Portrait.psd


4x1_Widget_Frame_Landscape.psd


3x3_Widget_Frame_Landscape.psd


2x2_Widget_Frame_Landscape.psd
Standard widget shadows

You can apply a shadow effect to your widget's artwork, so it matches other standard Android widgets, using the following settings in the Photoshop Layer Style dialog box.


Widget graphics tips and tricks

The Android team has developed a few tricks for aligning widget artwork within standard widget bounding boxes and frames, so the widget aligns visually with other widgets and the other elements of the Home screen, as well as other techniques for creating widgets.
Use a screen shot from the Android SDK emulator to align both the shapes and shadows of your widget controls with the Search widget and with other elements on the Home screen.

Cut the widget artwork asset" based on the full size of a cell, including any padding you want. (That is, for a 4 x 1 widget, cut the asset at 320 by 100 pixels.)


To reduce banding when exporting a widget, apply the following Photoshop Add Noise setting to your graphic.


Apply 9-patch techniques to shrink the graphic and set the padding of the content area. (See the detailed guide here.)

Note: The current Android widget templates were designed using a custom gradient angle, which means the 9-patch techniques can't be used to optimize the size of the asset. However, 9-patch techniques were used to set the content area padding.
In some cases, devices have low pixel depths that can cause visual banding and dithering issues. To solve this, application developers should pass assets through a "proxy" drawable defined as XML:. This technique references the original artwork, in this case "background.9.png", and instructs the device to dither it as needed.
Widget graphics file format

Save your widget artwork using the appropriate bounding box size in PNG-24 format on a transparent background and in 8-bit color.





Portrait Mode
4 x 13 x 32 x 2
Bounding Box:320 x 100240 x 300160 x 200
Outer Frame with Shadow:304 x 75224 x 272144 x 189
Inner Edge Box:287 x 58207 x 256129 x 174

Landscape Mode
4 x 13 x 32 x 2
Bounding Box:424 x 74318 x 222212 x 148
Outer Frame with Shadow:412 x 63305 x 200199 x 136
Inner Edge Box:395 x 46288 x 182184 x 121

Отблагодарить можно через форму справа "Donate" ... )

To reward you via the form on the right "Donate" ... )

:)

iPhone 5 vs Samsung Galaxy S III: кто дольше проживёт в блендере?


Вне сомнений, iPhone 5 и Samsung Galaxy S III являются одними из самых лучших смартфонов, которые сейчас можно купить. Сегодня двум заклятым врагам придётся столкнуться с общим противником – блендером. Кто дольше проживёт в этой неравной борьбе?
В ходе этой двойной «пытки» американец с китайскими корнями почти сразу сдался, а кореец, почти как мужественный самурай, ещё некоторое время не сдавался, но в итоге тоже был вынужден упасть на колени перед беспощадным блендером.
Автор: Евгений Бонд

Отблагодарить можно через форму справа "Donate" ... )

To reward you via the form on the right "Donate" ... )

:)

Запустили приложение

World Clock Wallpaper - Musée d'Orsay (Paris)


Скачать из Google Play

Отблагодарить можно через форму справа "Donate" ... )

To reward you via the form on the right "Donate" ... )

:)

четверг, 11 октября 2012 г.

Ainol Novo Legend: IPS-экран на 10", 4 ядра, Android 4.1 и 8000 мАч


Ainol_Novo_Legend.jpg
Китайцы продолжают жечь напалмом, на этот раз представив 10-дюймовый Ainol Novo Legend, у которого характеристики весьма впечатляют на фоне низкой цены.
Так, в базу входят IPS-дисплей с разрешением 1280x800 (последнее выглядит странно – обычно при 9.7" бывает 1024х768, а при 10.1" вполне могут быть 1280x800), четырехъядерный процессор неизвестного производства, ОС Android 4.1 (причём, заявлен доступ в онлайн-магазин приложений Google Play), 1 и 16 ГБ оперативной и флеш-памяти, слот для карт microSD модули Bluetooth 4.0 и Wi-Fi. Аккумулятор также неплох – ёмкость составляет аж 8 Ач. Вес, правда, не самый рекордный (620 г), но терпимый.
А теперь о самом интересном: в Китае его стоимость равна $240, а заказать можно будет в конце октября.

Отблагодарить можно через форму справа "Donate" ... )

To reward you via the form on the right "Donate" ... )

:)

понедельник, 8 октября 2012 г.

Creating a Preference Activity in Android


In this tutorial we will build a preference screen using the PreferenceActivity class. Our main activity will contain 2 Buttons and a TextView. One of the buttons will open the preference screen, and the other will display the values stored in SharedPreferences.
The final output should look like this:

And here’s what happens when clicking on the Username/Password fields (left screenshot), and the List Preference field (right screenshot):

At a first glance it may look a bit intimidating, but as you will see later, actually it’s quite easy to define a preference screen. Trust me, I’m an engineer! (c) :)
To put all this things together in a fashionable way, we will be using the PreferenceActivity class. The good thing about this class is that the definition of layout file it’s very simple. It provides custom controls specially designed for preference screens. Another good thing is that you don’t need to write code to save the values from preference screen to SharedPreferences. All this work is done automatically by the activity.

So, lets begin creating our preference screen
1. Create a new project in Eclipse:
Project: PreferenceDemoTest
Activity: PreferenceDemoActivity
2. Create a new Android XML file prefs.xml in the folder res/xml/. This file will contain the layout for our preference screen:
01<?xml version="1.0" encoding="utf-8"?>
02<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
03 <PreferenceCategory
04   android:summary="Username and password information"
05   android:title="Login information" >
06  <EditTextPreference
07     android:key="username"
08     android:summary="Please enter your login username"
09     android:title="Username" />
10  <EditTextPreference
11     android:key="password"
12     android:summary="Enter your password"
13     android:title="Password" />
14 </PreferenceCategory>
15 
16 <PreferenceCategory
17   android:summary="Username and password information"
18   android:title="Settings" >
19  <CheckBoxPreference
20     android:key="checkBox"
21     android:summary="On/Off"
22     android:title="Keep me logged in" />
23 
24  <ListPreference
25     android:entries="@array/listOptions"
26     android:entryValues="@array/listValues"
27     android:key="listpref"
28     android:summary="List preference example"
29     android:title="List preference" />
30 </PreferenceCategory>
31</PreferenceScreen>
Notice that the root element of prefs.xml is the <PreferenceScreen> elementand not a RelativeLayout or LinearLayout for example. When a PreferenceActivity points to this layout file, the <PreferenceScreen> is used as the root, and the contained preferences are shown.
<PreferenceCategory> – defines a preference category. In our example the preference screen is split in two categories: “Login Information” and “Settings”
<EditTextPreference> – defines a text field for storing text information.
<CheckBoxPreference> – defines a checkbox.
<ListPreference> – defines a list of elements. The list appears as group of radio buttons.

3. At this stage the prefs.xml might complain that the @array/listOptions and @array/listValuesresources cannot be found.
To fix this create a new XML file array.xml in the folder res/values/. This file will contain the elements of the ListPreference.
01<?xml version="1.0" encoding="utf-8"?>
02 <resources>
03   <string-array name="listOptions">
04     <item>Option 1</item>
05     <item>Option 2</item>
06     <item>Option 3</item>
07     </string-array>
08 
09   <string-array name="listValues">
10     <item>1 is selected</item>
11     <item>2 is selected</item>
12     <item>3 is selected</item>
13   </string-array>
14 </resources>
The “listOptions” array defines the elements of the list, or with other words, the labels.
The “listValues” array defines the values of each element. These are the values that will be stored in the SharedPreferences. The number of list options and list values should match. The first list value is assinged to the first list option, the second value to the second option,… and so on.

4. Create a new class PrefsActivity.java that extends PreferenceActivity:
1public class PrefsActivity extends PreferenceActivity{
2 
3@Override
4protected void onCreate(Bundle savedInstanceState) {
5   super.onCreate(savedInstanceState);
6   addPreferencesFromResource(R.xml.prefs);
7}
8}
Notice that instead of the traditional setContentView(), we use hereaddPreferencesFromResource() method. This inflates our prefs.xml file and uses it as the Activity’s current layout.

5. Add the PrefsActivity.java to the AndroidManifest file:
1<application
2......./>
3  <activity
4    android:name=".PrefsActivity"
5    android:theme="@android:style/Theme.Black.NoTitleBar" >
6  </activity>
7</application>

6. Now, to test our preference activity lets modify the main.xml layout file by adding 2 Buttons and 1 TextView. One of the buttons will open the preference screen, and the other will display the values stored in SharedPreferences.
main.xml:
01<?xml version="1.0" encoding="utf-8"?>
02<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
03  android:layout_width="fill_parent"
04  android:layout_height="fill_parent"
05  android:orientation="vertical" >
06 
07<Button
08  android:id="@+id/btnPrefs"
09  android:layout_width="wrap_content"
10  android:layout_height="wrap_content"
11  android:text="Preferences Screen" />
12 
13<Button
14  android:id="@+id/btnGetPreferences"
15  android:layout_width="wrap_content"
16  android:layout_height="wrap_content"
17  android:text="Display Shared Preferences" />
18 
19<TextView
20  android:id="@+id/txtPrefs"
21  android:layout_width="wrap_content"
22  android:layout_height="wrap_content" />
23 
24</LinearLayout>

7. Finally, modify the PreferenceDemoActivity to handle our logic implementation:
01public class PreferenceDemoActivity extends Activity {
02TextView textView;
03 
04@Override
05public void onCreate(Bundle savedInstanceState) {
06   super.onCreate(savedInstanceState);
07   setContentView(R.layout.main);
08 
09   Button btnPrefs = (Button) findViewById(R.id.btnPrefs);
10   Button btnGetPrefs = (Button) findViewById(R.id.btnGetPreferences);
11 
12   textView = (TextView) findViewById(R.id.txtPrefs);
13 
14   View.OnClickListener listener = new View.OnClickListener() {
15 
16   @Override
17   public void onClick(View v) {
18   switch (v.getId()) {
19   case R.id.btnPrefs:
20      Intent intent = new Intent(PreferenceDemoActivity.this,
21      PrefsActivity.class);
22      startActivity(intent);
23      break;
24 
25   case R.id.btnGetPreferences:
26      displaySharedPreferences();
27      break;
28 
29   default:
30     break;
31   }
32   }
33   };
34 
35   btnPrefs.setOnClickListener(listener);
36   btnGetPrefs.setOnClickListener(listener);
37}
38 
39private void displaySharedPreferences() {
40   SharedPreferences prefs = PreferenceManager
41    .getDefaultSharedPreferences(PreferenceDemoActivity.this);
42 
43   String username = prefs.getString("username""Default NickName");
44   String passw = prefs.getString("password""Default Password");
45   boolean checkBox = prefs.getBoolean("checkBox"false);
46   String listPrefs = prefs.getString("listpref""Default list prefs");
47 
48   StringBuilder builder = new StringBuilder();
49   builder.append("Username: " + username + "\n");
50   builder.append("Password: " + passw + "\n");
51   builder.append("Keep me logged in: " + String.valueOf(checkBox) + "\n");
52   builder.append("List preference: " + listPrefs);
53 
54   textView.setText(builder.toString());
55}
56}
Here we attach 2 listeners for each button and display the values retrieved from  SharedPreferences in a TextView.
By this time you should compile and run successfully the application.

Отблагодарить можно через форму справа "Donate" ... )

To reward you via the form on the right "Donate" ... )

:)

друзья )

Сохраняйте и делитесь желаниями, и не забывайте о важных датах! парсинг центр