Real Madrid transfer news deadline day: Aubameyang eyeing Madrid as he admits he needs to leave Dortmund in summer - Goal.com



Real Madrid transfer news deadline day: Aubameyang eyeing Madrid as he admits he needs to leave Dortmund in summer - Goal.com

Gill Clark Getty Images The in-demand striker has put clubs all over Europe on alert by revealing that he must quit Thomas Tuchel's side to further his career Pierre-Emerick Aubameyang has admitted that he needs to leave Borussia Dortmund in the summer to further his career, describing a move to Real Madrid as his "dream". The Gabon international is one of the most in-demand strikers in European football as a star man for the Bundesliga side, and has already scored 20 goals for his club this season. Dortmund have recently stated they would have to consider a sale if they received bids of €80 million for the forward, who has now claimed that he needs to quit the club in the summer. "If I want to go to the next level, I need to leave in the summer," Aubameyang told Radio RMC.  "Real Madrid is still a dream, but there has been too much noise. "I have an important choice to make. Many people would like to see me in England.

Read full article from Real Madrid transfer news deadline day: Aubameyang eyeing Madrid as he admits he needs to leave Dortmund in summer - Goal.com


Getting Started with the Jackson JSON Processor — Citrine Informatics



Getting Started with the Jackson JSON Processor — Citrine Informatics

What if you don't want your class to follow the JavaBean conventions? For example, you may want to create an immutable class - one without any setters. For those situations we can use the @JsonCreator annotation to declare a method that Jackson uses to create new instances of our class. The example below uses a constructor as the JsonCreator method. Note that you must annotate each argument of the constructor with @JsonProperty and give the name of the JSON field that should be used for that argument.


Read full article from Getting Started with the Jackson JSON Processor — Citrine Informatics


java - How do I correctly reuse Jackson ObjectMapper? - Stack Overflow



java - How do I correctly reuse Jackson ObjectMapper? - Stack Overflow

It's fine to use a single instance per application provided you don't call any configuration methods after it's been made visible i.e. you should do all your initialization inside a static block.


Read full article from java - How do I correctly reuse Jackson ObjectMapper? - Stack Overflow


LeetCode 494. Target Sum – 柳婼 の blog



LeetCode 494. Target Sum – 柳婼 の blog

You are given a list of non-negative integers, a1, a2, …, an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and – as its new symbol.

Find out how many ways to assign symbols to make sum of integers equal to target S.

Example 1:
Input: nums is [1, 1, 1, 1, 1], S is 3.
Output: 5
Explanation:

-1+1+1+1+1 = 3
+1-1+1+1+1 = 3
+1+1-1+1+1 = 3
+1+1+1-1+1 = 3
+1+1+1+1-1 = 3

There are 5 ways to assign symbols to make the sum of nums be target 3.
Note:
The length of the given array is positive and will not exceed 20.
The sum of elements in the given array will not exceed 1000.
Your output answer is guaranteed to be fitted in a 32-bit integer.

题目大意:给一个非负的整数数组,可以在每个元素前面加+或者-,给一个目标整数S,求问有多少种不同的添加方式,可以让数组中所有元素在添加符号之后相加的结果为S~
分析:深度优先搜索,尝试每次添加+或者-,当当前cnt为nums数组的大小的时候,判断sum与S是否相等,如果相等就result++。sum为当前cnt步数情况下的前面所有部分的总和~


Read full article from LeetCode 494. Target Sum – 柳婼 の blog


【LeetCode】 491. Increasing Subsequences - LSF_Kevin的博客 - 博客频道 - CSDN.NET



【LeetCode】 491. Increasing Subsequences - LSF_Kevin的博客 - 博客频道 - CSDN.NET

Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing subsequence should be at least 2 .

Example:

Input: [4, 6, 7, 7]  Output: [[4, 6], [4, 7], [4, 6, 7], [4, 6, 7, 7], [6, 7], [6, 7, 7], [7,7], [4,7,7]]  

Note:

  1. The length of the given array will not exceed 15.
  2. The range of integer in the given array is [-100,100].
  3. The given array may contain duplicates, and two equal integers should also be considered as a special case of increasing sequence.

Read full article from 【LeetCode】 491. Increasing Subsequences - LSF_Kevin的博客 - 博客频道 - CSDN.NET


Google employees staged a protest over Trump’s immigration ban - The Verge



Google employees staged a protest over Trump's immigration ban - The Verge

Walking off the job in eight offices worldwide More than 2,000 Google employees in offices around the world staged a walkout on Monday afternoon in protest of President Donald Trump's executive order banning immigration in seven Muslim-majority countries. Using the hashtag # GooglersUnite , employees tweeted photos and videos of walkout actions around the world, including at headquarters in Mountain View. The protest came after employees donated more than $2 million to a crisis fund that will be distributed among nonprofit groups working to support refugees. Google match employees' donation with $2 million. "This was in direct response to the immigration action," Enzam Hossain, an employee on the Mountain View campus, told The Verge. "We wanted to be a part of it, and support our colleagues who are facing it." Googlers Enzam Hossain, left, and Bickey Russell (Lauren Goode / The Verge) Both Google co-founder Sergey Brin and CEO Sundar Pichai spoke to employees at Mountain View.

Read full article from Google employees staged a protest over Trump's immigration ban - The Verge


jodatime - Java 8 Date equivalent to Joda's DateTimeFormatterBuilder with multiple parser formats? - Stack Overflow



jodatime - Java 8 Date equivalent to Joda's DateTimeFormatterBuilder with multiple parser formats? - Stack Overflow

There is no direct facility to do this, but you can use optional sections. Optional sections are enclosed inside squared brackets []. This allows for the whole section of the String to parse to be missing.

DateTimeFormatter formatter = DateTimeFormatter.ofPattern(""      + "[yyyy/MM/dd HH:mm:ss.SSSSSS]"      + "[yyyy-MM-dd HH:mm:ss[.SSS]]"      + "[ddMMMyyyy:HH:mm:ss.SSS[ Z]]"  );

This formatter defines 3 grand optional sections for the three main patterns you have. Each of them is inside its own optional section.


Read full article from jodatime - Java 8 Date equivalent to Joda's DateTimeFormatterBuilder with multiple parser formats? - Stack Overflow


Spring RestController specific basePath | Mathias Hauser



Spring RestController specific basePath | Mathias Hauser

I recently started taking a look into Angular 2 and though about a proper project setup in combination with Spring RestControllers. During development, the front-end Angular 2 application will run via Webpack and the Spring Boot application with an embedded Tomcat. All RestController should use a common base path, since I plan to run the Angular 2 application together with the Spring application in a production environment. The test scenario is a simple index.html file that should be hosted in the URL '/index.html' and RestController hosted in '/api/hello'

Expected URL structure

/index.html – angular app placeholder
/api/hello – Endpoint for a rest controller

I recommend downloading the source of this example before you start. Link to the repository blog_rest-controller-base-path direct link to the source zip source-zip


Read full article from Spring RestController specific basePath | Mathias Hauser


java - How to configure a default @RestController URI prefix for all controllers? - Stack Overflow



