Live.js Not Updating - refresh

I have a pos system that can write a order to a .txt file everytime something is changed (added or removed) in the order. I am trying to get a drive thru customer order display screen solution. I got everything working through using wamp webserver and displaying the content as html and having live.js refresh the chrome browser whenever there is an order update, however I am having issues when there isnt a refresh for over 5 minuets, it takes live.js 30-50 seconds to detect that the .txt file has changed and actually refresh the page. I need a solution that will always work instantly which live.js does fine until the computer idles for over 3-7 minuets.
Anyone experienced with live.js or have another solution that you think would perform better?
I can post the live.js code here if you guys want but its just the default code from live.js
Much appreciated.

just add to the head
meta http-equiv="refresh" content="1"
Will refresh the page every 1 second.

Related

Oracle apex form doesent INSERT/UPDATE or Create entry in database

Hi everyone so I have a problem with Oracle Apex, I created a master-detail with a from and everything worked fine. Then I created another page within the same app but nothing connected to the page mentioned before, and now nothing on the first page works. When I try to create an entry the form opens I can type anything in and when I click "create" the form closes and nothing happens. Nothing is inserted into the database, edit also doesn't work as well ass deletes everything looks perfect till the form closes, the region refreshes but nothing actually happens.
No error shows up in the app or in the console/debugger
I checked the form processes and the DML is there.
Tried to manually set value in SQL Workshop and that works, I'm able to manually insert rows but not through the form.
Please help this is for my final project and I need this to work.
Thank you in advance!
Edit: 4) Also saw that no button works on the form. I have a combination of form + interactive grid and the grid usualy has like a page navigation buttons for previous/ next and those dont work aswell. So maybe i try deleting and re creating all the buttons?
EDIT2: Managed to fix it, and found that I was somehow missing the Close Dialog process in my form. Added it and now everything works!
Close dialog process in the form page was missing, recreated it from a different form, and now everything works!

removeItem in iCloud instantly

Im using NSFM's method removeItemAtURL to remove some item in iCloud, though right after that i run a NSMetaDataQuery and it can still see this item for like 3 seconds. Is there a way to fix this?
Im trying to upload an item to iCloud, and if file with such name exists i need to replace it, and then track NSMetaDataItem's uploadingPercentKey to show it to user, though as i said before, the item is still returns YES from valueForKey:NSMetadataUbiquitousItemIsUploadedKey like for 3 seconds after removal.
As far as I know there is no way to speed this up. The metadata is handled separate to your app by a daemon. That could take a little while to update the metadata, and even longer to send that metadata to the cloud, and then to other devices.
I think you just have to try to design around this delay. Assume that the metadata may not be completely up to date.

Webview Swipe issue - Appcelerator Titanium

Right now I am using one webview to show data from my aplicationDatadirectory, here everything is working fine, I get content when user click next back respectively. Now what I am doing is in onload of webview I register "touchevent" and "touchmove" in webview's html like this :-
$.webview.evalJS('document.getElementsByTagName("body")[0].addEventListener("touchstart", function mytouch(){Ti.App.fireEvent("touch", {X:event.touches[0].pageX,Y:event.touches[0].pageY,length:event.touches.length});}, false);');
$.webview.evalJS('document.getElementsByTagName("body")[0].addEventListener("touchmove", function mymove(){Ti.App.fireEvent("move", {X:event.touches[0].pageX,Y:event.touches[0].pageY,length:event.touches.length});}, false);');
on the basis of this I find swipe event. I get correct html in webview(I can see images). But I am unable to get touchstart and move call. I dont know what is the problem here. I set data in webview using url here.
Now when I set data in webview using html(I used data of my html file(given below) in one var) now I am unable to see images it just shows me one black border(empty) but here my touchstart and touchmove events are firing also my swipe is also working as expected. I am checking this functionality in iPhone.
Can any one find the issue what is going wrong here? Thanks.
I think that this depends on the time when you apply
$.webview.evalJS('document.getElementsByTagName("body")[0].addEventListener("touchstart", function mytouch(){Ti.App.fireEvent("touch", {X:event.touches[0].pageX,Y:event.touches[0].pageY,length:event.touches.length});}, false);');
$.webview.evalJS('document.getElementsByTagName("body")[0].addEventListener("touchmove", function mymove(){Ti.App.fireEvent("move", {X:event.touches[0].pageX,Y:event.touches[0].pageY,length:event.touches.length});}, false);');
If you use the html property data is loaded immediately and you can use the code exactly after setting html content. If you use the url (even if it is located locally, which might be difficult for android) then you need to wait a short time until the page is loaded. There is also an event listener for that (web view-event load) but i can't say if that works for local resources but i don't think so.
In this case you should apply your javascript snippet into your html resources (if they are locally) instead of manually adding it using evalJS.
Please note that there is an issue on android that you can't use local images (resources folder) in your webview when you provide the content via html property.
I made it swipe working in iOS(in android it was working).
I did not expect this thing to be a reason but I do not know logic behind it. I was accessing .xhtml files from application data directory and it was working without any issue in android but in iOS it was not.
I just change(rename in my code) .xhtml file to .html and now it is working. :)
Hope this can help someone who is looking for the same.(or just for his interest)
Thanks.

Unpredictable display of Facebook og:image

We added Facebook Open Graph tags to our site NowGamer.com a few months back and everything worked perfectly initially. But in the last few weeks we've noticed that on about 2/3 of images the og:image would not display when an item was shared or liked. Sometimes going to the linter would scrape the page and the image would then be available.
But in other instances the image thumnbnail doesn't appear in the linter - although the link to the full image displays it at full size OK.
https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.nowgamer.com%2Fnews%2F1298151%2Fassassins_creed_3_join_or_die_freedom_collectors_editions_details.html
The images all fit within the 3:1 parameters although they are relatively large (they have to be as they are screenshots for video games). Here is an example of exactly the same type and size of image that does display in the Linter and on shares/Likes
https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.nowgamer.com%2Fps3%2Fps3-reviews%2F1293635%2Fresident_evil_operation_raccoon_city_review.html
I can't see why one works and the other doesn't. Any suggestions?
The thumbnail's width AND height must be at least 50 pixels, and
cannot exceed 130x110 pixels.
http://developers.facebook.com/docs/share/
Strange: I would have gone with a cache problem which I've also experienced before. For pure testing purposes if you want to attempt to refresh a different version of the URL try adding ?v=1 or some other parameter which makes the URL unique. This forces Facebook to go and get the URL again so you can make sure the images are working as expected.I think YouTube have also had this problem over the last few months http://groups.google.com/a/googleproductforums.com/forum/#!category-topic/youtube/sharing-and-connecting-on-youtube/YnTqofAhcN8

Caching data (image, rss) with django

That's my first question in here, I've been looking through old questions, but nothing matched with my problem. Here it is.
I'm creating some site with one main functionality. We want this site to display content of other sites, but in a specific way. User chooses let's say two pages from five and want to see their content. He clicks button 'Display' and goes to next page where he finds let's say view from web cam, and here comes problem.
I want to cache image that is hidden behind the url from which image was downloaded, so after refresh image won't be downloaded again, but browser will get it from cache.
I've been looking through documentation of Django, but nothing seemed to be useful.
I know that I should:
1) create table which stores cache
2) add to settings.py some CACHE_BACKEND = ...
3) use #cache_page(300) before declaration of function which returns content which should be cached,
but... it doesn't seem to work.
I will be greateful if someone tells how to solve that problem, maybe with some sort of code showing the mechanism.
Cheers,
Chris.
I think that right way to do this will be to store image somewhere on your server and delete it later with cron or something similar.
Django cache framework wasn't created for the purpose you are trying to use it.