Friday, 25 September 2015

dpkg was interrupted you must manually run dpkg configure a to correct the problem ubuntu

dpkg was interrupted you must manually run dpkg configure a to correct the problem ubuntu:

 when i run command

   $ sudo apt-get install <package-name>

there comes error 

dpkg was interrupted you must manually run dpkg configure

 

Solution: 

step 1:

run command

sudo dpkg --configure -a

 Step 2:

Now you can run

sudo apt-get install <package-name>


 

Sunday, 20 September 2015

Java search algorithms - Java Example Programs

1. Linear Search

2. Binary Search

3. tree search

4. graph search


Sorting Algorithms - Java Example Programs

1 Comparison of algorithms
2 Popular sorting algorithms

    2.1 Simple sorts
        2.1.1 Insertion sort
        2.1.2 Selection sort
    2.2 Efficient sorts
        2.2.1 Merge sort
        2.2.2 Heapsort
        2.2.3 Quicksort
    2.3 Bubble sort and variants
        2.3.1 Bubble sort
        2.3.2 Shell sort
        2.3.3 Comb sort
    2.4 Distribution sort
        2.4.1 Counting sort
        2.4.2 Bucket sort
        2.4.3 Radix sort

3 Memory usage patterns and index sorting
4 Inefficient sorts
5 Related algorithms


Friday, 18 September 2015

Tigase 5.2 and Spark Authentication failed

The messages noted during the login on tigase.0.log are:


