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
My son uses Google Calendar for his roster (layer2) and homework (layer1).
When a new event is manually added to the Google Calendar, I want to pre-populate the event text, to remind him not to skip important data.
So when he clicks on the calendar to add a NEW event (existing events should not be modified) the text field should already say:
Subj: Chapter: Page:
I have tried to use AutoHotKey, but the "New event" window is not detected by the AutoHotKey spy.
In the Google scripts, I have not been able to find a function like OnOpenNewEvent, to launch a script at the moment a new event window is opened.
Any suggestions on how to do this?
The new event window is just HTML, so no--it isn't a new window, and AHK can't detect it.
It looks like event templates are a commonly-requested feature, but I haven't found any ideas on how to do it.
A couple alternative suggestions:
Put together a script that monitors the RSS/ical feed for his calendar, and looks for events that are missing the desired tags; then take some action when the tags are missing
Make an autohotkey script that detects a series of keystrokes, and inserts the template. For example, when he types ".hw." in a google chrome window or firefox window, it will generate the template. See script below:
#ifWinActive ahk_class Chrome_WidgetWin_0
:C:.hw.::Subj: Chapter: Page:
#ifWinActive ahk_class MozillaWindowClass
:C:.hw.::Subj: Chapter: Page:
#ifWinActive
The above script requires teaching him to type the template text ".hw.", but at least remembering one thing is easier than three.
Kimball,
Based on your initial thought, I have opted to (initially) use the following:
:c*:qq::
SetTitleMatchMode, 2
IfWinActive, Google Calendar - Google Chrome
{
Send, Subj: Chapt: Page:{space}
Send, {Home}
Send, {right 6}
}
Else
{
Send, qq
}
Return
This way the hotstring "qq" is always executed, unlike your approach, but only expanded when the calendar is open in Chrome. I opted for the *, so the hotstring is executed immediately.
I learned something new from your approach, setting a hotstring dynamically depending on the winActive status. I will start to play with that idea...
Do you know which method, yours v.s. mine is more efficient? Maybe there is no real difference in the end.
And yes, I know I could combine all Send lines into one if I wanted to.
Related
i want to create a dynamic remarketing campaign in Google Ads, but i have to let GTM know where to extract the information for ecomm_prodid, ecomm_pagetype, ecomm_totalvalue and ecomm_category from my website. I understand that i have to create a Data Layer Variable but i just don't know how to make those tags extract the necessary info from my website. I also know that you should be able to see in Google Tag Assistant the Metadata for your products (price, brand, category etc) in the Dynamic Remarketing Tag. Unfortunately i cannot add code to my website as it was created on a platform that doesn't allow custom code, so i have to use GTM.
For example the class for the price is: fPrice -g-product-final-price-258. Shouldn't ecomm_totalvalue take info from this class? I tried reading Help pages from google but they are soooo confusing, i cannot understand them.
If anyone would help me with this i would be very grateful.
Thanks
I know this is 10 months late but this might help you or lead someone arriving here to hopefully the right direction and/or solution. I came across your question unanswered when looking for something else. It seems you have two questions so I'll try to answer both.
For starters you might want to have a quick look at the GTM Dynamic Remarketing Documentation.
Question 1: Where to extract the information for [variables] ?
You are on the right track with the dataLayer here. Usually you need to implement that with custom Javascript on your website (which in your case you can't do / see below for that). You would usually populate a events & variables with dataLayer.push() function.
Here is a sample of how that could look:
dataLayer.push({
'event': 'your_event_name',
'a_container_name' : {
'key1' : key_var_1,
'key2' : key_var_2, }
})
You can also do inner structures within those structures (nested dictionary).
Once those are populated you can create variables in Google Tag Manager (GTM) and simply pick up the values with the naming convention you've used separated by a "." (dot). For the above you could for example do: "a_container_name.key1" which would then populate the variable in GTM with the value of "key_var_1".
You can use the event name (here: 'your_event_name') as the trigger for the Tag in GTM to fire your Tag.
So in your case you would usually want the variable "ecomm_prodid" taken from the webpage with a bit of javascript and pushed into the dataLayer for you to pick up in GTM as described.
Question 2: I cannot add code to my website, what can I do ?
While this is entirely possible it is unfortunately a bit more tedious and potentially much more error prone. In this case you have to read the values you want directly from your website through GTM.
You can use custom javascript inside variables in GTM. To do so click on "variables", then click on "New" and select "Custom Javascript". You can then use pretty much any javascript here to basically scrape the value off your website based on id, class or any other HTML identifiers. There are tons of options on how to do that. You have to use what works best for you.
However this is potentially very error prone. Here is why:
You've stated that your class for the price is "fPrice -g-product-final-price-258". This looks to me very much like an auto generated identifier. Next time you look at that product or pick another one it is most likely different. So your option is to take either another unique identifier or use a sub-string of that one (e.g.: fPrice -g-product-final-price only). But keep in mind if your website ever updates or changes those class names the javascript you wrote instantly will not work any longer.
So it is important to pick some robust form of identifier or write the javascript code so that it will last. As mentioned, the jvascript to scrape or read directly off your website can be as custom as you like. Here is a crude example of how this would look like.
var text = ''; // empty value placeholder
if (document.getElementsByClassName("YOUR_SPECIFIC_CLASS_NAME")) {
....loop through returned elements if applicable....
....do stuff here or check stuff here...
text = SOME_ELEMENT.innerHTML;
console.log(text) // helps to debug your code
}
return text
Again this is only a crude example but if you get this to work then you can simply use the populated variable in your Tag in any field that supports variable with the double curly brackets: {{YOU_TAG_MANAGER_VARIABLE_NAME}}
I hope this helps and gives you a bit on an insight. Good luck!
PS: By the way. If you can't edit your code because of your website provider or website engine then I would strongly recommend moving away from it. As you can see it would save you a ton of headache. For smaller to mid sites and smaller e-commerce stores use Wordpress. For larger stuff there are other solutions. In any case there are some website builders out there that are simply really bad but at the same time very misleading. Basically leading you to the problems as you've described. Don't use them :)
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
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I have a hidden field in a xqy page. Now I want to get its value in the same page through xquery code. The page is not refreshing. I do not want to use javascript. Is there any way to get the value of the hidden field with xquery without submitting the page.
Instead of simple HTML and outputting it directly you could use XForms. Some extensive documentation about XForms is available at http://en.wikibooks.org/wiki/XForms
You can then use a XForms-Processor (e.g. XSLTForms or betterForms), which can be used server- and client-side. This allows you to get the value of any fields (not just hidden fields) with pure X-technologies. XForms also includes MVC by default, which is quite nice. However, depending on your project and the amount of code already existing you might have to change a lot, as it is a complete technology. But normally this is the way to go to avoid JavaScript and instead using X*
You would need XQuery capabilities within the browser. MarkLogic runs server-side, so needs a round-trip (e.g. a submit). But you could have a look at XQiB: http://www.xqib.org/
HTH!
This question is vague enough to be interpreted several different ways: you will get better answers if you ask better questions.
But I'll be a little more optimistic than Geert. If the form field is in an HTML form built by a server XQuery module, the data for it must be available to that module while it is building the form. Arrange your code so that you can use it for whatever is needed, before returning the completed page.
You might be looking for some magical way to write XPath against the half-complete results of the query that's actually running. That isn't possible without some work on your part. You could arrange your code so that the form or the hidden field is a node returned by some other function, and write XPath relative to it to retrieve its value. If the hidden field was built using a request parameter from the previous HTTP request, you could call xdmp:get-request-field again. The point is to arrange your code so that you have the data you need it, when you need it.
The XQuery code at https://github.com/mblakele/cq might have some useful examples. It plays all sorts of games with form fields, both with and without JavaScript.
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.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Pls give me the solutions for this two problem, which i was asked recently in interview.
Prob1: Suppose I have application with 10 admin, so they can change the data anytime their having own userid and password. For example, one user retrieve one data from database table, while retrieving it value was 2, after retrieving he didn't update the update button, then he went for breaks for 10 minits. In between other admin change the original database table with value 3, 4, 5 and Finally 10 value by the 10th admin. Now the current value in table 10. But when he comes from breaks and click on the update button value 2 will be saved, which is not at all expected value..it should be 10. How to approach to this problem????
Prob2: Suppose one user forget to logout his application while he was leaving for the day. And after 10 minits while he reached his house, due to urgency again he wants to open that application from his home computer. If he tries to login to the application in that period what will happen????(Session timeout was 30 Mints). If its a problem how to overcome this????
Pls give me the solutions......pls...pls
Thanks,
Sumit
The first problem is to do with dealing with database concurrency, see this blog post for a good explanation.
Two isn't really a problem, as he will simply login from his home computer and create a new session. Most web apps support multiple same user sessions. If that's not the behaviour you want, you have to do some work. Not if that is the desired behaviour.
Prob_1: Unless there is a lock-in approach to editing the data (the data is locked when you read it and untill you're done no-one can edit, in that case the other admins wouldn't have been able to edit while our guy was on his coffee-break) when the guy comes back and updates the values (assuming that all the values currently on screen will be overridden when click update on this app) there's no reason why the value you're talking about should not be 2.
Nevertheless, said so I suspect that:
my answer doesn't make any sense - I am trying to interpret your question to my best but there's good chances smt is getting lost in translation.
the interviewers wanted you to say something about the session timeout which expires during the coffee-break
Prob_2: this is a standard problem of web-apps. In asp.net there's plenty of ways of checking if a given user is already logged in leveraging global.asax. Here's a tutorial with all the answers - knock yourself out :)