java - How to configure a default @RestController URI prefix for all controllers? - Stack Overflow

There's a new solution to solve this kind of problem available since Spring Boot 1.4.0.RC1 (Details see https://github.com/spring-projects/spring-boot/issues/5004)

The solution of Shahin ASkari disables parts of the Auto configuration, so might cause other problems.

The following solution takes his idea and integrates it properly into spring boot. For my case I wanted all RestControllers with the base path api, but still serve static content with the root path (f.e. angular webapp)


Read full article from java - How to configure a default @RestController URI prefix for all controllers? - Stack Overflow


[SPR-13882] Support default URI prefix for web service @RequestMapping - Spring JIRA



[SPR-13882] Support default URI prefix for web service @RequestMapping - Spring JIRA

I had opened a ticket in Spring-Boot on this topic and it was suggested I create one on the Spring JIRA I have added the original ticket as the Reference URL.

There doesn't seem to be anyway, short of explicitly prefixing each individual
@RequestMapping


Read full article from [SPR-13882] Support default URI prefix for web service @RequestMapping - Spring JIRA


Bannon to media: drop dead - Axios



Bannon to media: drop dead - Axios

Don't have an account? Register now. Join AXIOS to save stories for later, get personalized news, and more! Register with email Thanks for signing up! In order to help us deliver news that will be most relevant to you, please tell us a little about yourself. Email sent! AP Photo/Andrew Harnik Trump adviser Steve Bannon speaks to the New York Times and demands to be quoted. So here it is: "The media should be embarrassed and humiliated and keep its mouth shut and just listen for awhile," Mr. Bannon said during a telephone call. "I want you to quote this," Mr. Bannon added. "The media here is the opposition party. They don't understand this country. They still do not understand why Donald Trump is the president of the United States." There's more: "The elite media got it dead wrong, 100 percent dead wrong," Mr. Bannon said of the election, calling it "a humiliating defeat that they will never wash away, that will always be there.

Read full article from Bannon to media: drop dead - Axios


java - Hibernate error - QuerySyntaxException: users is not mapped [from users] - Stack Overflow



java - Hibernate error - QuerySyntaxException: users is not mapped [from users] - Stack Overflow

In the HQL , you should use the java class name and property name of the mapped @Entity instead of the actual table name and column name , so the HQL should be :

List<User> result = (List<User>) session.createQuery("from User").list();

Read full article from java - Hibernate error - QuerySyntaxException: users is not mapped [from users] - Stack Overflow


How to solve Eclipse error cannot install breakpoint due to missing line number attributes - First8 Java ConsultancyFirst8 Java Consultancy



How to solve Eclipse error cannot install breakpoint due to missing line number attributes - First8 Java ConsultancyFirst8 Java Consultancy

Momentarily I'm working on a project in which I had some problems with the debugger. Every time I tried to install a breakpoint I got the error message 'cannot install breakpoint, due to missing line numbers' from Eclipse.


Read full article from How to solve Eclipse error cannot install breakpoint due to missing line number attributes - First8 Java ConsultancyFirst8 Java Consultancy


java - breakpoint error when debugging in eclipse, how to fix it - Stack Overflow



java - breakpoint error when debugging in eclipse, how to fix it - Stack Overflow

I have had the same problem, but reading your post helped me resolve mine. I changed org.eclipse.jdt.core.prefs as follow:

BEFORE:

eclipse.preferences.version=1  org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled  org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7  org.eclipse.jdt.core.compiler.compliance=1.7  org.eclipse.jdt.core.compiler.problem.assertIdentifier=error  org.eclipse.jdt.core.compiler.problem.enumIdentifier=error  org.eclipse.jdt.core.compiler.source=1.7

AFTER:

eclipse.preferences.version=1  org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled  org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7  org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve  org.eclipse.jdt.core.compiler.compliance=1.7  org.eclipse.jdt.core.compiler.debug.lineNumber=generate  org.eclipse.jdt.core.compiler.debug.localVariable=generate  org.eclipse.jdt.core.compiler.debug.sourceFile=generate  org.eclipse.jdt.core.compiler.problem.assertIdentifier=error  org.eclipse.jdt.core.compiler.problem.enumIdentifier=error  org.eclipse.jdt.core.compiler.source=1.7

Read full article from java - breakpoint error when debugging in eclipse, how to fix it - Stack Overflow


debugging - Eclipse - Unable to install breakpoint due to missing line number attributes - Stack Overflow



debugging - Eclipse - Unable to install breakpoint due to missing line number attributes - Stack Overflow

  1. In eclipse menu, go to Window->Preferences->Java->Compiler
  2. Unmark checkbox "Add line number attributes..."
  3. Click Apply -> Yes
  4. Mark checkbox "Add line number attribute..."
  5. Apply again.
  6. Go happy debuging


Read full article from debugging - Eclipse - Unable to install breakpoint due to missing line number attributes - Stack Overflow


Lawmakers: Trump Mexico tax plan would hurt Texas



Lawmakers: Trump Mexico tax plan would hurt Texas

AUSTIN — Texas lawmakers are warning of the damage President Trump's proposal for a 20% tax on imports from Mexico would do to the Lone Star State.

On Thursday, Trump spokesman Sean Spicer said the president would make Mexico pay for a border wall through the tax. Trump's aides later walked that back a bit, saying the tax was just an option. But it caused deep alarm among economists, business leaders and some elected officials on both sides of the aisle.


Read full article from Lawmakers: Trump Mexico tax plan would hurt Texas


Lazy Initialize @Autowired Dependencies with @Lazy



Lazy Initialize @Autowired Dependencies with @Lazy

By default all autowired dependencies are eagerly created and configured at startup. When the @Lazy annotation is present together with the @Component annotation on class level, then the component will not be eagerly created by the container, but when the component is first requested. Together with the @Autowired injection point, you need to mark it with @Lazy annotation.


Read full article from Lazy Initialize @Autowired Dependencies with @Lazy


ssh: Could not resolve hostname \342\200\223i - to tumble,



ssh: Could not resolve hostname \342\200\223i - to tumble,

ssh: Could not resolve hostname \342\200\223i

ssh: Could not resolve hostname \342\200\223i name or service unknown

A friend recently got this error on Ubuntu when trying to ssh to a server via ip. The command was like

ssh -i mykey.pem ubuntu@1.2.3.4

Worked fine for me on Windows, OSX etc but not Ubuntu. Turned out to be a copy/paste issue. The -i was converted to – (which is not the minus char) and was difficult to spot.

Took me a while to work out why him modified command failed, even though DNS, Internet etc was fine on the Ubuntu system, and was using an ip anyway. So thought I'd shae for a quick fix if searching for the above error.


Read full article from ssh: Could not resolve hostname \342\200\223i - to tumble,


error making an ssh tunnel | Official Apple Support Communities



error making an ssh tunnel | Official Apple Support Communities

I'm getting an error trying to create an ssh tunnel.

*ssh –L 10548:localhost:548 username@my.computer.at.work*

returns

*ssh: Error resolving hostname \342\200\223L: nodename nor servname provided, or not known*

normal ssh works ok so the problem is with localhost. This only happens on one of my computers. the other one connects fine using the same internet connection.

