Search Results

Search found 31319 results on 1253 pages for 'source engine'.

Page 51/1253 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • Source Code to Image Converter

    - by Alix Axel
    I want to display some dozens of highlighted snippets (of code) on a presentation, I though of pasting the relevant snippets in a editor, capturing the screen and cropping the image to the code. Is there an easier way to do this? An editor? Maybe a Pastie-like website that can export direclty to PNG? Thanks in advance!

    Read the article

  • Java How to get exact tile location in random tile engine

    - by SYNYST3R1
    I am using the slick2d library. I want to know how to get the exact tile location so when I click on a tile it only changes that tile and not every tile on the screen. My tile generation class public Image[] tiles = new Image[3]; public int width, height; public int[][] index; public Image grass, dirt, selection; boolean selected; int mouseX, mouseY; public void init() throws SlickException { grass = new Image("assets/tiles/grass.png"); dirt = new Image("assets/tiles/dirt.png"); selection = new Image("assets/tiles/selection.png"); tiles[0] = grass; tiles[1] = dirt; width = 50; height = 50; index = new int[width][height]; Random rand = new Random(); for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { index[x][y] = rand.nextInt(2); } } } public void update(GameContainer gc) { Input input = gc.getInput(); mouseX = input.getMouseX(); mouseY = input.getMouseY(); if(input.isMouseButtonDown(Input.MOUSE_LEFT_BUTTON)) { selected = true; } else{ selected = false; } } public void render() { for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { tiles[index[x][y]].draw(x * 64, y *64); if(IsMouseInsideTile(x, y)) selection.draw(x * 64, y * 64); } } } public boolean IsMouseInsideTile(int x, int y) { return (mouseX >= x * 64 && mouseX <= (x + 1) * 64 && mouseY >= y * 64 && mouseY <= (y + 1) * 64); } I have tried a couple different ways to change the tile I am clicking on, but I don't understand how to do it.

    Read the article

  • Google App Engine - Cannot See Children in Datastore Viewer

    - by Taylor L
    I have the following kinds/relationships in my datastore: UserAccount 1-to-1 PersistentLogin 1-to-many PersistentLogins They are all in the same entity group and UserAccount is the parent. Should I expect to see the other kinds in the datastore viewer? Currently, I only see UserAccount entities, but I'm pretty confident the other entities are there because my code is working as expected. Is this just a nuance of the datastore viewer?

    Read the article

  • Open Source Simple Speech Recognition in C++ in Windows

    - by Cenoc
    Hey Everyone, I was wondering, are there any basic speech recognition tools out there? I just want something that can distinguish the difference between "yes" and "no" and is reasonably simple to implement. Most of the stuff out there seems to make you start from scratch, and I'm looking for something more high level. Thanks!

    Read the article

  • Fetching just the Key/id from a ReferenceProperty in App Engine

    - by ozone
    Hi SO, I could use a little help in AppEngine land... Using the [Python] API I create relationships like this example from the docs: class Author(db.Model): name = db.StringProperty() class Story(db.Model): author = db.ReferenceProperty(Author) story = db.get(story_key) author_name = story.author.name As I understand it, that example will make two datastore queries. One to fetch the Story and then one to deference the Author inorder to access the name. But I want to be able to fetch the id, so do something like: story = db.get(story_key) author_id = story.author.key().id() I want to just get the id from the reference. I do not want to have to deference (therefore query the datastore) the ReferenceProperty value. From reading the documentation it says that the value of a ReferenceProperty is a Key Which leads me to think that I could just call .id() on the reference's value. But it also says: The ReferenceProperty model provides features for Key property values such as automatic dereferencing. I can't find anything that explains when this referencing takes place? Is it safe to call .id() on the ReferenceProperty's value? Can it be assumed that calling .id() will not cause a datastore lookup?

    Read the article

  • Google App Engine django model form does not pick up BlobProperty

    - by Wes
    I have the following model: class Image(db.Model): auction = db.ReferenceProperty(Auction) image = db.BlobProperty() thumb = db.BlobProperty() caption = db.StringProperty() item_to_tag = db.StringProperty() And the following form: class ImageForm(djangoforms.ModelForm): class Meta: model = Image When I call ImageForm(), only the non-Blob fields are created, like this: <tr><th><label for="id_auction">Auction:</label></th><td><select name="auction" id="id_auction"> <option value="" selected="selected">---------</option> <option value="ahRoYXJ0bWFuYXVjdGlvbmVlcmluZ3INCxIHQXVjdGlvbhgKDA">2010-06-19 11:00:00</option> </select></td></tr> <tr><th><label for="id_caption">Caption:</label></th><td><input type="text" name="caption" id="id_caption" /></td></tr> <tr><th><label for="id_item_to_tag">Item to tag:</label></th><td><input type="text" name="item_to_tag" id="id_item_to_tag" /></td></tr> I want the Blob fields to be included in the form as well (as file inputs). What am I doing wrong?

    Read the article

  • Google App Engine PersistenceManager can process multiple objects ?

    - by Frank
    I have some code like this : PersistenceManager pm=PMF.get().getPersistenceManager(); String query="select from "+PayPal_Message.class.getName()+" where processed == false order by time desc"; List<PayPal_Message> messages=(List<PayPal_Message>)pm.newQuery(query).execute(); if (messages.isEmpty()) { } else { for (PayPal_Message g : messages) { Contact_Info_Entry A_Contact_Entry=Process_PayPal_Message_To_Get_A_License(g.getContent().getValue()); pm=PMF.get().getPersistenceManager(); try { pm.makePersistent(A_Contact_Entry); g.setProcessed(true); pm.makePersistent(g); } catch (Exception e) { Send_Email(Email_From,"[email protected]","Servlet Error Message [ "+time+" ]",new Text(e.toString())); } // finally { pm.close(); } } } pm.close(); I wonder if it's ok to use the pm above to process multiple objects before closing it. Or do I have to get and close pm for processing each object ?

    Read the article

  • Google App Engine - Dealing with concurrency issues of storing an object

    - by Spines
    My User object that I want to create and store in the datastore has an email, and a username. How do I make sure when creating my User object that another User object doesn't also have either the same email or the same username? If I just do a query to see if any other users have already used the username or the email, then there could be a race condition. UPDATE: The solution I'm currently considering is to use the MemCache to implement a locking mechanism. I would acquire 2 locks before trying to store the User object in the datastore. First a lock that locks based on email, then another that locks based on username. Since creating new User objects only happens at user registration time, and it's even rarer that two people try to use either the same username or the same email, I think it's okay to take the performance hit of locking. I'm thinking of using the MemCache locking code that is here: http://appengine-cookbook.appspot.com/recipe/mutex-using-memcache-api/ What do you guys think?

    Read the article

  • Delete an entity by key without fetching it first in app engine (using JDO)

    - by Peter Recore
    Is there a way to delete an entity without having to fetch it from the datastore first? I am assuming I already have the key or id for the entity. I'm thinking of something like deleteObjectById that would be an analogue to getObjectById on PersistenceManager. The closest I can think of is using Query.deletePersistentAll() (as seen here) and specifying a query that only relies on the key, but I can't tell if that is going to fetch the entity before deleting it. thanks EDIT: I know how to do this using the low level API, as well as in the python API. I was wondering if there was a way to do it within the JDO layer.

    Read the article

  • Google App Engine Application Error 5

    - by Sam
    I frequently get this Application error. What does this mean ? File "/base/data/home/apps/0xxopdp/10.347467753731922836/matrices.py", line 215, in insert_into_db obj.put() File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/db/__init__.py", line 895, in put return datastore.Put(self._entity, config=config) File "/base/python_runtime/python_lib/versions/1/google/appengine/api/datastore.py", line 404, in Put return _GetConnection().async_put(config, entities, extra_hook).get_result() File "/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_rpc.py", line 601, in get_result self.check_success() File "/base/python_runtime/python_lib/versions/1/google/appengine/datastore/datastore_rpc.py", line 572, in check_success rpc.check_success() File "/base/python_runtime/python_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 502, in check_success self.__rpc.CheckSuccess() File "/base/python_runtime/python_lib/versions/1/google/appengine/api/apiproxy_rpc.py", line 126, in CheckSuccess raise self.exception ApplicationError: ApplicationError: 5 I do make many calls to the datastore. What caused this problem ?

    Read the article

  • Doubts on Expression Engine

    - by bparanj
    Is EE better than Plone? Is there a way to allow guest bloggers to post content in EE? Is anyone interested in attending the EE conference this year? There is a discount if we sign up as a group. Please contact me directly if you are interested bparanj at gmail.

    Read the article

  • OpenSource Projects - Is there a site which lists projecs that need more developers?

    - by Jamie
    Morning/Afternoon/Evening all, Do any of you know of a website which lists opensource projects which are in need of more help? Let me elaborate, I would like to work on another open source project (I already work on a couple), however, it would be nice to have a site which lists lots of OS projects, their aims, deadlines, workload, how many more developers they are in need of etc. Of course, I could just pick a topic i'm interested in, find an OS project and then work on it, however, it would be nice to see a diversified list of projects. Primarily because some little known awesome projects get little attention and big projects such as jQuery forks, adium, gimp etc. etc. get a lot of attention because they are well known (and of course because they are great)and thus get a lot of developers working on them. It would be nice to see some little known projects getting more attention and thus hopefully drawing some people to work on them. Currently there are many websites hosting os projects, such as github, sourceforge, google code etc. A website to centralise all of this into one place and categorise it would be awesome. Let me know your thoughts please. I'm not looking for an answer per se, so I will mark it is as a community wiki. Your thoughts would be great.

    Read the article

  • App Engine Django Form Uniqueness Validation?

    - by GeekTantra
    Is there a simpler way to use uniqueness validation with Django Forms in AppEngine? I understand that performance would be problem if we keep an uniqueness constraint but since the amount of data being added is very small performance is not a big concern, rather development time is a concern here. Any help is appreciated.

    Read the article

  • how to send some data to the Thread module on python and google-map-engine

    - by zjm1126
    from google.appengine.ext import db class Log(db.Model): content = db.StringProperty(multiline=True) class MyThread(threading.Thread): def run(self,request): #logs_query = Log.all().order('-date') #logs = logs_query.fetch(3) log=Log() log.content=request.POST.get('content',None) log.put() def Log(request): thr = MyThread() thr.start(request) return HttpResponse('') error is : Exception in thread Thread-1: Traceback (most recent call last): File "D:\Python25\lib\threading.py", line 486, in __bootstrap_inner self.run() File "D:\zjm_code\helloworld\views.py", line 33, in run log.content=request.POST.get('content',None) NameError: global name 'request' is not defined

    Read the article

  • Google App Engine getting verbose_name of a property from an instance

    - by Brian M. Hunt
    Given a model likeso: from google.appengine.ext import db class X(db.Model): p = db.StringProperty(verbose_name="Like p, but more modern.") How does one access verbose_name from x=X() (an instance of X)? One might expect that x.p.verbose_name would work, or alternatively x.properties()['p'].verbose_name, but neither seems to work. Thanks! EDIT: x.name.verbose_name = x.p.verbose_name

    Read the article

  • App-Engine Parse a UrlFetch UTF-8 encoded stream

    - by Davidrd91
    I am trying to parse an XML from a URL using the xml.sax parser. I know there are other libraries to use but coming from Java this is the one I am most familiar with and seems the least complicated to me. The code I'm using to parse is as follows: parser = xml.sax.make_parser() handler = MangaHandler() parser.setContentHandler(handler) url = urlfetch.Fetch('http://www.mangapanda.com/alphabetical', allow_truncated = False, follow_redirects = False, deadline = False) xml.sax.parseString(url.content, handler) This returns a SaxException (invalid token) once the parser reaches the first & sign: SAXParseException: <unknown>:582:34: not well-formed (invalid token) Because urlfetch returns a string and not a stream I cannot use the parse() (which only works with streams) and am left to use parseString() instead. To see if parsing as a stream would fix this I tried: parser.parse(io.StringIO(url.content).encode('utf-8')) but this returns: TypeError: initial_value must be unicode or None, not str I have also tried to use the urllib2 libraries which do return a stream instead of urlfetch but the file is too large and is automatically truncated, leaving me with missing data. Any Sort of work-around for this would be greatly appreciated as I've spent days getting around one obstacle just to be stopped by another.

    Read the article

  • Reg Google app engine datastore -primarykey

    - by megala
    hi, I created table in google Big table datastore ,In that the i set primary key using @annotations as follows @Id @Column(name = "groupname") private String groupname; @Basic private String groupdesc; I worked corretly,but it override the previous record,how to solve this for eg if i entered groupname=group1 groupdesc=groupdesc than it accept after that i enter same groupname it override previous record for eg groupname=group1 groupdesc=groups this record override previous one.

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >