Shared posts

20 Sep 08:27

NOWHERE - Let's Make It Happen!

by Leonard Ritter

This is the day. The day that our love child NOWHERE goes into official crowdfunding to allow us to work full time on the game that we always wanted to play.

The NOWHERE site has been completely rebooted and now features the concept trailer that we have put everything into within the past week. Until now I was very hesitant to give the big picture away, but as we depend on your support, this is the last ace that I had in my sleeve.

Much love also goes out to the great folks from Humble Store who are shouldering the payment process for us. Buying NOWHERE will now add the alpha to your existing humble account. If you already have an account with us, you'll still receive new Alphas this way, with an option to migrate NOWHERE to your Humble account if you like, and the ability to upgrade your tier.

We hope that you'll love what we're doing and ask you to tell everyone you know about NOWHERE. The internet is a noisy place, so let's be the loudest, if only for half an hour. Our success is your success.

17 Sep 10:07

Con Google Chrome o Firefox tu iP local está expuesta

by noreply@blogger.com (Maligno)
Las técnicas de WebBrowsing Fingerprinting pueden estar contentas al poder añadir otro punto de información importante a los datos que recolectan de un cliente. En este caso funciona en Google Chrome y Mozilla Firefox, y ofrece un dato más que útil: La dirección IP local del cliente. La prueba de que esto es así la puedes hacer en la siguiente URLhttp://net.ipcalf.com/ 

Figura 1: Accediendo a tu dirección IP Local en Google Chrome con WebRTC

Esto se hace aprovechando un leak de WebRTC que pretende dotar a la web de protocolos de comunicaciones en tiempo real para expandir el número de soluciones que se pueden ofertar por la red. Debido a este leak, con un sencillo código JavaScript es posible acceder a la información de la dirección IP local del cliente.

Figura 2: Código de WebRTC con el data leak de la dirección IP.

Por supuesto estos datos no son útiles sólo para hacer un WebBrowsing finferprinting, sino que todos los clientes de tu red que estén navegando por Internet con Google Chrome o Mozilla Firefox están exponiendo el direccionamiento de tu red, y esto puede ser especialmente sensible en escenarios de APT.

Yo he probado con el cliente TOR Browser, bundle que utiliza a Mozilla Firefox, y he podido comprobar que esta característica no está habilitada, por lo que no se pone más sencillo conocer la ubicación de alguien que esté navegando con él.

Figura 3: Mozilla Firefox en TOR Browser no hace leak de la dirección IP
Sin embargo, revisa cómo tienes configurado tu entorno de conexión a TOR, no vaya a ser que se lo estés poniendo muy fácil a todo el mundo. Yo he probado en Diigo Web Browser y en Google app para iOS y tampoco ha leakeado la dirección IP Local, pero no he podido probarlo en Android o en otros navegadores, así que si haces pruebas te agradeceré que me dejes en los comentarios los resultados obtenidos.

Saludos Malignos!
13 Sep 11:43

Slideshow

Points to anyone who hacks the Flickr devs' computers to make their text editors do this when you click on anything.
13 Sep 11:38

Kites

by Wes + Tony

''Going every day hoping it gets sucked into a jet engine.''

Kites are just people wishing that they had birds as pets. That’s all.

13 Sep 11:36

III Edición del Congreso Navaja Negra

by Lorenzo Martínez



Los días 3, 4 y 5 de Octubre, tendrá lugar en Albacete la tercera edición del Congreso de seguridad Informática "Navaja Negra".

Este congreso, que ha acrecentado su relevancia a pasos agigantados, es además uno de los más esperados por el sector de la seguridad española. 


De hecho, tal y como os comenté hace unos días, y como no me pierdo ni uno, será un placer asistir por primera vez al Navaja Negra Conference como ponente junto a esta pila de enormes colegas.

Aparte de las más de 20 charlas, el final del evento culminará con una mesa redonda entre Cuerpos y Fuerzas de Seguridad del Estado (David Pérez de la Brigada de Información Tecnológica de la Policía Nacional y César Lorenzana del Grupo de Delitos Telemáticos de la Guardia Civil), Pablo F. Burgueño como abogado "del diablo" y varios invitados 'sorpresa'... donde se generará un debate donde "casi todo" estará permitido, por lo que pediremos que entren con armas de fuego en el recinto (a los contendientes de ambos bandos...). Para cerrar el congreso, hay prevista una comida típica manchega.

Podéis ver el itinerario completo del congreso en http://navajanegra.com/itinerario.aspx

Como he dicho en más de una ocasión, para mí un evento no es sólo la riqueza aprendida en las diferentes charlas, sino el ambiente que se respira. Tanto en los eventos en los que participo en Latinoamérica, como en España, la experiencia de compartir buenos momentos con cracks de uno y otro lado del charco, para mí, es algo que hay que vivir!   

La organización ofrece descuentos para aquellos que se desplacen vía Renfe y ha negociado descuentos con diversos hoteles para el alojamiento. Toda la información, así como la forma de apuntarse (a partir de las 11) en la página web de Navaja Negra

