Search Results

Search found 15 results on 1 pages for 'indiehacker'.

Page 1/1 | 1 

  • Redirect some URL requests to CloudFront and the rest direct to the normal server?

    - by indiehacker
    Say I have two types of URL requests that must be handled by my REST API: http://query.restapi.com/image.png?apikey=abc123 http://query.restapi.com/2.0/<apiKey>/resource.json?from=umi.us_census00.state_geometry Is it possible to redirect only some URL requests for static images (ie., regex: *.png?.*) to take advantage of CloudFront's caching and have the rest of the requests go directly to the normal EC2 server (or at least take a speedier indirect route to the normal EC2 server?). Perhaps the added request time for the misses to CloudFront is irrelevant to worry about? Or perhaps my situation is not best to use for CloudFront? I understand I will need to make DNS change where the current URL requests having http://query.restapi.com/some.png?apikey=0123 get redirected to http://d1234.cloudfront.net/some.png, but I am hoping there is some way for just redirecting static .png requests to take advantage of CloudFront?

    Read the article

  • How do you interpret `strace` on an apache process returning `restart_syscall`?

    - by indiehacker
    We restart an apache server every day because RAM usage reaches its limit. Though of value See this serverfault answer, I dont think lowering the MaxClients in the apache configuration is a solution to the unknown root problem. Can you make sense out of the below data? Below is an extract of what $top with M returns: 20839 www-data 20 0 1008m 359m 22m S 4 4.8 1:52.61 apache2 20844 www-data 20 0 1008m 358m 22m S 1 4.8 1:51.85 apache2 20842 www-data 20 0 1008m 356m 22m S 1 4.8 1:54.60 apache2 20845 www-data 20 0 944m 353m 22m S 0 4.7 1:51.80 apache2 and then investigating a single process with $sudo strace -p 20839 returns only this one line, which is cryptic, for me: restart_syscall(<... resuming interrupted call ...> <unfinished ...> Any insights? Thanks.

    Read the article

  • What is the length of time to send a list of 200,000 integers from a client's browser to an internet

    - by indiehacker
    Over the connections that most people in the USA have in their homes, what is the approximate length of time to send a list of 200,000 integers from a client's browser to an internet sever (say Google app engine)? Does it change much if the data is sent from an iPhone? How does the length of time increase as the size of the integer list increases (say with a list of a million integers) ? Context: I wasn't sure if I should write code to do some simple computations and sorting of such lists for the browser in javascript or for the server in python, so I wanted to explore this issue of how long it takes to send the output data from a browser to a server over the web in order to help me decide where (client's browser or app engine server) is the best place for such computations to be processed.

    Read the article

  • How long (max characters) can a datastore entity key_name be? Is it bad to haver very long key_names

    - by indiehacker
    What is the maximum number of characters that can be used to define the key_name of a datastore entity? Is it bad to have very long key_names? For example: Lets say we use key_names of a 170 characters, which is the length of a Twitter message 140 plus 10 numeric characters for latitude and 10 for longtitude and 10 for a timestamp. (Reasoning of such a key_name: So by using such a key_name we can easily and quickly be sure of no duplicate postings, since the same message should not come from the same place and time more than once.)

    Read the article

  • Can I specify the order of how changes happen in an single App Engine transaction ? Is it equal to t

    - by indiehacker
    If I passed a list of key ids as an argument in a transaction, would the change associated with the first key in the list happen first? And if not, how do I specify the order that I want the changes to happen in? As a concrete example, consider this code below from Google Docs Transactions--would changes to the first item in acc.key() happen first? class Accumulator(db.Model): counter = db.IntegerProperty() Docshttp://code.google.com/appengine/docs/python/datastore/transactions.html: def increment_counter(key, amount): obj = db.get(key) obj.counter += amount obj.put() q = db.GqlQuery("SELECT * FROM Accumulator") acc = q.get() db.run_in_transaction(increment_counter, acc.key(), 5)

    Read the article

  • Is there some performance issue between leaving empty ListProperties or using dynamic (expando) prop

    - by indiehacker
    Is there a datastore performance difference between adding dynamic properties of the expando class when they are needed for an entity or the simpler (for me) framework of just setting up all possible properties I might need from the start even though most instances will just be left empty. In my specific case I would be having 5-8 empty ReferenceList properties as 'overhead' that will be empty when I skip using expando class.

    Read the article

  • Why browser doesnt recognize jquery when <script src="...jquery.js> is on a html page served by Goo

    - by indiehacker
    jquery.js source code is not being recognised by browser using my page.html served by Google App Engine as a http:some_request to the SDK, BUT when I load the exact same page.html into the browser directly from my local hard drive as jquery.js all works OK, it is recognized, so I know my path is OK.... I don't understand? In the header of my page.html I have the following: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script> I also tried without success in the header this: <script src="/static/jquery.js" type="text/javascript"></script> I am working along with the examples in the [Jquery tutorial][1]. I am sure there is something simple I dont understand about how .html pages served to the browser from app engine interact differently with the browser than what I normally would expect....but I frustratingly just cant get it.....everything else I have with my app engine app is working fine......would love some help so i can move forward....

    Read the article

  • In datastore, confused on how to pass a list of key_names as an argument to somemodel.get_or_insert(

    - by indiehacker
    Are there examples of how to pass a list of key_names to Model.get_or_insert() ? My Problem: With a method of ParentLayer I want to make the children. The key_names of the new (or editable) entities of class Child will come from such a list below: namesList = ["picture1","picture2"] so I should be able to build a list of key_names with method from the parent class as follows: class ParentLayer(db.Model): def getOrMakeChildren(self, namesList): keyslist = [ db.Key.from_path( 'Child' , name , parent = self.key() ) for name in namesList ] the problem is next where I simply want to get_or_insert entities based on keylist defined above: childrenEntitiesList = Child.get_or_insert(keyslist) # no works? also none of the below attempts worked: #childrenEntitiesList = Child.get_or_insert(keyslist, parent = u'TEST') #childrenEntitiesList = Child.get_or_insert(keyslist, parent=self.key().name() ) #childrenEntitiesList = Child.get_or_insert(keyslist, parent=self.key()

    Read the article

  • Instantiate a model when the kind of model needed is represented as a string argument

    - by indiehacker
    My input data is a string representing the kind of datastore model I want to make. In python, I am using the eval() function to instantiate the model (below code), but this seems overly complex so I was wondering if there is a simpler way people normally do this? >>>model_kind="TextPixels" >>>key_name_eval="key_name" >>>key_name="key_name" >>>kwargs {'lat': [0, 1, 2, 3], 'stringText': 'boris,ted', 'lon': [0, 1, 2, 8], 'zooms': [0, 10]} >>>obj=eval( model_type + '(key_name='+tester+ ',**kwargs )' ) >>>obj <datamodel.TextPixels object at 0xed8808c>

    Read the article

  • Any strategies for assessing the trade-off between CPU loss and memory gain from compression of data

    - by indiehacker
    Are very large TextProperties a burden? Should they be compressed? Say I have a information stored in 2 attributes of type TextProperty in my datastore entities. The strings are always the same length of 65,000 characters and have lots of repeating integers, a sample appearing as follows: entity.pixel_idx = 0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,5,5,5,5,5,5,5,5,5,5,5,5....etc. entity.pixel_color = 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,...etc. So these above could also be represented using much less storage memory by compressing say using only each integer and the length of its series ( '0,8' for '0,0,0,0,0,0,0,0') but then its takes time and CPU to compress and decompress? Any general ideas? Are there some tricks for testing different attempts to the problem?

    Read the article

  • I expect to see in the browswer "http://path/some_page.html" but instead it identifies with "http:/

    - by indiehacker
    I am developing with app engine SDK. I have a feeling this is much too basic a question so apologies ahead of time... A simple submit button doesnt work instead of just showing an alert box as expected it continues on afterwards and redirects me to the latest http-request, and I think this is because I dont understand how to tell the browser to recognize the proper URLs. Why does my browser say I am at the most recent http-request http://localhost:8080/putProjectInDB rather than the somepage.html that was actually served to the browser that I am currently looking at? How can I get the browser to recognize and show in its url spot the normal expected http://somepage.html ? Just in case, here are details of the specific problem which you might be able to ignore for answering the question: This hasnt been mattered for me until I just wanted to put into my .html a simple button that changes some stuff of the page without needing the server. The below code after displaying the alert box redirects me to the last server request http://localhost:8080/putProjectInDB instead of just staying in the same html page. in header: function MyFormCommands() { alert('Some Text'); } in body: <form onSubmit="MyFormCommands()" ><input type=submit ></form >

    Read the article

  • Need a cleaner way, which avoids too many 'if statements', to write this method for inputing data in

    - by indiehacker
    What is the best way to reference datastore model attributes without using the four 'if statements' I have in the below sample code, which seem messy and inefficient. For real-world code I may have a situation of 100 attributes such as self.var1, self.var2, ... self.varN that I want to some how reference with just an integer (or strings) as an argument to some method. class PixelObject(db.Model): zoom0 = db.ListProperty(int) zoom1 = db.ListProperty(int) zoom2 = db.ListProperty(int) zoom3 = db.ListProperty(int) zoom4 = db.ListProperty(int) def inputZoomData(self, zoomInteger, input_data): """input_data goes to specified attribute based on if 0,1,2,3,or 4 is argument""" if zoomInteger == 0: self.zoom0 = input_data if zoomInteger == 1: self.zoom1 = input_data if zoomInteger == 2: self.zoom2 = input_data if zoomInteger == 3: self.zoom3 = input_data if zoomInteger == 4: self.zoom4 = input_data

    Read the article

  • Are reads and (transactional) writes faster for entities of the same group than otherwise?

    - by indiehacker
    What advantage is there to designing child-parent relationships, which allow us to do writes in transactions, when there is never a real concern for consistency and contention and those sort of more complex issues? Does it make writes and reads faster? Consider my situation where there are many .png images that are referenced to one mosaic layer, and these .png images are written just once by a single user. The user can design many mosaic layers and her mosaic layers and referenced image entities are never changed/updated, they are just deleted some time in the future. Other users can come to the web project site and interactively view the mosaic layer as different layouts/configurations of the images as they play (query) with different criteria. So reads should be very fast. So there is no real worry of contention, or users conflicting with one another with writing new image entities. And because of that I am assuming there is no "requirement" for the .png image entities to be grouped by their same mosaic layer in child-parent relationship. However, perhaps, since the documentation says they are stored close to one another, if the many image entities were grouped as children to a single mosaic layer parent than this has the advantage that the writing (in transaction) and reading will happen much faster?

    Read the article

1