Hilarious, isn't it?
Hilarious, isn't it?
IoC, or DI definitely takes a perspective turnaround inside your head, but you get around it slowly. I was playing around ways to integrate LogBack, and Spring – essentially around having Spring give me a pre-created instance of LogBack logger.
I searched around posts, but most people seem to be against using Spring just for substituting one-line of Logback (Logger log = LoggerFactory.getLogger("LogbackTest");
) to get your logger.
I, on the other hand, was more interested in how to get Spring give me a LogBack logger instance without too much contrived hand-written code to achieve so. And with a bit of reading through Spring principles, documentation I found the way.
Essentially, when using Logback’s LoggerFactory you have access to only a single getLogger() factory method. This is static which makes things a bit different for what Spring would call a bean – a class providing constructor, getter, setter methods. To circumvent this non-bean style, Spring provides what you call as static initializers a.k.a substitutes for constructors, which allow you to call a static method in lieu of calling a constructor on an object.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="bean1" class="org.slf4j.LoggerFactory" factory-method="getLogger"> <constructor-arg value="LogbackTest" /> </bean> </beans>
Now, this bean1 can be used as a regular bean inside your class
ApplicationContext ctx = new FileSystemXmlApplicationContext("logbacktest.xml"); Logger log = (Logger) ctx.getBean("bean1"); log.debug("This is my first message"); log.info("How about this information message");
Throw in a logback.xml in your classpath, and viola you have a nice Spring injected dependency – log in your code, while still using Logback!
There is no straight (should I say “easy”) way to export Outlook mails to Thunderbird. Using Thunderbird’s import from Outlook did not work since quite a few emails came up as raw HTML, and I had to manually change Automatic encoding detection to OFF, Universal to see the contents each time.
A sure-shot (well… which took me 99% of the) way was Outlook –> Import into Outlook Express –> Import into Thunderbird. This worked, but with one sad issue – non-English attachment names are not as original. If you can live with that, then this is the surest way to go !
Few references which helped-
Import .pst files – MozillaZine KB
String A= "a string";
String B= "a string";
will point to same string object on heap.System.gc()
finalize
method is invoked only once before being removed from memory. Always call super.finalize()
if you override it.Much recently to my dismay, I figured out that I cannot remove Symantec’s Endpoint Protection from my own laptop without administrator password. I do not own this password, and I do not want anybody other than me permitting me what to uninstall. Hence I went ahead for manual uninstall according to these instructions (from Symantec’s own site) below-
The instructions are crisp and clear. I could manually uninstall following each step of those instructions, but there is one big trouble. The instructions talk to removing over 100’s of registry keys, values which I believe is sheer impossible manually. Why didn’t Symantec simply provide a small tool which has all those instructions bundled in a simple click-n-go fashion?
I have tried to create a small registry file which can automate the removal of registry entries Uninstall Registry entries for Symantec Endpoint Protection
For all other manual deletion of files, it would be great to write a small AutoIt script compiled to an exe. Maybe sometime later…
“Contributing to society” at Toyota means two things. First, it means, “to manufacture automobiles that meet the needs of society and enrich people’s lives.” And second, “to take root in the communities we serve by creating jobs, earning profits and paying taxes, thereby enriching the local economies where we operate.”
TOYOTA: Company > Company Profile > Message from Top Management.
Last whole week I was stumbled by the fact that my home network with 3 PCs suddenly stopped working. None of them were able to “see” each other, except for a little while… strange.
Technically (since it is easier to describe), A, B, C – my 3 computers – could reach each other, share files, host apache, download files without any extra configuration.
Last week, however while using C’s http server from A suddenly stopped. Puzzled, I thought the machine might be overloaded, or something like this must be causing page to timeout, or apache must have hanged (does it?). But things seemed to be working OK on C, in fact top showed a load average below 1 ?
Further puzzled, I tried pinging A to C, and vice-versa. It worked… but only for a while. Pinging after a while seemed to stop. Huh?
Scourging over the Internet wasn’t easy for answer. Maybe my way of searching was wrong, but I did spent a good week trying to fish out the ping issue, then next to dig deeper to find that accessing C’s IP from outside (it already has a global ip; though dynamic, paired through dyndns to the world) worked. Now each of them – A, B, C – have no internal 192.168 ip’s, just public ip’s. What good are public ip’s if I have to access them from outside than just sitting home?
Something was wrong.
To cut short, I called the ISP, asked them if they have changed anything recently (well, I was using A, B, C sharing files for over 6 months now). My ISP reported that no such upgrade, or settings were done. Deeply mad about this situation, I chose to disable the firewall (Eset Nod32) on A, and then tryout the ping – which worked effortlessly to C, and back.
What the hell! Why did Nod32 suddenly seem to block my own A, B, C from seeing each other? ARP Poisioning? I don’t know, only thing I know is that it shouldn’t block them. 🙂
Well, atleast things are fine now. I’ve changed settings on Nod32 to Not block threat detected addresses henceforth.