Posts

How to close a excel if it is opening when accessing using JAVA and APACHE-POI 3.6?` -

We are developing applications in Java and are using APE PoI 3.6 to access MS Excel files. Let's assume that my Excel file is open when I run my program, this error and the program ends. So, first I have to check whether my Excel has been opened or not. If it is opening, then I want to close my Excel file and open that file ... itemprop = "text"> POI does not run Excel anymore It is an independent code that opens your Excel file and interprets the content. There is no direct route to Java code to communicate with Excel and to see if it's running. To try to coordinate, you can see the Java / Com Bridge for complex mechanisms.

java - Accessing a mapper's counter from a reducer -

I need to access the counters from my Maper in my reducers. Is this possible? If so, how is it done? As an example: My Mapper is: Public square counter mapper and text text, text, text, text & gt; {Static enum TestCounters {TEST} @ Override throws the protected Zero map (text key, text value, reference reference) IOException, interrupted; Exception {context.getCounter (TestCounters.TEST). Construction (1); Context.write (key, value); }} is my reducer extends the public square CounterReducer Reducer & lt; Text, Text, Text, Longway & gt; {@Override Reduces Safe Zero (text key, iterable & lt; text & gt; values, reference references) throws IOException, interrupted; Exception {counter counter = context.getCounter (CounterMapper.TestCounters.TEST); Long counter value = counter .getValue (); Context.write (key, new long countervalue); }} counterValue is always 0. Am I doing something wrong or is it not possible? In Reducer's Configurable (JobCon...

c# - Handling a one-to-many relationship with value types in Fluent NHibernate -

I am working on migrating an application to NHibernate, and I am using Fluent NIBnet I have a phone number value type in which there are some properties - number , number type , and details . There are several objects in my domain that have a phone number store. In the database (SQL 2008), these values ​​are kept in different tables. That's why I can have customer and customer phone number as well as vendors and seller phone number . The problem is that I would not like to use a simple PhoneNumber value type without having customer phone number and seller phone number Type whose properties are related to their parent's type, and I do not know how to accomplish it in NHibernate Is it possible or do I need to match my domain object more closely to the built-in database schema? is? Update: A little more info It seems that I'm having trouble getting a basic map to work for the encounter. Here's a simple example: Public class CustomerMap: C...

c - How would I properly make this loop display the first 40 digits of the fibonacci sequence? -

As far as I can tell, it seems that it should work. The first two elements are set to 1 (I'm ignoring the first 0). Loop is considered to be loop through the array, and since Fibonacci numbers are equal to the sum of two preceding numbers, I want to add them, then they have to display them. The output is all 2s, and I'm pretty sure why not. Note: I am not looking for direct answers, but there is a way that I can understand myself. // Fibonacci sequence #include & lt; Stdio.h & gt; Int main (zero) {int fib_numbers [40] = {1, 1}, i; For (i = 1; i & lt; 40; i ++) {Fib_translation [i] = fib_scrime [i] + fib_nug [ii]; Printf ("\ t% d \ n", phib_genement [i]); } Return 0; } after the first step, the wrong element is 0 (not initial, but 0 in this matter). FAB [I + 1] = FAB [I] + FIB [I-1] is about; Printf ("% d \ n", fb [i + 1])? And of course, Phib should have 41 shapes instead of 40.

javascript - How to test if an input contains a question mark? -

I have a script which tests, if there is an input question mark, and if this happens then some CSS changes is. How can I do this? jQuery usage : Do not use jQuery: if (document.getElementById ('myinputbox'). Value.indexOf ("?") = 1) { Document.getElementById ("Some LayerHelments") ClassName + = "NewClass"; This.className + = "NewClass"; } And {warnings ("question mark is not included"); } Update: Confirm KidDown () $ ("# myinputbox"). Keydown (function () (if ($ (This) .val () IndexOf ("?") = -1) {$ (this). CSS ("color", "green");} and {$ (this ) .css ("color", "red");}});

java - convert String in time to Time object without Date -

I have a problem converting string time into a time object because it prints with date, this is my code string time = "15:30:18"; Date format SDF = new SimpleDateform ("HH: mm: SS"); Date date = sdf Prs (time); System.out.println ("time:" + date); How to convert and print only time without a date in Java. It would be better if you can give an example. Thank you. Use the same SimpleDateFormat that you used to parse it: string time = "15: 30" ;; Date format SDF = new SimpleDateform ("HH: mm: SS"); Date date = sdf Prs (time); System.out.println ("Time:" + sdf.format (date)); Remember, the date object always represents a combined date / time value; it can not represent only the date-only or the time-value value That's why you have to use the correct DateFormat to ensure that you "only see" the desired parts.

Using OpenSSL library in D -

I have to use OpenSSL library at Ubuntu 10.04 with DMD + Tango bundle. I've compiled OpenSSL 1.0.0d I have files: /usr/local/ssl/lib/libssl.a / usr / local / ssl / lib /libcrypto.a So, I'm using them like this: $ dmd myfile.d -l / usr / local / ssl / And error is: No such file: File format not recognized collection 2: LD 1 exit status --- Error Level 1 I also tried to do it with OpenSSL 0.9.8r is. I do not have any information: / I can prepare SSL certification, so I think OpenSSL works right. Please help me. I believe the second argument is -ll / usr / local / ssl / lib should be -L once to the compiler to rest the linker, and then ld -L for the option That the library adds a directory to the search path).