domenica 31 luglio 2011

javascritp per manipolare immagini (filtri..)

Immaginate di voler fare un'applicazione che consente di gestire le foto in ogni fase:
1) upload massivo
2) ridimensionamento massivo o mirato
3) applicazione di filtri...

Ecco per la III terza parte si puo usare http://camanjs.com/


provare !!!!

guardate il preset example:

http://camanjs.com/examples/presets

vi ricorda un po instagram e affini?

instagram from java

se avete un iphone e vi piace fare foto, non potetet non provare instagram..l'ultimo ritrovato dello scatto istantaneo (stile polaroid) solo per iphone (questo non piace...) con una serie di filtri per abbellire, rendere + strane le vs immagini...

a noi interessa usare le api da java...
è possibile soltanto il recupero delle foto/informazioni/commenti/amici...
non si può caricare nulla....

ho provato questa libreria, ancora poco organizzata
https://github.com/sachin-handiekar/jInstagram

(va checkoutata e compilata ion locale, non ci sono librerie..no maven...no ant)...


una guida minimale per muovere i primi passi:
https://github.com/sachin-handiekar/jInstagram/wiki/jInstagram-Usage

per fare i test vi serve la registrazione sul sito:
http://instagram.com/developer/

per fare dei test da client (eclipse), fate cosi:
1) create una paginetta (che magari scrive solo ciao!) su un server pubblico:

basta che sia raggiungibile:
es http://giava.by/instaflower/oauth/index.html

2) da browser chiamate questo indirizzo:
http://instagram.com/oauth/authorize/?client_id=CLIENT_ID&redirect_uri=REDIRECT-URI&response_type=token

sostituite nell'url il CLIENT_ID che avete ricevuto nel registrarvi sul sito sviluppatori e il vs indirizzo pubblico (REDIRECT-URI)

3) prendete il token che vi è stato assegnato:

es: http://giava.by/instaflower/oauth/#access_token=xxxxxx.xxx.1926f93543824d95bb83d3a9805874df

access_token=xxxxxx.xxx.1926f93543824d95bb83d3a9805874df

ecco un esempio rapido per avere tutte le vs foto:

import java.util.List;

import org.jinstagram.Instagram;
import org.jinstagram.auth.model.Token;
import org.jinstagram.entity.common.Caption;
import org.jinstagram.entity.common.Comments;
import org.jinstagram.entity.common.ImageData;
import org.jinstagram.entity.common.Images;
import org.jinstagram.entity.common.Likes;
import org.jinstagram.entity.common.Location;
import org.jinstagram.entity.users.basicinfo.UserInfo;
import org.jinstagram.entity.users.basicinfo.UserInfoData;
import org.jinstagram.entity.users.feed.MediaFeed;
import org.jinstagram.entity.users.feed.MediaFeedData;
import org.jinstagram.entity.users.feed.UserFeed;
import org.jinstagram.entity.users.feed.UserFeedData;
import org.jinstagram.exceptions.InstagramException;

public class First {

static String your_client_secret = "172460d1932b4393b2097f67dfd78ff1";
static String access_token="xxxxxx.xxx.1926f93543824d95bb83d3a9805874df";
static String nickname ="pippoPluto";

public static void main(String[] args) throws InstagramException {

Token accessToken = new Token(
access_token,
your_client_secret);
Instagram instagram = new Instagram(accessToken);
UserFeed userFeed = instagram.searchUser(nickname);
List userList = userFeed.getUserList();
long userId = 0;
for (UserFeedData userFeedData : userList) {
userId = userFeedData.getId();
}
UserInfo userInfo = instagram.getUserInfo(userId);

UserInfoData userData = userInfo.getData();
System.out.println("id : " + userData.getId());
System.out.println("first_name : " + userData.getFirst_name());
System.out.println("last_name : " + userData.getLast_name());
System.out
.println("profile_picture : " + userData.getProfile_picture());
System.out.println("website : " + userData.getWebsite());

MediaFeed mediaFeed = instagram.getUserFeeds();
List mediaFeeds = mediaFeed.getData();

for (MediaFeedData mediaData : mediaFeeds) {
System.out.println("id : " + mediaData.getId());
System.out.println("created time : " + mediaData.getCreatedTime());
System.out.println("link : " + mediaData.getLink());
System.out.println("tags : " + mediaData.getTags().toString());
System.out.println("filter : " + mediaData.getImageFilter());
System.out.println("type : " + mediaData.getType());

System.out.println("-- Comments --");
Comments comments = mediaData.getComments();

System.out.println("-- Caption --");
Caption caption = mediaData.getCaption();

System.out.println("-- Likes --");
Likes likes = mediaData.getLikes();

System.out.println("-- Images --");
Images images = mediaData.getImages();

ImageData lowResolutionImg = images.getLowResolution();
ImageData highResolutionImg = images.getStandardResolution();
ImageData thumbnailImg = images.getThumbnail();

Location location = mediaData.getLocation();
if (location != null)
System.out.println(location.getName());
System.out.println("****************************************");
}

}
}

