4. Cassandra support



4. Cassandra support

  • Spring configuration support using Java based @Configuration classes or an XML namespace for a Cassandra driver instance and replica sets

  • CassandraTemplate helper class that increases productivity performing common Cassandra operations. Includes integrated object mapping between CQL Tables and POJOs.

  • Exception translation into Spring's portable Data Access Exception hierarchy

  • Feature Rich Object Mapping integrated with Spring's Conversion Service

  • Annotation based mapping metadata but extensible to support other metadata formats

  • Persistence and mapping lifecycle events

  • Java based Query, Criteria, and Update DSLs

  • Automatic implementation of Repository interfaces including support for custom finder methods.


  • Read full article from 4. Cassandra support


    Aspect Oriented Programming with Spring AspectJ and Maven | Java Code Geeks



    Aspect Oriented Programming with Spring AspectJ and Maven | Java Code Geeks

    Nevertheless Spring AOP framework comes with certain limitations in comparison to a complete AOP implementation, such as AspectJ. The most common problems people encounter while working with Spring AOP framework derive from the fact that Spring AOP is "proxy – based". In other words when a bean is used as a dependency and its method(s) should be advised by particular aspect(s) the IoC container injects an "aspect – aware" bean proxy instead of the bean itself. Method invocations are performed against the proxy bean instance, transparently to the user, in order for aspect logic to be executed before and/or after delegating the call to the actual "proxy–ed" bean.


    Read full article from Aspect Oriented Programming with Spring AspectJ and Maven | Java Code Geeks


    aspectj and sprint AOP | JOE's space



    aspectj and sprint AOP | JOE's space

    "Crosscutting" is how to characterize a concern than spans multiple units of OO modularity – classes and objects. Crosscutting concerns resist modularization using normal OO constructs, but aspect-oriented programs can modularize crosscutting concerns.


    Read full article from aspectj and sprint AOP | JOE's space


    Maven Java web project not recognised when importing into Eclipse - Stack Overflow



    Maven Java web project not recognised when importing into Eclipse - Stack Overflow

    Try selecting the project in the Package Explorer and performing Maven --> Update Project Configuration


    Read full article from Maven Java web project not recognised when importing into Eclipse - Stack Overflow


    (5) What are the advantages of Amazon EMR, vs. your own EC2 instances, vs. running Hadoop locally? - Quora



    (5) What are the advantages of Amazon EMR, vs. your own EC2 instances, vs. running Hadoop locally? - Quora

    COST - EC2 is costly - EMR is even more costly.

    If you got a local setup & have Static IP - this should be saving you thousands of $s - and we did - we are migrating slowly to local / private cloud for our Big Data Operations.

    Note: it all comes with the operational cost of Maintenance & Responsibility of maintaining Storage, Networking, etc - but worth all the effort on daily run basis.

    Read full article from (5) What are the advantages of Amazon EMR, vs. your own EC2 instances, vs. running Hadoop locally? - Quora


    A Complete Guide To Tomcat Start-Up: Manual, Automatic, and Remote | MuleSoft



    A Complete Guide To Tomcat Start-Up: Manual, Automatic, and Remote | MuleSoft

    Most users will find it easiest to simple run "startup" from the command-line, which will start Tomcat normally, with output and error streams being written to the standard Catalina.out log file.

    However, if you'd like to watch the server start up right in the terminal, you can use "catalina" with the "run" parameter to prevent these log streams from being redirected.

    A number of other parameters can be used with "catalina" as well; notably, these include "jpda start", used to start Tomcat as a Java Platform Debugger Architecture for remote debugging, and "-config [path/to/alt/server.xml]", which allows you to specify an alternate "server.xml" configuration file to use during start-up.


    Read full article from A Complete Guide To Tomcat Start-Up: Manual, Automatic, and Remote | MuleSoft


    java - How to assertThat something is null with Hamcrest? - Stack Overflow



    java - How to assertThat something is null with Hamcrest? - Stack Overflow

    You can use IsNull.nullValue() method:

    import static org.hamcrest.Matchers.is;  import static org.hamcrest.Matchers.nullValue;    assertThat(attr.getValue(), is(nullValue()));

    Read full article from java - How to assertThat something is null with Hamcrest? - Stack Overflow


    Understanding Spark Caching | Sujee Maniyam



    Understanding Spark Caching | Sujee Maniyam

  • For small data sets (few hundred megs) we can use raw caching.  Even though this will consume more memory, the small size won't put too much pressure on Java garbage collection.
  • Raw caching is also good for iterative work loads (say we are doing a bunch of iterations over data).  Because the processing is very fast
  • For medium / large data sets (10s of Gigs or 100s of Gigs) serialized caching would be helpful.  Because this will not consume too much memory.  And garbage collecting gigs of memory can be taxing

  • Read full article from Understanding Spark Caching | Sujee Maniyam


    java - Apache spark in memory caching - Stack Overflow



    java - Apache spark in memory caching - Stack Overflow

    To uncache explicitly, you can use RDD.unpersist()

    If you want to share cached RDDs across multiple jobs you can try the following:

    1. Cache the RDD using a same context and re-use the context for other jobs. This way you only cache once and use it many times
    2. There are 'spark job servers' that exist to do the above mentioned functionality. Checkout Spark Job Server open sourced by Ooyala.
    3. Use an external caching solution like Tachyon

    Read full article from java - Apache spark in memory caching - Stack Overflow


    Big Data Analytics: Spark | Haifeng's Random Walk



    Big Data Analytics: Spark | Haifeng's Random Walk

    In the previous post, we discussed MapReduce. Although it is great for large scale data processing, it is not friendly for iterative algorithms or interactive analytics because the data have to be repeatedly loaded for each iteration or be materialized and replicated on the distributed file system between successive jobs. Apache Spark is designed to solve this problem in means of in-memory computing. The overall framework and parallel computing model of Spark is similar to MapReduce but with an important innovation, reliant distributed dataset (RDD).


    Read full article from Big Data Analytics: Spark | Haifeng's Random Walk


    [SPARK-1103] [WIP] Automatic garbage collection of RDD, shuffle and broadcast data by tdas · Pull Request #126 · apache/spark



    [SPARK-1103] [WIP] Automatic garbage collection of RDD, shuffle and broadcast data by tdas · Pull Request #126 · apache/spark

    This PR allows Spark to automatically cleanup metadata and data related to persisted RDDs, shuffles and broadcast variables when the corresponding RDDs, shuffles and broadcast variables fall out of scope from the driver program. This is still a work in progress as broadcast cleanup has not been implemented.


    Read full article from [SPARK-1103] [WIP] Automatic garbage collection of RDD, shuffle and broadcast data by tdas · Pull Request #126 · apache/spark


    How far will Spark RDD cache go? - Stack Overflow



    How far will Spark RDD cache go? - Stack Overflow

    The whole idea of cache is that spark is not keeping the results in memory unless you tell it too. So if you cache the last RDD in the chain it only keeps the results of that one in memory. So yes you do need to cache them separately, keep in mind you only need to cache an RDD if you are going to use it more than once, for example:

    rdd4.cache()  val v1 = rdd4.lookup("key1")  val v2 = rdd4.lookup("key2")  

    If you do not call cache in this case rdd4 will be recalculated for every call to lookup (or any other function that requires evaluation). You might want to read the paper on RDD's it is pretty easy to understand and explains the ideas behind certain choices they made regarding how RDD's work.

    share|improve this answer
        
    Appreciate your answer. So whenever there will be a fork, you need to cache that rdd to reduce the repetitive computation. The only pain is to unpersist on the cached rdd (since I have multiple-fork on my rdd transformation). I will read the paper again. Thanks –  EdwinGuo Sep 2 '14 at 16:35
        
    @EdwinGuo don't quote me on this but I think most people find that taking the extra time to unpersist is usually more trouble than it's worth, it's better to let the JVM handle this as unresisting is a very expensive operation –  aaronman Sep 2 '14 at 16:39
        
    ok, should I open up another question regarding that? trying to search on unpersist, no luck. "Mark the RDD as non-persistent, and remove all blocks for it from memory and disk." from the gitHub, did not mention to much –  EdwinGuo Sep 2 '14 at 16:57
        
    @EdwinGuo if you need to, I would search the spark user group before asking –  aaronman Sep 2 '14 at 17:16
    1  
    Another approach to caching i heard about is more recent versions of spark may support automatic unpersisting using user defined priorities e.g. FIFO –  samthebest Sep 3 '14 at 4:36

    Read full article from How far will Spark RDD cache go? - Stack Overflow


    Mark Occurrences



    Mark Occurrences

    The types of elements whose occurrences will be highlighted can be configured in the Mark Occurrences preferences page (Window | Preferences | PHP | Editor | Mark Occurrences ).


    Read full article from Mark Occurrences


    java - Mocking member variables of a class using Mockito - Stack Overflow



    java - Mocking member variables of a class using Mockito - Stack Overflow

    Then in your test set-up, you can use the whenNew method to have the constructor return a mock

    whenNew(Second.class).withAnyArguments().thenReturn(mock(Second.class));

    Read full article from java - Mocking member variables of a class using Mockito - Stack Overflow


    syntax - Is it possible to make anonymous inner classes in Java static? - Stack Overflow



    syntax - Is it possible to make anonymous inner classes in Java static? - Stack Overflow

    No, you can't, and no, the compiler can't figure it out. This is why FindBugs always suggests changing anonymous inner classes to named static nested classes if they don't use their implicit this reference.

    Edit: Tom Hawtin - tackline says that if the anonymous class is created in a static context (e.g. in the main method), the anonymous class is in fact static. But the JLS disagrees:

    An anonymous class is never abstract (§8.1.1.1). An anonymous class is always an inner class (§8.1.3); it is never static (§8.1.1, §8.5.1). An anonymous class is always implicitly final (§8.1.1.2).


    Read full article from syntax - Is it possible to make anonymous inner classes in Java static? - Stack Overflow


    Spying with Mockito - to call or not to call a method | stevenschwenke.de



    Spying with Mockito - to call or not to call a method | stevenschwenke.de

    1. when(bloMock.doSomeStuff()).thenReturn(1);

    and

    1. doReturn(1).when(bloMock).doSomeStuff();

    The very important difference is that the first option will actually call the doSomeStuff()- method while the second will not. Both will cause doSomeStuff() to return the desired 1.


    Read full article from Spying with Mockito - to call or not to call a method | stevenschwenke.de


    What is the keyboard shortcut to sleep display ... | Apple Support Communities



    What is the keyboard shortcut to sleep display ... | Apple Support Communities

    I do not like using a Hot Corner (alone) because it is too easy to inadvertently sleep the screen by random movement of the the cursor. However, there is a solution....

     

    You can add a "modifier key" (e.g., the "Command" key) to the hot corner sequence so that moving the cursor to the chosen hot corner does NOT sleep the screen unless you also push and hold the modifier key.

     

    To add a modifier key, open "System Preferences", go to "Desktop & Screen Saver", choose the "Screen Saver" tab, and click on "Hot Corners…". Open the dropdown for the corner you prefer. Before clicking "Put Display to Sleep" hold down the Command key (or another modifier key*)  and then click "Put Display to Sleep".


    Read full article from What is the keyboard shortcut to sleep display ... | Apple Support Communities


    OS X Mavericks: Create keyboard shortcuts for apps



    OS X Mavericks: Create keyboard shortcuts for apps

  • Choose Apple menu > System Preferences, then click Keyboard.
  • Click Shortcuts, select App Shortcuts, then click Add (+).
  • Choose an app from the Application pop-up menu. If you want to set the same key combination for a menu command that appears in many apps, choose All Applications.

    If the app you want to select does not appear in the list, choose Other and locate it using the Open dialog. Some apps may not allow you to set keyboard shortcuts.


  • Read full article from OS X Mavericks: Create keyboard shortcuts for apps


    android - Adding file to .apk - Stack Overflow



    android - Adding file to .apk - Stack Overflow

    You can save it in /res/raw folder
    If you save your file as yourfile.txt

    InputStream inputStream = this.getResources().openRawResource(R.raw.yourfile);

    Read full article from android - Adding file to .apk - Stack Overflow


    Android - add files into APK package? - Stack Overflow



    Android - add files into APK package? - Stack Overflow

    The assets/ folder in apk is intended to store any extra user files in any formats. They will be included to apk automatically on compilation stage and can be accessed from the app using getAssets() function. For example:

        final InputStream is = getResources().getAssets().open("some_file.xml")

    It is even unnecessary to copy them to some local folder to read them.


    Read full article from Android - add files into APK package? - Stack Overflow


    coderwall.com : establishing geek cred since 1305712800



    coderwall.com : establishing geek cred since 1305712800

    Some people are developers. Some of them have secure sites. What's more incredible, some want to test their websites on mobile phones with a environment as similar as possible to the production one, so they want to use a self-signed SSL certificate. Then, why it's so difficult to do it?


    Read full article from coderwall.com : establishing geek cred since 1305712800


    Get certificate and add it to a Java truststore, when only having https URL? - Stack Overflow



    Get certificate and add it to a Java truststore, when only having https URL? - Stack Overflow

    openssl s_client -connect android.googleapis.com:443

    s_client is a "generic SSL/TLS client which connects to a remote host using SSL/TLS", and among other things it prints out the server certificate it received from the remote server. It isn't an HTTP client, so it doesn't know to follow the 301 redirect, it'll just give you the certificate of the initial server you connected to.


    Read full article from Get certificate and add it to a Java truststore, when only having https URL? - Stack Overflow


    java - HTTPS GET (SSL) with Android and self-signed server certificate - Stack Overflow



    java - HTTPS GET (SSL) with Android and self-signed server certificate - Stack Overflow

    WARNING: for anybody else arriving at this answer, this is a dirty, horrible hack and you must not use it for anything that matters. SSL/TLS without authentication is worse than no encryption at all - reading and modifying your "encrypted" data is trivial for an attacker and you wouldn't even know it was happening.

    Still with me? I feared so...


    Read full article from java - HTTPS GET (SSL) with Android and self-signed server certificate - Stack Overflow


    Introduction to Wi-Fi Network Security



    Introduction to Wi-Fi Network Security

    Encryption type options available depend on the Security type chosen. Besides None, which can be only used with Open networks, the WEP option can be used with either WEP or 802.1X authentication. Two other options, called TKIP and AES, refer to specialized encryption technologies usable with the WPA family of Wi-Fi security standards.

    Read full article from Introduction to Wi-Fi Network Security


    How to Find Wi-Fi Security Encryption Type of a Router from Mac OS X



    How to Find Wi-Fi Security Encryption Type of a Router from Mac OS X

    You can also use the option-click trick to discover the security and encryption protocols in use on other networks that are within range, even if you're not connected to them and have never connected the Mac to them. To do this, simply hover the mouse over the other wireless router names to see the little pop-up box shown in the screenshot:


    Read full article from How to Find Wi-Fi Security Encryption Type of a Router from Mac OS X


    How can I find out whether a WiFi’s security is WEP, WPA or WPA2?



    How can I find out whether a WiFi's security is WEP, WPA or WPA2?

    1.Go to Control Panel -> Network and Internet -> Network and Sharing Center.
    2.Click on Manage wireless networks on the left pane.
    3..Right Click your wireless network connection and select Properties.
    4.Click on Security tab.

    Read full article from How can I find out whether a WiFi's security is WEP, WPA or WPA2?


    Pre-Shared Keys (WEP, WPA/WPA2-Personal) - Meraki Documentation



    Pre-Shared Keys (WEP, WPA/WPA2-Personal) - Meraki Documentation

    A pre-shared key (PSK) allows anyone who has the key to use the wireless network.

    Wired Equivalent Privacy (WEP) is the original 802.11 pre-shared key mechanism, utilizing RC4 encryption. WEP is vulnerable to being hacked; the encryption key can be derived by an eavesdropper who sees enough traffic. Only use WEP if it is not possible to utilize more advanced security—for instance, when there are legacy client devices in the network that do not support WPA/WPA2.

    WPA- and WPA2-Personal (Wi-Fi Protected Access) use stronger encryption than WEP. (WPA-Personal uses TKIP with RC4 encryption, while WPA2- Personal uses AES encryption.) WPA2-Personal is preferred.


    Read full article from Pre-Shared Keys (WEP, WPA/WPA2-Personal) - Meraki Documentation


    ADB with multiple devices - Shockoe



    ADB with multiple devices - Shockoe

    As you can see, we have three devices attached to our system. Two emulators and one physical phone. Now let's logcat our physical device because it's running our application that we want to debug. Just pass the -d switch to adb to target our device.

    $ adb -d logcat

    If we had a single emulator instance and one or more physical devices attached we could pass in the -e switch to adb which targets emulator.

    $ adb -e logcat

    The final switch we can use for device targeting is the -s switch, which stands for serial number.

    $ adb -s emulator-5554 logcat
    $ adb -s emulator-5556 logcat
    $ adb -s HT09PR217646 logcat


    Read full article from ADB with multiple devices - Shockoe


    How do I get the logfile from an Android device? - Stack Overflow



    How do I get the logfile from an Android device? - Stack Overflow

    The -d option dumps the entire circular buffer into the text file and if you are looking for a particular action/intent try

    $adb logcat -d | grep 'com.whatever.you.are.looking.for' -B 100 -A 100 > shorterlog.txt

    Read full article from How do I get the logfile from an Android device? - Stack Overflow


    android - Permission denied (missing INTERNET permission?) - Stack Overflow



    android - Permission denied (missing INTERNET permission?) - Stack Overflow

    Did you try giving permission above the application tag?

    You should take care of order in which tags are defined in Manifest.xml.

    See structure of Manifest

    Edited:

    <uses-permission android:name="android.permission.INTERNET" />      <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />      <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />      <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />      <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />      <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />    <application      ... >

    Details:

    Order of defining tabs in Manifest:

    1. Permissions
    2. Applications
    3. Receiver, Service, Metadata

    Read full article from android - Permission denied (missing INTERNET permission?) - Stack Overflow


    networking - android.os.NetworkOnMainThreadException - Stack Overflow



    networking - android.os.NetworkOnMainThreadException - Stack Overflow

    You should almost always do what the accepted answer recommends, but if you really really know better and must do it synchronously, you can override the default behavior as follows.


    Read full article from networking - android.os.NetworkOnMainThreadException - Stack Overflow


    Where is android studio building my .apk file? - Stack Overflow



    Where is android studio building my .apk file? - Stack Overflow

    YourApplication\app\build\outputs\apk


    Read full article from Where is android studio building my .apk file? - Stack Overflow


    Android: how to set Wifi settings to access Internet connection in Android simulator? - Stack Overflow



    Android: how to set Wifi settings to access Internet connection in Android simulator? - Stack Overflow

    Try using these Android permissions.

    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission>  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>

    Read full article from Android: how to set Wifi settings to access Internet connection in Android simulator? - Stack Overflow


    (5) What is the best replacement for Fiddler on a Mac? - Quora



    (5) What is the best replacement for Fiddler on a Mac? - Quora

    I need some awesome packet sniffing / HTTP debugging with configurable filtering rules that can easily show me:
    - HTTP Request and Response Headers
    - GET and POST Parameters in the Request and Response
    - Actual Content of Connection (view image or text)

    Read full article from (5) What is the best replacement for Fiddler on a Mac? - Quora


    How to automate login a website - Java example



    How to automate login a website – Java example

    In this example, we will show you how to login a website via standard Java HttpsURLConnection. This technique should be working in most of the login form.

    Tools & Java Library used in this example

    1. Google Chrome Browser – Network tab to analyze HTTP request and response header fields.
    2. jsoup library – Extracts HTML form values.
    3. JDK 6.

    Read full article from How to automate login a website – Java example


    Android’s HTTP Clients | Android Developers Blog



    Android's HTTP Clients | Android Developers Blog

    Apache HTTP client has fewer bugs on Eclair and Froyo. It is the best choice for these releases.

    For Gingerbread and better, HttpURLConnection is the best choice. Its simple API and small size makes it great fit for Android. Transparent compression and response caching reduce network use, improve speed and save battery. New applications should use HttpURLConnection; it is where we will be spending our energy going forward.


    Read full article from Android's HTTP Clients | Android Developers Blog


    android - URLConnection or HTTPClient : Which offers better functionality and more efficiency? - Stack Overflow



    android - URLConnection or HTTPClient : Which offers better functionality and more efficiency? - Stack Overflow

    Apache HTTPClient has fewer bugs on Eclair and Froyo. It is the best choice for these releases.

    For Gingerbread and better, HttpURLConnection is the best choice. Its simple API and small size makes it great fit for Android. Transparent compression and response caching reduce network use, improve speed and save battery. New applications should use HttpURLConnection; it is where Google will be spending its energy going forward.


    Read full article from android - URLConnection or HTTPClient : Which offers better functionality and more efficiency? - Stack Overflow


    Apache HttpComponents - HttpClient for Android



    Apache HttpComponents - HttpClient for Android

    Differences with the stock version of Apache HttpClient

    1. Compiled against HttpClient 4.0 APIs.
    2. Commons Logging replaced with Android Logging.
    3. Base64 implementation from Commons Codec replaced with Android Base64.
    4. Android default SSLSocketFactory used by for SSL/TLS connections.

    Compatibility notes

    1. HttpClient port for Android is compiled against the official Android SDK and is expected to be fully compatible with any code consuming HttpClient services through its interface (HttpClient) rather than the default implementation (DefaultHttpClient).
    2. Code compiled against stock versions of Apache HttpClient 4.3 is not fully compatible with the HttpClient port for Android. Some of the implementation classes had to be copied (or shaded) with different names in order to avoid conflicts with the older versions of the same classes included in the Android runtime. One can increase compatibility of with the stock version of HttpClient by avoiding 'org.apache.http.**.*HC4' classes.

    Read full article from Apache HttpComponents - HttpClient for Android


    wi fi - Can I automatically log in to open WiFi that requires web login/password? - Android Enthusiasts Stack Exchange



    wi fi - Can I automatically log in to open WiFi that requires web login/password? - Android Enthusiasts Stack Exchange

    The best you can do is set it up to auto-connect to the network and then manually open a browser when you're in range. Save the username and password in the browser. That gets it down to 2 clicks (er... touches). Make sure Remember Passwords is on the the browser's settings.


    Read full article from wi fi - Can I automatically log in to open WiFi that requires web login/password? - Android Enthusiasts Stack Exchange


    What Is a WEP Key in Wi-Fi Networking?



    What Is a WEP Key in Wi-Fi Networking?

    Answer: A WEP key is a security code system for Wi-Fi networks. WEP keys allow a group of devices on a local network (such as a home network) to exchange encoded messages with each other while hiding the contents of the messages from easy viewing

    Read full article from What Is a WEP Key in Wi-Fi Networking?


    How to Crack a Wi-Fi Network's WEP Password with BackTrack



    How to Crack a Wi-Fi Network's WEP Password with BackTrack

    Unless you're a computer security and networking ninja, chances are you don't have all the tools on hand to get this job done. Here's what you'll need:


    Read full article from How to Crack a Wi-Fi Network's WEP Password with BackTrack


    Android button example



    Android button example

    In Android, just use "android.widget.Button" class to display a normal button.

    In this tutorial, we show you how to display a normal button, add a click listener, when user click on the button, open an URL in your Android's internet browser.

    P.S This project is developed in Eclipse 3.7, and tested with Android 2.3.3.


    Read full article from Android button example


    Tutorial For Android: Turn off, Turn on wifi in android using code tutorial



    Tutorial For Android: Turn off, Turn on wifi in android using code tutorial

    Explanation
    Get the Wifi service from our system
    wifiManager = (WifiManager) this.getSystemService(Context.WIFI_SERVICE);

    Check the our wifi is currently turned on or turned off
    if(wifiManager.isWifiEnabled()){

    Turn on/off our wifi
    wifiManager.setWifiEnabled(<true|false>);

    Read full article from Tutorial For Android: Turn off, Turn on wifi in android using code tutorial


    What is Context in Android? - Stack Overflow



    What is Context in Android? - Stack Overflow

    As the name suggests, its the context of current state of the application/object. It lets newly created objects understand what has been going on. Typically you call it to get information regarding another part of your program (activity, package/application)


    Read full article from What is Context in Android? - Stack Overflow


    ide - What is the shortcut to Auto import all in Android Studio? - Stack Overflow



    ide - What is the shortcut to Auto import all in Android Studio? - Stack Overflow

    By changing the keymaps settings you can use the same keyboard short cuts as in Eclipse (Or your favourite IDE)

    File -> Settings -> KeyMap

    change keymaps settings to eclipse so that you can use the short cut keys like in eclipse.


    Read full article from ide - What is the shortcut to Auto import all in Android Studio? - Stack Overflow


    Organize imports is still "CTRL + SHIFT and O" Right? | Treehouse Forum



    Organize imports is still "CTRL + SHIFT and O" Right? | Treehouse Forum

    In Android Studio, there is a way to automatically organize imports as you type. If you are on a Mac, go to Android Studio -> Preferences (on Windows I think it's under File -> Settings), and then under Editor -> Auto Import, you can change the settings to look like this.


    Read full article from Organize imports is still "CTRL + SHIFT and O" Right? | Treehouse Forum


    3 Ways to Find the SSID on a Computer - wikiHow



    3 Ways to Find the SSID on a Computer - wikiHow

    Find your current SSID. The network that you are connected to will be indicated by a checkmark "✓". The SSID is the network's name.
    • Hold the Option key when clicking the Wireless icon to see additional information about your current network.

    Read full article from 3 Ways to Find the SSID on a Computer - wikiHow


    YouTube's Absurd 60FPS, 4K Videos Are Too Awesome For Your Computer | Gizmodo Australia



    YouTube's Absurd 60FPS, 4K Videos Are Too Awesome For Your Computer | Gizmodo Australia

    Google is working on an exciting new feature for YouTube: videos you can't watch! Blame your shitty computer and internet connection.

    YouTube has been slowly preparing for the pixel-filled video streaming future. In August last year, the mobile app began supporting Quad HD content and YouTube got a buttery 60 frames-per-second upgrade a few months later. Next stop, 4K.


    Read full article from YouTube's Absurd 60FPS, 4K Videos Are Too Awesome For Your Computer | Gizmodo Australia


    32.15 How to use Working Sets for filtering Problems/Task/Search views?



    32.15 How to use Working Sets for filtering Problems/Task/Search views?

    enable

    Read full article from 32.15 How to use Working Sets for filtering Problems/Task/Search views?


    Eclipse Problems View: Only Show Problems for Project | MCU on Eclipse



    Eclipse Problems View: Only Show Problems for Project | MCU on Eclipse

    Show Error/Warnings on Project

    A better way in my view is to use this: There is an option in the Problems view to just show the messages for the currently active/selected project:


    Read full article from Eclipse Problems View: Only Show Problems for Project | MCU on Eclipse


    Filtering the Problems View in Eclipse | Rick's Tech Talk



    Filtering the Problems View in Eclipse | Rick's Tech Talk

    package

    Read full article from Filtering the Problems View in Eclipse | Rick's Tech Talk


    How to use just one scala library for maven/eclipse/scala - Stack Overflow



    How to use just one scala library for maven/eclipse/scala - Stack Overflow

    There is nothing to worry about. Eclipse warns you that you have several scala-library.jars on your classpath, but as long as they are the same version, it doesn't matter.

    If one of them diverged (for instance, by bumping the Scala version number in your pom file), you'd be in trouble: depending on the classpath order, the IDE will pick up classes from one or the other, and you might get different results when building on the command line.

    Coming back to your setup, you could

    • remove the Scala Library classpath container from your Eclipse projects, leaving just the jar that maven adds.
    • ignore the warning

    Read full article from How to use just one scala library for maven/eclipse/scala - Stack Overflow


    Build failure for Scala, Maven and Java integration - Stack Overflow



    Build failure for Scala, Maven and Java integration - Stack Overflow

    I would recommend using the net.alchim31.maven:scala-maven-plugin to do your compilation. You can then set the argument to the compiler -Yresolve-term-conflict:object.


    Read full article from Build failure for Scala, Maven and Java integration - Stack Overflow


    Maven: The Complete Reference - 6.1. Maven Command Line Options - Sonatype.com



    Maven: The Complete Reference - 6.1. Maven Command Line Options - Sonatype.com

    The following sections detail Maven's command line options. 6.1.1. Defining Properties To define a property use the following option on the command line: -D, --define Defines a system property This is the option most frequently used to customized the behavior of Maven plugins. Some examples of using the -D $ mvn help:describe -Dcmd=compiler:compile $ mvn install -Dmaven.test.skip=true Properties defined on the command line are also available as properties to be used in a Maven POM or Maven Plugin. Form more information about referencing Maven properties, see Chapter 9, Properties and Resource Filtering . Properties can also be used to activate build profiles. For more information about Maven build profiles, see Chapter 5, Build Profiles . 6.1.2. Getting Help To list the available command line parameters, use the following command line option: -h, --help $ mvn --help usage: mvn [options] [] [] Options: -am,--also-makeIf project list is specified,

    Read full article from Maven: The Complete Reference - 6.1. Maven Command Line Options - Sonatype.com


    unsatisfied dependency scalaz-stream_2.10-0.5a for specs2_2.10:2.4.4 - Google Groups



    unsatisfied dependency scalaz-stream_2.10-0.5a for specs2_2.10:2.4.4 - Google Groups

    Sorry I forgot to mention that you need to add the bintray repo to your resolvers:

    "Scalaz Bintray Repo"  at "http://dl.bintray.com/scalaz/releases"

    Read full article from unsatisfied dependency scalaz-stream_2.10-0.5a for specs2_2.10:2.4.4 - Google Groups


    scala - comparing sbt and Gradle - Stack Overflow



    scala - comparing sbt and Gradle - Stack Overflow

    Note that one key differecen between SBT and Gradle is its dependency management: SBT: Ivy, with a a revision which can be given as a fixed one (1.5.2, for instance) or as latest (or dynamic) one. See "Ivy Dependency" That means the "-SNAPSHOT" mechanism support can be problematic, even though Mark Harrah details in this thread: It is true the cache can get confused, but it is not true that Ivy doesn't understand resolving snapshots. Eugene explained this point in another thread, perhaps on the admin list. There is an issue with sbt's auto-update that was addressed in 0.12. What Ivy does not support, as far as I know, is publishing snapshots in the manner Maven does. I believe I have stated this elsewhere, but if anyone wants to improve the situation, my opinion is that effort is best spent working with the Gradle team to reuse their dependency management code. Gradle: This thread mentions (Peter Niederwieser): Just to let you know,

    Read full article from scala - comparing sbt and Gradle - Stack Overflow


    Richard Goulter's Blog - Gradle or SBT



    Richard Goulter's Blog - Gradle or SBT

    Motivation Somehow I find the current setup less ideal than it should be. Here's the "problem" for-which gradle and sbt are a couple of build systems which provide the "solution": I've a bunch of Scala code which depends on Java sources generated from an Antlr 4 grammar. It would be nice to be able to build these easily from the command line without locking it down to a particular IDE. (Bonus points for being able to generate just the Antlr 4 files themselves). It would be nice to be able to automatically generate Eclipse project files. JVM Build Systems – In terms of these JVM-related build-systems, the story goes something like this: ant used to be the big guy, but then maven came along which allowed for automatic dependency resolution. (It would download specified dependencies for the project). ant got ivy to help with this. However, ant and maven are both written in XML; maven has more conventions such-that while every maven repo looks the same,

    Read full article from Richard Goulter's Blog - Gradle or SBT


    java - Debugging methods in Scala library from Eclipse - Stack Overflow



    java - Debugging methods in Scala library from Eclipse - Stack Overflow

    Well, it's gonna be quite non-trivial if you don't install the Scala plugin for Eclipse, you can find it here:

    http://scala-ide.org

    Scala is compiled for the JVM so you will be able to debug it without the plugin. Theoretically. The practical issue is that the class file contains tons of generated stuff which can be extremely hard to understand (even for guys who're pro how Scala translates its concepts, e.g., anonymous functions into bytecode).

    Just an example: you'll have to deal with monsters like scala.some.Class$$anon$1$$anonfun$someFunction$1$2$$anonfun$apply$2.apply. It is far-far easier if you install the plugin and see something like c -> c.somefunction( println(e)).

    So try to find out which version of Scala was used for your dependency, install the required Scala IDE for that Scala version, attach the source and you'll be able to debug.


    Read full article from java - Debugging methods in Scala library from Eclipse - Stack Overflow


    Why is my JVM having access to less memory than specified via -Xmx? - Plumbr



    Why is my JVM having access to less memory than specified via -Xmx? – Plumbr

    February 11, 2015 by Nikita Salnikov-Tarnovski “Hey, can you drop by and take a look at something weird”. This is how I started to look into a support case leading me towards this blog post. The particular problem at hand was related to different tools reporting different numbers about the available memory. In short, one of the engineers was investigating the excessive memory usage of a particular application which, by his knowledge was given 2G of heap to work with. But for whatever reason, the JVM tooling itself seemed to have not made up their mind on how much memory the process really has. For example jconsole guessed the total available heap to be equal to 1,963M while jvisualvm claimed it to be equal to 2,048M. So which one of the tools was correct and why was the other displaying different information? It was indeed weird, especially seeing that the usual suspects were eliminated – the JVM was not pulling any obvious tricks as:

    Read full article from Why is my JVM having access to less memory than specified via -Xmx? – Plumbr


    Unsigned Integer Arithmetic API now in JDK 8 (Joseph D. Darcy's Oracle Weblog)



    Unsigned Integer Arithmetic API now in JDK 8 (Joseph D. Darcy's Oracle Weblog)

    At long last, after due discussion and review , I've just pushed initial API support for unsigned integer arithmetic into JDK 8! The support is implemented via static methods, primarily on java.lang.Integer and java.lang.Long , that: Compare values as unsigned Colloquially, "unsigned integer" means a 32-bit int long value where all the bits are interpreted as contributing to the magnitude. In the unsigned realm, the values of an integer type of a given bit-width range from 0 to 2width-1 rather than from -(2width-1) to 2width-1-1. A feature of the two's complement encoding of Java integers is that the bitwise results for add, subtract, and multiply are the same if both inputs are interpreted as signed values or both inputs are interpretted as unsigned values. (Other encodings like one's complement and signed magnitude don't have this properly.) Therefore, of the basic arithmetic operations, only a separate divide method needs to be provided to operate on values interpreted as unsigned.

    Read full article from Unsigned Integer Arithmetic API now in JDK 8 (Joseph D. Darcy's Oracle Weblog)


    Java 8 will have some support for unsigned integers | Java, SQL and jOOQ.



    Java 8 will have some support for unsigned integers | Java, SQL and jOOQ.

    This seemed to be good news at first. An announcement by Oracle's Joe Darcy claiming that Java will finally have *some* support for unsigned integers:

    http://blogs.oracle.com/darcy/entry/unsigned_api

    This will only be added on an API level, though. Not on a language level including all the expected features:

    • Primitive types
    • Wrapper types
    • Arithmetics
    • Casting rules
    • Boxing / Unboxing

    Read full article from Java 8 will have some support for unsigned integers | Java, SQL and jOOQ.


    language design - Why doesn't Java support unsigned ints? - Stack Overflow



    language design - Why doesn't Java support unsigned ints? - Stack Overflow

    Gosling: For me as a language designer, which I don't really count myself as these days, what "simple" really ended up meaning was could I expect J. Random Developer to hold the spec in his head. That definition says that, for instance, Java isn't -- and in fact a lot of these languages end up with a lot of corner cases, things that nobody really understands. Quiz any C developer about unsigned, and pretty soon you discover that almost no C developers actually understand what goes on with unsigned, what unsigned arithmetic is. Things like that made C complex. The language part of Java is, I think, pretty simple. The libraries you have to look up.

    Read full article from language design - Why doesn't Java support unsigned ints? - Stack Overflow


    JCache won't make it into Java EE 7 | JavaWorld



    JCache won't make it into Java EE 7 | JavaWorld

    "This is undoubtedly disappointing to many of you as the community indicated strong support for JCache in the well-participated Java EE 7 survey," Oracle said in an official blog post on Thursday. "However, the consensus on both the Java EE 7 and JCache EGs was that it is best to not hold up Java EE 7 any further."


    Read full article from JCache won't make it into Java EE 7 | JavaWorld


    JCache is Final! I Repeat: JCache is Final! (The Aquarium)



    JCache is Final! I Repeat: JCache is Final! (The Aquarium)

    Just as a reminder, JSR 107 was started in 2001 and to put things in perspective, J2SE 1.4 was released in 2002! So there has been clearly 'a few hiccups here and there'... Anyway, the good news is that JCache is now final! I repeat: JCache is final! Let's salute the tenacity and the perseverance of the different EG members who drove this specification to its finalization!


    Read full article from JCache is Final! I Repeat: JCache is Final! (The Aquarium)


    Google Guava : primitives support on waitingforcode.com - articles about Google Guava



    Google Guava : primitives support on waitingforcode.com - articles about Google Guava

    The first difference between Guava's and Java's primitives is that wrapper class names are written in plural (Ints, Longs, Shorts). The second difference is the support of signed and unsigned values through SignedBytes, UnsignedBytes, UnsignedInteger, UnsignedInts, UnsignedLong and UnsignedLongs classes. Another difference is the support for arrays. Thanks to methods like asList or toArray, we can quickly convert some of Java's primitives into List or arrays. It's not the case in Java's wrapper classes which are more like strict object representations of primitives rather than utility classes.


    Read full article from Google Guava : primitives support on waitingforcode.com - articles about Google Guava


    Linux watch Command with pipe



    Linux watch Command with pipe

    you

    Read full article from Linux watch Command with pipe


    Linux watch Command with pipe



    Linux watch Command with pipe

    The Linux watch Command The watch command in Linux provides a way to handle repetitive tasks. By default watch will repeat the command that follows it every two seconds. As you can imagine, watch is a great tool to keep an eye on log files. Here's an example. watch tail /var/log/syslog In order to stop the command execution, just use the standard kill sequence, [Ctrl]+C. Using the Linux watch command to monitor the syslog You can change the time interval by issuing the -n switch and specifying the interval in seconds. To check the log file every 10 seconds, try this. watch -n 10 tail /var/log/syslog The Linux watch Command with a Pipe The watch command isn't limited to viewing log files. It can be used to repeat any command you give it. If you have your system set up to monitor the CPU temperature , you can use watch to view that with the sensors command. watch -n 1 sensors acpitz-virtual-0 Adapter: Virtual device temp1: +45.0°C (crit = +100.

    Read full article from Linux watch Command with pipe


    Watch: Repeat Unix Commands or Shell-Scripts every N seconds



    Watch: Repeat Unix Commands or Shell-Scripts every N seconds

    line

    Read full article from Watch: Repeat Unix Commands or Shell-Scripts every N seconds


    How to use the watch command, by The Linux Information Project (LINFO)



    How to use the watch command, by The Linux Information Project (LINFO)

    The watch Command watch is used to run any designated command at regular intervals. It displays its output on a console (i.e., all-text mode display) or terminal window (i.e., a window in a GUI that emulates a console) that is temporarily cleared of all other content (i.e., prompts , commands and results of commands). This makes it easy to observe the changing output of a command over time. The basic syntax of watch is watch [option(s)] command When used without any of its few options , watch executes the specified command every two seconds. The command can include any options and arguments (i.e., file names or other input data) that would normally be used with it. The top line in the output includes the frequency of the reports, the command inclusive of any options and arguments, and the current date and time. The time interval between reports can be changed from its default two seconds by using the -n option followed by an integer which represents the desired number of seconds.

    Read full article from How to use the watch command, by The Linux Information Project (LINFO)


    solr的copyFeild用法(改变各个feild的权重,修改打分结果)-注意! - 飞鸟快快的专栏 - 博客频道 - CSDN.NET



    solr的copyFeild用法(改变各个feild的权重,修改打分结果)-注意! - 飞鸟快快的专栏 - 博客频道 - CSDN.NET

    解决办法:把name字段的fieldType也修改为mmseg4j的分析器的feildType:

    搜索all上的"黄海波视频"-------------则出现的结果是:

    'parsedquery'=>'(+DisjunctionMaxQuery((((personName:黄海波 personName:视频)^10.0) | (description:黄海波 description:视频) | ((title:黄海波 title:视频)^1.5))) DisjunctionMaxQuery((all:"黄海波 视频")))/no_coord',

    结论是:personName能搜索到结果,权重自然起作用!!


    Read full article from solr的copyFeild用法(改变各个feild的权重,修改打分结果)-注意! - 飞鸟快快的专栏 - 博客频道 - CSDN.NET


    How to display Maven plugin goals and parameters



    How to display Maven plugin goals and parameters

    How do you know what is the available goals of a maven plugin, for example maven-eclipse plugin – mvn eclipse:goals?. In this article, we will show you how to display the entire goals of a Maven plugin.


    Read full article from How to display Maven plugin goals and parameters


    YAML Tutorial - Xavier Shay's Blog



    YAML Tutorial - Xavier Shay's Blog

    YAML is a flexible, human readable file format that is ideal for storing object trees. YAML stands for "YAML Ain't Markup Language". It is easier to read (by humans) than JSON, and can contain richer meta data. It is far nicer than XML. There are libraries available for all mainstream languages including Ruby, Python, C++, Java, Perl, C#/.NET, Javascript, PHP and Haskell. It looks like this:


    Read full article from YAML Tutorial - Xavier Shay's Blog


    YAML - Wikipedia, the free encyclopedia



    YAML - Wikipedia, the free encyclopedia

    YAML syntax was designed to be easily mapped to data types common to most high-level languages: list, associative array, and scalar.[4] Its familiar indented outline and lean appearance make it especially suited for tasks where humans are likely to view or edit data structures, such as configuration files, dumping during debugging, and document headers (e.g. the headers found on most e-mails are very close to YAML). Although well-suited for hierarchical data representation, it also has a compact syntax for relational data.[5] Its line and whitespace delimiters make it friendly to ad hoc grep/Python/Perl/Ruby operations. A major part of its accessibility comes from eschewing the use of enclosures such as quotation marks, brackets, braces, and open/close-tags, which can be hard for the human eye to balance in nested hierarchies.


    Read full article from YAML - Wikipedia, the free encyclopedia


    YAML Tutorial - Essentials



    YAML Tutorial - Essentials

    YAML Rules

    • Applicable YAML files: all files with a .yml extension.
      • Essentials uses a config.yml file.
    • Tabs are NOT allowed, use spaces ONLY.
    • You MUST indent your properties and lists with 1 or more spaces.
    • All keys/properties are case-sensitive. ("ThIs", is not the same as "thiS")

    Read full article from YAML Tutorial - Essentials


    eclipse - 'Building workspace' has encountered an error - Stack Overflow



    eclipse - 'Building workspace' has encountered an error - Stack Overflow

    I ran into this same issue and I believe the culprit to be the Sonarqube plugin I had installed.

    This discussion pointed me in that direction:


    Read full article from eclipse - 'Building workspace' has encountered an error - Stack Overflow


    Angularjs-Eclipse plugin | nodeleaf.net



    Angularjs-Eclipse plugin | nodeleaf.net

      If you've read previous post about Nodeclipse plugin , you already know how to customize Eclipse to develop web applications for nodejs and express . If you didn't then please refer to this post in order to setup the Eclipse IDE we'll be using here. To summarize: Nodeclipse plugin provides an IDE for nodejs application projects with express routing and MongoDB shell scripting — a wide bunch of web tools grouped into one single cross-platform Eclipse IDE . But there is one more thing of interest to complete this already rich web developer's tools cluster … In this post I will show how to complete a web centric Eclipse IDE with angularjs-eclipse plugin, to build a simple dynamic front-end web page. So let's start: from Eclipse's Preferences window, open Install/Update group then add a new software site for angularjs-eclipse as below: At the time this was written, the angularjs-eclipse software site location was http://oss.opensagres.fr/angularjs-eclipse/0.1.0/.

    Read full article from Angularjs-Eclipse plugin | nodeleaf.net


    What is key performance indicator (KPI)? - Definition from WhatIs.com



    What is key performance indicator (KPI)? - Definition from WhatIs.com

    A key performance indicator (KPI) is a business metric used to evaluate factors that are crucial to the success of an organization. KPIs differ per organization; business KPIs may be net revenue or a customer loyalty metric, while government might consider unemployment rates.


    Read full article from What is key performance indicator (KPI)? - Definition from WhatIs.com


    My Research Diaries: Running Apache Spark Unit Tests Sequentially with Scala Specs2



    My Research Diaries: Running Apache Spark Unit Tests Sequentially with Scala Specs2

    Apache Spark has a growing community in the Machine Learning and Analytics world. One of the thing that often comes up when developing with Spark is the Unit tests for functions that take in an RDD and return an RDD. There is the famous Quantified Blog on Spark Testing with FunSuite which gives a great way to design the trait class and then use it in our test classes. But it was a little outdated (written for Spark 0.6). In other words, the system.clearproperty("spark.master.port") is no longer a property that exists in Spark 1.0.1. Thankfully the Spark Summit 2014 talk on "Spark Testing: Best Practices" is based on the latest version of Spark and has the right properties to set, namely spark.driver.port and spark.hostPort. We also used org.Specifications2 (scala Specifications) and Mockito libraries for testing, so our trait class looks a little different.

    Read full article from My Research Diaries: Running Apache Spark Unit Tests Sequentially with Scala Specs2


    java - Eclipse: Set maximum line length for auto formatting? - Stack Overflow



    java - Eclipse: Set maximum line length for auto formatting? - Stack Overflow

    In preferences Java -> Code Style -> Formatter, edit the profile. Under the Line Wrapping tab is the option for line width (Maximum line width:). you will need to make your own profile.


    Read full article from java - Eclipse: Set maximum line length for auto formatting? - Stack Overflow


    java - Mockito How to mock and assert a thrown exception? - Stack Overflow



    java - Mockito How to mock and assert a thrown exception? - Stack Overflow

    Make the exception happen like this:

    when(obj.someMethod()).thenThrow(new AnException());

    Verify it has happened either by asserting that your test will throw such an exception:

    @Test(expected = AnException.class)

    Or by normal mock verification:

    verify(obj).someMethod();

    Read full article from java - Mockito How to mock and assert a thrown exception? - Stack Overflow


    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