FAQ Database Discussion Community


In XSLT 1.0 how to create a lookup function on XML data embedded in the XSLT using key and document('')?

xslt,key,document,lookup,xpath-1.0
My specific need is to lookup line-heights given a particular font-size, but I am seeking to learn a general technique of creating lookups/a specific mapping. I think it is possible to embed XML in the XSLT document itself (so it can work standalone) and build a key on it using...

BsonClassMap Serializer' is not configurable using an attribute of type 'BsonRepresentation Attribute'

c#,mongodb,nosql,document,bson
I am a beginner in mongodb. I have a hierarchial models in mongo, Please see my code below. public class Technology { public Technology() { ProductGroups = new List<ProductGroup>().ToArray(); } [BsonRepresentation(BsonType.ObjectId)] public ObjectId _id { get; set; } public string Name { get; set; } [BsonRepresentation(BsonType.Array)] public ProductGroup[] ProductGroups {...

Document-Term-Matrix of tm Package in R

r,matrix,document,tm,term
I am using document term matrix of tm package in R. I faced an error saying: Doc <- DocumentTermMatrix(Data) Error in UseMethod("TermDocumentMatrix", x) : no applicable method for 'TermDocumentMatrix' applied to an object of class "table" I tried data frame, data table, matrix and table but I faced the error...

how to show values associate with a custom document in liferay 6.2

liferay,document,liferay-velocity
I created a document type, and I'm using Asset Publisher to display this types of documents I would like view the values that I associated with my custom document, that I created with the document library. What is the way to do this with velocity? I found this java code...

javascript click button after be shure that page has completely loaded

javascript,button,window,document,onload
I have the website example.com and on this website is a button with the id "button1" and by clicking on this button, it opens an unknown url "example.com/unknownUrl" with the known button "buttonOnUnknownPage" on it. How can i be sure that the unknown page has finished loading and i can...

iOS Open Document with External App from UIWebVIew

ios,uiwebview,external,document
I have a UIWebView. When a link which contains a document is clicked, I want to open that document in a external app (office, openoffice, etc) but not inside the UIWebView. I know how to do it for emails: - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { if ([[[request URL] scheme]...

Initialize a document and mark it as “unchanged”

osx,swift,core-data,document
I'm trying to write my first Core Data driven document-oriented OSX application in Swift, as I want to get a bit more into Mac programming. The documents should be saved as XML files only, which I've managed to successfully configure. The problem is that I want to pre-add some information...

How do I convert a regular JSON object into a Mongo document using Mongoose?

javascript,json,mongodb,mongoose,document
I have a JSON Object called parsedSong that I want to convert into a Mongo document using Mongoose. var newSong = new Song(parsedSong); However, this only provides me with a new document that only has an id attribute. How can I make a conversion that doesn't cut my data from...

Apache POI characters run for .docx

java,api,apache-poi,document,docx
In .doc files, There is a function to get each character in paragraph by using CharacterRun charrun = paragraph.getCharacterRun(k++); and then I can use those character runs to inspect their attributes like if ( charrun.isBold() == true) System.out.print(charrun.text()); or something like that. But with .docx files seems to have no...

Microstrategy - Bar Chart in a Document does not show all the series

bar-chart,document,microstrategy
I have a bar chart in a document. Each bar is a value of an attribute, but sadly the chart shows at most 5 columns. I cannot find an option, in the web or the desktop, for showing 1 bar for every value in the attribute. How can I do...

How to find cells that contain specific text then hide the entire row

excel,vba,excel-vba,hide,document
When a button is pressed I want to loop through all the cells in my Sheet and find the cells that contains .doc or .xls or .pdf and hide the entire Row. I know I can't use Contains but there must be something similar. Cell example PM-TR Training.doc This is...

javascript: document.dispatchEvent(CustomEvent) does nothing

javascript,jquery,document,custom-events
I have the following chunk of code $(function(){ var TaskEvent = new CustomEvent('TaskAdded',{ detail: { message:'A task fue ponida, champion' }, bubbles:true, cancelable:true }); var btn = $("#boton"); function HandleSugar(e){ console.log(e.detail.message); } btn.click(function(e){ document.dispatchEvent(TaskEvent); }); $(document).on('TaskEvent',HandleSugar); }) When clicking in the button (#boton) nothing happens. Any idea? Some clarifications: The...

How to install the IOP (Institute of Physics) Latex document class for Texlive and the Lyx Document Processor (Answer Provided)

latex,document,physics,lyx,latex-environment
Background I originally asked a question on Stackoverflow, asking how I add the IOP document class to the list of available document classes in Lyx. (I will try to remove or merge that out dated quesiton.) I now understand that this is a 2-stage process. Stage 1 is to install...

How to rename file forth and back in java

java,file,zip,rename,document
I want to rename a file name xxx.docx to xxx.docx.zip then rename it back to xxx.docx in Java. Here is my code. File file = new File(path); File file2 = new File(path+".zip"); file.renameTo(file2); File file3 = new File(file.getPath()); file2.renameTo(file3); It won't work. Thank you. Edit : The problem is I...

Storing many small documents without redundant fields

mongodb,collections,aggregate,document
This is a subset of the classic many small vs. few large documents problem in mongoDB. Right now I have a large mongodb document that looks like this: //Collection: Everything { _id: "1", date: Date(...), target: "192.168.0.7" tests: [ { name: "Speed Test", components: [ { name: "Upload Test" results:...

How to dynamically change document title via function?

javascript,jquery,document,title
I'd like to change document's title dynamically. In the first instance I tried this snippet: var milis = 3000, titles = [ 'Setting up color scheme' ], count = 0; titles.push(document.title); setInterval(function(){ document.title = titles[count % titles.length]; ++count; }, milis); This works perfectly, but I need to put the snippet...

Force angular.element .on 'change' to call specified function on the same file

angularjs,events,jquery-selectors,document
When I select say hello.png the first time, it loads it and calls handleFileSelect() function. However, if I pick the same file again, the function won't get called until I pick another filename. How can I force it to call the function? I was thinking that the modification would be...

Javascript - Place some HTML into the document

javascript,html,if-statement,document
I am a Javascript beginner. I try to have these two pieces of html placed into the markup. The anchors' IDs are set from tab-1 to tab-6. This is what I've wrote so far. It doesn't do anything. Anybody got some ideas? <script> if (window.location.hash == "#tab-1" || "#tab-2" ||...

Microstrategy documents - matching differen attributes with the same value

attributes,document,matching,value,microstrategy
I'm building a document with a dashboard-like appearance. I'm using radio buttons for selecting the year. Sadly in one of my datasets the attribute year is another attribute, even if contains exactly the same values. How can I solve the problem of matching attributes basing on their values in documents?...

Making JQuery function Plain JS [duplicate]

javascript,jquery,events,listener,document
This question already has an answer here: Uncaught TypeError: Object #<NodeList> has no method 'addEventListener' 3 answers Hey I have the following function which works great in JQuery, but for many reasons I require it in plain JS. $('audio').on("play pause ended", function () { document.title = document.title.replace("\u25B6", "") $("audio").each(function...

In what order does .find() return MongoDB documents? [duplicate]

python,mongodb,document,text-classification
This question already has an answer here: How does MongoDB sort records when no sort order is specified? 2 answers I was wondering if there is a certain "order" of some sort in which MongoDB documents are returned when querying like this: collection.find() Is it always the same, given...

'Greater than' some value in height()

jquery,css,height,document
i'm trying to write a jQuery which checks if the document height is greater than some value but it seems it doens't work. So here is what i tried if ($(document).height(>1000px){ $('#colorpicker').click(function(){ $('.colorss').css('top', '500px') }) } ...

Need suggestions regarding the .doc file reading in android

android,apache-poi,document,docx4j
I'll be working on a new app that reads the .doc and .docx files and get the number of words, no of lines, no of pages, no of images, no of formula's so so from the particular word document. So, i used the Java Scanner class to get the word...

XML - Select xmlNode depending on innertext

c#,xml,document
I have a 'xmlDocument'-Object, which contains this structure: <Projects> <Project> <Name>Value1</Name> </Project> <Project> <Name>Value2</Name> </Project> </Projects> I need to change these values on runtime via c#. My thought was create new 'xmlnode'-Object Change its innertext save the document But I don't know how to select the xml-node depending on its...

document.execCommand doesn't work in angularJS

javascript,angularjs,document
I have an application where I want to make an editing area, just like this one on StackOverflow. I don't want to use the textAngular directive, because it's too hard to understand, so I found about this Javascript function, document.execCommand, which it seems to be exactly what I need. The...