Read full article from error making an ssh tunnel | Official Apple Support Communities


Alphabet's moonshots are making more money, still aren't profitable



Alphabet's moonshots are making more money, still aren't profitable

17m ago 1h ago 3h ago 4h ago Hardware sales are also "promising," according to Google CEO Sundar Pichai. Share Tweet Share Save Alphabet , Google's parent company, continues to rake in money hand over fist. In its fourth and final quarter for 2016, the company reported $26.02 billion in revenue, which is a growth of 22 percent compared to this time last year. According to a press release , this performance was led by "mobile search and YouTube," which makes sense since advertising continues to be Google's bread and butter -- $22.4 billion of that revenue came from advertising. This time however, even Alphabet's non-Google properties improved revenue-wise -- it reported $262 million revenue from its Other Bets this quarter, which is an improvement over the $150 million from this time last year. Indeed, Other Bets made $809 million in the entirety of 2016, which is up 82 percent over 2015.

Read full article from Alphabet's moonshots are making more money, still aren't profitable


Alphabet reports Q4 2016 revenue of $26 billion, ‘great momentum’ for Google’s new hardware | 9to5Google



Alphabet reports Q4 2016 revenue of $26 billion, 'great momentum' for Google's new hardware | 9to5Google

-3.52 Alphabet has just published Q4 2016 earnings of $26 billion, up 22% from the same quarter last year. Covering the final three months of the year, these numbers notably include the first holiday season featuring the Google-made Pixel and Home. While beating analyst expectations, the stock is down in after-hours trading. Revenue is up 22% from $21.3 billion in Q4 2015, with net income at $5.3 billion for this quarter. For comparison, Alphabet reported $22.4 billion in revenue and $5 billion in net income last quarter . Not reported separately, Google's hardware sales are grouped together with Play Store sales, enterprise efforts, and more in "Other Revenues." Year-over-year, it is up 62% to $3.4 billion and a notable increase from $2.4 billion last quarter. CFO Ruth Porat notes, "great momentum in Google's newer investment areas and ongoing strong progress in Other Bet." The much-analyzed "Other Bets" is again losing money,

Read full article from Alphabet reports Q4 2016 revenue of $26 billion, 'great momentum' for Google's new hardware | 9to5Google


SimpleDateFormat pitfalls « The Java Explorer



SimpleDateFormat pitfalls « The Java Explorer

Every instance of SimpleDateFormat has an associated time zone to work with, as a TimeZone instance. Otherwise, a parsing operation would not be able to determine an absolute point in time (Date object), from a given string denoting a date. If not specified otherwise, the time zone associated with a new SimpleDateFormat is the default one, corresponding to the time zone reported by the operating system.


Read full article from SimpleDateFormat pitfalls « The Java Explorer


10 Kirkland Products You Should Buy From Costco | Mark Wallengren | KOST 103.5



10 Kirkland Products You Should Buy From Costco | Mark Wallengren | KOST 103.5

1 day ago   Jan 24, 2017 at 4:42pm PST   Oct 4, 2015 at 7:28am PDT   Dec 15, 2015 at 9:58pm PST Yup, beer. And beer aimed right at the sweet spot: light. None of those fancy craft beers. Kirkland Signature Light Beer is your basic watery light, with a hint of plain ol' light beer taste, without Bud Light's off-putting (in my opinion) aftertaste. We've seen it at very nice prices in 30- and 48-packs. Yes, please.   Dec 7, 2016 at 7:55am PST   5. Kirkland Ice Cream May 23, 2014 at 11:13pm PDT At $11 for two half-gallons, it's a bit pricey in my world considering you can usually find a leading ice cream brand such as Breyers on sale at the supermarket for a lot less. Coupons can bring down the supermarket price even more. (Costco doesn't accept manufacturers' coupons.)     A photo posted by @golfnorthwest on Dec 20, 2016 at 10:52am PST Golfers got giddy over Costco's new line of golf balls, so much that they sold out, were restocked – and sold out again right before Christmas.

Read full article from 10 Kirkland Products You Should Buy From Costco | Mark Wallengren | KOST 103.5


Testing for SimpleDateFormat thread safety - Don't Panic!



Testing for SimpleDateFormat thread safety - Don't Panic!

It's a little alarming how many good developers are unaware that many standard Java classes – including subclasses of Format – are not thread safe. Many are also not sure about how their applications perform in a multi-threaded environment or how their web application container (Tomcat) will run their app in multiple threads. This can cause nasty intermittent bugs that can be incredibly hard to find and fix. It's important to be aware of threading issues at development time but it's also important to be able to test for them.


Read full article from Testing for SimpleDateFormat thread safety - Don't Panic!


Mexican President: We will not pay for Trump's wall - CNNPolitics.com



Mexican President: We will not pay for Trump's wall - CNNPolitics.com

Washington (CNN)Mexican President Enrique Peña Nieto said Wednesday his country "will not pay for any wall," defying the claims US President Donald Trump has made. But he did not cancel his trip planned for the United States next week.


Read full article from Mexican President: We will not pay for Trump's wall - CNNPolitics.com


javadoc-The Java API Documentation Generator



javadoc-The Java API Documentation Generator

