Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I want to have a little search box, where the user can search for a place (using API), then when they select a place e.g "statue of liberty, new york", I want to take them to a detail
page I.E mysite/ID/statue-of-liberty-new-york
and then let them do some things on that page,
The only data I want from google on the detail page, is the places ID and of course the name and address of the place, that's it then I want to do my own stuff and attach my own data to the places.
I'm a bit annoyed it's hard to understand what is acceptable, they should have expressed this TOC in laymans terms.
Here's some relveant info from their TOC:
a) No Unauthorized Copying, Modification, Creation of Derivative Works, or Display of the Content. You must not copy, translate, modify, or create a derivative work (including creating or contributing to a database) of, or publicly display any Content or any part thereof except as explicitly permitted under these Terms. For example, the following are prohibited: (i) creating server-side modification of map tiles; (ii) stitching multiple static map images together to display a map that is larger than permitted in the Maps APIs Documentation; (iii) creating mailing lists or telemarketing lists based on the Content; or (iv) exporting, writing, or saving the Content to a third party's location-based platform or service.
(b) No Pre-Fetching, Caching, or Storage of Content. You must not pre-fetch, cache, or store any Content, except that you may store: (i) limited amounts of Content for the purpose of improving the performance of your Maps API Implementation if you do so temporarily (and in no event for more than 30 calendar days), securely, and in a manner that does not permit use of the Content outside of the Service; and (ii) any content identifier or key that the Maps APIs Documentation specifically permits you to store. For example, you must not use the Content to create an independent database of "places" or other local listings information.
The relevant policies for your question you'll find here: https://developers.google.com/places/policies
you may use the searchbox and you also may use the results to show them on a page without showing a google-map
it's still not clear if you use any type of map inside your application, but when you do so, you may not use any data delivered by the places-service to use them on this map(e.g. you may not use the latLng of the place-result to create a marker on this map)
you must show the google-logo (because you show data -name and address- received from the service)
when the response contains html_attributions for the place you also must show these html_attributions
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
How can I set the default language based on Country and/or keyboard using the sitecore framework?
I take your point that you would expect an out of the box solution, but in fact the requirements are often perculiar to the project. That said, here are some thoughts
Creating a custom language resolver is probably the best approach.
First Attempt
I normally start by trying to use the the browser language preferences (HttpRequest.UserLanguages), which might supply the whole 2-part language 'en-GB', or sometimes just the basic language 'en'.
If this gave you the whole language, then your're done. Just get the system language with the with the same name.
If it gave you the basic language only, you need to get the country somehow.
If it didn't give you anything. You need to get the country, and find a default language for that country.
Getting the Country
If you go with the MaxMind option, you should probably use the the GeoLite version locally, as you can't rely on the DMS Geo IP lookup being performed in a timely manner.
If the lookup is successful, and you already had a basic language then you should now have 2-part language to compare against your system languages.
If the lookup was successful, but you don't have basic language, then you need to get a default. In the past, I have created a 'Language Mapping' template with 2 fields. A 'Country code' text field, and a 'Language' droplink source to the list of system language. When you have obtained the country code, you simply look it up in your mapping items, and set the context language accordingly.
Some things to consider
Remember you need to have some sort of fallback for when the lookups haven't worked.
Perhaps store the language as a cookie, so the lookup is not done every time.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am programming a website in asp.net Visual Web Developer which I am going to have a lot of product pictures to display on the webpage. Should I store all my images in SQL Server and pull each picture from there or should I store all of the images in a "Picture" folder created inside of my website root folder? Is there a big difference? The Images would be linked to other tables in the database by using the Order_Number this is not a problem.
Too long for a comment.
Images in the database -- I know too many people that regret that decision. Just don't do it except perhaps in light duty usage.
Don't store the path of the image in the database. If you ever have to split images into multiple locations you will have a big mess. Ideally you store a unique (string) identifier hash. Then you computer via a shared function to correct location to pull this from based on the hashed name.
For version 1.0 you could just dump everything into a single directory (so your hash to directory function is very simple). Ideally you want the generated name to be "randomly distributed", i.e., as likely to be zq% as an%. You also ideally want it to be short. Unique is a requirement. For example, you could use an identity field - guaranteed unique but not randomly distributed. If you have large numbers of images, you will want to store these in multiple directory -- so you don't essentially lock up your machine if you ever look at this directory with windows explorer.
A good practice is to combine methods. e.g. Make a hashing function that yield 4 characters (perhaps by keeping only 4 characters of output from TSQL HASHBYTES or CHECKSUM (hashing the identity value) and making the short hash the directory name. Now use the identity value as the filename and you have a simple and scaleable design since you can tweak the algorithm down the road if needed.
Store them on the hard drive, this will allow IIS to cache them and serve them much more efficiently. If you make it so that requesting an image requires invoking a controller IIS cannot cache the image as a static file.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have an ASP.NET 4.0 Web Application that needs to create application forms for insurance. Basically, the program loads a PDF Template, populates the form fields, then flattens and closes the PDF. The templates are small when I create them from Word (about 156k for 5 pages) but each form field added to the template via Adobe Acrobat adds about 5-10k to the overall file size. Unfortunately, these pages have a whole lot of form fields (200+), and the end result tends to be about half a MB to a 1 MB per page.
Can anyone suggest an alternate application, usable dynamically from an ASP.NET webpage, that can do a similar job but maintain a smaller file size? It doesn't need to be a free component, but it does need to have a way for me to create a template from a word document but not use Office automation to populate the word doc and save as PDF. My preference would also be that it deal with streams and not files, but that is a minor consideration for me in the circumstances.
Take a look at ABCpdf, I'm pretty sure it can handle what you're looking for
It might be worth looking at Docmosis. You can use word documents as templates to populate and produce PDF and other outputs. Because of the way it works, the document size will not "explode" as you have indicated is a problem with a large number of fields with your current scenario. ASP.NET can invoke Docmosis in various ways depending on your application's runtime environment. Docmosis offers online web-services which have minimal footprint/requirements for an application environment as well as downloadable and embeddable options. It is commercial (I work for the company that created it) and has no Office Automation requirements.
Hope that helps.
You might try Docotic.Pdf library for this.
The library can be used to fill existing fields from code or by importing FDF files.
The library can not flatten form fields but you can make fields read-only or protect the whole document from changes with permissions.
Here are some sample that might be useful:
Fill existing form
Import FDF data
Find control by name
Permissions
Disclaimer: I work for the vendor of the library.
In our system, we have URLs for pages where the content, including the title, is based on user generated content. I'm trying to figure out the best design that balances SEO, human readability and resiliency.
I've been reading a bunch of material on this, including Tim Berners-Lee's document from way back: Cool URIs don't change.
As an example, imagine I have a book review site where users are submitting content (a worded review) and the book's title and author.
So if they submitted a book review for A Tale of Two Cities (user unintentionally mispells it) with Author of Charles Dickens. The URL could be:
http://foo.com/charles-dickens/a-tale-of-two-cities
Later on, if another book by Dickens is added, it could be:
http://foo.com/charles-dickens/oliver-twist
Then http://foo.com/charles-dickens/ could be a list of all the reviewed books on the site.
However, the problem comes into play if a change is made to book title. Imagine the user mispelled something, like A Tale of Two City, then it's later corrected. This would also change the URL and would break any external links to that page, pagerank, etc.
What is the recommended way to handle this type of problem? Options I see:
First commit wins: No changes to URL are possible after it's initially established
Last commit wins: Always change the URL. So if there's a change to the User generated content, revise the URL. With this approach, either the old URL is dead or a trail is preserved of all the URL changes and all of them still function. Stackoverflow seems to to this.
Don't base URL on UGC: Ignore the user generated content and just come up with URLs not based on it. So url could be http://foo.com/reviews/1234.
What are people's thoughts on this?
You're slightly wrong; Stack Overflow combines #2 and #3. A question has a specific id, and that's all you need to locate the question. For example, this question's id is 11011252. You can access the question with https://stackoverflow.com/questions/11011252, no need to add the portion of the URL (or would you call it a URI in this case?) generated from the question title. In fact, that will get automatically tacked on (whether by redirect or some other method) when you use the titleless address.
Even better, you can append whatever you want (within reason, I suppose) to the end of the address. https://stackoverflow.com/questions/11011252/this-text-will-be-ignored will take you to the question without any problem.
Stack Overflow isn't the only website that does this, either; many other sites I've seen focused on user-generated content follow the same protocol/whatever you call it. It seems like the best method to go with, as it combines the advantages of #3 (underlying URI remains the same) with the advantages of #2 (the URL contains some information about its target, which users will like), and best of all means you won't get any URI conflicts if two people generate content with the same non-unique identifiers.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I created a content type for some Quizz on my site, and now I'd like to create a basic form (only available to admins) to pull some stats on them.
The fields used for the quizz are name, start date, end date and correct answer. Each of these fields should be a searchable criteria in the form, and return a list of quizz. There should also be a relationship with the user table to display a list of those who answered the quizz.
Later I'm gonna need an option to extract the data in excel, but let's focus on the form first.
The version i'm using is Drupal6 and please take in consideration that I'm still pretty new to Drupal.
How can I do this?
I imagine you are using CCK for the 'quiz' content type?
If you are, then the best way to 'mash' this data up with getting overly complex is to use Views. You can think of views as an interactive SQL query builder.
You can create pages, blocks or even RSS feeds from the output of Views.
Module Forena seems like a valid alternative to consider. For more details about Forena, 2 types of documentation are available:
Community documentation.
Documentation that comes with Forena, which you can access right after install and enable of the module. Checkout the demo site for an online example of the current:
Forena documentation - use the link 'Reporting documentation' or visit relative link /reports/help.
Forena samples - use the link 'Reporting samples' or visit relative link /reports/samples (these samples are fully functional, so make sure to experiment a bit with it, such as the drill downs available on the SVG Graph sample).
The newest 7.x-4.x version also includes an amazing (I think) UI for either creating your reports (the WYSIWYG report editor) and/or for creating your SQL queries (the Query Builder).
Be aware: I'm a co-maintainer of Forena.