document

How to create .odt files with C#.NET?

和自甴很熟 提交于 2019-11-30 09:29:00
Note: I found this "Creating a Word Doc in C#.NET" , but that is not what I want. Do you know how to create a .odt to create file from C# .NET? Is there a .NET component or wrapper for an OpenOffice.org library to do this? bmotmans Have a look at AODL (see http://odftoolkit.org/projects/odftoolkit/pages/AODL ). fully managed .NET 1.1 (so it runs on MS.Net and Mono) support for text and spreadsheet documents create, read, edit, save documents ... EDIT by kame: New link AODL-Wiki You can check out the OASIS Standards site for information on the ODT standard. From what I've seen, they're using an

Best way to check if a field exist in an Elasticsearch document

半世苍凉 提交于 2019-11-30 07:03:45
问题 May be is a very stupid question, What is the best way to check if a field of a document in elasticsearch exists? I can't find anything in the documentation. For example if this document doesn't have the field/key "price" I don't want to return in the result. { "updated": "2015/09/17 11:27:27", "name": "Eye Shadow", "format": "1.5 g / 0.05 oz", } What I can do? Thanks 回答1: You can use the exists filter combined with a bool/must filter like this: { "query": { "filtered": { "filter": { "bool":

Accessing elements by type in javascript

对着背影说爱祢 提交于 2019-11-30 06:04:58
A while ago I was making some test in Javascript, and played with a code to get the text of all elements with a certain class, Now I was trying to make something like this but obtain all elements by a certain type, for example all elements type="text" Is there any way to do this in Javascript or should I use jquery? var xx = document.getElementsByClassName("class"); for (i=0;i<xx.length;i++){ var str=xx[i].innerHTML; alert(str); } In plain-old JavaScript you can do this: var inputs = document.getElementsByTagName('input'); for(var i = 0; i < inputs.length; i++) { if(inputs[i].type.toLowerCase(

Angular js unit test mock document

流过昼夜 提交于 2019-11-30 04:52:33
I am trying to test angular service which does some manipulations to DOM via $document service with jasmine. Let's say it simply appends some directive to the <body> element. Such service could look like (function(module) { module.service('myService', [ '$document', function($document) { this.doTheJob = function() { $document.find('body').append('<my-directive></my directive>'); }; } ]); })(angular.module('my-app')); And I want to test it like this describe('Sample test' function() { var myService; var mockDoc; beforeEach(function() { module('my-app'); // Initialize mock somehow. Below won't

Objective-C standards document

无人久伴 提交于 2019-11-30 04:38:19
I'm a C and C++ programmer trying to get started with Objective-C. I'm really bewildered, though, by the apparent total absence of a standards document for the language and standard library. I can understand that there's no ISO standard, but is there no reference document at all? And how is it that nobody seems very concerned about this state of affairs? (Admittedly, it's hard to Google for such a thing, because "reference", "document", and "standard" are all overloaded terms. So it's possible that I've just missed something critical.) This question gets close to asking the same thing: Where

Confused by document dimensions in JavaScript

白昼怎懂夜的黑 提交于 2019-11-29 23:45:34
问题 I am really confused by the different properties that exist in JavaScript for getting the dimensions of a document and how to get those numbers. Can someone recommend a good place to start to understand how I would get the size of the document and position stuff correctly? 回答1: I'll try to answer as simply as I can. The Document and Viewport In terms of geometry, there are two sets of dimensions to be aware of; the document dimensions, which reflect the entire size of the loaded page,

Update or replace an embedded document in MongoDB collection

久未见 提交于 2019-11-29 17:36:45
I have following data structure: db.objects { "_id" : 1, "name" : "object name", "type" : "rectangle", "area" : { "position_x1" : 0, "position_y1" : 0, "position_x2" : 0, "position_y2" : 0 }, "dimension" : { "width" : 0, "height" : 0 } } I want to replace/update "area" and "dimension" separately for a document in objects collection with "_id" = 1. [?] Please let me know how can i achieve using MongoDB C# driver. This is a very simple use of the $set operator. So essentially the update form is: db.objects.update( { "_id": 1 }, { "$set": { "area": { /* all of your object properties */ },

How do I get the Window object from the Document object?

谁说胖子不能爱 提交于 2019-11-29 16:35:10
问题 I can get window.document but how can I get document.window ? I need to know how to do this in all browsers. 回答1: The Window object is the top level object in the JavaScript hierarchy, so just refer to it as window Edit: Original answer before Promote JS effort. JavaScript technologies overview on Mozilla Developer Network says: In a browser environment, this global object is the window object. Edit 2: After reading the author's comment to his question (and getting downvotes), this seems to

C# get element by name

北城余情 提交于 2019-11-29 14:50:14
Soo ive figured out how to get element by id, but i dont know how i can get element by name Here is my code: private void SendData() { webBrowser1.Document.GetElementById("textfield1").SetAttribute("value", textBox1.Text); webBrowser1.Document.GetElementById("textfield2").SetAttribute("value", textBox1.Text); } The problem is in my html code only textfield1 is a id but textfield2 is name soo i want to figure out how to get textfield2 Here is my html code: <html> <input type="text" id="textfield1" value="TEXT1"><br> <input type="text" name="textfield2" value="TEXT2"><br> <input type="submit"

How to create .odt files with C#.NET?

半世苍凉 提交于 2019-11-29 14:38:25
问题 Note: I found this "Creating a Word Doc in C#.NET", but that is not what I want. Do you know how to create a .odt to create file from C# .NET? Is there a .NET component or wrapper for an OpenOffice.org library to do this? 回答1: Have a look at AODL (see http://odftoolkit.org/projects/odftoolkit/pages/AODL). fully managed .NET 1.1 (so it runs on MS.Net and Mono) support for text and spreadsheet documents create, read, edit, save documents ... EDIT by kame: New link AODL-Wiki 回答2: You can check