buy lasix http://all-treatment.org/buy-levitra-vardenafil/ http://all-treatment.org/buy-viagra-sildenafil-citrat/ isotretinoin online buy cialis online
27 gen. 2017

Antivirus ?

Author: Joaquim Perez Noguer | Filed under: Seguretat

Com a usuari de Linux des de fa vint anys, l’antivirus no el veig necessari ara per ara. El SO és prou robust i el nombre de virus per a Linux és molt més baix que per a altres SO.

Però alerta, que aquesta opinió de Robert O’Callahan diu que fins i tot pels usuaris de Windows seria millor que no fessin servir antivirus (excepte els que proporcionen Microsoft). I no és perquè en Robert treballi a Microsoft precisament. El motiu no és per temes de rendiment de l’Antivirus, sinó per com fa la funció d’Antivirus. Es queixa per exemple que alguns antivirus interfereixen en les mesures de seguretat dels productes, en aquest cas el Firefox, i els fan més vulnerables que sense antivirus.

En el meu cas, en la meva feina, també puc dir que alguns antivirus interferien  en les mesures de seguretat i anti-phishing que vam desenvolupar en una web segura. I la resposta del fabricant de antivirus va ser de negativa total i supèrbia.

La veritat és que no es pot generalitzar i si fos usuari de Windows ara mateix tampoc seria gaire partidari de treure l’antivirus. Però és una opinió que cal tenir en compte.

Origen: Eyes Above The Waves: Disable Your Antivirus Software (Except Microsoft’s)



19 gen. 2017

three.js – Javascript 3D library

Author: Joaquim Perez Noguer | Filed under: General

Vegeu three.js – Javascript 3D library  un mòdul javascript per a fer impressionants animacions 3D com aquest simulador de cotxes 3D (feu anar els cursors i les tecles W, A, S, D )



19 gen. 2017

Motion .js Graphics For The Web

Author: Joaquim Perez Noguer | Filed under: Web

Vegeu  mojs.io – Motion Graphics For The Web un altre mòdul javascript per a fer animacions en les vostres pàgines web.

 

 



19 gen. 2017

CSS Features queries + Grid layout + Native variables

Author: Joaquim Perez Noguer | Filed under: Web

Origen: 3 New CSS Features to Learn in 2017

Aquest 2017 es pot dir que el CSS per fi ho té tot!

1. Feature Queries

Fins ara es mirava si el navegador era Firefox, IE o Chrome, mòbil i es feia un CSS especialitzat per a cada tipus de navegador. Amb Feature Queries només caldrà un sol CSS, en el qual podrem preguntar al navegador si sap o no sap fer una cosa.

@supports ( display: flexbox ) 
          and 
          ( not ( display: flex ) ) {
  .foo { display: flexbox; }
}

2. Grid Layout + flexible lengths + gutters

Per definir les parts de la pantalla vam utilitzar TABLE, DIV amb float:left i moltes coses més. Però ara per fi tenim una forma decent i fàcil de definir-ho.

.hg__header { grid-area: header; }
.hg__footer { grid-area: footer; }
.hg__main { grid-area: main; }
.hg__left { grid-area: navigation; }
.hg__right { grid-area: ads; }

.hg {
    display: grid;
    grid-template-areas: "header header header"
                         "navigation main ads"
                         "footer footer footer";
    grid-template-columns: 150px 1fr 150px;
    grid-template-rows: 100px 
                        1fr
                        30px;
    min-height: 100vh;
}

@media screen and (max-width: 600px) {
    .hg {
        grid-template-areas: "header"
                             "navigation"
                             "main"
                             "ads"
                             "footer";
        grid-template-columns: 100%;
        grid-template-rows: 100px 
                            50px 
                            1fr
                            50px 
                            30px;
    }
}

3. Native Variables

Què és un llenguatge sense variables ? Doncs això CSS després de tants anys per fi permet definir variables.

:root {
  --theme-colour: cornflowerblue;
}

h1 { color: var(--theme-colour); }  
a { color: var(--theme-colour); }  
strong { color: var(--theme-colour); }  

….

const rootEl = document.documentElement;  
rootEl.style.setProperty('--theme-colour', 'plum');  

12 gen. 2017

String.intern

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

Java ofereix un sistema intern per optimitzar la memòria utilitzada quan llegeixes grans quantitats de texts i té molts repetits: String.intern, però cal anar amb compte.

Vegeu les recomanacions String.intern in Java 6, 7 and 8 – string pooling  – Java Performance Tuning Guide

  • Stay away from String.intern() method on Java 6 due to a fixed size memory area (PermGen) used for JVM string pool storage.
  • Java 7 and 8 implement the string pool in the heap memory. It means that you are limited by the whole application memory for string pooling in Java 7 and 8.
  • Use -XX:StringTableSize JVM parameter in Java 7 and 8 to set the string pool map size. It is fixed, because it is implemented as a hash map with lists in the buckets. Approximate the number of distinct strings in your application (which you intend to intern) and set the pool size equal to some prime number close to this value multiplied by 2 (to reduce the likelihood of collisions). It will allow String.intern to run in the constant time and requires a rather small memory consumption per interned string (explicitly used Java WeakHashMap will consume 4-5 times more memory for the same task).
  • The default value of -XX:StringTableSize parameter is 1009 in Java 6 and Java 7 until Java7u40. It was increased to 60013 in Java 7u40 (same value is used in Java 8 as well).
  • If you are not sure about the string pool usage, try -XX:+PrintStringTableStatistics JVM argument. It will print you the string pool usage when your program terminates.

 

12 gen. 2017

Anatomia d’un objecte Java

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

Com guarda el Java els objectes en memòria? T’ho explica  From Java code to Java heap

When your Java code uses the new operator to create an instance of a Java object, much more data is allocated than you might expect.

For example, it might surprise you to know that the size ratio of an int value to an Integer object — the smallest object that can hold an int value — is typically 1:4. The additional overhead is metadata that the JVM uses to describe the Java object, in this case an Integer.

The amount of object metadata varies by JVM version and vendor, but it typically consists of:

Class : A pointer to the class information, which describes the object type. In the case of a java.lang.Integer object, for example, this is a pointer to the java.lang.Integer class.

Flags : A collection of flags that describe the state of the object, including the hash code for the object if it has one, and the shape of the object (that is, whether or not the object is an array).

Lock : The synchronization information for the object — that is, whether the object is currently synchronized.

The object metadata is then followed by the object data itself, consisting of the fields stored in the object instance. In the case of a java.lang.Integer object, this is a single int.So, when you create an instance of a java.lang.Integer object when running a 32-bit JVM, the layout of the object might look like Figure 2:Figure 2. Example layout of a java.lang.Integer object for a 32-bit Java processExample layout of a java.lang.Integer object for a 32-bit Java processAs Figure 2 shows, 128 bits of data are used to store the 32 bits of data in the int value, because the object metadata uses the rest of those 128 bits.

 

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) {
System.out.println(in);
}
}.hi(“weird”);

Detect deadlocks
public static class DeadLockDetector extends Thread {
@Override
public void run() {
while(true) {
ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
long[] ids = threadMXBean.findDeadlockedThreads();
if (ids != null) {
System.exit(127);
}
try {
Thread.sleep(1000);
} 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)
unsafe.allocateInstance(ClassWithExpensiveConstructor.class);
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”);
field.setAccessible(true);
char[] value = (char []) field.get(someString);
String anotherString = “NOTREALLY”;
for (int i=0; i<value.length; i++){
char c = anotherString.toCharArray()[i];
value[i]=c;
}

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.

Web: