avatar
Today is събота
04.09.2010

08.08.2010

sprintf() в javascript

от admin — Категории: javascriptНяма коментари

Ако много много ви липсва sprintf() и пишете на javascript, тогава може да проверите този линк :
http://code.google.com/p/sprintf/

Душата ви вече може да е спокойна, че няма да конкатенирате стрингове ;)

12.07.2010

Първи ден на работа.

от admin — Категории: ДругиНяма коментари

Ектра беше ;) Не мога да бъда по-доволен. VMWare си знаят работата.
Остава само да навляза по-бързо в нещата и да започна да кодя ;)
vmware logo

04.06.2010

Flex 4: Application.application -> FlexGlobals.topLevelApplication

от admin — Категории: Flex, Flex tips&tricksНяма коментари

Ако сте свикнали във Flex 3 да ползвате

Application.application

вече кода е

FlexGlobals.topLevelApplication

22.05.2010

Flex component lifecycle

от admin — Категории: Flex, Flex tips&tricksНяма коментари

Ако се чудите от къде да намерите добре обяснен component lifecycle за Flex SDK 3/4, може да изгледате следното клипче :
http://weblog.mrinalwadhwa.com/2009/02/17/understanding-the-flex-component-lifecycle/
От 2008-ма е, но е обяснено много добре.

19.05.2010

Ако ще ходите на интервю за работа.

от admin — Категории: ДругиНяма коментари

http://sites.google.com/site/steveyegge2/five-essential-phone-screen-questions
Прочетете тази статия ;) От първото до последното изречение са само истински неща.

08.04.2010

Какво на кой порт слуша ?

от admin — Категории: javaНяма коментари

Пиша си аз Java Server и bind-вам на случаен порт, всичко върви и изведнъж гърми някакъв странен Exception.
Нещо се е оплескало, Java-та спря, а на порта продължава да слуша ServerSocket-a.
Ако искате да проверите дали някой порт в момента е свободен или нещо слуша на него, под Windows направете така :
run-> cmd -> netstat -o -n -a | findstr 0.0:5555
като в случая на 5555 сложете произволен порт.

Ако ви изпише
TCP 0.0.0.0:5555 0.0.0.0:0 LISTENING 5260
Значи нещо слуша там.
Ако не изпише нищо – порта е свободен.

А самата Java може да спрете през task manager-a, като намерите javaw.exe с малко памет и го прекратите.

25.12.2009

Flash Builder 4 ака Flex 4

от admin — Категории: Други1 Коментар

Реших, че ми е крайно време да пробвам новата бета и да видя какви са промените.
Мога да кажа, че останах очарован ;) Не гледах новите промени по компонентите, mxml-а etc, ами реших направо да пробвам дълбоките води – data centric development ( това значи 1во да си напишеш бекенда и да вържеш флекса към service-ите )
Понеже не знаех кода за цялата далавера, реших да ползвам wizard-a.
Това е класът, който ползвах.

<?php 
 class TestService {
    public function hello() {
      return "hello";
    }
 
    public function helloWithName($name) {
      return "Hello " . $name; 
    }
 }
?>

Първо при създаване на нов проект – посочих PHP, посочих си web root и root url-a ( htdocs, localhost ), след което посочих къде се намира PHP класът, изтегли ми автоматично Zend Framework, и създаде 2 класа за ползване.
Важният е това :

/**
 * This is a generated class and is not intended for modfication.  To customize behavior
 * of this service wrapper you may modify the generated sub-class of this class - TestService.as.
 */