A doc comment is composed of a main description followed by a tag section - The main description begins after the starting delimiter /** and continues until the tag section. The tag section starts with the first block tag, which is defined by the first @ character that begins a line (ignoring leading asterisks, white space, and leading separator /**). It is possible to have a comment with only a tag section and no main description. The main description cannot continue after the tag section begins. The argument to a tag can span multiple lines. There can be any number of tags -- some types of tags can be repeated while others cannot. For example, this @see starts the tag section:


Read full article from javadoc-The Java API Documentation Generator


Spring MVC: save memory with lazy streams in RESTful services



Spring MVC: save memory with lazy streams in RESTful services

Web applications have recently settled on the "rich client" type of architecture, which means that the V part of the MVC pattern (the View) runs on the client side. A corollary of this is that the server side can now focus on pure data model, a further consequence being that the Web landscape is arriving at something that was a buzzword ten years ago in the Enterprise segment: service-oriented architecture (SOA).

The server side today is almost invariably defined in terms of RESTful web services it provides; well-defined over-the-wire APIs are the norm. I find this development great: all that server-side HTML templating business never found a sweet spot in my heart. In the big picture this means that the focus of the Web is shifting from offering end products to providing value-adding services which the customers can mix and match in creating their own customized user-visible products.


Read full article from Spring MVC: save memory with lazy streams in RESTful services


Specifying Environment Properties



Specifying Environment Properties

You can specify environment properties to the JNDI by using the environment parameter to the InitialContext constructor(in the API reference documentation) and application resource files. Several JNDI standard environment properties could be specified also by using system properties and applet parameters, as described later in this section.

Application Resource Files

To simplify the task of setting up the environment required by a JNDI application, you may distribute application resource files along with application components and service providers. An application resource file has the name jndi.properties. It contains a list of key/value pairs presented in the properties file format (see java.util.Properties). The key is the name of the property (for example, java.naming.factory.object) and the value is a string in the format defined for that property.

Here is an example of an application resource file.

java.naming.factory.object=com.sun.jndi.ldap.AttrsToCorba:com.wiz.from.Person  java.naming.factory.state=com.sun.jndi.ldap.CorbaToAttrs:com.wiz.from.Person  java.naming.factory.control=com.sun.jndi.ldap.ResponseControlFactory  java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory  java.naming.provider.url=ldap://localhost:389/o=jnditutorial  com.sun.jndi.ldap.netscape.schemaBugs=true  

Read full article from Specifying Environment Properties


Sustainable Architectural Design Decisions



Sustainable Architectural Design Decisions

Software architects must create designs that can endure throughout software evolution. Today, software architecture comprises not only a system's core structure but also essential design decisions.1,2 So, to achieve sustainable architectures, we need sustainable design decisions. In correspondence with Heiko Koziolek's definition of architecture sustainability,3 we argue that architectural design decision sustainability involves

  • the time period when the right and relevant decisions remain unchanged, and
  • the cost efficiency of required changes to those decisions.

Read full article from Sustainable Architectural Design Decisions


Melania Trump Doesn't Deserve Your Sympathy 



Melania Trump Doesn't Deserve Your Sympathy 

Advertisement It was just one of many pieces of evidence that Melania Trump deserves sympathy; that she is unhappy, that her husband treats her poorly or, more hopefully, that she hates her husband . In addition to the photograph, other evidence was offered: a video of the couple dancing at the inaugural ball and a side-by-side comparison of former President Obama accompanying Michelle during the 2009 White House transition. Obama is thoughtful, he waits for Michelle before he walks up the steps of their new home to greet then-President George W. Bush. In contrast, Donald Trump greets the Obamas without his wife and she hurries to make her way up the stairs alone, accompanied into the house by the Obamas who are more considerate—more respectful—than her own husband. The images, particularly the comparison to President Obama, reinforce a narrative that is easy enough to believe (likely because it's true): that Obama is a better man than Trump and thus treats women accordingly.

Read full article from Melania Trump Doesn't Deserve Your Sympathy 


Cisco to Buy AppDynamics for $3.7 Billion - WSJ



Cisco to Buy AppDynamics for $3.7 Billion - WSJ

Cisco Systems Inc. is buying software company AppDynamics Inc. for $3.7 billion, plucking the startup from IPO registration at a big premium in an effort to bolster its software offerings to large enterprise customers.

AppDynamics, whose software helps companies including Cisco monitor the performance of their applications, was gearing up to be the first tech company to go public this year. The company was expected to price Wednesday night, and earlier Tuesday bankers increased the IPO's estimated price that would have valued AppDynamics at as high as about $2 billion.


Read full article from Cisco to Buy AppDynamics for $3.7 Billion - WSJ


bash - Get path of current script when executed through a symlink - Unix & Linux Stack Exchange



bash - Get path of current script when executed through a symlink - Unix & Linux Stack Exchange

Try this as a general purpose solution:

DIR="$(cd "$(dirname "$0")" && pwd)"

In the specific case of following symlinks, you could also do this:

DIR="$(dirname "$(readlink -f "$0")")"

Read full article from bash - Get path of current script when executed through a symlink - Unix & Linux Stack Exchange


Reliable way for a bash script to get the full path to itself? - Stack Overflow



Reliable way for a bash script to get the full path to itself? - Stack Overflow

I'm surprised that the realpath command hasn't been mentioned here. My understanding is that it is widely portable / ported.

Your initial solution becomes:

SCRIPT=`realpath $0`  SCRIPTPATH=`dirname $SCRIPT`

And to leave symbolic links unresolved per your preference:

SCRIPT=`realpath -s $0`  SCRIPTPATH=`dirname $SCRIPT`

Read full article from Reliable way for a bash script to get the full path to itself? - Stack Overflow


Opening multiple Eclipse instances on OS X (the easy way) – Yet Another Coder's Blog



Opening multiple Eclipse instances on OS X (the easy way) – Yet Another Coder's Blog

he one application instance only scheme of OS X can be an ache, especially when you do need to work on different workspaces simultaneously and the application at hand does not support it; such as Eclipse. The earliest mention of this problem with Eclipse I found in bug 139319; which was about starting multiple instances of Eclipse on OS X for exactly this purpose. Another related issue (bug 245339) was opened for the purpose of discussing a proper implementation of multi-workspace handling. The prior was closed as RESOLVED WONTFIX due to this.

Six years later Eclipse still cannot handle more than one workspace at a time – and OS X has become fairly popular. Thus several developers have had the same gripes and a few different solutions have come up:

These solutions are all a bit cumbersome and require labour; so I set about to write a small plugin that remedies this by adding a Open Workspace menu item just as in the original request. It will detect the application of the running Eclipse instance and start another in a fashion similar to the Switch Workspace command.


Read full article from Opening multiple Eclipse instances on OS X (the easy way) – Yet Another Coder's Blog


osx - Open multiple Eclipse workspaces on the Mac - Stack Overflow



osx - Open multiple Eclipse workspaces on the Mac - Stack Overflow

  1. Open the command line (Terminal)

  2. Navigate to your Eclipse installation folder, for instance:

    • cd /Applications/eclipse/
    • cd /Developer/Eclipse/Eclipse.app/Contents/MacOS/eclipse
    • cd /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse
    • cd /Users/<usernamehere>/eclipse/jee-neon/Eclipse.app/Contents/MacOS
  3. Launch Eclipse: ./eclipse &

This last command will launch eclipse and immediately background the process.

Rinse and repeat to open as many unique instances of Eclipse as you want.


Read full article from osx - Open multiple Eclipse workspaces on the Mac - Stack Overflow


eclipse - An internal error occurred during: "Updating Maven Project - Stack Overflow



eclipse - An internal error occurred during: "Updating Maven Project - Stack Overflow

This is all you need:

  1. Right-click on your project, select Maven -> Disable Maven Nature.
  2. Open you terminal, go to your project folder and do "mvn eclipse:clean"
  3. Right click on your Project and select "Configure -> Convert into Maven Project"

Read full article from eclipse - An internal error occurred during: "Updating Maven Project - Stack Overflow


eclipse - An internal error occurred during: "Updating Maven Project". java.lang.NullPointerException - Stack Overflow



eclipse - An internal error occurred during: "Updating Maven Project". java.lang.NullPointerException - Stack Overflow

I solved mine by deleting the .settings folder and .project file in the project and then reimporting the project.


Read full article from eclipse - An internal error occurred during: "Updating Maven Project". java.lang.NullPointerException - Stack Overflow


eclipse - An internal error occurred during: "Importing Maven projects". java.lang.NullPointerException - Stack Overflow



eclipse - An internal error occurred during: "Importing Maven projects". java.lang.NullPointerException - Stack Overflow

There may be a spelling mistake with the project 'final name' or other declarations within the pom.xml. You could delete the project from the workspace then import it back. That should at least show some errors in console. You may get this error if you refractored your project name. Somehow, the refractor does not update the references.


Read full article from eclipse - An internal error occurred during: "Importing Maven projects". java.lang.NullPointerException - Stack Overflow


Switching tabs with keyboard - features - Atom Discussion



Switching tabs with keyboard - features - Atom Discussion

most native OS X apps actually use ⇧⌘[ and ⇧⌘] for switching to the next and previous tabs respectively. Atom supports that standard keybinding out of the box.

Read full article from Switching tabs with keyboard - features - Atom Discussion


Keyboard shortcut for cycling through tabs - features - Atom Discussion



Keyboard shortcut for cycling through tabs - features - Atom Discussion

That was the very first thing I fixed. Go to the Atom menu > Open Your Keymap and add:

'body':    'ctrl-tab': 'pane:show-next-item'    'ctrl-shift-tab': 'pane:show-previous-item'

Note that this will cycle in the displayed order, not the most recently used order like ST does.


Read full article from Keyboard shortcut for cycling through tabs - features - Atom Discussion


How do I search across all open files? - support - Atom Discussion



How do I search across all open files? - support - Atom Discussion

From this cheatsheet http://sweetme.at/2014/03/10/atom-editor-cheat-sheet/#atom_find_replace1.5k I found Cmd + Shift + f to do just that.

Read full article from How do I search across all open files? - support - Atom Discussion


The Best Google Play Music Tips and Tricks You May Not Know About



The Best Google Play Music Tips and Tricks You May Not Know About

Google Play Music is an underrated music service that combines a Spotify-like subscription with Pandora-style radio stations and your own music library. Even if you've used it from day one , here are some excellent features you might have overlooked. Identify Songs Playing Around You, Shazam-Style Shazam is awesome at finding out what song is playing over the stereo at the restaurant, but why download a separate app just for that when Google Play Music is already on your phone? Open it up and tap the search bar. The first search suggestion will read "Identify what's playing." Tap this and the app will start listening to the music playing in the room. Once it identifies the song, it will pull it up in search results. From there, you can play the song, save it to your library, or add it to a playlist. Find YouTube Videos For Your Favorite Songs Google Play Music has one huge advantage over other music services: YouTube, and specifically,

Read full article from The Best Google Play Music Tips and Tricks You May Not Know About


osx - Environment variables in Mac OS X - Stack Overflow



osx - Environment variables in Mac OS X - Stack Overflow

There's no need for duplication. You can set environment variables used by launchd (and child processes, i.e. anything you start from Spotlight) using launchctl setenv.

For example, if you want to mirror your current path in launchd after setting it up in .bashrc or wherever:

PATH=whatever:you:want  launchctl setenv PATH $PATH

Read full article from osx - Environment variables in Mac OS X - Stack Overflow


linux - How to show grep result with complete path or file name - Stack Overflow



linux - How to show grep result with complete path or file name - Stack Overflow

Have you tried using the -l flag?

grep -l somethingtosearch

This will return just the paths and file names where the search was found, not the whole lines where the match was made.

Use with -r flag for recursion.


Read full article from linux - How to show grep result with complete path or file name - Stack Overflow


[SOLR-6246] Core fails to reload when AnalyzingInfixSuggester is used as a Suggester - ASF JIRA



[SOLR-6246] Core fails to reload when AnalyzingInfixSuggester is used as a Suggester - ASF JIRA

The idea being that when AnalyzingInfixLookupFactory initially constructs the FSDirectory, it could explicitly configure something like the SingleInstanceLockFactory - that should allow 2 instances of AnalyzingInfixSuggester (in the same JVM) open it at the same time – but then, to prevent corruption risk if both Suggester instances try to write to that Directory, we need to subclass them and customize them to know when the "reload" is taking place, so the old one blocks itself from doing anymore writes.

so suggestions would still be available while waiting for the new core to start, but not updates to the dictionary.


Read full article from [SOLR-6246] Core fails to reload when AnalyzingInfixSuggester is used as a Suggester - ASF JIRA


Change the default startup folder when you open Outlook



Change the default startup folder when you open Outlook

Once in Outlook's main window, click on the File button in the top left corner, and select Options from the Backstage view. In the Outlook Options popup that just opened, select the "Advanced" settings on the left.


Read full article from Change the default startup folder when you open Outlook


Ringing in 2017 with updates to our Google Voice apps



Ringing in 2017 with updates to our Google Voice apps

Ringing in 2017 with updates to our Google Voice apps Jan Jedrzejowicz Product Manager Google Voice When we first introduced Google Voice our goal was to create "one number for life"—a phone number that's tied to you, rather than a single device or a location. Since then, millions of people have signed up to use Google Voice to call, text and get voicemail on all their devices. It's been several years since we've made significant updates to the Google Voice apps (and by several, we mean around five 😉), but today we're bringing a fresh set of features to Google Voice with updates to our apps on Android , iOS and the web . The first thing you'll notice about the updated Google Voice apps is a cleaner, more intuitive design that keeps everything organized. Your inbox now has separate tabs for text messages, calls and voicemails. Conversations stay in one continuous thread, so you can easily see all your messages from each of your contacts in one place.

Read full article from Ringing in 2017 with updates to our Google Voice apps


Save a search by using a Smart Folder in Outlook 2016 for Mac - Outlook for Mac



Save a search by using a Smart Folder in Outlook 2016 for Mac - Outlook for Mac

A Smart Folder, also known as a saved search or a search folder, is a virtual folder that dynamically displays a set of search results. For example, you could create a search to find all the items in the Manager category that are flagged for follow up but not yet completed. This search can be saved as a Smart Folder so that you can use these search criteria later without having to manually re-create the advanced search.


Read full article from Save a search by using a Smart Folder in Outlook 2016 for Mac - Outlook for Mac


OS X Yosemite: Create or modify a Smart Folder



OS X Yosemite: Create or modify a Smart Folder

Smart Folders use search to automatically gather files by type and subject matter. Smart Folders are updated as you change, add, and remove files on your Mac.

Create a Smart Folder

  1. In the Finder, choose File > New Smart Folder, or press Option-Command (⌘)-N.

  2. To search for files, enter a topic, a phrase, or another parameter in the search field.

  3. To determine whether the search should include only the names of files or their entire contents, choose "Name matches" in the menu that appears below the search field, then click Name, then choose either Filename or Everything.

  4. To search for additional specific attributes, click Add (+) below the search field, then make choices using the search attribute pop-up menus appear.

    The menus work in pairs; for example, to search for images, you choose Kind from the pop-up menu on the left, then choose Images from the pop-up menu next to it.

  5. Click Save, then specify a name and location for your Smart Folder.

    If you don't want your Smart Folder to be in the sidebar, deselect Add To Sidebar.

    You can't use certain characters, including punctuation such as a colon (:), in folder names. If an error message appears, try using another name.


Read full article from OS X Yosemite: Create or modify a Smart Folder


Upgrade to Outlook 2016 for Mac



Upgrade to Outlook 2016 for Mac

The process to upgrade to Outlook 2016 for Mac consists of installing the new version and importing data from an earlier version, because Outlook 2016 for Mac and Outlook for Mac 2011 can co-exist on the same computer. The first time you run Outlook 2016 for Mac, you are given the choice to automatically import data from your previous Outlook installation now, or choose to manually import your data later. The automatic import is the preferred option for the following reasons:

  • Faster, seamless experience for the user.

  • Automatically migrates everything from the previous installation: email, calendar, contacts, accounts, and signatures.

  • Auto-detects and fixes any data corruption.

  • Once done, no further user action is required.


Read full article from Upgrade to Outlook 2016 for Mac


FindBugs Bug Descriptions



FindBugs Bug Descriptions

This method uses a try-catch block that catches Exception objects, but Exception is not thrown within the try block, and RuntimeException is not explicitly caught. It is a common bug pattern to say try { ... } catch (Exception e) { something } as a shorthand for catching a number of types of exception each of whose catch blocks is identical, but this construct also accidentally catches RuntimeException as well, masking potential bugs.

A better approach is to either explicitly catch the specific exceptions that are thrown, or to explicitly catch RuntimeException exception, rethrow it, and then catch all non-Runtime Exceptions, as shown below:


Read full article from FindBugs Bug Descriptions


java - Exception is caught when Exception is not thrown - Stack Overflow



java - Exception is caught when Exception is not thrown - Stack Overflow

This is a very famous findbug warning,

according to official documentation this kind of warning is generated when

  • method uses a try-catch block that catches Exception objects, but Exception is not thrown within the try block.
  • sometimes it also is thrown when we use catch(Exception e) to catch all types of exceptions at once, it could mask actual programming problems, so findbugs asks you to catch specific exception, so that run-time exceptions can be thrown which indicate programming problems.

for more understanding(and the solution as well) you can have look at the official documentation.

for your case it seems that statements in try clause do not throw the exception you are handling in catch clause


Read full article from java - Exception is caught when Exception is not thrown - Stack Overflow


Installing an Application from Self Service



Installing an Application from Self Service

This document covers how to install an application from the campus hosted Self Service on a campus Macintosh.

Note: Adobe products can only be installed with no other applications running. It is best to reboot the Mac and run the install at the end of the day so the install can finish cleanly. This is not required for non-Adobe installs, but it is recommended.

Read full article from Installing an Application from Self Service


Self-Service under OS X | University of Oxford Department of Physics



Self-Service under OS X | University of Oxford Department of Physics

The Self-Service Application allows you to update or install preconfigured software onto your Apple Macintosh system without the need for full administrative access to the system.


Read full article from Self-Service under OS X | University of Oxford Department of Physics


LeetCode 488 Zuma Game 解题报告 - Hanker Zheng's



LeetCode 488 Zuma Game 解题报告 - Hanker Zheng's

LeetCode 488 Zuma Game Think about Zuma Game. You have a row of balls on the table, colored red(R), yellow(Y), blue(B), green(G), and white(W). You also have several balls in your hand.

Each time, you may choose a ball in your hand, and insert it into the row (including the leftmost place and rightmost place). Then, if there is a group of 3 or more balls in the same color touching, remove these balls. Keep doing this until no more balls can be removed.

Find the minimal balls you have to insert to remove all the balls on the table. If you cannot remove all the balls, output -1.

Examples:

Input: "WRRBBW", "RB"
Output: -1
Explanation: WRRBBW -> WRR[R]BBW -> WBBW -> WBB[B]W -> WW

Input: "WWRRBBWW", "WRBRW"
Output: 2
Explanation: WWRRBBWW -> WWRR[R]BBWW -> WWBBWW -> WWBB[B]WW -> WWWW -> empty

Input:"G", "GGGGG"
Output: 2
Explanation: G -> G[G] -> GG[G] -> empty

Input: "RBYYBBRRB", "YRBGB"
Output: 3
Explanation: RBYYBBRRB -> RBYY[Y]BBRRB -> RBBBRRB -> RRRB -> B -> B[B] -> BB[B] -> empty

Note: You may assume that the initial row of balls on the table won't have any 3 or more consecutive balls with the same color. The number of balls on the table won't exceed 20, and the string represents these balls is called "board" in the input. The number of balls in your hand won't exceed 5, and the string represents these balls is called "hand" in the input. Both input strings will be non-empty and only contain characters 'R','Y','B','G','W'.


Read full article from LeetCode 488 Zuma Game 解题报告 - Hanker Zheng's


Spring MVC: Difference between context:annotation-config and context:component-scan - Find Nerd



Spring MVC: Difference between context:annotation-config and context:component-scan - Find Nerd

Difference between <context:annotation-config/> vs <context:component-scan/>:

<context:annotation-config/> : <context:annotation-config/> is used to activate all the annotations that are present in java beans and those are already registered using application context file or being registered while component scanning (annotations). The main point is they need to be registered.

<context:component-scan/> : <context:component-scan/> scan packages and classes within given base packages then it find and register beans into ApplicationContext. It does all things that <context:annotation-config/> is supposed to do.

Example:

From the below example you will see the difference between <context:annotation-config/> and <context:component-config/>. Here I'm taking 3 Beans for reference.


Read full article from Spring MVC: Difference between context:annotation-config and context:component-scan - Find Nerd


Avoid unwanted component scanning of Spring Configuration - Lubos Krnac's blog



Avoid unwanted component scanning of Spring Configuration - Lubos Krnac's blog

I came through interesting problem on Stack Overflow. Brett Ryan had problem that Spring Security configuration was initialized twice. When I was looking into his code I spot the problem. Let me show show the code.


Read full article from Avoid unwanted component scanning of Spring Configuration - Lubos Krnac's blog


Customizing HttpMessageConverters with Spring Boot and Spring MVC - DZone Java



Customizing HttpMessageConverters with Spring Boot and Spring MVC - DZone Java

Internally Spring MVC uses a component called a HttpMessageConverter to convert the Http request to an object representation and back.

A set of default converters are automatically registered which supports a whole range of different resource representation formats - json, xml for instance.

Now, if there is a need to customize the message converters in some way, Spring Boot makes it simple. As an example consider if the POST method in the sample above needs to be little more flexible and should ignore properties which are not present in the Hotel entity - typically this can be done by configuring the Jackson ObjectMapper, all that needs to be done with Spring Boot is to create a new HttpMessageConverter bean and that would end up overriding all the default message converters, this way:

Read full article from Customizing HttpMessageConverters with Spring Boot and Spring MVC - DZone Java


java - Spring-using library defined beans conflict with application - Stack Overflow



java - Spring-using library defined beans conflict with application - Stack Overflow

_halObjectMapper looks like the name of the bean created by spring-hateoas via @EnableHypermediaSupport.

Spring boot accepts the bean with name objectMapper if multiple beans of type ObjectMapper exist. You can therefore get round the problem by creating a 3rd object mapper bean with the name objectMapper and could even use one of the existing ObjectMapper beans.


Read full article from java - Spring-using library defined beans conflict with application - Stack Overflow


spring - Requested bean is currently in creation: Is there an unresolvable circular reference? - Stack Overflow



spring - Requested bean is currently in creation: Is there an unresolvable circular reference? - Stack Overflow

Spring uses an special logic for resolving this kind of circular dependencies with singleton beans. But this won't apply to other scopes. There is no elegant way of breaking this circular dependency, but a clumsy option could be this one:


Read full article from spring - Requested bean is currently in creation: Is there an unresolvable circular reference? - Stack Overflow


How to pretty print your JSON with Spring and Jackson - Spring in Practice



How to pretty print your JSON with Spring and Jackson - Spring in Practice

When implementing RESTful web services using Spring Web MVC, by default Spring doesn't pretty print the JSON output. Fortunately this is easy to address when using Java-based configuration. Here's how, using Jackson 2.


Http Message Converters with the Spring Framework | Baeldung



Http Message Converters with the Spring Framework | Baeldung

This article describes how to Configure HttpMessageConverter in Spring.

Simply put, message converters are used to marshall and unmarshall Java Objects to and from JSON, XML, etc – over HTTP.

2. The Basics

2.1. Enable Web MVC

The Web Application needs to be configured with Spring MVC support – one convenient and very customizable way to do this is to use the @EnableWebMvc annotation:


Read full article from Http Message Converters with the Spring Framework | Baeldung


Spring 3.2 content negotiation class cast exception - Stack Overflow



Spring 3.2 content negotiation class cast exception - Stack Overflow

I fixed the problem by removing duplicated <mvc:annotation-driven/> from xml-configuration or @EnableWebMVC annotation from the class because spring documentation warns about that and allowed only once by contract.


Read full article from Spring 3.2 content negotiation class cast exception - Stack Overflow


java - MappingJacksonHttpMessageConverter not found with Spring4 - Stack Overflow



java - MappingJacksonHttpMessageConverter not found with Spring4 - Stack Overflow

There's a newer version of that class in Spring 4: use org.springframework.http.converter.json.MappingJackson2HttpMessageConverter (note the '2').

In my REST servlet's Spring config file I have it configured as follows (I added my custom objectMapper to it, but you can just omit that):


Read full article from java - MappingJacksonHttpMessageConverter not found with Spring4 - Stack Overflow


java - JSON Jackson - exception when serializing a polymorphic class with custom serializer - Stack Overflow



java - JSON Jackson - exception when serializing a polymorphic class with custom serializer - Stack Overflow

You'll need to additionally override serializeWithType within you CustomPetSerializer because IPet is polymorphic. That's also the reason why serialize is not called. Check this related SO question that explains in detail when serializeWithType is called. For instance, your serializeWithType implementation might look something like this:


Read full article from java - JSON Jackson - exception when serializing a polymorphic class with custom serializer - Stack Overflow


Navigate and Fix Errors and Warnings in a Class With Eclipse Keyboard Shortcuts - DZone Java



Navigate and Fix Errors and Warnings in a Class With Eclipse Keyboard Shortcuts - DZone Java

I really don't like it when Eclipse shows errors/warnings annotations in a class. It's sometimes nice to jump from one to the next and clean out a class one line at a time, but most of the time they're just distractions, so I want to be able to find and fix them fast.

So there must be a better way to jump between the errors/warnings  than to use the mouse or page down to the next error. These methods are not only slow but often frustrating because you tend to miss the annotation, especially if it's a big class. And navigating to the Problems view using the keyboard is ok, but sometimes overkill for just clearing out errors/warnings in one class.

A good thing then that Eclipse offers keyboard shortcuts that take you to the next/previous annotation in the class. And it does so in a way that selects the annotation immediately, allowing you to use Quick Fix (Ctrl+1) to fix it fast. So here's how to use these shortcuts to navigate between the error/warning annotations and fix some of the errors easily.


Read full article from Navigate and Fix Errors and Warnings in a Class With Eclipse Keyboard Shortcuts - DZone Java


Cassandra代替Redis? – 后端技术 by Tim Yang



Cassandra代替Redis? – 后端技术 by Tim Yang

最近用Cassandra的又逐渐多了,除了之前的360案例,在月初的QCon Shanghai 2013 篱笆网也介绍了其使用案例。而这篇百万用户时尚分享网站feed系统扩展实践文章则提到了Fashiolista和Instagram从Redis迁移到Cassandra的案例。考虑到到目前仍然有不少网友在讨论Redis的用法问题,Redis是一个数据库、内存、还是Key value store?以及Redis和memcache在实际场景的抉择问题,因此简单谈下相关区别。

首先,Redis和Cassandra完全是适合不同的使用场景的NoSQL产品。前者是适用小规模内存型的key value或者key list数据,后者适合存储大规模数据。因此这篇文章提到切换主要原因或许还是前期Redis使用场景不合适,在初创公司项目初期,以顺手的工具快速实现功能的做法也可以理解。


Read full article from Cassandra代替Redis? – 后端技术 by Tim Yang


Google Code Archive - Long-term storage for Google Code Project Hosting.



Google Code Archive - Long-term storage for Google Code Project Hosting.

Declaring cache semantics directly in the Java source code puts the declarations much closer to the affected code. There is not much danger of undue coupling, because code that is meant to have its results cached is almost always deployed that way anyway.

The ease-of-use afforded by the use of the @Cacheable annotation is best illustrated with an example, which is explained in the text that follows. Consider the following interface and class definition: ``` public interface WeatherDao {


Read full article from Google Code Archive - Long-term storage for Google Code Project Hosting.


Spring caching with Ehcache – CodingpediaOrg



Spring caching with Ehcache – CodingpediaOrg

Are you aware of the Pareto principle, also known as the 80-20 rule, which states that, for many events, roughly 80% of the effects come from 20% of the causes? Well, this principle also holds true for Podcastpedia.org, where most of the traffic is driven by some of the podcasts, and only some of the search criteria are used the most. So why not cache them?

For application caching Podcastpedia uses Ehcache, which is an open source, standards-based cache for boosting performance, offloading your database, and simplifying scalability. It's the most widely-used Java-based cache because it's robust, proven, and full-featured.

This post presents how Ehcache is integrated with Spring, which is the main technology used to develop Podcastpedia.org


Read full article from Spring caching with Ehcache – CodingpediaOrg


Spring Redis Delete does not delete key - Stack Overflow



Spring Redis Delete does not delete key - Stack Overflow

alueOperations does NOT have delete method. So the following won't work:

redisTemplate.opsForValue().delete(key);

Try

redisTemplate.delete(key);

Read full article from Spring Redis Delete does not delete key - Stack Overflow


How do I get the size of a set on Redis? - Stack Overflow



How do I get the size of a set on Redis? - Stack Overflow

You are looking for the SCARD command:

SCARD key

Returns the set cardinality (number of elements) of the set stored at

Return value
Integer reply: the cardinality (number of elements) of the set, or 0 if key does not exist.


Read full article from How do I get the size of a set on Redis? - Stack Overflow


data structures - Why the time complexity of insertion in a redis SET is O(n)? - Stack Overflow



data structures - Why the time complexity of insertion in a redis SET is O(n)? - Stack Overflow

Complexity is not O(n) but O(N) for N members added. Concretely, it means that you can consider that each insertion operation is done in constant time - O(1) - which is only asymptotically true.

Hereunder, we suppose that n is the number of items in the set.

To perform a SADD operation Redis has to first lookup the object representing the set (hash lookup - complexity O(1)), and then try to add the item in the object itself.

The set can be represented in memory as an intset or a hash table.

If the object is a intset (i.e. a sorted vector of integers), it will perform a binary search to search for the position of the item - O(log n) and then eventually, insert the item - O(n) - however this is only for small values of n. The set-max-intset-entries must be chosen so that the whole object fits in the CPU caches for optimal performance.

If the object is a hash table, then Redis will have to perform a lookup and add the item if needed - complexity is O(1).

Because a SADD command can add N items, the resulting asymptotic complexity is O(N).


Read full article from data structures - Why the time complexity of insertion in a redis SET is O(n)? - Stack Overflow


Women’s Marches: Millions of protesters around the country vow to resist Donald Trump - The Washington Post



Women's Marches: Millions of protesters around the country vow to resist Donald Trump - The Washington Post

Millions of women gathered in Washington and cities around the country Saturday to mount a roaring rejoinder to the inauguration of Donald Trump one day earlier. The historic protests of a new president packed cities large and small — from Los Angeles to Boston to Park City, Utah, where celebrities from the Sundance Film Festival joined a march on the snowy streets. In Chicago, the demonstration was overwhelmed by its own size, forcing officials to curtail its planned march when the crowd threatened to swamp the planned route.


Read full article from Women's Marches: Millions of protesters around the country vow to resist Donald Trump - The Washington Post


使用Spring Cache + Redis + Jackson Serializer缓存数据库查询结果中序列化问题的解决 - 王鸿飞的专栏 - 博客频道 - CSDN.NET



使用Spring Cache + Redis + Jackson Serializer缓存数据库查询结果中序列化问题的解决 - 王鸿飞的专栏 - 博客频道 - CSDN.NET

我们希望通过缓存来减少对关系型数据库的查询次数,减轻数据库压力。在执行DAO类的select***(), query***()方法时,先从Redis中查询有没有缓存数据,如果有则直接从Redis拿到结果,如果没有再向数据库发起查询请求取数据。

序列化问题

要把domain object做为key-value对保存在redis中,就必须要解决对象的序列化问题。spring Data Redis给我们提供了一些现成的方案:

  • JdkSerializationRedisSerializer. 使用JDK提供的序列化功能。 优点是反序列化时不需要提供类型信息(class),但缺点是序列化后的结果非常庞大,是JSON格式的5倍左右,这样就会消耗redis服务器的大量内存。
  • Jackson2JsonRedisSerializer. 使用Jackson库将对象序列化为JSON字符串。优点是速度快,序列化后的字符串短小精悍。但缺点也非常致命,那就是此类的构造函数中有一个类型参数,必须提供要序列化对象的类型信息(.class对象)。 通过查看源代码,发现其只在反序列化过程中用到了类型信息。

如果用方案一,就必须付出缓存多占用4倍内存的代价,实在承受不起。如果用方案二,则必须给每一种domain对象都配置一个Serializer,即如果我的应用里有100种domain对象,那就必须在spring配置文件中配置100个Jackson2JsonRedisSerializer,这显然是不现实的。


Read full article from 使用Spring Cache + Redis + Jackson Serializer缓存数据库查询结果中序列化问题的解决 - 王鸿飞的专栏 - 博客频道 - CSDN.NET


Microsoft annoys Chrome users with taskbar pop-up ads in Windows 10 - TechSpot



Microsoft annoys Chrome users with taskbar pop-up ads in Windows 10 - TechSpot

The ads have begun appearing to those testing the still-in-beta Creators Update for Windows. In a short statement due to the initial backlash, A Microsoft spokesperson wrote: "We are always testing new features and information that can help people enhance their Windows 10 experience."

That isn't stopping users from taking to Google's Chrome Web Store to complain about Microsoft's spammy ways and leave one star reviews for the extension in question.

Previously, Microsoft has used the Windows 10 task bar to convince Chrome users to switch to its own browser, with a small notification next to the battery percentage icon telling them that "Chrome is draining your battery faster. Switch to Microsoft Edge for up to 36% more browsing time." 

They also ran a campaign  in 2016 that placed full screen Tomb Raider adds on users' lock screens. Users could opt out by unchecking the box marked 'Get fun facts, tips, tricks and more on your lock screen' in their Windows 10 settings. Some are already speculating that Microsoft might be experimenting with the idea of offering a version of Windows for free, and a paid version that blocks advertising.


Read full article from Microsoft annoys Chrome users with taskbar pop-up ads in Windows 10 - TechSpot


Spring 4 支持的 Java 8 功能 – 码农网



Spring 4 支持的 Java 8 功能 – 码农网

Spring Framework 4支持Java 8语言和API功能。在本文中,我们将关注Spring 4支持的新Java 8功能。最重要的是lambda表达式、方法引用、JSR-310 Date and Time以及可重复注释。

Lambda表达式

Spring代码库使用了大量的函数式接口,使用Java 8,我们可以使用lambda表达式编写更干净、更紧凑的代码。每当期望函数式接口的对象时,我们就可以供给lambda表达式。让我们在讲下一个内容之前先了解函数式接口。


Read full article from Spring 4 支持的 Java 8 功能 – 码农网


Labels

Algorithm (219) Lucene (130) LeetCode (97) Database (36) Data Structure (33) text mining (28) Solr (27) java (27) Mathematical Algorithm (26) Difficult Algorithm (25) Logic Thinking (23) Puzzles (23) Bit Algorithms (22) Math (21) List (20) Dynamic Programming (19) Linux (19) Tree (18) Machine Learning (15) EPI (11) Queue (11) Smart Algorithm (11) Operating System (9) Java Basic (8) Recursive Algorithm (8) Stack (8) Eclipse (7) Scala (7) Tika (7) J2EE (6) Monitoring (6) Trie (6) Concurrency (5) Geometry Algorithm (5) Greedy Algorithm (5) Mahout (5) MySQL (5) xpost (5) C (4) Interview (4) Vi (4) regular expression (4) to-do (4) C++ (3) Chrome (3) Divide and Conquer (3) Graph Algorithm (3) Permutation (3) Powershell (3) Random (3) Segment Tree (3) UIMA (3) Union-Find (3) Video (3) Virtualization (3) Windows (3) XML (3) Advanced Data Structure (2) Android (2) Bash (2) Classic Algorithm (2) Debugging (2) Design Pattern (2) Google (2) Hadoop (2) Java Collections (2) Markov Chains (2) Probabilities (2) Shell (2) Site (2) Web Development (2) Workplace (2) angularjs (2) .Net (1) Amazon Interview (1) Android Studio (1) Array (1) Boilerpipe (1) Book Notes (1) ChromeOS (1) Chromebook (1) Codility (1) Desgin (1) Design (1) Divide and Conqure (1) GAE (1) Google Interview (1) Great Stuff (1) Hash (1) High Tech Companies (1) Improving (1) LifeTips (1) Maven (1) Network (1) Performance (1) Programming (1) Resources (1) Sampling (1) Sed (1) Smart Thinking (1) Sort (1) Spark (1) Stanford NLP (1) System Design (1) Trove (1) VIP (1) tools (1)

Popular Posts