Eclipse: Failed to load JavaHL Library.

Eclipse oscar Nessun Commento »
Failed to load JavaHL Library.
These are the errors that were encountered:
no libapr-1 in java.library.path
no libapriconv-1 in java.library.path

Eclipse (-> window for windows OS) -> preferences -> team -> svn 

Choose SVN Interface:

client : SVNKit (Pure Java)

Schermata 2014-10-16 alle 08.48.03

Apply and try again.

If you haven’t SVNKit (Pure Java) then:

Search subclipse plugin for eclipse and install it from eclipse update link. it should be installed automatically

IFrame load event

Javascript, JQuery Soft! Nessun Commento »

You may try this (using jQuery)

$(function(){
    $('#MainPopupIframe').load(function(){
        $(this).show();
        console.log('laod the iframe')
    });

    $('#click').on('click', function(){
        $('#MainPopupIframe').attr('src', 'http://heera.it');    
    });
});

DEMO

Update: Using plain javascript

window.onload=function(){
    var ifr=document.getElementById('MainPopupIframe');
    ifr.onload=function(){
        this.style.display='block';
        console.log('laod the iframe')
    };
    var btn=document.getElementById('click');    
    btn.onclick=function(){
        ifr.src='http://heera.it';    
    };
};

DEMO

Update: Also you can try this (dynamic iframe)

$(function(){
    $('#click').on('click', function(){
        var ifr=$('<iframe/>', {
            id:'MainPopupIframe',
            src:'http://heera.it',
            style:'display:none',
            load:function(){
                $(this).show();
                alert('iframe loaded !');
            }
        });
        $('body').append(ifr);    
    });
});

DEMO

[SVN] Error: svn: E155004 Commit failed

Varie Soft! Nessun Commento »
Error: svn: E155004 Commit failed (details follow):
svn: E155004: Working copy '/path/to/repo' locked
svn: E155004: '/path/to/repo' is already locked.
find . -name 'lock' -exec rm -v {} \;

The problem is that with Subversion 1.7 this doesn’t work anymore. The good news is there is a better way to do this – and what it appears I should have been doing this all along. All you need is:

<-- linea di comando -->
svn cleanup

<-- interfaccia -->
1 - Select the project
2 - Right click on the selected Project
3 - Team -> Cleanup

If you’re interested, the man page is available in the SVN book.

Rimuovere da Eclipse la validazione dell’HTML

Linux, PHP, WordPress Soft! Nessun Commento »


A volte è utile non avere un controllo dell’HTML su Eclipse. Ecco come fare:

Eclipse -> Preferenze -> Validation

Personalizzato per ogni progetto:

Properties -> Validation

disabilita tutti i check che riguardano HTML.

Paginazione di un datagrid in flex

Varie Soft! Nessun Commento »

L’esempio vale più di mille spiegazioni:

import mx.collections.ArrayCollection;
        import mx.utils.StringUtil;

        private static const DP_LENGTH:int = 100;
        private static const VISIBLE_ROWS_COUNT:int = 20;

        [Bindable]
        private var currentPage:int = 0;

        [Bindable]
        private var dataProvider:ArrayCollection;

        protected function init():void
        {
            var dpArray:Array = [];
            for (var i:int = 0; i < DP_LENGTH; i++)
            {
                var item:Object = { first: i, second: Math.random(), third: Math.random() };
                dpArray.push(item);
            }
            dataProvider = new ArrayCollection(dpArray);
            dataProvider.filterFunction = pagingFilterFunction;
            dataProvider.refresh();
        }

        protected function nextPage():void
        {
            currentPage++;
            dataProvider.refresh();
        }

        protected function prevPage():void
        {
            currentPage--;
            dataProvider.refresh();
        }

        private function pagingFilterFunction(item:Object):Boolean
        {
            var start:int = currentPage * VISIBLE_ROWS_COUNT;
            var end:int = start + VISIBLE_ROWS_COUNT - 1;
            var index:int = dataProvider.getItemIndex(item);
            return (index >= start) && (index <= end);
        }

Interessante articolo Adobe Flex DataGrid with 4 million rows. Demo

Accessing services-config.xml values from Flex at runtime

AIR, AS3, Flex Soft! Nessun Commento »

Ecco come accedere al file services-config.xml in runtime.

<?xml version="1.0" encoding="UTF-8"?>
<services-config>
	<services>
		<service id="amfphp-flashremoting-service" class="flex.messaging.services.RemotingService"
				messageTypes="flex.messaging.messages.RemotingMessage">
			<destination id="amfphp">
				<channels>
					<channel ref="my-amfphp"/>
				</channels>
				<properties>
					<source>*
				</properties>
			</destination>
		</service>
	</services>
	<channels>
		<channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
			<endpoint uri="gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
		</channel-definition>
	</channels>
</services-config>

Provare:

trace(ServerConfig.getChannel("my-amfphp").endpoint);
Home | Graffiti e Disegni | Educazione | Chi siamo | Blog | Progetti | Contatti
RSS Feed Comments RSS Accedi