package services.testservice
{
import mx.rpc.AsyncToken;
import com.adobe.fiber.core.model_internal;
import mx.rpc.AbstractOperation;
import mx.collections.ItemResponder;
import mx.rpc.remoting.RemoteObject; 
import mx.rpc.remoting.Operation;
import com.adobe.fiber.services.wrapper.RemoteObjectServiceWrapper;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;
import com.adobe.serializers.utility.TypeUtility;
 
[ExcludeClass]
internal class _Super_TestService extends RemoteObjectServiceWrapper
{      
 
    // Constructor
    public function _Super_TestService()
    {
        // initialize service control
        _serviceControl = new RemoteObject(); 
 
        var operations:Object = new Object();
        var operation:Operation;         
 
        operation = new Operation(null, "hello");
		 operation.resultType = String; 		 
        operations["hello"] = operation;
 
        operation = new Operation(null, "helloWithName");
		 operation.resultType = Object; 		 
        operations["helloWithName"] = operation;
 
 
        _serviceControl.operations = operations;   
		_serviceControl.convertResultHandler = TypeUtility.convertResultHandler;
        _serviceControl.source = "TestService";
        _serviceControl.endpoint = "gateway.php";
		_serviceControl.destination = "TestService";
 
 
 
         model_internal::initialize();
    }
 
	/**
	  * This method is a generated wrapper used to call the 'hello' operation. It returns an AsyncToken whose 
	  * result property will be populated with the result of the operation when the server response is received. 
	  * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
	  * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.rpc.AsyncToken
      * @see mx.rpc.CallResponder 
      *
      * @return an AsyncToken whose result property will be populated with the result of the operation when the server response is received.
	  */          
	public function hello() : AsyncToken
	{
		var _internal_operation:AbstractOperation = _serviceControl.getOperation("hello");
		var _internal_token:AsyncToken = _internal_operation.send() ;
 
		return _internal_token;
	}   
 
	/**
	  * This method is a generated wrapper used to call the 'helloWithName' operation. It returns an AsyncToken whose 
	  * result property will be populated with the result of the operation when the server response is received. 
	  * To use this result from MXML code, define a CallResponder component and assign its token property to this method's return value. 
	  * You can then bind to CallResponder.lastResult or listen for the CallResponder.result or fault events.
      *
      * @see mx.rpc.AsyncToken
      * @see mx.rpc.CallResponder 
      *
      * @return an AsyncToken whose result property will be populated with the result of the operation when the server response is received.
	  */          
	public function helloWithName(name:Object) : AsyncToken
	{
		var _internal_operation:AbstractOperation = _serviceControl.getOperation("helloWithName");
		var _internal_token:AsyncToken = _internal_operation.send(name) ;
 
		return _internal_token;
	}   
 
}
 
}

А другият е просто наследен с по-хубаво име и за надграждане.

/**
 * This is a generated sub-class of _TestService.as and is intended for behavior
 * customization.  This class is only generated when there is no file already present
 * at its target location.  Thus custom behavior that you add here will survive regeneration
 * of the super-class. 
 **/
package services.testservice
{
public class TestService extends _Super_TestService
{       
}
}

А самото ползване става така :

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768" xmlns:testservice="services.testservice.*">
	<s:layout>
		<s:VerticalLayout/>
	</s:layout>
 
	<fx:Script>
		<![CDATA[
			import mx.controls.Alert;
			import mx.events.FlexEvent;
			import mx.rpc.events.ResultEvent;
 
 
			protected function button1_clickHandler(event:MouseEvent):void
			{
				//da izvikame service-a
				var s:String = nameInput.text;
				helloResult.token = testService.helloWithName(s);
				helloResult.addEventListener(ResultEvent.RESULT, onResult);
 
			}
 
			protected function onResult(e:ResultEvent):void 
			{
				Alert.show(e.result.toString());
			}
 
		]]>
	</fx:Script>
 
	<fx:Declarations>
		<s:CallResponder id="helloResult"/>
		<testservice:TestService id="testService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
	</fx:Declarations>
	<s:Button click="button1_clickHandler(event)" />
	<s:TextInput id="nameInput" />
</s:Application>

Направо да не повярваш колко лесно става цялата тази работа !
Евала на Adobe.
Мисля в скоро време да направя 1 видео по-подробно за тези сървизи и как да се качи такова чудо на production сървър.

25.11.2009

Енотека. FailТека

от admin — Категории: Други1 Коментар

Много хора им харесват дизайна.
Аз не съм от тях.
енотека

14.09.2009

Fluid HTML – HTML markup за Flash O_O

от admin — Категории: ДругиНяма коментари


Това ще е нещо голямо, ако се развие в правилната посока !
Аз с най-голямо удоволствие бих го ползвал в целия му потенциал, но за сега явно е още в развитие. Да се надяваме, че Adobe ще видят тези хора, ще ги наемат на работа и ще праработят тази технология в следващата версия на Flash Player.

07.08.2009

Вече съм студент ;) (party)

от admin — Категории: Други1 Коментар

И аз барабар с останалите студенти, вчера се записах във ФМИ, специалност КН ( компютърни науки ).
Октомври месец ще се види що за чудо е ;)

© 2010 Rado's blog All rights reserved - Wallow theme by TwoBeers Crew - Powered by WordPress - Забавлявайте се!