11 Sep 11:07

The first rule of NSA club...

by Robert Graham
According to the law, you can't use the NSA log -- or even mention the letters "NSA" or use the name "National Security Agency":

   Sec. 15. (a) No person may, except with the written permission
of the Director of the National Security Agency, knowingly use the
words 'National Security Agency', the initials 'NSA', the seal of
the National Security Agency, or any colorable imitation of such
words, initials, or seal in connection with any merchandise,
impersonation, solicitation, or commercial activity in a manner
reasonably calculated to convey the impression that such use is
approved, endorsed, or authorized by the National Security Agency.

Well, you might argue, clearly that doesn't apply, but it is precisely this law that was used to justify censorship of a post critical of the NSA by cryptography professor Mathew Green's post. His university threatened Green with legal action unless he removed the NSA logo -- based on their interpretation of this law.

10 Sep 15:44

montt en dosis diarias - -37

by noreply@blogger.com (montt)

05 Sep 09:20

" Querido Diario : Me he quedado atrapado en la lavadora "...



" Querido Diario : Me he quedado atrapado en la lavadora " (Il accidenti dil electrodomesticci) Jacopo Carucci

02 Sep 09:50

GoingNative will be livestreamed this week: Sep 4-6

slack

Bracing for epic conference

The GoingNative 2013 conference starts Wednesday and is just about sold out. A few seats remain, so register now (or get on the waitlist in case there's a last-minute cancellation you can snag).

It's decidedly desirable to be physically in the room to get the full experience, and hundreds of people from over 10 countries are already on their way. But if you can't come in person to Redmond, WA, USA for this week's C++ fest, you'll be glad to know the talks will be livestreamed as well on the Channel 9 homepage. The streaming is compatible with all major platforms. For those of you around the world, please note that the talk times are in North American Pacific Daylight Time.

Talks include the following, including both full-length talks and a number of 20- and 30-minute "nuggets."

Day 1: Wed Sep 4

  • Opening Keynote: The Essence of C++ -- With Examples in C++84, C++98, C++11, and C++14 (Bjarne Stroustrup)
  • C++ Seasoning (Sean Parent)
  • Writing Quick Code in C++, Quickly (Andrei Alexandrescu)
  • Don’t Help the Compiler (Stephan T. Lavavej)
  • Compiler++ (Jim Radigan)

Day 2: Thu Sep 5

  • Day 2 Keynote: One C++ (Herb Sutter)
  • rand() Considered Harmful (Stephan T. Lavavej)
  • An Effective C++11/14 Sampler (Scott Meyers)
  • C++14: Through the Looking Glass (Michael Wong)
  • The Care and Feeding of C++’s Dragons (Chandler Carruth)
  • Interactive Panel: Ask Us Anything! (speakers)

Day 3: Fri Sep 6

  • Everything You Always Wanted to Know About Threading (But...) (Elliot H. Omiya)
  • The Way of the Exploding Tuple (Andrei Alexandrescu)
  • To Move or Not to Move: That is the Question (Michael Wong)
  • Bringing await to C++ (Deon Brewis)
  • A C++ REST SDK: OSS web services on Windows and Linux (Niklas Gustafsson)
  • Compiler Confidential (Eric Brumer)
  • Find-Build-Share-Use: Using NuGet for C and C++ Libraries (Garrett Serack)
  • My Favorite C++ 10-Liner (Herb Sutter)

 

30 Aug 13:49

August 14, 2013


OLD MAN WEINERSMITH SHAKES HIS FIST AT THE NEWS
28 Aug 12:32

08.22.2013

slack

First of the weekly animated C&H shorts of this season :D

Cyanide and Happiness, a daily webcomic

Copy this into your blog, website, etc.
<a href="http://www.explosm.net/comics/3274/"><img alt="Cyanide and Happiness, a daily webcomic" src="http://explosm.net/show/thumbnails/thumbnail-e3xJVb.jpg" width=275 height=200 border=0></a><br />Cyanide & Happiness @ <a href="http://www.explosm.net">Explosm.net</a>

...or into a forum
[URL="http://www.explosm.net/comics/3274/"]
[IMG]http://explosm.net/show/thumbnails/thumbnail-e3xJVb.jpg[/IMG][/URL]
Cyanide & Happiness @ [URL="http://www.explosm.net/"]Explosm.net[/URL]
<—- Share this comic!

02 Aug 08:53

August 01, 2013


Holy crap it's August. We're almost in the best part of the year.
01 Aug 10:30

References for "The Future of Programming"

I gave a talk at the DBX conference called The Future of Programming. Below are links and quotes from some primary sources I used, as well as links to wikipedia and elsewhere where you can learn more.
29 Jul 11:04

July 25, 2013


Pow!
29 Jul 10:09

Larry and Jen Do Roman Numerals in C++—Jon Jagger and Olve Maudal

larry-and-jen-roman.PNGYes, C++ is for beginning programmers too. This is a delightful introduction to C++ programming -- and with nice test-first style to boot.

Larry and Jen Do Roman Numerals in C++

by Jon Jagger and Olve Maudal

22 Jul 10:45

July 19, 2013


SDCC GEEKS! I'll be at booth 2300!
18 Jul 11:23

Social Media

The social media reaction to this asteroid announcement has been sharply negative. Care to respond?
15 Jul 10:37

More NSA Code Names

by schneier

We don't know what they mean, but there are a bunch of NSA code names on LinkedIn profiles.

ANCHORY, AMHS, NUCLEON, TRAFFICTHIEF, ARCMAP, SIGNAV, COASTLINE, DISHFIRE, FASTSCOPE, OCTAVE/CONTRAOCTAVE, PINWALE, UTT, WEBCANDID, MICHIGAN, PLUS, ASSOCIATION, MAINWAY, FASCIA, OCTSKYWARD, INTELINK, METRICS, BANYAN, MARINA
15 Jul 10:34

Netflix - Uses bananas in place of stars for Arrested...



Netflix - Uses bananas in place of stars for Arrested Development’s rating in user’s instant queue.

/via fuckyeahspencercross

12 Jul 11:12

07.12.2013

Cyanide and Happiness, a daily webcomic

Copy this into your blog, website, etc.
<a href="http://www.explosm.net/comics/3230/"><img alt="Cyanide and Happiness, a daily webcomic" src="http://www.flashasylum.com/db/files/Comics/Rob/privateb.gif" border=0></a><br />Cyanide & Happiness @ <a href="http://www.explosm.net">Explosm.net</a>

...or into a forum
[URL="http://www.explosm.net/comics/3230/"]
[IMG]http://www.flashasylum.com/db/files/Comics/Rob/privateb.gif[/IMG][/URL]
Cyanide & Happiness @ [URL="http://www.explosm.net/"]Explosm.net[/URL]
<—- Share this comic!

09 Jul 09:16

Windows Timer Resolution: Megawatts Wasted

by brucedawson

The default timer resolution on Windows is 15.6 ms – a timer interrupt 64 times a second. When programs increase the timer frequency they increase power consumption and harm battery life. They also waste more compute power than I would ever have expected – they make your computer run slower! Because of these problems Microsoft has been telling developers to not increase the timer frequency for years.

So how come almost every time I notice that my timer frequency has been raised it’s been done by a Microsoft program?

This article was updated July 13, 2013, based on feedback from readers. See the bottom for the new material.

Seeing the current timer frequency is easy – just run the clockres tool by sysinternals.

ClockRes v2.0 – View the system clock resolution
Copyright (C) 2009 Mark Russinovich
SysInternals – http://www.sysinternals.com

Maximum timer interval: 15.600 ms
Minimum timer interval: 0.500 ms
Current timer interval: 1.000 ms

For maximum battery life the current timer interval (which can be changed with timeBeginPeriod) should be 15.6 ms. but as you can see above some program had set it to 1.0 ms. That means the timer interrupt is firing an extra 936 times per second.

Finding the culprit – WPF

Finding out who raised the timer frequency is non-obvious, but still fairly easy. Just open an administrator command prompt and run “powercfg -energy duration 5”. Part of the resulting HTML report will look like this:

The stack of modules responsible for the lowest platform timer setting in this process.
Requested Period 10000
Requesting Process ID 3932
  Requesting Process Path
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe
  Calling Module Stack
C:\Windows\SysWOW64\ntdll.dll
C:\Windows\SysWOW64\winmm.dll
C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF\wpfgfx_v0400.dll
C:\Windows\SysWOW64\kernel32.dll
C:\Windows\SysWOW64\ntdll.dll

So, Visual Studio 11, through its use of WPF, requested a 1.0 ms timer interval, confusingly displayed as 10,000 with the units being 100 ns. This is a known problem with WPF. All versions of Visual Studio trigger this behavior sometimes, and presumably most WPF programs can also trigger it. While increasing the timer frequency might make sense for an application that is trying to maintain a steady frame rate it does not make sense for WPF to leave the timer frequency raised even when there is no animation going on.

Finding the culprit – SQL Server

Another common culprit on my machine is sqlservr.exe. I think this was installed by Visual Studio but I’m not sure. I’m not sure if it is being used or not. Either way, SQL Server should not be raising the timer frequency. If doing so is needed to improve performance then that sounds like a design flaw. And, as with WPF, if raising the frequency is needed then it should only be done when SQL Server is busy, instead of leaving it permanently raised.

Platform Timer Resolution:Outstanding Timer Request
A program or service has requested a timer resolution smaller than the platform maximum timer resolution.
Requested Period 10000
Requesting Process ID 2384
Requesting Process Path \Device\HarddiskVolume1\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Binn\sqlservr.exe

Finding the culprit – quartz.dll

I don’t have the powercfg output for it but C:\Windows\System32\quartz.dll is another cause of an increased timer frequency. I’m not even sure what Quarts is (Expression Web Designer?) but I know it is sometimes wasting energy.

Finding the culprit – Chrome

imageMicrosoft is the usual culprit on my machine, but Google’s Chrome is also an offender. If I run Chrome then it instantly raises the timer frequency to 1,000 Hz, even when I’m on battery power and just displaying a raw HTML page.

To the right we can see Chrome displaying a harsh indictment of Chrome.

Finding the culprit – svchost.exe

Sometimes svchost.exe raises the timer frequency to 100 Hz. That’s nowhere near as bad as 1,000 Hz, but still annoying. It’s particularly frustrating because I can’t tell which service is doing it.

Tragedy of the commons – highest frequency wins

The Windows timer interrupt is a global resource and it ticks at one rate for the entire system. That means that a single program that raises the timer frequency affects the behavior of the entire system.

When a process calls timeBeginPeriod this frequency request is in force until it is explicitly cancelled with timeEndPeriod or until the process terminates. Most programs (including my own test program below) never call timeEndPeriod, relying instead on Windows process cleanup. This works, and is reasonable for any application that needs the timer frequency high for its entire lifetime, but for any process whose lifetime may outlast its need for a high frequency timer, it’s time to start calling timeEndPeriod. As Microsoft recommends, this includes movie players that are paused, and games that are minimized. It also includes web browsers that do not currently need high-resolution timers, or are running on battery power.

(see Sleep Variation Investigated for what the timer frequency affects)

Does it matter?

My main home computer is a laptop. I use it on the bus every day and I like to save my battery power for useful things rather than having it wasted on waking up the CPU 1,000 times a second.

Microsoft says that it matters. In this article they say “We are committed to continuously improving the energy efficiency of Windows PCs” and yet, four years later, they don’t seem to be following their own guidelines or heading their own warnings which say “Some applications reduce this to 1 ms, which reduces the battery run time on mobile systems by as much as 25 percent.”

imageOne handy way of estimating the power cost is to use the Intel Power Gadget tool. On supported Intel processors this shows you the power drawn by the CPU package in real-time with a claimed precision of 0.01 W. Power Gadget is handy because it works equally well whether on battery power or plugged in. On my Windows 7 Sandybridge laptop it consistently shows a .3 W increase in power draw from having the timer frequency increased. That’s almost 10% of the idle CPU package power draw, although a lower percentage of total system power draw.

An increase of 0.3 W may not seem like much but there are a couple of reasons to take it seriously. One is that if your software is on average running on 33 million machines (a conservative bet for something like Chrome) then increasing the timer frequency could be wasting about ten MW of power. A check-in that fixes such a bug gives you enough carbon-offset-karma to last a lifetime.

Another reason to take this issue seriously is that I have been told that the importance of this issue is only increasing over time. With newer CPUs and with better timer coalescing the frenetic interrupts are likely to consume a greater percentage of total compute power.

Fast timers waste performance

Executing interrupts also uses some execution resources so having more interrupts per second should make your computer run a little bit slower. I tested this theory by writing a program that spins in a busy loop and reports every second on how quickly it’s getting work done. While this program was running I would change the timer resolution and see whether its throughput was affected.

It was affected. A lot.

I just did some quick tests on two machines, so the exact values shouldn’t be taken too seriously, and results will certainly vary depending on machine type, load, etc. But the results clearly indicate a performance cost to having high-frequency interrupts enabled. The overhead that I measured varied from 2.5% to 5%. That’s about an order of magnitude more than I expected. This level of slowdown is significant enough that it makes the common practice of raising the timer frequency in high-performance animation software seem counter-productive.

Raising the Windows timer frequency is bad. It wastes power and makes your computer slower. Routinely doing this in all sorts of programs that end up sitting idle for hours really needs to stop.

Here are some raw results:

4.03904e+006 iterations/s
4.08690e+006 iterations/s
4.09211e+006 iterations/s
4.09437e+006 iterations/s
4.05934e+006 iterations/s
4.00926e+006 iterations/s
4.07723e+006 iterations/s
4.10709e+006 iterations/s
4.02196e+006 iterations/s
4.10028e+006 iterations/s
4.10170e+006 iterations/s
4.10272e+006 iterations/s
4.10708e+006 iterations/s
4.10137e+006 iterations/s
3.95200e+006 iterations/s
3.90879e+006 iterations/s
3.92327e+006 iterations/s
3.91697e+006 iterations/s
3.92326e+006 iterations/s
3.91740e+006 iterations/s
3.92221e+006 iterations/s
3.91711e+006 iterations/s
3.91795e+006 iterations/s
3.92029e+006 iterations/s
3.92204e+006 iterations/s
3.92487e+006 iterations/s
3.91863e+006 iterations/s
3.92451e+006 iterations/s
3.92307e+006 iterations/s
3.92017e+006 iterations/s
3.91865e+006 iterations/s
3.91699e+006 iterations/s
3.92120e+006 iterations/s
3.90531e+006 iterations/s
3.98594e+006 iterations/s
4.10586e+006 iterations/s
4.10674e+006 iterations/s
4.11726e+006 iterations/s
4.11836e+006 iterations/s
4.11177e+006 iterations/s
4.10970e+006 iterations/s

The 20 second period in the middle where performance suddenly drops is exactly when the timer resolution increase happened, and I got similar results every time I tried. I tested this both on my laptop on battery power and my workstation on wall power and the results were always similar.

Source code

It’s not science without disclosing the source code, so here’s my performance measuring program:

#include “stdafx.h”

#include <stdio.h>
#include <Windows.h>

LARGE_INTEGER g_frequency;
const double kDelayTime = 1.0;

double GetTime()
{
    LARGE_INTEGER counter;
    QueryPerformanceCounter(&counter);
    return counter.QuadPart / double(g_frequency.QuadPart);
}

int g_array[1024];
int offset;
int g_sum;

void SpinABit()
{
    for (int i = 0; i < ARRAYSIZE(g_array); ++i)
    {
        g_sum += g_array[i + offset];
    }
}

void Stall()
{
    double start = GetTime();
    int iterations = 0;
    for (;;)
    {
        ++iterations;
        SpinABit();
        double elapsed = GetTime() – start;
        if (elapsed >= kDelayTime)
        {
            printf(“%1.5e iterations/s\n”, iterations / elapsed);
            return;
        }
    }
}

int main(int argc, char* argv[])
{
    QueryPerformanceFrequency(&g_frequency);
    for (;;)
        Stall();
    return 0;
}

And here’s my program that raises the timer frequency for 20 s.

#include <stdio.h>
#include <Windows.h>

#pragma comment(lib, “winmm.lib”)

int main(int argc, char* argv[])
{
    timeBeginPeriod(1);
    printf(“Frequency raised.\n”);
    Sleep(20000);
    printf(“Frequency lowered.\n”);
    // timeEndPeriod call is omitted because process
    // cleanup will do that.
    return 0;
}

Don’t forget to check the system timer resolution using clockres before running the test by. Make sure the timer interval is at least 10 ms before doing the test or else you won’t see dramatic changes.

And fix your code. Everybody.

Update, July 13, 2013

I’ve added some clarifications based on reader confusion, and some new information that I learned from reader comments. Enjoy.

I have not tried this on Windows 8 but one reader reports that the performance slowdown is gone on Windows 8. This article in ArsTechnica discusses the move to a tick-less kernel in Windows 8. It seems that some of the cost of just having the timer enabled has gone away with the move to tick-less. Now the cost should be proportional to how frequently applications ask to be woken, which is much saner. I have not verified these changes myself but it sounds encouraging. I have not seen many technical details about the tickless Windows kernel, but a recent article about the tickless Linux kernel explains some of the issues and challenges. In particular it is quite likely that Windows 8 still runs the interrupt on one processor, so that timeGetTime will have its increased precision. The article Timer-Resolution.docx discusses timer coalescing, and disabling of timer interrupts on processors that don’t need them, which is presumably part of what was changed in Windows 8.

There are two reasons for raising the timer frequency. One is that it improves the resolution of Sleep(n) and of timeouts on WaitForSingleObject. For instance, some games have a power saving mode that throttles the game to 30 fps and this can only be done accurately if Sleep(1) returns in one millisecond, rather than 15-16 milliseconds. By enabling a lower frame rate without requiring busy waiting the higher timer frequency actually saves energy, in this case. For details on Sleep(n) and timer frequency read Sleep Variation Investigated. Multi-media playback often raises the timer frequency for variants of this reason, but these programs should reset the frequency when they are no longer animating.

Another reason for raising the timer frequency is so that timeGetTime will be more accurate. This is used, for instance, by SQL Server to more accurately measure query times. This behavior can be controlled using trace flag T8038, and is discussed more in KB931279. For details on the difference between timeGetTime and GetTickCount see timeGetTime versus GetTickCount.

The Chrome developers realized years ago that raising the timer frequency on battery power was a bad idea, as documented in Chrome: Cranking Up The Clock. However their mitigation of not raising the frequency when on battery power regressed. Issue 153139 tracks this – star it if you think it’s important or want to be notified of changes. If this article causes Chrome to fix this issue then it will have been worthwhile as that will probably save many megawatts of power. Or, as one reader prefers, many billions of Joules of power (per hour that the fix is in effect).

Using QueryPerformanceCounter gives even more accurate time results, but QPC has a history of being buggy. More timing discussions can be found here and here.

The Windows timer frequency is set to the highest frequency requested by a running program. Timer frequency requests can be cancelled by calling timeEndPeriod, but this is rarely done. Timer frequency requests are automatically cancelled when a process ends. If powercfg -energy duration 5 shows that a process has raised the timer frequency you can solve this by killing that process.

Preventing the timer frequency from being raised on your machine is simple. All you have to do is inject code into every process which shims timeBeginPeriod before it is called so that calls to it are a NOP. However, despite this being an obviously trivial task that could be put together in mere seconds, nobody has yet offered up anything more than code snippets and links to references.

Timer Queues were suggested as being a better timer mechanism, but the advantages of this better timer mechanism were not described.

An unexpected side effect of this article is that many developers said “Cool – now I know how to increase the timer frequency!” That makes me nervous, but as long as those developers raise the timer frequency for good reasons, and reset it with timeEndPeriod when they no longer need it, then all will be well.

Reddit discussion is here.

OSNews discussion is here.


08 Jul 12:02

Un día te dicen…

by gallir

Un día te dicen que apoyan las energías renovables, al día siguiente están pidiendo desde una manifestación que se mantengan los subsidios al ineficiente y contaminante carbón español.

Un día te dicen que es importante la soberanía en la energía, al día siguiente que se prohíban todas las pruebas con el fracking (aunque les esté yendo muy bien a otros países).

Un día escriben en su blog que el establishment de la ciencia oficial opresora no acepta papers con sus ideas y modelos que solucionarán los problemas económicos del mundo, al otro día se quejan de que el gobierno está matando a la ciencia [oficial opresora].

Un día sacan una declaración que apoyan a la ciencia, al siguiente piden que se no se apliquen más vacunas contra el papiloma, o anuncian que pretenden eliminar los transgénicos en todo Andalucía.

Un día te dicen que obligarán a toda la administración pública a usar software libre, al día siguiente te dicen que los iPad de diputados son una herramienta de trabajo, que los diputados no son la administración pública y que todo es culpa del capitalismo.

Un día exigen que renuncien todos los diputados de los otros partidos -elegidos el mismo día, con el mismo procedimiento y con más votos que ellos- porque no son democráticos, al día siguiente te dicen que su objetivo no es la democracia sino la revolución.

Un día te dicen que hay que revisar toda la política energética del país, que se cometieron desastres, al día siguiente rechazan que se haga una auditoría.

Un día te dicen que los otros partidos son todos iguales de malo, al día siguiente forman gobierno con uno de ellos.

Un dia te dicen que no hay que someterse a “los mercados”, al día siguiente que hay que venderles más deudas y aumentar el déficit.

Un día te dicen que se necesitan bancas públicas para evitar -entre otras cosas- problemas como los desahucios por ejecución de hipoteca, al día siguiente nos enteramos que uno de sus gestores en una Caja [pública] compró un piso desahuciado a un vecino por menor valor que la hipoteca.

Un día nos dicen que lo que hizo un político adversario hace 40 años es insoportable, al siguiente que sus errores de hace 18 fueron cosa de la “cotidianeidad” y del capitalismo.

Por supuesto, los anteriores tienen sesgos y cualquier puede identificar al partido al que hago referencia… lo hago porque alguna vez fui un iluso que los votaba, y porque es la esperanza de muchos jóvenes. Pero se puede extender, fácilmente (demasiado fácilmente, criticar al partido en el gobierno lo hacen todos, ya es muy aburrido por repetitivo y poco original).

Un día te dicen que saben perfectamente las soluciones para este país, al siguiente que no pueden hacer nada contra la realidad y la herencia recibida.

Un día te dicen que la solución es bajar impuestos, al día siguiente que es mejor subirlos porque lo importante es bajar el déficit y cumplir con los acreedores.

Un día te dicen que son ejemplos de transparencia y honestidad, al día siguiente nos enteramos de Bárcenas. Mejor dicho, todavía no nos enteramos.

Un día te dicen que no huirán de dar explicaciones y asumir responsabilidades, al día siguiente tenemos un plasma con ruido blanco.

Un día te dicen que España necesita reformas serias para la liberalización y un cambio de modelo productivo, al día siguiente festejan porque aseguraron 42.000 millones de fondos europeos para seguir manteniendo una agricultura ineficiente y proteccionista (que por otro lado, perjudica a países en desarrollo exportadores).

Un día te dicen que la ciencia y educación es prioritaria, al día siguiente te enteras que están todos el borde la quiebra por los recortes.

Un día te dicen que es fundamental bajar el precio de la energía, al siguiente suben las tarifas.

Podría seguir hablando y extenderlos a otros partidos, por ejemplo el PSOE:

Un día¿eh? (no se enteran todavía ni para qué existen, mucho menos explicar qué han hecho en 7 años de gobierno para prevenir la crisis que han colaborado a generar).

En fin, que venga de donde venga, o son unos ignorantes sin dos neuronas en condiciones para asegurar una mínima coherencia, o nos toman el pelo adrede. Yo creo que hay de los dos, que cada uno elija cómo prefiere seguir siendo engañado y a quién festejar sus eslóganes para seguir engañando. En eso consiste la democracia… o no.

PS: Se trata de “incentivos”,  si la gente festeja y aplaude los eslóganes populistas -¡y los vota!- de soluciones mágicas simplistas se incentiva a que sigan haciendo lo mismo. Pero podéis dormir tranquilos, la culpa es siempre de los otros.


08 Jul 09:38

PSN newsletter - When images aren’t loaded the Autobot...



PSN newsletter - When images aren’t loaded the Autobot logo shows up in a newsletter about a exclusive Transformers: Fall of Cybertron offer in the PlayStation store.

/via Reddit

28 Jun 12:05

06.28.2013

Cyanide and Happiness, a daily webcomic

Copy this into your blog, website, etc.
<a href="http://www.explosm.net/comics/3217/"><img alt="Cyanide and Happiness, a daily webcomic" src="http://www.flashasylum.com/db/files/Comics/Rob/slippery4.png" border=0></a><br />Cyanide & Happiness @ <a href="http://www.explosm.net">Explosm.net</a>

...or into a forum
[URL="http://www.explosm.net/comics/3217/"]
[IMG]http://www.flashasylum.com/db/files/Comics/Rob/slippery4.png[/IMG][/URL]
Cyanide & Happiness @ [URL="http://www.explosm.net/"]Explosm.net[/URL]
<—- Share this comic!

27 Jun 10:07

I think my texture coordinates might be messed up ...

by noreply@blogger.com (Sander van Rossen)

19 Jun 09:38

Tapa la webcam o ponte sexy si usas Adobe Flash Player

by noreply@blogger.com (Maligno)
Conozco desde hace tiempo el bug de Adobe Flash Player que por medio de un ataque de ClickJacking permitía activar la webcam y grabar al usuario que visita una web con robar solo unos clics para utilizar el configurador de la webcam en el sitio de Adobe. Este bug lo suponía solucionado desde el 2011, pero lo cierto es el descubridor del mismo ha vuelto a alertar de que aún no lo está.

Figura 1: PoC publicada en 2011

Yo he ido a probar la PoC que te tira una foto con un clickjacking de chicas sexies usando un OS X Mountain Lion 10.8.4, Google Chrome 27 y la última versión de Adobe Flash Player... y no lo está. Eso sí, al menos me ha salido la lucecita en el MacBook Pro para que me diera tiempo a sonreir, aunque no me he animado a ello como podéis ver.

Figura 2: Cara con la que he salido cuando he probado la PoC

Dos años parece más que suficiente para que Adobe se hubiera tomado esto más en serio, pero no ha sido así, por lo que se lo pueden estar pasando genial los malos gracias a la colaboración de Google Chrome. Un negativo para el equipo de seguridad de Adobe. Sea cual sea tu versión de Adobe Flash Player estás vulnerable, así que ya sabes lo que debes hacer: Tapa la webcam o ponte sexy para salir en Internet

Saludos Malignos!
17 Jun 10:08

06/16/13 PHD comic: 'More Wisdom from my 3 Year Old'

Piled Higher & Deeper by Jorge Cham
www.phdcomics.com
Click on the title below to read the comic
title: "More Wisdom from my 3 Year Old" - originally published 6/16/2013

For the latest news in PHD Comics, CLICK HERE!

12 Jun 09:57

Picnic (15 Comments)

by Wes + Tony

''Whoa! And there's another one in my pocket! And behind your ear!''

Those of you interested in electronic entertainment squares might already know this, but there’s a video game console war going on! In one corner there’s Microsoft and they want you to buy the Xbox One, which is a pristine graphite sphere that vibrates endlessly and whose sole output produces spiders. Then there’s Sony pushing their PlayStation 4, which is known for floating one foot off the ground and turning into a black hole when you whisper its True Name. And finally Nintendo’s Wii U, whose primary selling points are its controller (the howling skull of a dead king) and Mario Kart.

So choose wisely! If you get the wrong one you’ll feel awfully silly.

-Wes

10 Jun 09:41

GotW #92 Solution: Auto Variables, Part 1

by Herb Sutter

What does auto do on variable declarations, exactly? And how should we think about auto? In this GotW, we’ll start taking a look at C++’s oldest new feature.

 

Problem

JG Questions

1. What is the oldest C++11 feature? Explain.

2. What does auto mean when declaring a local variable?

Guru Questions

3. In the following code, what is the type of variables a through k, and why? Explain.

int         val = 0;
auto a = val;
auto& b = val;
const auto c = val;
const auto& d = val;

int& ir = val;
auto e = ir;

int* ip = &val;
auto f = ip;

const int ci = val;
auto g = ci;

const int& cir = val;
auto h = cir;

const int* cip = &val;
auto i = cip;

int* const ipc = &val;
auto j = ipc;

const int* const cipc = &val;
auto k = cipc;

4. In the following code, what type does auto deduce for variables a and b, and why? Explain.

int val = 0;

auto a { val };
auto b = { val };

 

Solution

1. What is the oldest C++11 feature? Explain.

auto x = something; to declare a new local variable whose type is deduced from something, and isn’t just always int.

Bjarne Stroustrup likes to point out that auto for deducing the type of local variables is the oldest feature added in the 2011 release of the C++ standard. He implemented it in C++ 28 years earlier, in 1983—which incidentally was the same year the language’s name was changed to C++ from C with Classes (the new name was unveiled publicly on January 1, 1984), and the same year Stroustrup added other fundamental features including const (later adopted by C), virtual functions, & references, and BCPL-style // comments.

Alas, Stroustrup was forced to remove auto because of compatibility concerns with C’s then-existing implicit int rule, which has since been abandoned in C. We’re glad auto is now back and here to stay.

2. What does auto mean when declaring a local variable?

It means to deduce the type from the expression used to initialize the new variable. In particular, auto local variables deduction is exactly the same as type deduction for parameters of function templates—by specification, the rule for auto variables says “do what function templates are required to do”—plus they can capture initializer_list as a type. For example:

template<class T> void f( T ) { }

int val = 0;

f( val ); // deduces T == int, calls f<int>( val )
auto x = val; // deduces T == int, x is of type int

When you’re new to auto, the key thing to remember is that you really are declaring your own new local variable. That is, “what’s on the left” is my new variable, and “what’s on the right” is just its initial value:

auto my_new_variable = its_initial_value;

You want your new variable to be just like some existing variable or expression over there, and be initialized from it, but that only means that you want the same basic type, not necessarily that other variable’s own personal secondary attributes such as top-level const- or volatile-ness and &/&& reference-ness which are per-variable. For example, just because he’s const doesn’t mean you’re const, and vice versa.

It’s kind of like being identical twins: Andy may be genetically just like his brother Bobby and is part of the same family, but he’s not the same person; he’s a distinct person and can make his own choice of clothes and/or jewelry, go to be seen on the scene in different parts of town, and so forth. So your new variable will be just like that other one and be part of the same type family, but it’s not the same variable; it’s a distinct variable with its own choice of whether it wants to be dressed with const, volatile, and/or a & or && reference, may be visible to different threads, and so forth.

Remembering this will let us easily answer the rest of our questions.

3. In the following code, what is the type of variables a through k, and why? Explain.

Quick reminder: auto means “take exactly the type on the right-hand side, but strip off top-level const/volatile and &/&&.” Armed with that, these are mostly pretty easy.

For simplicity, these examples use const and &. The rules for adding or removing const and volatile are the same, and the rules for adding or removing & and && are the same.

int         val = 0;
auto a = val;
auto& b = val;
const auto c = val;
const auto& d = val;

For a through d, the type is what you get from replacing auto with int: int, int&, const int, and const int&, respectively. The same ability to add const applies to volatile, and the same ability to add & applies to &&. (Note that && will be what Scott Meyers calls a universal reference, just as with templates, and does in some cases bring across the const-ness if it’s binding to something const.)

Now that we’ve exercised adding top-level const (or volatile) and & (or &&) on the left, let’s consider how they’re removed on the right. Note that the left hand side of a through d can be used in any combination with the right hand side of e through k.

int&        ir  = val;
auto e = ir;

The type of e is int. Because ir is a reference to val, which makes ir just another name for val, it’s exactly the same as if we had written auto e = val; here.

Remember, just because ir is a reference (another name for the existing variable val) doesn’t have any bearing on whether we want e to be a reference. If we wanted e to be a reference, we would have said auto& as we did in case b above, and it would have been a reference irrespective of whether ir happened to be a reference or not.

int*        ip  = &val; 
auto f = ip;

The type of f is int*.

const int   ci  = val;
auto g = ci;

The type of g is int.

Remember, just because ci is const (read-only) doesn’t have any bearing on whether we want g to be const. It’s a separate variable. If we wanted g to be const, we would have said const auto as we did in case c above, and it would have been const irrespective of whether ci happened to be const or not.

const int&  cir = val;
auto h = cir;

The type of h is int.

Again, remember we just drop top-level const and & to get the basic type. If we wanted h to be const and/or &, we could just add it as shown with b, c, and d above.

const int*  cip = &val;
auto i = cip;

The type of i is const int*.

Note that this isn’t a top-level const, so we don’t drop it. We pronounce cip‘s declaration right to left: The type of cip is “pointer to const int,” not “const pointer to int.” What’s const is not cip, but rather *cip, the int it’s pointing to.

int* const  ipc = &val;
auto j = ipc;

The type of j is int*. This const is a top-level const, and ipc‘s being const is immaterial to whether we want j to be const.

const int* const cipc = &val;
auto k = cipc;

The type of k is const int*.

4. In the following code, what type does auto deduce for variables a and b, and why? Explain.

As we noted in #2, the only place where an auto variable deduces anything different from a template parameter is that auto deduces an initializer_list. This brings us to the final cases:

int val = 0;

auto a { val };
auto b = { val };

The type of both a and b is std::initializer_list<int>.

That’s the only difference between auto variable deduction and template parameter deduction—by specification, because auto deduction is defined in the standard as “follow those rules over there in the templates clause, plus deduce initializer_list.”

If you’re familiar with templates and curious how auto deduction and template deduction map to each other, the table below lists the main cases and shows the equivalent syntax between the two features. For the left column, I’ll put the variable and the initialization on separate lines to emphasize how they correspond to the separated template parameter and call site on the right.

Not only are the cases equivalent in expressive power, but you might even feel that some of the auto versions feel even slicker to you than their template counterparts.

Summary

Having auto variables really brings a feature we already had (template deduction) to an even wider audience. But so far we’ve only seen what auto does. The even more interesting question is how to use it. Which brings us to our next GotW…

Acknowledgments

Thanks in particular to the following for their feedback to improve this article: davidphilliposter, Phil Barila, Ralph Tandetzky, Marcel Wild.


Filed under: GotW
10 Jun 08:50

Comic for June 9, 2013