SEARCH KEYWORD -- JAVA THREAD
Check file readability in Java
File operation is quite platform dependent. Although Java is a cross platform programming language, the file operation in Java is also platform dependent. The obvious evidence is the file permission check. In Java, we can call canRead(), canWrite() and canExecutable() to check whether the program can read, write or execute the file specified. However, on Windows, when we call canRead() on a File object, we may get unexpected result. Actually, on Windows, when we call canRead() on a File object, ...
Traditional recursion vs Tail recursion
Recursion is a frequently adopted pattern for solving some sort of algorithm problems which need to divide and conquer a big issue and solve the smaller but the same issue first. For example, calculating fibonacci accumulating sum and calculating factorials. In these kinds of issues, recursion is more straightforward than their loop counterpart. Furthermore, recursion may need less code and looks more concise. For example, let's calculate sum of a set of numbers starting with 0 and st...
ALGORITHM,RECURSION,TAIL RECURSION,TRADITIONAL RECURSION 2016-09-23 23:54:09
Difference between Enumeration and Iterator in java interview question and answer
This tutorial explains about what are the differences between Iterators and Enumeration and similarity of both interface which may be asked in a core java interview. Functionalities of both Iterator & Enumeration interfaces are similar that means both generates a series of all elements of the object which is to have its values iterated that can be traversed one at a time using next() method incase of Iterator and nextElement() method incase of Enumeration. The more powe...
Java,Iterator,Enumeration 2012-05-01 07:41:52
Deep Dive into Spin Locks in Golang
In concurrent programming, a Mutex is a commonly used synchronization mechanism to protect critical resources and prevent data races. However, in certain specific scenarios, especially when the lock-holding time is short and the number of threads is limited, a more lightweight lock known as a Spin Lock can provide higher performance. What is a Spin Lock A Spin Lock is a form of busy-wait lock. When a thread attempts to acquire a lock held by another thread, it continuously checks the lock's stat...
Programmer's Mother's Day
Mother's Day is a celebration honoring mothers and motherhood, maternal bonds, and the influence of mothers in society. It is celebrated on various days in many parts of the world, most commonly in March or May. Mothers usually receive gifts on this day.Carnation is dedicated to be mother's flower. As a special group of people - programmers, our way of expression will naturally have our own characteristics. We can write programs to express our love to our mothers. Here is a Chines...
Mother's day. Program 2013-05-12 01:10:15
Turn on SecurityManager in Java
SecurityManager in Java is to check whether the application codes can access some restricted resource such as file, socket etc. This can be used in applications which have high security requirements. With this feature turned on, our system resources can be secured with only permitted operations. When JVM starts, it will first check whether the SecurityManager is on by checking the system property java.security.manager, if it's on, then an instance of SecurityManager will be created and it can be...
SecurityManager,enable,program 2013-12-16 05:03:53
Different types of keystore in Java -- JCEKS
JCEKS stands for Java Cryptography Extension KeyStore and it is an alternative keystore format for the Java platform. Storing keys in a KeyStore can be a measure to prevent your encryption keys from being exposed. Java KeyStores securely contain individual certificates and keys that can be referenced by an alias for use in a Java program. The process of storing and loading different entries in JCEKS is similar to what JKS does. So please refer to the article Different types of keystore in Java -...
Paint messages will come in as fast as you let them
There is a class of messages which are generated on demand rather than explicitly posted into a message queue. If you call GetÂMessage or PeekÂMessage and the queue is empty, then the window manager will look to see if one of these generated-on-demand messages is due, messages like WM_TIMER, WM_MOUSEÂMOVE, and WM_PAINT. Neil wonders, "In that program that called InvalidateÂRect 100,000 times, how many paint messages were generated?" The Zen answer to this question is "Yes." A ...
WM_PAINT,paint message,work,Mouse move 2011-12-21 09:37:14
Regex vs IndexOf in Java.
Overview The author of these articles Are C# .Net Regular Expressions Fast Enough for You? and .Net Regex: Can Regular Expression Parsing be Faster than XmlDocument or Linq to Xml? recently pointed out to me that he had found that Regular expressions were at least as fast or faster than the alternatives in C#. However it has been my experience that regular expressions in Java were slower. It is hard for me to say why this might be different in Java and C# or even if these are fair compari...
Java,indexOf,Regular Expression,Efficiency 2012-01-03 10:58:52
Android socket programming example
Socket is a kind of interface for different sides t communicate, it usually identified by an IP and a port. There are many server side software on a server and they would provide different service. Each server many create some sockets and bind them to some ports so that clients can listen to. Software on the Internet will exchange data though a bidirectional connection established. Each end of the connection has a socket created. In Java, Socket and ServerSocket are in java.net package, ServerSo...
RECENT
- Special ARP Uses: Gratuitous ARP, ARP Probe, and ARP Announce
- SIEM Big Data Visualization [04] : Data Transmission Latency SIEM Log Analysis Dashboard
- How to make select in WinSock exceed the 64-socket limit
- EtsiosApp Release Date: All You Need to Know
- SIEM Big Data Visualization [03]:Graph-Based SIEM Log Analysis Dashboard
- How AI is Changing Web Development: A New Era of Digital Innovation
- SIEM Big Data Visualization [02]: National Cyber Threats Dashboard
- Exploring the Impact of a Loan Origination System on Financial Institutions
- Power Grid OT Simulation System
- Why is Golang's Compilation Speed So Fast?
- more>>