mercoledì 27 luglio 2011

jboss7: domini sicurezza custom

alla ricerca di come far funzionare il cas+ldap come moduli di sicurezza a cascata:

http://community.jboss.org/message/613183

http://community.jboss.org/thread/168118

non vera, ma scoraggiante:
http://stackoverflow.com/questions/5046122/how-do-you-specify-the-security-domain-for-a-war-under-jboss-7

jsf: grafici ed excel

riporto una piccola chattata...

argomenti: creare grafi belli e avanzati in jsf.

soluzioni valutabili:
primefaces demo 3 carina sia nell'uso di excel che di chart (ma sono poche)
http://www.primefaces.org/showcase-labs/ui/chartsHome.jsf
http://www.primefaces.org/showcase-labs/ui/sheet.jsf

extjs (molto bella ma tutto javascript)..possibile jsf integrazione:
http://j2flower.blogspot.com/search/label/EXTJS

varie librerie jsf/chart
http://code.google.com/p/jsflot/

ecco la ns conversazione...
[16.25.33] Fulvio : extjs spacca, lo sto usando, anche se con JS faccio fatica
[16.25.39] flower: lo so, ma che deve fare? tutto quello che fa excel? hai visto l'ultima demo di primefaces?


[16.26.37] Fulvio: è un gestionale, c'è bisogno di fare tanti grafici per visualizzare dei dati. abbiamo bisogno di un tipo di chart molto particolare (onde quadre)..
[16.28.22] flower: questo: http://code.google.com/p/jsflot/


[16.30.07] Fulvio : no, che disegni come volgio io... ora vedo se le classiche line chart possono fare onde quadre
[16.32.26] flower: non comprendo, se esiste bene... se no, non è che lo crei tu! è da matti! chi si mette li a farlo?
[16.32.49] Fulvio: ecco appunto :)

[16.30.23] flower: dovresti usare quella libreria che wrappa flex da jsf, quella della exadel, e ti tieni flex (fai animazione flash e passi parametri da jsf)
[16.30.55] flower: http://livedemo.exadel.com/fiji-demo/

[16.33.08] flower: qui li hai tutti
[16.33.05] flower: http://webification.com/php-js-flash-chart-libraries-roundup

jboss6: creare datasource di default

per sostituire il datasource di default (che è su hsqldb):

http://wiki.openscg.com/index.php/JBoss_AS_6_with_PostgreSQL_9

l'esempio è in postgresql, ma vale anche per gli altri...

jboss6: tuning [per velocizzare il boot...]

non esistendo ancora una pagina ufficiale, qui si pososno trovare utili informazioni:

http://community.jboss.org/thread/159648?start=0&tstart=0

lunedì 25 luglio 2011

foto panoramiche: hugin

indispensabile usare hugin:
http://hugin.sourceforge.net/tutorials/index.shtml

http://www.linuxfocus.org/Italiano/September2004/article348.shtml

http://grigio.org/come_creare_foto_panoramiche_magnifiche

http://www.geekissimo.com/2008/08/31/hugin-come-creare-un-panorama-da-una-serie-di-scatti-digitali/

http://gerlos.altervista.org/book/export/html/229

http://www.torinoacolori.it/hugin.html

http://caprasilana.wordpress.com/tag/hugin/

http://thejoe.it/wordpress/2010/06/02/hugin-e-le-foto-panoramiche-alcuni-consigli-per-iniziare/

http://www.volalibero.it/creare_foto_panoramiche.html

http://www.flickr.com/groups/hugin/

http://www.flickr.com/photos/asbruff/sets/72157626013072992/

utile

http://www.bryanhansel.com/2007/a-quick-and-dirty-hugin-panoramic-stitcher-tutorial/

http://shutterexperiments.com/2011/02/06/equirectangular-panoramas/#more-65