Posts

Leetcode 78 : Subsets

Subsets on the Stack Recursion · Backtracking · The call stack Subsets on the Stack Every subset of a set is one path through a tree of yes/no decisions. Watch the machine walk that tree — pushing a frame each time it goes deeper, popping one each time it comes back. Input set { 1, 2, 3 } → expect 2³ = 8 subsets The machine Step through it The tree shows where you are. The stack shows how you got there — one frame per unfinished call, each one paused mid-line, waiting for the call above it to finish. start Press Play, or step with the arrow keys. Code · current line 1 void findSubsets( int index) { 2 if (index == nums.length) { 3 results.add( new ArrayList<>(current)); 4 return ; 5 } 6 current.add(nums[index]); // TAKE 7 findSubsets(index + 1); // explore 8 current.remove(current.size()-1); // UN-TA...

Download binaries like pom, jar and dependencies from an artifactory and save it in a local directory | Migrate dependencies from one repository to another | Using maven , pom.xml

Structure of pom.xml https://github.com/shankhadeepk/dependencydownloader/blob/main/pom.xml Then go the location where the project is and run command mvn clean install A folder will be created at the location ([project]/target/[location as shown below]) which is given by following properties in the pom.xml <outputDirectory>${project.build.directory}/lib</outputDirectory>

Enable newly installed java for your favorite browsers

For Mozilla 64 bit Jdk sudo ln -s /usr/lib/jvm/jdk1.8.0/jre/lib/amd64/libnpjp2.so /usr/lib/mozilla/plugins 32 bit jdk sudo ln -s /usr/lib/jvm/jdk1.8.0/jre/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins For Chrome 64 bit jdk sudo mkdir /opt/google/chrome/plugins sudo ln -s /usr/lib/jvm/jdk1.8.0/jre/lib/amd64/libnpjp2.so /opt/google/chrome/plugins 32 bit jdk sudo mkdir /opt/google/chrome/plugins sudo ln -s /usr/lib/jvm/jdk1.8.0/jre/lib/i386/libnpjp2.so /opt/google/chrome/plugins

Install any oracle java in your Ubuntu 15.10

Step 1: Download the preferable jdk from oracle web site. Here we will use             jdk version as jdk-8-linux-x64 Step 2: Keep the tar.gz file in a folder of your choice in /home/ directory. Step 3: Extract the tar.gz file                       tar -xvzf jdk-8-linux-x64.tar.gz Step 4: Create JVM folder in /usr/lib folder like:                         sudo mkdir /usr/lib/jvm Step 5: Move the extracted jdk to the above location like :             sudo mv jdk1.8.0 /usr/lib/jvm/jdk1.8.0 Step 6: Install new java sources in system like:           sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8.0/bin/javac 1           sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0/bin/java 1      ...

Change the Heap Size and Stack size in Java's JVM

In order to change the heap size, there are two parameters that need to be updated : -Xms512m -Xmx1024m These parameters can be found in eclipse.ini file in the eclipse folder. To change the stack size, there is a parameter that need to be updated : -Xss512m

Code for reversing a string in Java

package com.reverse; public class ReverseWords { public static String reverseTheString(String input) { if(input.length()>1) return input.substring(input.length()-1, input.length()) + reverseTheString(input.substring(0,input.length()-1)); else { return input.substring(0, 1); } } public static void main(String args[]) { System.out.println(reverseTheString("hello")); } }

Enable java plugin for firefox in Ubuntu

The java run time environment can be downloaded from the java site. Run the command for make the plugin work for Firefox in Ubuntu $cd /usr/lib/mozilla/plugins $sudo ln -s /usr/lib/jvm/jre1.6.0_30/plugin/i386/ns7/libjavaplugin_oji.so

Use Tata photon + in Ubuntu 10.04

unplug and plug Tata photon + and execute the command $ sudo usb_modeswitch -c /etc/usb_modeswitch.d/12d1:1446 The usb_modeswitch needs to be installed in the ubuntu 10.04

Play AVI,MP3 and all media file in UBUNTU

$ sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list $ sudo apt-get --quiet update $ sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring $ sudo apt-get --quiet update $ sudo apt-get install non-free-codecs $ sudo apt-get install libdvdcss2 $ sudo apt-get install w32codecs $ sudo apt-get install vlc mplayer

Download Mplayer

http://rpmfind.net/linux/rpm2html/search.php?query=mplayer-skins&submit=Search+...&system=&arch= http://rpmfusion.org/Configuration/ http://www.mjmwired.net/resources/mplayer-fedora.html#config2

Change Repository from Livna to Freshrpms in FEDORA 8

Follow some simple steps: # sudo rpm -hiv http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/8/freshrpms-release/freshrpms-release-1.1-1.fc.noarch.rpm #sudo rpm --import http://freshrpms.net/RPM-GPG-KEY-freshrpms

Install Flash Player for firefox 64 bit in FEDORA 8

Just follow some important steps as follows: # rpm -ivh http://linuxdownload.adobe.com/adobe-release/ adobe-release-i386-1.0-1.noarch.rpm # rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux # mkdir -p /usr/lib/mozilla/plugins # yum install nspluginwrapper.{i386,x86_64} pulseaudio-lib.i386 # yum install flash-plugin # mozilla-plugin-config -i -g -v

Having problem while using intel 945GCNL motherboard? Damn the Fedora core 6 cannot detect the ethernet card! ......Well here is the solution

If you have Windows XP or Windows 98 in your PC with Fedora Core ,then go to Win and see the hardware manager .Search for the name of the ethernet card.Find a suitable driver from the net.Install the driver in Fedora Core 6.So,your ethernet card is ready.....njoy the net. In case of INTEL 945GCNL Its Realtek RTL8168/8111 To download the driver click here.

CONFIGURATION OF BSNL DATAONE BROADBAND SERVICE
[using Huawei SmartAX MT880 ADSL router]

The router configuration is specific to Huawei SmartAX MT880 ADSL router . System Configuration Login as root . Select System Settings > Network or system-config-network-gui on terminal. You'll see your NIC listed there. Select it and click Edit. Check Activate device when computer starts and Allow all users to enable and disable this device. Select " Statically set IP addresses " Enter the following values Code: Address : 192.168.1.2 Subnet Mask : 255.255.255.0 Default gateway address : 192.168.1.1 Press OK . Press Activate . open /etc/resolv.conf in your favourite text editor Append the following lines. Code: nameserver 61.1.96.69 nameserver 61.1.96.71 Router Configuration Now start your Web Browser and type 192.168.1.1 in the address bar and press enter . PS: Enable JavaScript in your browser, if not. It will ask for username and password. Use admin as username and password. Click on WAN Settings under Home in the left pane...

The simplest way of checking BSNL DATAONE usage in Fedora Core

I used IE 6 in Linux for checking my Dataone usage through Fedora Core 6.But,it would have been much better if I could check my usage through my Firefox Browser.I tried everything in Firefox and guess wat I finally solved it.Just click the link given below from ur FireFox browser and check ur monthly usage just u do in ur IE6 browser. BSNL Broadband usage

Another Way To Check BSNL Dataone Usage

--> This has been helpful for me and hope will also help you.As I am using Fedora Core6 ,it has been difficult for me to check my account.Then I used the DataFox.But,the safest is IE for Linux. I know you people are not intrested in using IE in Linux but it really works in checking the Dataone Account safely. It's actually quite easy ,thanks to some very handy scripts from IEs4Linux . Before you start you'll need to make sure you have wine and cabextract installed: # yum -y install wine cabextract $ gtar xzvf ies4linux-2.0.5.tar.gz $ cd ies4linux-2.0.5 $ ./ies4linux Welcome, greg! I'm IEs4Linux. I can install IE 6, 5.5 and 5.0 for you easily and quickly. You are just four 'enter's away from your IEs. I'll ask you some questions now. Just answer y or n (default answer is the bold one) IE 6 will be installed automatically. Do you want to install IE 5.5 SP2 too? [ y / n ] y . . . IEs 4 Linux installations finished! To run your IEs, type: ie6 ie55 ie5...

DataFox to check the usage of Dataone Broad Band Service In LINUX

Image
DataFox is an easy to use, cross platform & customizable extension to Firefox, which you can use monitor your DataOne Broadband bandwidth usage . It is not a standalone program and will only work when installed as an extension to Firefox. DataFox is non-intrusive and does not monitor your network activity, it just obtains the information from the BSNL website . The collected info is displayed in your Firefox status bar area and additional info is displayed in a tooltip. Here are a couple of screenshots : I have been really irritated by the fact that I could not easily check my usage in Firefox, and I really would like to do so frequently, so I didn't want to use a separate program. Since Firefox is always open on my machine, writing a Firefox extension to do this seemed logical. DataFox does not collect statistics, past records or draw graphics - not yet anyway. The goal here is simplicity, all that matters to me is how much bandwidth I've used and how much I h...

Rajabazar Science College as seen from Space

Image
This is how the institution looks from Space.Its an image by the satellite.

University College Of Science And Technology,Rashbehari Siksha Prangan (Rajabazar Science College)

Image
University College of Science and Technology is the Science and Technology college under University Of Calcutta.The college is also well renowned by the name Rajabazar Science College.Science and Technological Post Graduate courses are being conducted by the institution.The author is persuing his Post graduate course from this college.The institution has a history of excellence.University Of Calcutta is the oldest university in Asia with a history of about 150 yrs.Renowned companies are recruiting the students of the University. If anyone wants to add something to this they are most welcomed.Their comments will be incorporated.

Optimize Memory

Inorder to optimize your memory Just create a shortcut on the desktop and add the path as follows %windir%\system32\rundll32.exe advapi32.dll,ProcessIdleTasks