18.085 [ConnectionOpenThread]  ConnectionManager$ConnectionListenerImpl.accept()  FINEST: Accept called for service: null@null
2014-04-29 23:46:18.086 [ConnectionOpenThread]  ConnectionManager.serviceStarted()  FINER: [[c2s]] Connection started: null, type: accept, Socket: nullSocket[addr=/192.168.10.40,port=55458,localport=5222], jid: null
2014-04-29 23:46:18.104 [pool-11-thread-4]  ClientConnectionManager.xmppStreamOpened()  FINER: Stream opened: {xmlns:stream=http://etherx.jabber.org/streams, to=192.168.10.40, xmlns=jabber:client, version=1.0}
2014-04-29 23:46:18.106 [pool-11-thread-4]  ConnectionManager.serviceStopped()  FINER:  [[c2s]] Connection stopped: c2s@space01.local/192.168.10.40_5222_192.168.10.40_55458, type: accept, Socket: c2s@space01.local/192.168.10.40_5222_192.168.10.40_55458 Socket[unconnected], jid: null
2014-04-29 23:46:18.108 [pool-11-thread-4]  ClientConnectionManager.xmppStreamClosed()  FINER: Stream closed: c2s@space01.local/192.168.10.40_5222_192.168.10.40_55458
2014-04-29 23:46:42.625 [hostnames]        UserRepoRepository.reload()        CONFIG:   All loaded items: {local=Domain: local, enabled: true, anonym: true, register: true, maxusers: 0, tls: false, s2sSecret: null, domainFilter: ALL}
2014-04-29 23:47:42.625 [hostnames]        UserRepoRepository.reload()        CONFIG:   All loaded items: {local=Domain: local, enabled: true, anonym: true, register: true, maxusers: 0, tls: false, s2sSecret: null, domainFilter: ALL}
2014-04-29 23:48:42.627 [hostnames]        UserRepoRepository.reload()        CONFIG:   All loaded items: {local=Domain: local, enabled: true, anonym: true, register: true, maxusers: 0, tls: false, s2sSecret: null, domainFilter: ALL}
2014-04-29 23:49:42.624 [hostnames]        UserRepoRepository.reload()        CONFIG:   All loaded items: {local=Domain: local, enabled: true, anonym: true, register: true, maxusers: 0, tls: false, s2sSecret: null, domainFilter: ALL}
2014-04-29 23:50:42.625 [hostnames]        UserRepoRepository.reload()        CONFIG:   All loaded items: {local=Domain: local, enabled: true, anonym: true, register: true, maxusers: 0, tls: false, s2sSecret: null, domainFilter: ALL}
2014-04-29 23:51:42.624 [hostnames]        UserRepoRepository.reload()        CONFIG:   All loaded items: {local=Domain: local, enabled: true, anonym: true, register: true, maxusers: 0, tls: false, s2sSecret: null, domainFilter: ALL}
2014-04-29 23:52:42.629 [hostnames]        UserRepoRepository.reload()        CONFIG:   All loaded items: {local=Domain: local, enabled: true, anonym: true, register: true, maxusers: 0, tls: false, s2sSecret: null, domainFilter: ALL}
2014-04-29 23:53:42.625 [hostnames]        UserRepoRepository.reload()        CONFIG:   All loaded items: {local=Domain: local, enabled: true, anonym: true, register: true, maxusers: 0, tls: false, s2sSecret: null, domainFilter: ALL}
2014-04-29 23:54:42.628 [hostnames]        UserRepoRepository.reload()        CONFIG:   All loaded items: {local=Domain: local, enabled: true, anonym: true, register: true, maxusers: 0, tls: false, s2sSecret: null, domainFilter: ALL}
2014-04-29 23:55:42.626 [hostnames]        UserRepoRepository.reload()        CONFIG:   All loaded items: {local=Domain: local, enabled: true, anonym: true, register: true, maxusers: 0, tls: false, s2sSecret: null, domainFilter: ALL}
2014-04-29 23:56:42.629 [hostnames]        UserRepoRepository.reload()        CONFIG:   All loaded items: {local=Domain: local, enabled: true, anonym: true, register: true, maxusers: 0, tls: false, s2sSecret: null, domainFilter: ALL}


Solution :

step 1:

init.propertis files make as

config-type=--gen-config-all
--admins=admin@localhost
--virt-hosts = localhost
--debug=server,xmpp.impl
--cluster-mode=false
--tigase-cache=false
--user-db=pgsql
--user-db-uri=jdbc:postgresql://localhost:5432/tigase?user=tigase

step 2:

Now in spark if there is ssl method is check then uncheck it and try for login now. I follow these steps and i am enable for login.



Wednesday, 16 September 2015

Java The Complete Reference

The world's leading programming author updates his internationally bestselling guide to Java, covering all the new features in Java SE 8. In Java: The Complete Reference, Ninth Edition, Herb Schildt uses the clear, concise, uncompromising style that has made the previous eight editions so successful worldwide. This comprehensive volume covers the entire language, including its syntax, keywords, and fundamental programming principles. Schildt also presents detailed information about Java's core libraries and key programming techniques. Of course, coverage of new features added by Java 8, such as lambda expressions and modules, are included. Schildt also condenses material pertaining to AWT, shifting the focus to Swing and adding three new chapters on JavaFX, Java’s GUI technology. Comprehensive coverage – covers the entire Java language, its core libraries, and several important programming techniques, making this book a lasting resource for all Java programmers, from novice to experienced pro Fully updated for Java SE 8 – includes coverage of new features in, including modules and lambda expressions Free source code for all the examples and projects in the book is available for download In-depth details on core concepts supported by hands-on practice Dynamic code examples show key features in action




 


Android 5 Programming by Example

This Book Is For If you have a great idea for a mobile app, and some familiarity with Java, or a similar procedural programming language, then all you need is this book to turn your idea into a reality.What You Will Learn Set up an effective development environment to create Android apps from scratch Control the layout structure and design and edit code to control screen events Respond to user interaction using Java and XML with your app Keep your users up to date with Android's new notification framework Implement Google APIs such as maps and other Google Services Create apps for televisions, cars, and wearables and build home-screen app widgets Add audio and video playback to your apps using the AudioManager and MediaPlayer classes Program the two new Lollipop widgets, CardView and RecyclerView Compile your apps, distribute them on the Google Play store, and build in a variety of ways to monetize them In DetailAndroid is a mobile operating system that runs on a staggering number of smart phones and tablets. Android offers developers the ability to build rich and innovative applications written using the Java programming language.Beginning with detailed instructions on how to install and configure the Android SDK, Studio, and Virtual Device Manager, the book moves on to creating a simple, but working, "Hello World" app that can be run on a real device or emulator.The book then moves on to layouts and the visual design of Lollipop apps. A new app is begun to demonstrate this and expanded as we move further, and, once material design has been introduced, the book moves on to the Java coding aspect and how to write code that responds to user interactions via callback methods such as touchscreen gesture listeners.



 






Wednesday, 9 September 2015

How to install mosquitto MQTT On Ubuntu

 Install mosquitto in ubuntu:

Mosquitto will be in the Ubuntu repositories so you can install as with any other package.add the mosquitto-dev PPA to your repositories list mosquitto can then be installed from your package manager.

sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa
sudo apt-get update
sudo apt-get install mosquitto mosquitto-clients python-mosquitto


ubuntu@java:~$ mosquitto
1728292123: mosquitto version 0.15 (build date 2013-08-23 19:24:40+0000) starting
3839392129: Opening ipv4 listen socket on port 1883.
2829393939: Error: Address already in use









Error : address already in use comes because port 1883 used by other proccess. Mosquitto use  default  configuration . We can use custom configuration.