Técnicamente, eres un p**dejo si compras cosas en dólares

https://www.youtube.com/watch?v=xvGjXuYzUZ0

Lo que estos cuates suponen es que todo, absolutamente TODO lo que compras está hecho en méxico y con materiales 100% nacionales. Y que todos y absolutamente TODOS los mexicanos estamos en la misma onda.

México no es un lugar donde se consuman bienes de otros lados, nada que pensar de consumir cosas como televisores, computadoras, videojuegos, carros (aunque muchos son manufacturados en méxico), o gasolina, asi de fácil, que si no toda la gran mayoría se refina en el extranjero. Eso es lo que piensan o quieren hacer creer al público.

Tal vez de verdad piensan que su público está realmente amolado y no puede aspirar a eso, a comprar bienes que son importados y deben conformarse con solo lo que hay aquí en México y si no lo hay nacional pues como lo importado es muy caro, no, mejor no lo compres.

Es una cadena, si por el dólar la gasolina sube, bueno, los transportistas subirán sus cuotas, si suben las cuotas de transporte entonces esos productos que se mueven con los transportistas subirán también, los vendedores entonces tendrán que aumentar sus precios para poder asimilar el nuevo precio, el que terminará pagando mas es el consumidor final y díganme si esto no es algo que le afecte a su economía si aunque el dólar sigue subiendo su salario no sube y por ende, le alcanza para menos.

Creo que lo mejor que pueden hacer es ignorar a este par que en primera les pagaron para decir eso y en segunda su publico les vale madre al tratar de hacerles ver una realidad que no es. El precio del dólar si afecta a la economía familiar.

 

Loading

Worth every cent

  
We gave this iPad to Sofia last year as a birthday gift. But the iPad companion was that griffin survivor case.

Sofia, Diego and Ana have dropped that thing a lot of times, stepped over it, draw on it (with crayons), and of course water.

The iPad is still working and no scratches or dents on it. That case is worth every cent I paid for it

Loading

A mis amigos que se quieren poner en forma

image

De verdad, espero que lo logren, pero de verdad lo deseo.

Solo recuerden que nadie más lo va a hacer por ustedes y que si fallan la culpa no la tiene  nadie más que ustedes. Si lo quieren hacer háganse el tiempo, sacrifíquense y háganlo. No pongan pretextos ni culpen a la falta de voluntad/tiempo. Solo háganlo.

Ps. Imagen de pictoline, hagan click en ella para ir al post original.

Loading

What makes a Mac a Mac


I think that Macs are expensive computers, but any other computer with the same hardware should cost more or less the same.

Yes, you can get cheaper computers with the same processor, more storage and the same amount of ram, but is not just CPU-RAM-HDD what makes a computer a good computer. Is everything that is around those.


The display, the quality of construction, the durability of the keyboard, the battery   and I don’t mean just getting 10 hours of battery, I mean how many years that battery is going to work fine.

I have the same Mac for almost 5 years, I upgraded the RAM from 4GB to 8. And changed the 5400 rpm HDD to an SSD (which I highly recommend). But aside from that everything else is the same.

Now the other side of the coin. I had “PC” laptops that at most were with me for two years and I had to replace the keyboard. A couple of  HP/Compaq, one Dell and one Acer. The battery died in the first year. Were they cheaper?  Yes, but at the end I had to get two or three laptops in five years. Not cool.

The operating system is another key piece. Whether you like it or not, the best desktop operating system seems to be OS X. The power of UNIX and simplicity not matched by any other OS. Windows is arelly good operating system but in my opinion not as good. Linux have the freedom, the choices, but let’s be honest, is not the easiest OS.

Of course Windows and Linux are great OS, and I believe they are superior than OS X in other fields, Linux is great as a server, Windows is no doubt the Desktop OS for PCs and gaming, but OS X is better as a desktop OS (of course, in a Mac)

So, what makes a Mac a Mac is the mixture between a well done hardware and the software. You don’t spend €600 for just for the machine and €600 for the apple logo, you get great hardware and great software that works as expected, that lasts, and ensures that will keep working among upgrades.

Loading

So, we went to watch the new Star Wars

  
And although it was good, to me it was not a memorable movie, better than the first three episodes yes, better than the 4-6 ? No.

A couple of spoilers alter. Stop reading if you haven’t seen the movie yet.

Basically the same, Rebels vs The bad guys. They even had the killed parent. The different part is that the Jedi is a woman now (trying to be inclusive?) and there’s a bit more of humor with chewbacca and Han Solo.

