ZK - running on google app engine gives a timeout - google-app-engine

I have a test page with a list of 100 items.
When I scroll the list down every time this timeout error pops up.
Is there a fix for this in ZK?
There is nothing else special just a list with 100 test rows.

I'll make an educated guess that this is because you're storing some state (maybe "what page is this user on") in memory and expecting it to be around on the next request. In App Engine, it won't be. There are at least 3 ways around this:
Use memcache
If the data's important, put it in the datastore
If the data's small and non-confidential, send it down to the client and have the client send it back to the server on the next request. In this case, that seems like the correct solution.

UPDATE:
On zk docs it says to use:
<zk>
<!-- clustering environment -->
<system-config>
<disable-event-thread/>
<ui-factory-class>org.zkoss.zk.ui.http.SerializableUiFactory</ui-factory-class>
</system-config>
<!-- GAE doesn't allow user's thread -->
<client-config>
<resend-delay>-1</resend-delay>
</client-config>
</zk>
But when I comment this line out:
<disable-event-thread/>
The error goes away!

Related

Sanity/next slug- 404 not found

When I try to access my slug page, the name of the slug shows in the browser search bar (so I know its accessing the backend data), but nothing shows up on the page. In the console, error 404 keeps coming every 3 seconds.
Due to lack of timing, experience, knowledge, etc., I've had to switch from react to next very last minute (learning both for the first time at the moment). In react, I remember you could establish a path/page that went '/pageName/:slug', but I haven't seen that for next. I think this might be what is causing the issue, that I don't have an equivalent of that, but I'm not sure how to go about doing that. How do I fix this issue?
I'm happy to post any code if needed.
Got it. I hadn't given much context in the post, but I had two .js page files, gallery.js (where I can select a set), and sets.js where I wanted the slug to route into. So my link in gallery.js looked like this: <a href="./sets/[slug]">.
The fix: I renamed sets.js to [slug].js, and removed /sets/ so that it was just <a href="./[slug]">.

wikipedia dump all page titles and pageIDs

I'm trying to find a wikipedia dump containing pageIds and Titles. I don't want to request it on runtime or request 2000 per request, i want it ALL, i want to make a long list of all the pageIds and titles belonging to them and put them into my own database, so that i can use it in an application that requests the data from my own database.
Anybody know which dumps contain those information? It doesn't matter if they also contain more information that what i need - i can just write an app that picks the info i need.
I did try to request it ... it would have taken 140 days and they put up some limit of 2700 requests ... so it would take forever to get the whole thing, instead i want to download a file dumb and clean the data and upload a file to my own database containing only the info i need
Ok found it myself after getting multiple dumps, in short the answer is:
enwiki-latest-page.sql.gz
It contains pageids and Titles.
Entries look like this:
(1217768,0,'Black_River_(South_Carolina)','',0,0,0,0.6285160577990001,'20161001141146','20161001142916',738899573,1654,'wikitext')
First number is pageId. Third entry is title.
Rest i don't know what is - but no matter :D Thanks to myself i solved this issue and will close it :D Big pat on the bag

Watson Conversation, response missing text

Since yesterday, the Conversation service sometimes doesn't answer a response. It recognizes intents and entities, but there is not text in the response. This is what I get when I use CURL:
{"input":{"text":"soporte"},"context":{"conversation_id":"4c700daf-6dd2-4308-be8
d-b76426278536","system":{"dialog_stack":["root"],"dialog_turn_counter":1,"dialo
g_request_counter":1}},"entities":[],"intents":[{"intent":"soporte","confidence"
:1}],"output":{"log_messages":[{"level":"warn","msg":"No dialog node matched for
the input at a root level!"},{"level":"warn","msg":"No dialog node condition ma
tched to true in the last dialog round - context.nodes_visited is empty. Falling
back to the root node in the next round."}],"text":[]}}
When I test the Conversation from the Web interface, it shows that it recognizes the intent, but doesn't give an anwser.
This happens with any intent or entity, in both models I currently have. I clarify that it is an intermittent behavior, sometimes it works fine (it works fine aprox. 1 out of 3 times)
example image
This is still occurring with Conversation "version_date": "2017-04-21"
.
In my case,
- intent is correctly matched, whether Web or Slack
- Web UI sometimes produces the matching response
- slack app always gets "No dialog node matched for the input at a root level!"
Additional Log message : "No dialog node condition matched to true in the last dialog round - context.nodes_visited is empty. Falling back to the root node in the next round."
Examples
one intent is #value_judgement. An example question in the node is "Should we commit ground troops in Syria?" Intent is correctly detected, and Web UI produces response dialog.
second intent is #fact_check, with example "Is it true that 78% or the earth's surface is covered with water?". Intent is detected in both app and Web UI. Neither receive the response dialog.
Web UI succeeds
App Fails
To be honest, this is hard to answer without seeing a sample conversation script you are calling. So this answer is generic.
First let's examine your JSON response.
In the response we can see this:
"intents":[{
"intent":"soporte",
"confidence":1
}
This tells you that it found the intent, but not that it took any action on that intent. The action is defined by your Dialog tree.
The main error message is this:
No dialog node matched for the input at a root level!
This means that no where in your top level of nodes did it find a condition that matches. In your case, you need at least one node with the condition of #soporte to capture the intent.
You should also add an "Anything Else" node (normally done automatically) at the root. This way you can see when it hasn't matched something easier.
Here is an example tree:

Putting large number of documents: Google App Engine and Search API

It is question about limit on putting large number of documents in Search API. I intend to put 2057 documents(paragraphs from text file). When I parse each paragraph from text file, create document for each paragraph and put it into index, app seems to be running forever and not responding at all. What can be reason for such behavior?
With regards
I researched the documentation and found the following method:
put(java.lang.Iterable<Document> documents)
My way of importing like this:
1. I collect all documents to be put into index in collector(ArrayList, List) until 200 documents(it's limit by GAE)
2. Put this collector into this method
In my case, it decreased the time of putting by 100 times

Is this a Bot modifying my URLs for some tracking purpose?

I don't know if this is bad code on our part, or a bot/spider doing something for tracking purposes. What I'm seeing is our URLs are getting modified, and it's generating site errors and error emails that I'm set up to get when it seems like my site is being hacked.
For example, a URL that should read/load like this
http://site.com/page.asp?pid=915411&order=Date
gets loaded like this
http://site.com/page.asp?pid=-1'&order=Date
the email I get shows
query string = pid=-1%27&order=Date
The IP address that comes up in the error emails always change, but many point to Kiev or Minsk, but are so varied I don't see how I can stop this from happening easily. My site is on an IIS 7.5 server, win2008.
Someone is trying to hack your application. They are testing if your application uses values from the forms or URL directly into SQL statements.
This hacking attempt is easy and called "SQL injection". Check your application if it is vulnerable, fix it immediately if required.
Additionally, try to track the attackers and if you see them coming from a set of IP addresses, block them.
Using HTTP_REEFER we are able to control the URL Modifying on directly.
Try the below code
if Request.ServerVariables("HTTP_REFERER") = "" Then
RESPONSE.WRITE " <b><h1><font color=blue></font><font color=red>UNSECURED MENU ACCESS</font><font color=blue></font><h1></b> "
response.end
End if

Resources