macks  [ Profile ]

Sort by: Date / Title /

  1. 2 days ago
    usando la libreria ffmpeg
    1. import commands
    2. import os
    3.  
    4. def execute():
    5.         cmd = 'c:/ffmpeg/ffmpeg.exe -y -itsoffset -4 -i c:/input.mpg -vframes 1 -s 100x90 -f image2 c:/uploads/img_gen.jpg'
    6.         #c = commands.getoutput(cmd) # linux
    7.         c = os.system(self.cmd) #windows
    8.         return c
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2058"></script>
  2. 2 days ago
    1. def testImages(request):
    2.     from PIL import Image
    3.     path = ('c:/images/soluciones__1.jpg')
    4.     #content = 'c:/images/soluciones1.jpg'
    5.     content = 'c:/images/image.gif'
    6.     image = Image.open(content)
    7.     image.thumbnail((200,150), Image.ANTIALIAS)
    8.     image.save(path, image.format)
    9.     savelog(image.format)
    10.     del image
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2057"></script>
  3. 1 week ago
    1. from django.db import load_backend, transaction, connection
    2.  
    3. #manipular datos de una bd externa
    4.  
    5. def sincronizeDB(self):
    6.         myBackend = load_backend('mysql') # or 'mysql', 'sqlite3', 'oracle'
    7.         myConnection = myBackend.DatabaseWrapper({
    8.             'DATABASE_HOST': '192.168.1.11',
    9.             'DATABASE_NAME': 'agenciaperu_local',
    10.             'DATABASE_OPTIONS': {},
    11.             'DATABASE_PASSWORD': "",
    12.             'DATABASE_PORT': "",
    13.             'DATABASE_USER': "root",})
    14.         # Now we can do all the standard raw sql stuff with myConnection.
    15.         myCursor = myConnection.cursor()       
    16.         id = 22
    17.         name = "tecnologia para jos"
    18.         slug = "tecnologia_para_jos"
    19.         row = myCursor.execute("INSERT INTO category(name, slug )  values(%s,%s);", [name, slug])
    20.         row = myConnection._commit()
    21.         #row = transaction.rollback_unless_managed()  -----> serĂ­a cuando trabajamos en local
    22.  
    23. # select simple
    24.         #row = myCursor.execute("select *from category where id = %s and highlight = %s;",[id,0])
    25.         myCursor.fetchall()
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2056"></script>
  4. sponsorised links
  5. 2 weeks ago
    1. values = ['Enero','Enero','Enero','Febrero']
    2. print  [(x,values.count(x)) for x in set(values)]
    3.  
    4. ====>>[('Enero', 3), ('Febrero', 1)]
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2055"></script>
  6. 4 weeks ago
    1. #template
    2. {% load humanize %}
    3. {{ my_num|intcomma }}
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2046"></script>
  7. 1 month ago
    1. #form.cleaned_data['videoPath'] = C:Apacheuploadsvideosvideo_test.flv
    2.  
    3. path = form.cleaned_data['videoPath'].replace("\","/")
    4.             vName = ''.join(path.split("/")[-1:])
    5.  
    6. #result = 'video_test.flv'
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2045"></script>
  8. 1 month ago
    1. cName = ['funciton','bcp','interbank','sheraton']
    2.     cPhone = ['65465465','4546545','56465465','545454545']
    3.     cRuc = [5465463545,546546546,5245454,9898998]
    4.  
    5.     store = [cName,cPhone,cRuc]
    6.    
    7.     l = []
    8.     i = 0
    9.     for s in store:
    10.         cname = store[0][i]
    11.         cphone = store[1][i]
    12.         cruc = store[2][i]
    13.         l.append({'cname': cname, 'phone':cphone, 'ruc':cruc})
    14.         i = i+1
    15.  
    16. savelog(l)
    17. [{
    18.   'phone': '65465465',
    19.   'cname': 'funciton',
    20.   'ruc': 5465463545L
    21. },
    22. {
    23.   'phone': '4546545',
    24.   'cname': 'bcp',
    25.   'ruc': 546546546
    26. },
    27. {
    28.   'phone': '56465465',
    29.   'cname': 'interbank',
    30.   'ruc': 5245454
    31. }]
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2035"></script>
  9. 2 months ago
    1. from django.utils.encoding import iri_to_uri, smart_str, smart_unicode
    2. from django.utils.http import urlquote
    3.  
    4. url = iri_to_uri('%s?query=%s' % (urlresolvers.reverse('search_home_index'), urlquote(query)))
    5. return HttpResponseRedirect(url)
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2014"></script>
  10. 2 months ago
    1. public static function blocks_arrays($array, $pieces){
    2.         if ($pieces < 2 ){
    3.             return array($array);
    4.         }
    5.         $newCount = ceil(count($array)/$pieces);
    6.         $a = array_slice($array, 0, $newCount);
    7.         $b = Utiles::blocks_arrays(array_slice($array, $newCount), $pieces-1);
    8.         return array_merge(array($a),$b);
    9.        
    10.     }
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2011"></script>
  11. 3 months ago
    1. #if simple
    2. u.is_activeTrue if is_active == 'on' else False
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2005"></script>

First / Previous / Next / Last / Page 1 of 5 (42 posteets)