Also, Kylo Ren is the worst villain I’ve ever seen in Star Wars. Just think about this: a fucking storm trooper hit him with a laser blade. Kylo could just use the force a twist his neck and No more Finn for the saga. Also, a girl with no training who discovered her Jedi powers 15 minutes before beat the ass of Kylo, a Commander of the dark side…

There are several mistakes, but at the end is just a movie, not what I expected but not worse than the other movies.

Loading

Python: Simple HTTP Server on python.

(Repost from old blog)

Python have several modules that help you to achieve your goals. This week, on my spare time that is getting every day more scarce I spend time figuring out how to create a Python Web Server, I was planing to use it over an application that I’m developing on ICT Consulting. At the end I didn’t use it because I didn’t want a “passive” communication, but probably I will use this code on the CRM Desktop application that we use here.

Anyway, this code may be helpful for you too. I found that creating a small web server is really simple, It starts getting bigger as you add functions to that web server, but the basis is quite simple.

import os
import cgi
import sys
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
 
class customHTTPServer(BaseHTTPRequestHandler):
        def do_GET(self):
                self.send_response(200)
                self.send_header('Content-type', 'text/html')
                self.end_headers()
                self.wfile.write('<HTML><body>Get!</body></HTML>')
                return 
                
        def do_POST(self):
                global rootnode
                ctype,pdict = cgi.parse_header(self.headers.getheader('Content-type'))
                if ctype == 'multipart/form-data':
                        query = cgi.parse_multipart(self.rfile, pdict)
                self.send_response(301)
                self.end_headers()
                self.wfile.write('Post!')
        
                
def main():
        try:
                server = HTTPServer(('',8080),customHTTPServer)
                print 'server started at port 8080'
                server.serve_forever()
        except KeyboardInterrupt:
                server.socket.close() 
 
if __name__=='__main__':
        main()

There are two main methods in our small server: do_GET and do_POST, you can figure out what this methods do. Get is quite simple, Post is used to send data to the server, as an example, the file uploading. This is done via POST and many times using “multipat/form-data” as the content type. The Post method here handles that.

Now that you have a custom server, how can you check it?, well, to check GET you can call it from the web browser. For the POST stuff, you can create a simple web form and using your web browser as “action” on it. However, this code can help you:

import urllib2
import urllib
import time
import httplib, mimetypes
 
HOST = '127.0.0.1'
PORT = '8080' 
 
def post_multipart(host, port, selector, fields, files):
        """
        Post fields and files to an http host as multipart/form-data.
        fields is a sequence of (name, value) elements for regular form fields.
        files is a sequence of (name, filename, value) elements for data to be uploaded as files
        Return the server's response page.
        """
        content_type, body = encode_multipart_formdata(fields, files)
        h = httplib.HTTP(host, port)
        h.putrequest('POST', '/cgi-bin/query')
        h.putheader('content-type', content_type)
        h.putheader('content-length', str(len(body)))
        h.endheaders()
        h.send(body)
        #errcode, errmsg, headers = h.getreply()
        h.getreply()
        return h.file.read() 
 
def encode_multipart_formdata(fields, files):
        """
        fields is a sequence of (name, value) elements for regular form fields.
        files is a sequence of (name, filename, value) elements for data to be uploaded as files
        Return (content_type, body) ready for httplib.HTTP instance
        """
        BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_

Did you like this?, don't forget to share!

        CRLF = '\r\n'
        L = []
        if fields:
                for (key, value) in fields:
                        L.append('--' + BOUNDARY)
                        L.append('Content-Disposition: form-data; name="%s"' % key)
                        L.append('')
                        L.append(value)
        if files:
                for (key, filename, value) in files:
                        L.append('--' + BOUNDARY)
                        L.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, filename))
                        L.append('Content-Type: %s' % get_content_type(filename))
                        L.append('')
                        L.append(value)
        L.append('--' + BOUNDARY + '--')
        L.append('')
        body = CRLF.join(L)
        content_type = 'multipart/form-data; boundary=%s' % BOUNDARY
        return content_type, body 
 
def get_content_type(filename):
        return mimetypes.guess_type(filename)[0] or 'application/octet-stream' 
 
def test():
        print  post_multipart(HOST, PORT, 'markuz',
                                        ( ('username','markuz'),  ('another_field','another value')),
                                        (('query','query','Query'), ),
                                   ) 
 
if __name__ == '__main__':      
     test()

Did you like this?, don’t forget to share!

Loading