[JS CS3] Find paragraphs that contain only one substitution of Style
Given a document with paragraph styles applied evenly. I need to locate all paragraphs in the document that contains a paragraph style override of the left indent. All other substitutions of style can be ignored.
I see in the DOM how to clear the replacements, but is it possible to locate the paragraphs with a specific substitution?
I suspect there is no way to do it, but thought I'd throw it out there.
if(para.leftIndent != para.appliedParagraphStyle.leftIndent){ // we have a left indent override... }
Substances
Tags: InDesign
Similar Questions
-
How to change the paragraph style to each paragraph that contains only one anchored object?
Hello
I have a document in word that should be converted in indesign. The document contains instructions, each step followed by an image.
I managed to import the document into Indesign and applied a paragraph with numbering style to everything (text, image).
Now, how do I change the the paragraph style to each paragraph that contains only an image? I need to get rid of the numbering.
Thanks in advance.
If the images are all anchored objects, you can use find/replace to find the anchor point and change the paragraph style only once for all paragraphs.
-
Battle of external table: files that contain only a picture
Hello
Does anyone know if this is possible: use an external table to load files that each contain only one photo (photo) in a BLOB column?
So: just a photo, not other columns and not many lines.
I tried, in the sense of this article: ORACLE-DATABASE external Tables containing LOB -
I'm starting to believe it is not possible due to the "delimited records by ' and 'fields terminated by' clauses, which are not really applicable given files (just a picture), but maybe (hopefully), I'm wrong.
Any pointer is more than welcome!
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
AMT for HP - UX: release 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
5 selected lines.
SQL > drop table photo_ext is serving;
Deleted table.
SQL > create table photo_ext
2 (blob_content blob
3 )
4 external organization
5 (type oracle_loader
6 default directory tmp
7 access settings
8 (records delimited by newline
9 nobadfile
10 nologfile
11 fields completed by «,»
12 field missing values are null
(13)
14 blob_filename tank (100)
15)
16 transformations column (lobfile (blob_filename) of the blob (tmp) blob_content)
17)
18 rental
19 ("54618645837_vp3.jpg",
20 "54618645837_vp4.jpg."
21 "54618645837_vp2.jpg."
22 "54618645837_vp1.jpg."
23 "54618645837.jpg."
24 "54618636860_vp6.jpg."
25 "54618636860_vp5.jpg."
26 "54618636860_vp4.jpg."
27 "54618636860_vp3.jpg."
28 '54618636860_vp2.jpg '.
29 )
30)
31 reject limit unlimited;
Table created.
SQL > select DBMS_LOB.getlength (blob_content) AS blob_length of photo_ext;
Select DBMS_LOB.getlength (blob_content) AS photo_ext blob_length
*
ERROR on line 1:
ORA-29913: error in executing ODCIEXTTABLEFETCH legend
ORA-29400: data cartridge error
KUP-04001: doing bij openen van bestand/tmp /.
ORA-06512: at "SYS." ORACLE_LOADER', line 52
You need for your names to jpg files in a text file, the name of one file per line in the list, then use the name of the text file as your location in your outer table. In the example below, I've listed just a jpg file bridge.jpg in text file test.dat.
Scott@orcl12c > host type test.dat
Bridge.jpg
Scott@orcl12c > create or replace directory tmp as 'c:\my_oracle_files '.
2.
Created directory.
Scott@orcl12c > create table photo_ext
2 (blob_content blob)
3 the external organization
4 (type oracle_loader
5 by default directory tmp
6 access settings
7 (records delimited by newline
8 nobadfile
9 nologfile
10 fields completed by «,»
11 lack of field values are null
12 (blob_filename tank (100))
13 column transformations
14 (lobfile (blob_filename) of the blob (tmp) blob_content))
15 rental ("test.dat"))
release limit 16 unlimited
17.
Table created.
Scott@orcl12c > select DBMS_LOB.getlength (blob_content) AS photo_ext blob_length
2.
BLOB_LENGTH
-----------
511500
1 selected line.
-
How to get a paragraph that contains the string selected in FDK?
Hello
I am writing a program that extracts content of the paragraph that contains a selection string. This program runs in the interaction point menu. When the user click on the menu item. The process as follows:
1. find a chain on a document, for example: F_ApiFind ("ABC").
2. the F_ApiFind ("ABC") API returns the F_TextRangeT structure.
3. the string "ABC" has been highlighted on the document.
Here's my question:
How can I write code to locate an object ID paragraph (pgfId) that contains the string (or object) 'ABC '?.
As the 'ABC' object belongs to the current paragraph, how can I get section ID (pgfId) and then get the content of the entire paragraph
without a loop through FP_FirstFlowInDoc, FP_FirstTextFrameInFlow, FP_FirstPgf and FP_NextPgfInFlow.
Thank you very much for you help,
Thai NguyenHi thai,
Paragraph ID is returned as part of the structure of F_TextRangeT, as the Member "objId". Let's say you have:
F_TextRangeT tr;
... then:
TR = F_ApiFind (...);
On an action to search with success, "tr" will contain the pgfId of the paragraph. I'm assuming you're looking for a string that is entirely contained in a paragraph, in which case two ways contains the ID of the paragraph:
tr.beg.objId
TR.end objId
If you want to retrieve all the text in the paragraph after the search, you could do something like: (attention, incomplete code!)
F_TextItemsT ti;
F_TextRangeT tr;
F_ObjHandleT docId.
...
TR = F_ApiFind (...);
TR. Beg.offset = 0;
TR.end.Offset = FV_OBJ_END_OFFSET;
TI = F_ApiGetTextForRange (docId, & b, FTI_String);
.. After that the text of the paragraph will be included in the ti TextItems structure. Navigate through this structure can be difficult and I will renounce any discussion about it for now unless you need more help. There is good information in the developer reference as to its use.
Russ
-
find fields that contains a space
I'm trying to find a field that contains a space in the data. I have a user_login column where all the user id is stored. User IDs are normally "SMITHJ', 'DOEJ' etc... but I wanted to see if we got one with a space. what the script would look like this get?
Thank you
example of
user_login PK
1 SMITHJ
2 DOEJ
3 OF THE CRUZJHello
Welcome to the forumSQL> with t as 2 ( 3 select 1 pk, 'SMITHJ' user_login from dual union all 4 select 2, 'DOEJ' from dual union all 5 select 3, 'DE LA CRUZJ' from dual 6 ) 7 -- 8 select * from t 9 where instr(user_login, ' ') > 0 10 / PK USER_LOGIN ---------- ----------- 3 DE LA CRUZJ
do a google on string handling Oracle and especially Instr.
-
Hello world
I tried to figure this out for the last three days. I've tried everything I can think and search all over the internet (GitHub, Forums, etc.). I'm not a javascript Wizard, and certainly a Newb Extendscript.
Try to determine the color space of the document. Last attempt was...
alert(theDoc.properties.ColorSpace);
Reminder on this:
I have a datamerge which creates the attached fields from a CSV file. It is an internal reference to a color code. I am able to test cycle using the for loop an enter the color code. But I can't seem to find a way to seek the shades. One thought was to put in a table and sift through them. The color code provided is not swatch set name that makes things interesting. For example, name is 2297R - 19995, where 2297r is the color code for the text frame. Possible?
main(); // this is the function function main(){ // setup some variables var theDoc = app.activeDocument; // active doc var thePage = theDoc.pages.item(0); // first page var theSwatches = theDoc.swatches; var list_of_swatches = theDoc.swatches.everyItem().getElements(); var n = theDoc.swatches.length; var color; var rgbValues; var i; var t; //Get all groups for this document: var theGroups = theDoc.groups; var theLayers = theDoc.layers; // Color Codes var primaryColor = thePage.textFrames.item("Primary Color Code"); var secondayColor = thePage.textFrames.item("Secondary Color Code"); var accentColor = thePage.textFrames.item("Accent Color Code"); var matchGarmentColor = thePage.textFrames.item("Match to Garment Color Code"); var lightTonalColor = thePage.textFrames.item("Light Tonal Color Code"); var darkTonalColor = thePage.textFrames.item("Dark Tonal Color Code"); var neutralColor = thePage.textFrames.item("Neutral Color Code"); var greenColor = thePage.textFrames.item("Green Color Code"); // Code Codes var primaryColorCode = primaryColor.contents; // var secondaryColorCode = secondaryColor.contents; // var accentColorCode = accentColor.contents; // var matchGarmentColorCode = matchGarmentColor.contents; // var lightTonalColorCode = lightTonalColor.contents; // var darkTonalColorCode = darkTonalColor.contents; // var neutralColorCode = neutralColor.contents; // var greenColorCode = greenColor.contents;
Help or advice is greatly appreciated.
Thank you.
Hello
... There is a third source eventually:
-content of the 'PartOfName' examination if there are spaces inside - in this case the search() method returns "-1"thus."
(i.e. warning (PartOfName.length) ==> is it == 5?)
Jarek
-
Find columns that exist in one, but that do not exist in another table?
I ' having a slight problem. I can't find an appropriate SQL query to return values for a column that exist in a table, but that do not exist in another (related).
TABLE CAR
(
PK CAR_ID,
CAR_TYPE
)
TABLE CAR_IN_REPAIR
(
PK ID,
FK CAR_ID,
FK REPAIR_SERVICE_ID
RETURN_DATE (NULL)
)
I want to show the records that appear in the table of the CAR, but who are not in the CAR_IN_REPAIR and that CAR_IN_REPAIR. RETURN_DATE is less than SYSDATE or zero (date of return unknown).
In short, I want the query to display the cars that are currenty in repair or does not know the date of return from the repair center (NULL)
I did a SQL query:
SELECT c.id
DRIVE c, CAR_IN_REPAIR r
WHERE c.id NOT IN r.car_id
the query returned no data but data is in the table of the CAR because he displayed when I SELECT * CAR?
Published by: OraNewbie on August 28, 2008 21:02Try this-
strikeselect * from CARminusselect * from CAR_IN_REPAIR--strike--
select * from CAR c WHERE c.id NOT IN ( select r.car_id from CAR_IN_REPAIR r )
Hope this will help you.
Kind regards.
LOULOU
Published by: Satyaki_De on August 29, 2008 12:35 AM
Oops! The table structure is different...
Published by: Satyaki_De on August 29, 2008 12:38 AM
-
Find paragraphs that begin on the last line of a page/column?
It is possible to mark them?
But here is not a solution the menu 'keep lines of the option '.
(this is a request to the editor)
The idea is to detect this kind of lines:
It should be pretty easy to score, for example with bar. But I don't see what the advantage in this operation would be compared to the use of the keep options.
app.findGrepPreferences = null;
app.findGrepPreferences.findWhat = "^."
myFinds = app.activeDocument.findGrep ();
for (i = 0; i< myfinds.length;="">
myFind = myFinds [i];
myLine = myFind.lines [0];
If (myLine == myFind.parentTextFrames [0] .lines [-1]) myLine.strikeThru = true;
}
I think that should do it (even if it has completely not tested).
-
Haw to find the element in the table that appears only once
I have a table like this 2d:
1 2 3 4 5 0
5 6 2 4 7 2
8 3 6 0 9 4
5 6 7 7 3 2
And I need to find items that appear only once in this table
In this case, 8 and 9
I also need this elements (row and column) position
Are integers
I tried to remodel the table and use the find but no result.
Your best bet is to remodel a table 1 d do your seaching and use 'Quotient & rest' to convert location (index) in the table 1 d back to the index in table 2D. Use "Array Size" to get the number of rows and columns of the table 2D.
The histogram only works on 1 d arrays.
Or reshape a 1 d table. For each digit (0-9), use 'Search 1 D Array' twice. If the first 'search' finds a match (does not =-1), use the offset to start the 2nd search beyond the 1st index discovery. If 2nd 'search' returns-1, then one and the SAME time happens
The index of the first 'search' to calculate the index (Quotient & rest") line and collar of the 2D array.
-
looking for images that contain keywords and DO not contain any other
Is there a way to LR to find images that contain keywords and do NOT contain others, all in the same search function? In the past I have had this problem by dumping to a subset of the images in the quick collection and then research within there, using a combination of text and metadata search. But is there a way to do this in one step for the entire collection, for example by using the text / search keyword bar and using the appropriate syntax? Sorry if this question has already been answered elsewhere and do not hesitate to send me to the thread, but I tried to do for a long time and unable to find an answer. See you soon
Search you using the filter bar for the photos that have the desired keywords and place an exclamation point in front of unwanted keywords.
Example:
Ohio! Cleveland
find all the photos with the keyword Ohio but did not keyword Cleveland
-
How to stop firefox quiting last tab (when only one tab is open) without warning?
I want to turn off ctrl + w when only one tab is open so that when only one tab is open, and if I press ctrl + w by mistake he shoud warn me before closing the browser
You can set the pref browser.tabs.closeWindowWithLastTab to false on the topic: page config to prevent the closure of the last tab to close this window and display a close button if only one tab is open.
You can open the topic: config page via the address bar.
You can accept the warning and click on "I'll be careful" to continue. -
Merge only one line on several lines
I need prepare a merge statement that merge only one line in a table. Here is the table definition, data instruction and fusion sample, I used.
Merge statement above will actually merge complete data. But I want that the first line will only get inserted to the base table (Mob_Main). If we take the "n1" name first row in the table with the ID Mob_Desc '10' should get only inserted. I go for a cursor to do what I have given huge volume, I prefer the merger instead.CREATE TABLE Mob_Attr (NAME VARCHAR2(20), ATTR_1 VARCHAR2(20), ATTR_2 VARCHAR2(20), ATTR_3 VARCHAR2(20)); CREATE TABLE Mob_Desc (NAME VARCHAR2(50), ATTR_1 VARCHAR2(20), ID NUMBER(20)); CREATE TABLE Mob_Main (NAME VARCHAR2(20), ATTR VARCHAR2(20), ID VARCHAR2(10)); insert into Mob_Attr(name, attr_1, attr_2,attr_3) values ('n1','aa',null,null); insert into Mob_Attr(name, attr_1, attr_2,attr_3) values ('n2','bb',null,null); insert into Mob_Attr(name, attr_1, attr_2,attr_3) values ('n3','cc',null,null); insert into Mob_Attr(name, attr_1, attr_2,attr_3) values ('n4','dd',null,null); insert into Mob_Desc (NAME,ATTR_1,ID) values ('n1','aa',10); insert into Mob_Desc (NAME,ATTR_1,ID) values ('n1','aa',15); insert into Mob_Desc (NAME,ATTR_1,ID) values ('n1','aa',123); insert into Mob_Desc (NAME,ATTR_1,ID) values ('n1','aa',1455); insert into Mob_Desc (NAME,ATTR_1,ID) values ('n2','bb',455); insert into Mob_Desc (NAME,ATTR_1,ID) values ('n2','bb',135); insert into Mob_Desc (NAME,ATTR_1,ID) values ('n3','cc',15); insert into Mob_Desc (NAME,ATTR_1,ID) values ('n3','cc',52); insert into Mob_Desc (NAME,ATTR_1,ID) values ('n4','dd',1455); merge into Mob_Main ma using (select d.name, d.attr_1,d.id from Mob_Attr a, Mob_Desc d where a.name = d.name and a.attr_1 = d.attr_1 ) q on (ma.name=q.name and ma.attr=q.attr_1) when not matched then insert (NAME,ATTR,ID) values (q.name,q.attr_1,q.ID);
MERGE INTO Mob_Main ma USING ( SELECT distinct d.name, d.attr_1, first_value(d.id) over (partition by d.name, d.attr_1 order by d.rowid) id FROM Mob_Attr a, Mob_Desc d WHERE a.name = d.name AND a.attr_1 = d.attr_1 ) q ON (ma.name = q.name AND ma.attr = q.attr_1) WHEN NOT MATCHED THEN INSERT (NAME, ATTR, ID) VALUES (q.name, q.attr_1, q.ID); COMMIT; select * from Mob_Main order by name, id; NAME ATTR ID -------------------- -------------------- ---------- n1 aa 10 n2 bb 455 n3 cc 15 n4 dd 1455 4 rows selected.
-
check if a string contains only some characters
I'm working on a java program that converts the Roman numbers. The user enters a string, and I need to check to make sure that it contains MDCLXVI and if he doesn't I will get them the input again string. I thought I'd do a while loop but I'm not sure if it's the smart way to make or the syntax to perform the check.
Here was a thought on the control with a while loop, but I've never used it before and maybe build evil.
My Code is as follows:while (!Pattern.matches("MDCLXVI", firstRoman)) { System.out.print("Not a valid Roman Number please try again"); firstRoman = firstRoman.toUpperCase(); }
Once they enter in the it, I want to check to make sure that it has characters MDCLXVI and if it contains any other characters then I will provide a new object Scanner keyboard to try again and if it fails again, it will go to the option to try again until they put in a string that contains only the characters above. I don't know where to go here to get the while loop has worked. New to Java and I got my program work properly when I put good known numbers of novel, but I want to take incorrect entries.// Ask for user to input firstRoman Number System.out.print("Enter your first Roman Number:"); // add the Roman Number to the String variable firstRoman = keyboard.nextLine(); firstRoman = firstRoman.toUpperCase();
Any help would be appreciated.
Thank you
Wally
I put the code for my main program and my class below just in case. I have already met the requirements of the teacher if the project is done, I'm just trying to improve.
CLASS:/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package myname.project.pkg6; import java.util.Scanner; import java.util.regex.Pattern; /** * * @author wsteadma */ public class mynameProject6 { /** * @param args the command line arguments */ public static void main(String[] args) { // Used for testing String firstRoman; String secondRoman; Scanner keyboard = new Scanner(System.in); // Ask for user to input firstRoman Number System.out.print("Enter your first Roman Number:"); // add the Roman Number to the String variable firstRoman = keyboard.nextLine(); firstRoman = firstRoman.toUpperCase(); // Ask for user to input secondRoman Number System.out.print("Enter your second Roman Number:"); // add the Roman Number to the String variable secondRoman = keyboard.nextLine(); // Add the name input into the name variable secondRoman = secondRoman.toUpperCase(); //Creating first instance of Roman Numbers class Roman firstNumber = new Roman(firstRoman); Roman secondNumber = new Roman(secondRoman); System.out.println("Printout of the created roman numbers"); //Prints out the Roman Number firstNumber.printRoman(); secondNumber.printRoman(); // Convert Roman to Decimal firstNumber.setDecimal(firstRoman); secondNumber.setDecimal(secondRoman); System.out.println("Viewing the Decimal values for the two defined instances"); //Prints decimal Numbers firstNumber.printDecimal(); secondNumber.printDecimal(); System.out.println("Adding the Roman Numbers and returning new Roman value"); Roman romanAdd; romanAdd = firstNumber.addRoman(secondNumber); romanAdd.printRoman(); System.out.println("Subtracting the Roman Numbers and return new Roman value"); Roman romanSub; romanSub = firstNumber.subRoman(secondNumber); romanSub.printRoman(); } }
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package myname.project.pkg6; /** * * @author wsteadma */ public class Roman { private String romNumber; private int decNumber; public Roman(String rNumber) { romNumber = rNumber; } public String getRoman() { return romNumber; } public int getDecimal() { return decNumber; } public void printRoman() { System.out.println("The Roman Number is " + romNumber); } public void printDecimal() { System.out.println("The Decimal Number is " + decNumber); } // Converts a roman number string into a decimal value public int setDecimal(String romNum) { int charValue = 0; char[] characters = new char[romNum.length()]; //System.out.println("romNum length is " + romNum.length()); for (int counter = 0; counter < romNum.length(); counter++) { characters[counter] = romNum.charAt(counter); //System.out.println(characters[counter]); } for (int sCounter = 0; sCounter < romNum.length(); sCounter++) { if (characters[sCounter] == 'M' || characters[sCounter] == 'm') { charValue += 1000; } else if (characters[sCounter] == 'D' || characters[sCounter] == 'd') { charValue += 500; } else if (characters[sCounter] == 'C' || characters[sCounter] == 'c') { charValue += 100; } else if (characters[sCounter] == 'L' || characters[sCounter] == 'l') { charValue += 50; } else if (characters[sCounter] == 'X' || characters[sCounter] == 'x') { charValue += 10; } else if (characters[sCounter] == 'V' || characters[sCounter] == 'v') { charValue += 5; } else if (characters[sCounter] == 'I' || characters[sCounter] == 'i') { charValue += 1; } } decNumber = charValue; return charValue; } // Converts a decomal number to a roman number public String setDec2Roman(int decNum) { String newRoman = ""; while (decNum >= 1000) { newRoman += "M"; decNum -= 1000; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 500) { newRoman += "D"; decNum -= 500; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 100) { newRoman += "C"; decNum -= 100; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 50) { newRoman += "L"; decNum -= 50; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 10) { newRoman += "X"; decNum -= 10; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 5) { newRoman += "V"; decNum -= 5; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum > 0) { newRoman += "I"; decNum -= 1; //System.out.println(decNum); //System.out.println(newRoman); } return newRoman; } public Roman addRoman(Roman newRom) { int totRom = newRom.setDecimal(newRom.romNumber) + decNumber; romNumber = newRom.setDec2Roman(totRom); return new Roman(romNumber); } public Roman subRoman(Roman subRom) { int totRom = decNumber - subRom.setDecimal(subRom.romNumber); romNumber = subRom.setDec2Roman(totRom); return new Roman(romNumber); } }
While (!.) Pattern.Matches ("MDCLXVI", firstRoman))
Try "[MDCLXVI] *" and see if it's better
{
System.out.Print ("a valid Roman Number please try again");
firstRoman = firstRoman.toUpperCase ();
}My Code is as follows:
// Ask for user to input firstRoman Number System.out.print("Enter your first Roman Number:"); // add the Roman Number to the String variable firstRoman = keyboard.nextLine(); firstRoman = firstRoman.toUpperCase();
Once they enter in the it, I want to check to make sure that it has characters MDCLXVI and if it contains any other characters then I will provide a new object Scanner keyboard to try again and if it fails again, it will go to the option to try again until they put in a string that contains only the characters above. I don't know where to go here to get the while loop has worked. New to Java and I got my program work properly when I put good known numbers of novel, but I want to take incorrect entries.
Any help would be appreciated.
Thank you
WallyI put the code for my main program and my class below just in case. I have already met the requirements of the teacher if the project is done, I'm just trying to improve.
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package myname.project.pkg6; import java.util.Scanner; import java.util.regex.Pattern; /** * * @author wsteadma */ public class mynameProject6 { /** * @param args the command line arguments */ public static void main(String[] args) { // Used for testing String firstRoman; String secondRoman; Scanner keyboard = new Scanner(System.in); // Ask for user to input firstRoman Number System.out.print("Enter your first Roman Number:"); // add the Roman Number to the String variable firstRoman = keyboard.nextLine(); firstRoman = firstRoman.toUpperCase(); // Ask for user to input secondRoman Number System.out.print("Enter your second Roman Number:"); // add the Roman Number to the String variable secondRoman = keyboard.nextLine(); // Add the name input into the name variable secondRoman = secondRoman.toUpperCase(); //Creating first instance of Roman Numbers class Roman firstNumber = new Roman(firstRoman); Roman secondNumber = new Roman(secondRoman); System.out.println("Printout of the created roman numbers"); //Prints out the Roman Number firstNumber.printRoman(); secondNumber.printRoman(); // Convert Roman to Decimal firstNumber.setDecimal(firstRoman); secondNumber.setDecimal(secondRoman); System.out.println("Viewing the Decimal values for the two defined instances"); //Prints decimal Numbers firstNumber.printDecimal(); secondNumber.printDecimal(); System.out.println("Adding the Roman Numbers and returning new Roman value"); Roman romanAdd; romanAdd = firstNumber.addRoman(secondNumber); romanAdd.printRoman(); System.out.println("Subtracting the Roman Numbers and return new Roman value"); Roman romanSub; romanSub = firstNumber.subRoman(secondNumber); romanSub.printRoman(); } }
CLASS:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package myname.project.pkg6; /** * * @author wsteadma */ public class Roman { private String romNumber; private int decNumber; public Roman(String rNumber) { romNumber = rNumber; } public String getRoman() { return romNumber; } public int getDecimal() { return decNumber; } public void printRoman() { System.out.println("The Roman Number is " + romNumber); } public void printDecimal() { System.out.println("The Decimal Number is " + decNumber); } // Converts a roman number string into a decimal value public int setDecimal(String romNum) { int charValue = 0; char[] characters = new char[romNum.length()]; //System.out.println("romNum length is " + romNum.length()); for (int counter = 0; counter < romNum.length(); counter++) { characters[counter] = romNum.charAt(counter); //System.out.println(characters[counter]); } for (int sCounter = 0; sCounter < romNum.length(); sCounter++) { if (characters[sCounter] == 'M' || characters[sCounter] == 'm') { charValue += 1000; } else if (characters[sCounter] == 'D' || characters[sCounter] == 'd') { charValue += 500; } else if (characters[sCounter] == 'C' || characters[sCounter] == 'c') { charValue += 100; } else if (characters[sCounter] == 'L' || characters[sCounter] == 'l') { charValue += 50; } else if (characters[sCounter] == 'X' || characters[sCounter] == 'x') { charValue += 10; } else if (characters[sCounter] == 'V' || characters[sCounter] == 'v') { charValue += 5; } else if (characters[sCounter] == 'I' || characters[sCounter] == 'i') { charValue += 1; } } decNumber = charValue; return charValue; } // Converts a decomal number to a roman number public String setDec2Roman(int decNum) { String newRoman = ""; while (decNum >= 1000) { newRoman += "M"; decNum -= 1000; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 500) { newRoman += "D"; decNum -= 500; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 100) { newRoman += "C"; decNum -= 100; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 50) { newRoman += "L"; decNum -= 50; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 10) { newRoman += "X"; decNum -= 10; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum >= 5) { newRoman += "V"; decNum -= 5; //System.out.println(decNum); //System.out.println(newRoman); } while (decNum > 0) { newRoman += "I"; decNum -= 1; //System.out.println(decNum); //System.out.println(newRoman); } return newRoman; } public Roman addRoman(Roman newRom) { int totRom = newRom.setDecimal(newRom.romNumber) + decNumber; romNumber = newRom.setDec2Roman(totRom); return new Roman(romNumber); } public Roman subRoman(Roman subRom) { int totRom = decNumber - subRom.setDecimal(subRom.romNumber); romNumber = subRom.setDec2Roman(totRom); return new Roman(romNumber); } }
-
Let's say I have 100 pictures of mynah and Robins-blue. I initially add 'birds' as a keyword to all 100 photos. After a meeting, I add "bluebird" to 20 photos and "blackbird" to 30 photos, 50 photos so only "the birds" as keyword, 20 have 'birds, bluebird' and 30 'bird, blackbird. ' Is there a way to pull up to 50 photos with only "the birds" as the key word? In other words, find pictures that have only the birds as a keyword?
Thank you.
I don't think there is a direct way to do this — in general, LR keyword corresponding operators are not the best. But you can do it manually from time to time:
-Create a keyword BirdsOnly.
-Select all of the photos of birds and assign the keyword BirdsOnly.
-Select all the photos of each of the subkeywords to birds in turn (Bluebird, Blackbird, etc.).
-Remove the birds and the BirdsOnly of the keywords from the photos of the subkeyword.
When you're done, don't receive any bird photo and all photos without a Blackbird and Bluebird will be assigned to BirdsOnly.
Rob Cole Consolidator keyword plugin:
http://www.Adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_US&EXTID=2224 522
can automate it to remove the keyword parent (e.g. birds) of photos assigned with subkeywords, but I don't think that it can help you to select the photos with just the parent keyword.
-
I need to find all documents that contain more than one keyword
I need to find documents that include more than one specific word (Word or WP) (2 or more) and which do not form a sentence. For example, words can be included in the various paragraphs of a document.
I tried to use the windows search option, but it only lets you search for a word or phrase in the content of the documents in a folder. If you try to refine your search with a second term, the search is not limited to documents that contain the first word... already so you get just a bunch of documents, some of which contain the two words...
I can't believe that this search option is not available in WORD. In WP, I used to be easily able to search for one or more terms or expressions and was even able to specify when the words must appear in the same paragraph, line, etc., in all my documents WP... This was very helpful.
Is there a method I have used to locate the documents that I need in WORD? Thank you!
Maybe I misunderstood, but for my W7 it seems to look up words in the same document, separated if I open "search programs and files" in the menu
and enter something like: word1 word2 kind: = document
More information on research using W7 here - http://www.howtogeek.com/73065/learn-the-advanced-search-operators-in-windows-7/ and also http://windows.microsoft.com/en-us/windows7/advanced-tips-for-searching-in-windows
There is also the 'GOLD' and 'AND' options that can help, then perhaps try:
"word1 AND word2 kind: document = ' (without the quotation marks).
It not work for you? Or have I misunderstood the question?
Maybe you are looking for
-
I installed the latest update required for my iphone ios 6 a few days ago, and now when I try to download pictures from my iphone to my PC (via USB connection), the PC does not see the iphone. iTunes sees it yet, but windows Explorer does not work.
-
I imported and edited a film in 1980 x 1080 50 p. How can I burn to a disc in this resolution? It is a short, and if I try to burn it as a BluRay to DVD does it automatically at a resolution of 720. When I used film to 25i, it allowed the 1080 resolu
-
Satellite Pro 4600: No sound
I can't hear any sound out of my Satellite Pro 4600. No internal speaker, my earpiece. According to Windows, everything works fine. Volume is not equal to zero. Sound is not attenuated. What can be wrong?
-
Where should I start with RS-232 to receive and analyze multiple signals using a single port?
Hello I'm starting a new project that will have a single serial port. I would use Labview to analyze several singles (which include two measures of temperature, two measures of pressure and a few others like two voltages, input encoder axis, etc...)
-
HP Pavilion 11 x 360: Touch Screen has suddenly stopped working?
I am on Windows 10 and recently, I decided to update my drivers using driver Booster. Everything worked well and I had no previous problem with this laptop or Windows 10. Once I have completed their update, it prompted me to restart my computer, and