buy lasix isotretinoin online buy cialis online
14 des. 2016

Trucs amb el Java

Author: Joaquim Perez Noguer | Filed under: Ciència i tecnologia

Mirant  What are some cool Java tricks? – Quora

He trobat algunes curiositats interessants amb el Java:

Double bracing Lists allows you to declare and initialize without Arrays.asList()
List<String> places = new ArrayList<String>() {
{ add(“x”); add(“y”); }

Joint-union in generic type params
public class Baz<T extends Foo & Bar> {}

Define, instantiate, and call all at once
new Object() {
void hi(String in) {

Detect deadlocks
public static class DeadLockDetector extends Thread {
public void run() {
while(true) {
ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
long[] ids = threadMXBean.findDeadlockedThreads();
if (ids != null) {
try {
} catch (InterruptedException e) { }

Unsafe… (it’s like Super User mode for Java… dangerous but powerful). Understanding sun.misc.Unsafe
public void testObjectCreation() throws Exception {
ClassWithExpensiveConstructor instance =    (ClassWithExpensiveConstructor)
assertEquals(0, instance.getValue());

Però el que el millor sense cap dubte és el que es pot fer amb Reflection:

    import java.lang.reflect.Field;

public class MutableString {

public static void main(String[] args) throws Exception {
String someString = “IMMUTABLE”;
Field field = Class.forName(“java.lang.String”).getDeclaredField(“value”);
char[] value = (char []) field.get(someString);
String anotherString = “NOTREALLY”;
for (int i=0; i<value.length; i++){
char c = anotherString.toCharArray()[i];

System.out.println(someString); // prints NOTREALLY
System.out.println(“IMMUTABLE”); // WTF !!! prints NOTREALLY



12 des. 2016

KaiRo: I Want an Internet of Humans

Author: Joaquim Perez Noguer | Filed under: Seguretat

On the Internet, not so much. We interact with and through a machine, see an “account” on the other end, remove all the context of what was said before and after, of the tone of voice and body language, of what surroundings others are in, we reduce to a few words that are convenient to type or what the communication system limits us to – and we go for whatever gives us the most attention. Because we don’t actually feel like we interact with other real humans, it’s mostly about what we get out of it. A lot of likes, reshares, replies, interactions. It helps that the services we use maximize whatever their KPI are and not optimize for what people actually want – after all, they want to earn money and that means having a lot of activity, and making people happy is not an actual goal, at best a wishful side effect.

We need to change that. We need to make social media actually social again (this talk by Chris Heilmann is really worth watching).We need to spread love (“make Trek, not Wars” in a tounge-in-cheek kind of way, no meaning negativity towards any franchise, but thinking about meanings and how we can make things better for our neighbors, our community, our world), not even hate the fear or fear the hate (which leads back into the circle), but analyze it, take it seriously and break it down. If we understand it, know how to deal with it, but not let it overcome us, fear can even be healthy – as another great screenwriter put it “Fear only exists for one purpose: To be conquered”. That is where we need to get ourselves, and need to help those other humans end up that spread hate and unreflected fear – or act out of that. Not by hating them back, but by trying to understand and help them.

We need to see the people, the humans, behind what we read on the Internet (I deeply recommend for you to watch this very recent talk by Erika Baker as well). I don’t see it as a “Crusade against Internet hate” as mentioned in the end of that talk, but more as a “Rally for Internet love” (unfortunately, some people would ridicule that wording but I see it as the love of humanity, the love for the human being inside each and everyone of us). I’m always finding it mind-blowing that every single person I see around me, that reads this, that uses some software I helped with, and every single other person on this planet (or in its orbit, there are none out further at this time as far as I know), is a fully, thinking, feeling, caring human being. Every one of those is different, every one of those has their own thoughts and fears that need to be addressed and that we need to address. And every one of those wants to be loved. And they should be. No matter who they voted for. No matter if they are a president elect or a losing candidate. We don’t need to agree with everything they are saying. But their fears should be addressed and conquered. And yes, they should be loved. Their differences should be celebrated and their commonalities embraced at the same time. Yes, that’s possible, think about it. Again, see the philosophy of infinite diversity in infinite combinations.

I want an Internet that connects those humans, brings them closer together, makes them understand each other more, makes them love each other’s humanity. I don’t care how many “things” we connect to the Internet, I care that the needs and feelings of humans and their individual and shared lives improve. I care that their devices and gadgets are their own, help their individuality, and help them embrace other humans (not treat them as accounts and heaps to data to be analyzed and sold stuff to). I want everyone to see that everyone else is (just) human, and spread love to or at least embrace them as humans. Then the world, the humans in it, and myself, can make it out of the difficult times and live long and prosper in the future.

I want an Internet of humans.

Origen: Home of KaiRo: I Want an Internet of Humans

12 des. 2016

Previsió de la ciber-seguretat pel 2017

Author: Joaquim Perez Noguer | Filed under: Seguretat

Este 2016 ha resultado ser otro año devastador para las brechas de ciberseguridad, tanto en pequeñas y grandes empresas como a nivel usuario. Los ataques a las cuentas de Yahoo, Twitter y el bitcoin han demostrado una vez más que nadie es inmune a los hackers y que son cada vez más sofisticados. Los virus siguen reinventándose y aumentando y se dirigen a los datos de más valor: números de la seguridad social, tarjetas de crédito, datos de salud, correos electrónicos y contraseñas. De cara a 2017, los expertos del foro ESET de seguridad informática adelantan cuáles serán las amenazas a tener en cuenta. Los ataques informáticos se centrarán el próximo año en las aplicaciones móviles, los videojuegos, el internet de las cosas, los gadgets de la salud y las infraestructuras críticas, como la administración pública, el sistema financiero y la industria nuclear.

Origen: Estas son las ciberamenazas de 2017 | Tecnología | EL PAÍS

11 des. 2016

Atlas històrics

Author: Joaquim Perez Noguer | Filed under: Ciència i tecnologia

Recull de diversos atlas historics via web o via vídeo.






23 nov. 2016

IA per llegir els llavis

Author: Joaquim Perez Noguer | Filed under: Ciència i tecnologia

Origen: Ya puede apuntar ‘leer los labios’ en ‘cosas que la IA hace mejor que los humanos’ – MIT Technology Review

21 nov. 2016

Mecànica quàntica

Author: Joaquim Perez Noguer | Filed under: Ciència i tecnologia

En la física quàntica tenim coses molt curioses:

  • Els fotons es poden comportar com a partícules. La llum pot fer moure objectes.
  • Els fotons es poden comportar com a ones. Els fotons quan passen un obertura molt petita, no passen rectes sinó que es difracten, fins i tot quan passen d’un en un!
  • Dos partícules es poden entrellaçar i el que li passi a una afectarà immediatament a l’altra tot i que estiguin molt separades

Una de les explicacions que es donava fins ara era que les partícules podien estar a més d’un lloc alhora i tenir més d’un estat alhora. I si això era així aleshores es produiria la paradoxa del Gat de Schrodinger.

Una altra solució ens l’expliquen en el següent vídeo. I si les partícules quàntiques fossin com pedres damunt d’un llac, “rebotant” infinitament. Les partícules provocarien ones i les ones provocarien canvis en la direcció de les partícules. I fent això es podrien explicar molts dels estranys fenòmens de la quàntica:


21 nov. 2016

CSS  display:grid  i  display:flex

Author: Joaquim Perez Noguer | Filed under: Web

Interessant tutorial de com utilitzar els nous modes display en CSS per a fer dissenys i layouts ben acabats.

Un dels problemes de sempre del HTML i el CSS és com posicionar bé els elements a la pantalla i que pugui mostrar-se bé encara que canviï la mida o l’orientació.

En un inici es feia servir TABLE quan TABLE era per mostrar taules de dades no per posicionar.

Després es va fer servir el float:left, quan el float estava pensat per mostrar il·lustracions junt amb el text a una banda o l’altra.

Finalment el CSS ha creat un sistema dedicat a posicionar bé els elements a la pantalla  display:flex  i display:grid.

Vegeu-ne l’explicació a  CSS Grid, Flexbox And Box Alignment: Our New System For Web Layout – Smashing Magazine


Més informació:




21 nov. 2016

Microsoft Goes All In for Linux

Author: Joaquim Perez Noguer | Filed under: Linux

La realitat sempre supera la ficció i  ara tenim:

I en un futur tindrem també

  • SQL Server i Azure per Linux
  • Tizen, el SO basat en Linux de Samsung, disposarà de Visual Studio i aplicacions .Net

Origen: Microsoft Goes All In for Linux

1 set. 2016

El per què dels embussos de cotxes

Author: Joaquim Perez Noguer | Filed under: Ciència i tecnologia

El per què dels embussos i com evitar-los:

YouTube Preview Image

5 jul. 2016

Com espiar un ordinador a través del ventilador

Author: Joaquim Perez Noguer | Filed under: General

Imagineu un ordinador super segur que ha estat infectat amb un voirus-espia que vol transmetre informació de la màquina. I no es pot transmetre la informació per la xarxa. Com fer-ho?

Uns experts han assajat d’utilitzar el soroll del ventilador de l’ordinador per transmetre-la.  Un virus de laboratorio logra hackear un PC ultraseguro a traves de su ventilador – MIT Technology Review