Search Results

Search found 230 results on 10 pages for 'zjm1126'.

Page 4/10 | < Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >

  • how to make the red div don't alert 'ss' when drag the black div on it ,

    - by zjm1126
    i using jquery and jquery-ui, this is my code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta name="viewport" content="width=device-width, user-scalable=no"> </head> <body> <style type="text/css" media="screen"> </style> <div id=a style="width:300px;height:300px;background:blue;position:absolute;"></div> <div id=b style="width:100px;height:100px;background:red;position:absolute;"></div> <div id=c style="width:50px;height:50px;background:black;clear:both"></div> <script src="jquery-1.4.2.js" type="text/javascript"></script> <script src="jquery-ui-1.8rc3.custom.min.js" type="text/javascript"></script> <script type="text/javascript" charset="utf-8"> $("#c").draggable({}); $("#b").droppable('disable');//this is not useful $("#a").droppable({ drop: function(event,ui) { alert('ss') } }); </script> </body> </html>

    Read the article

  • how to read a static file in .py file using django ..

    - by zjm1126
    this is my error code: text = open('/media/a.txt', 'rb').read() and my perplexed is: when i use this : text = open('a.txt', 'rb').read() it can be running but when i put the 'a.txt' to the 'media' folder, i can't running , why ? thanks IOError at / [Errno 13] file not accessible: '/media/a.txt'

    Read the article

  • how to format date when i load data from google-app-engine..

    - by zjm1126
    i use remote_api to load data from google-app-engine. appcfg.py download_data --config_file=helloworld/GreetingLoad.py --filename=a.csv --kind=Greeting helloworld the setting is: class AlbumExporter(bulkloader.Exporter): def __init__(self): bulkloader.Exporter.__init__(self, 'Greeting', [('author', str, None), ('content', str, None), ('date', str, None), ]) exporters = [AlbumExporter] and i download a.csv is : the date is not readable , and the date in appspot.com admin is : so how to get the full date ?? thanks i change this : class AlbumExporter(bulkloader.Exporter): def __init__(self): bulkloader.Exporter.__init__(self, 'Greeting', [('author', str, None), ('content', str, None), ('date', lambda x: datetime.datetime.strptime(x, '%m/%d/%Y').date(), None), ]) exporters = [AlbumExporter] but the error is :

    Read the article

  • how to show all method and data when the object not has "__iter__" function in python..

    - by zjm1126
    i find a way : (1):the dir(object) is : a="['__class__', '__contains__', '__delattr__', '__delitem__', '__dict__', '__doc__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__iter__', '__metaclass__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__str__', '__weakref__', '_errors', '_fields', '_prefix', '_unbound_fields', 'confirm', 'data', 'email', 'errors', 'password', 'populate_obj', 'process', 'username', 'validate']" (2): b=eval(a) (3)and it became a list of all method : ['__class__', '__contains__', '__delattr__', '__delitem__', '__dict__', '__doc__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__iter__', '__metaclass__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__str__', '__weakref__', '_errors', '_fields', '_prefix', '_unbound_fields', 'confirm', 'data', 'email', 'errors', 'password', 'populate_obj', 'process', 'username', 'validate'] (3)then show the object's method,and all code is : s='' a=eval(str(dir(object))) for i in a: s+=str(i)+':'+str(object[i]) print s but it show error : KeyError: '__class__' so how to make my code running . thanks

    Read the article

  • what is this 'content_type' mean..

    - by zjm1126
    content_type = ContentType.objects.get_for_model(Map) maps = maps.extra(select=SortedDict([ ('member_count', MEMBER_COUNT_SQL), ('topic_count', TOPIC_COUNT_SQL), ]), select_params=(content_type.id,)) and the ContentType is: class ContentType(models.Model): name = models.CharField(max_length=100) app_label = models.CharField(max_length=100) model = models.CharField(_('python model class name'), max_length=100) objects = ContentTypeManager() class Meta: verbose_name = _('content type') verbose_name_plural = _('content types') db_table = 'django_content_type' ordering = ('name',) unique_together = (('app_label', 'model'),) def __unicode__(self): return self.name def model_class(self): "Returns the Python model class for this type of content." from django.db import models return models.get_model(self.app_label, self.model) def get_object_for_this_type(self, **kwargs): """ Returns an object of this type for the keyword arguments given. Basically, this is a proxy around this object_type's get_object() model method. The ObjectNotExist exception, if thrown, will not be caught, so code that calls this method should catch it. """ return self.model_class()._default_manager.using(self._state.db).get(**kwargs) def natural_key(self): return (self.app_label, self.model) i want to know: what is the 'content_type' used for ??

    Read the article

  • did you know some good web site about 'iphone css layouts' ,and can you help me to improve my code..

    - by zjm1126
    i want to create a webpage on iphone , but i can't complete it in a simple way, this is my code: <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=5.0,user-scalable=yes"> </head> <body onorientationchange="updateOrientation();" onload=updateOrientation()> <div id="a"> <input id='ab' type="button" value="button" /> </div> <div id=b style="display: none">sssadwq dwqdqw</div> <style type="text/css"> *{ margin:0; padding:0; } /* Reposition on orientation change */ body.landscape{ height: 268px; } body.landscape #a{ height:134px; line-height:134px; } body.landscape #b{ height:114px; width:470px; } body{ height: 416px; } #a{ line-height:208px; height:208px; text-align:center; } #b{ height:198px; width:310px; background:red; border:5px solid black; } </style> <script src="jquery-1.4.2.js" type="text/javascript"></script> <script type="text/javascript"> function updateOrientation() { var orientation = window.orientation; switch (orientation) { // If we're horizontal case 90: case -90: // Set orient to landscape $(document.body).addClass("landscape"); break; // If we're vertical default: // Set orient to portrait $(document.body).removeClass("landscape"); break; } } $('#ab').click(function(){ if($('#b').css('display')=='none')$('#b').css('display','block') else $('#b').css('display','none') }) </script> </body> </html> it use much more fixed number,this is not the best way ,i think the best way is to use the percentage more and more, can you do it fo me ,, thanks

    Read the article

  • how to drag a 'div' element to the google maps ,that be changed to a 'marker'..use jquery

    - by zjm1126
    this is my code : <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"> </head> <body onload="initialize()" onunload="GUnload()"> <style type="text/css"> </style> <div id="map_canvas" style="width: 500px; height: 300px;float:left;"></div> <div id=b style="width: 50px; height: 50px;background:red;float:left;margin-left:300px;"></div> <script src="jquery-1.4.2.js" type="text/javascript"></script> <script src="jquery-ui-1.8rc3.custom.min.js" type="text/javascript"></script> <script src="http://ditu.google.cn/maps?file=api&amp;v=2&amp;key=ABQIAAAA-7cuV3vqp7w6zUNiN_F4uBRi_j0U6kJrkFvY4-OX2XYmEAa76BSNz0ifabgugotzJgrxyodPDmheRA&sensor=false"type="text/javascript"></script> <script type="text/javascript"> //********** function initialize() { if (GBrowserIsCompatible()) { // function createMarker(point, number) { var marker = new GMarker(point); var message = ["?","?","?","??","??"]; marker.value = number; GEvent.addListener(marker, "click", function() { var myHtml = "<b>#" + number + "</b><br/>" + message[number -1]; map.openInfoWindowHtml(point, myHtml); }); return marker; } // var map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(39.9493, 116.3975), 13); // Add 5 markers to the map at random locations var bounds = map.getBounds(); var southWest = bounds.getSouthWest(); var northEast = bounds.getNorthEast(); var lngSpan = northEast.lng() - southWest.lng(); var latSpan = northEast.lat() - southWest.lat(); for (var i = 0; i < 5; i++) { var point = new GLatLng(southWest.lat() + latSpan * Math.random(), southWest.lng() + lngSpan * Math.random()); map.addOverlay(createMarker(point, i + 1)); } } } //************* $("#b").draggable(); </script> </body> </html>

    Read the article

  • has any tools easy to download or uploaed data from gae ..

    - by zjm1126
    i find this: http://aralbalkan.com/1784 but it is : Gaebar is an easy-to-use, standalone Django application that you can plug in to your existing Google App Engine Django or app-engine-patch-based Django applications on Google App Engine to give them datastore backup and restore functionality. my app is not based on django,so did you know any tools esay to do this . thanks

    Read the article

  • any rss feed lib for gae..

    - by zjm1126
    i want enable rss for gae on my site . and did you know the simple way to do this ? thanks this is a example i searched: class FeedHandler(BaseRequestHandler): def get(self,tags=None): blogs = Weblog.all().filter('entrytype =','post').order('-date').fetch(10) last_updated = datetime.datetime.now() if blogs and blogs[0]: last_updated = blogs[0].date last_updated = last_updated.strftime("%Y-%m-%dT%H:%M:%SZ") for blog in blogs: blog.formatted_date = blog.date.strftime("%Y-%m-%dT%H:%M:%SZ") self.response.headers['Content-Type'] = 'application/atom+xml' self.generate('atom.xml',{'blogs':blogs,'last_updated':last_updated}) any more simple ?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >