Tik Tik Tik bunyi hujan di atas genteng,
Airnya turun tidak terkira
Cobalah tengok, dahan dan ranting,
Pohon dan kebun basah semua.
VBA Excel–Allow Paste Special Only
While recently answering a post on the MSDN forum, I realized that the Robert Gold(Vice President of Business Intelligence in Bostwick Laboratories, Inc) was facing the same problem that I was facing couple of years back when I was working as a Team Leader in one of the BPO’s. The MIS Department was reporting to me and one of the main jobs was to create “Trackers” for various departments. My team used to take hours to design a particular tracker only to realize after few days that the users were spoiling the format of the tracker by copying and pasting. Completely protecting it with a password was not the option. Nor did we find any option in Excel which forced selective pasting. It was then we devised this macro which allowed the user to paste but behind the scenes, converted that paste into paste special – values.
The only drawback of this method is that if the macros are disabled then this won’t work. But thanks to the IT Department, they ensured that the macros was enabled on each and every pc. After that we never faced a problem with users messing up the format of the sheet.
So how does this code work? What is the logic behind it? I would explain this in 3 sections.
- Logic
- Planting the Code
- Code
JDBC connection to very busy SQL 2000: selectMethod=cursor vs selectMethod=direct? – Stack Overflow
Briefly,
selectMethod=cursor
- theoretically requires more server-side resources than
selectMethod=direct
- only loads at most batch-size records into client memory at once, resulting in a more predictable client memory footprint
- theoretically requires more server-side resources than
selectMethod=direct
- theoretically requires less server-side resources than
selectMethod=cursor
- will read the entire result set into client memory (unless the driver natively supports asynchronous result set retrieval) before the client application can iterate over it; this can reduce performance in two ways:
- reduced performance with large result sets if the client application is written in such a way as to stop processing after traversing only a fraction of the result set (with
direct
it has already paid the cost of retrieving data it will essentially throw away; withcursor
the waste is limited to at most batch-size – 1 rows — the early termination condition should probably be recoded in SQL anyway e.g. asSELECT TOP
or window functions) - reduced performance with large result sets because of potential garbage collection and/or out-of-memory issues associated with an increased memory footprint
- reduced performance with large result sets if the client application is written in such a way as to stop processing after traversing only a fraction of the result set (with
- theoretically requires less server-side resources than
In summary,
- Can using
selectMethod=cursor
lower application performance? — either method can lower performance, for different reasons. Past a certain resultset size,cursor
may still be preferable. See below for when to use one or the other - Is
selectMethod=
an application-transparent setting on a JDBC connection? — it is transparent, but it can still break their app if memory usage grows significantly enough to hog their client system (and, correspondingly, your server) or crash the client altogether
Source: JDBC connection to very busy SQL 2000: selectMethod=cursor vs selectMethod=direct? – Stack Overflow
Sequences are incremented twice
When a sequence is incremented twice when running SELECT NEXT VALUE FOR MYSEQ; and you are using the Microsoft JDBC driver with the selectMethod=cursor, remove the selectMethod=cursor option from the JDBC URL. The sequences will then be incremented correctly.
Spring @Transactional explained | DuyHai’s Java Blog
Spring is a widely used framework today, bringing many powerfull features and extensions to the Java core stack. However most of people tend to use these features without understanding their underlying mechanism.
Since there is no “magic” in real life, we are going to dig into some Spring features related to Transaction and Database in this serie of articles.
This first article is dealing with the famous @Transactional annotation, saving the developers the burden of managing low level transaction code.
Continue reading “Spring @Transactional explained | DuyHai’s Java Blog”
35+ Use Cases for Choosing Your Next NoSQL Database – High Scalability –
We’ve asked What The Heck Are You Actually Using NoSQL For?. We’ve asked 101 Questions To Ask When Considering A NoSQL Database. We’ve even had a webinar What Should I Do? Choosing SQL, NoSQL or Both for Scalable Web Applications.
Now we get to the point of considering use cases and which systems might be appropriate for those use cases. Continue reading “35+ Use Cases for Choosing Your Next NoSQL Database – High Scalability –”
Generic Types (The Java Tutorials > Learning the Java Language > Generics (Updated))
By convention, type parameter names are single, uppercase letters. This stands in sharp contrast to the variable naming conventions that you already know about, and with good reason: Without this convention, it would be difficult to tell the difference between a type variable and an ordinary class or interface name.
The most commonly used type parameter names are:
- E – Element (used extensively by the Java Collections Framework)
- K – Key
- N – Number
- T – Type
- V – Value
- S,U,V etc. – 2nd, 3rd, 4th types
You’ll see these names used throughout the Java SE API and the rest of this lesson.
Source: Generic Types (The Java
Mini tutorial for configuring client-side SSL certificates.
Client-side SSL
For excessively paranoid client authentication.
Using self-signed certificate.
Create a Certificate Authority root (which represents this server)
Organization & Common Name: Some human identifier for this server CA.
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
Continue reading “Mini tutorial for configuring client-side SSL certificates.”
iluwatar/java-design-patterns: Design patterns implemented in Java
Design patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system. Design patterns can speed up the development process by providing tested, proven development paradigms. Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.
Source: iluwatar/java-design-patterns: Design patterns implemented in Java
Deeplearning4j: Open-source, distributed deep learning for the JVM
Deeplearning4j is the first commercial-grade, open-source, distributed deep-learning library written for Java and Scala. Integrated with Hadoop and Spark, DL4J is designed to be used in business environments, rather than as a research tool. Skymind is its commercial support arm.Deeplearning4j aims to be cutting-edge plug and play, more convention than configuration, which allows for fast prototyping for non-researchers. DL4J is customizable at scale. Released under the Apache 2.0 license, all derivatives of DL4J belong to their authors.By following the instructions on our Quick Start page, you can run your first examples of trained neural nets in minutes.
Source: Deeplearning4j: Open-source, distributed deep learning for the JVM