This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function () { | |
| "use strict"; | |
| // for better performance - to avoid searching in DOM | |
| var content = $('#content'); | |
| var input = $('#input'); | |
| var status = $('#status'); | |
| // my color assigned by the server | |
| var myColor = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package test.programs; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| public class ArraysMain { | |
| public static void main(String[] args) { | |
| // merge two lists by removing duplicates. | |
| List<Integer> list1 = Arrays.asList(new Integer[]{4,6,7,7,8}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // // Merge only duplicate elements in two array list . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.gallery.controller; | |
| import java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import javax.servlet.http.HttpServletResponse; | |
| import org.apache.commons.io.FileUtils; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <beans xmlns="http://www.springframework.org/schema/beans" | |
| xmlns:context="http://www.springframework.org/schema/context" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://www.springframework.org/schema/beans | |
| http://www.springframework.org/schema/beans/spring-beans-3.0.xsd | |
| http://www.springframework.org/schema/context | |
| http://www.springframework.org/schema/context/spring-context-3.0.xsd"> | |
| <!-- this tag instructs spring container to load all the classes which are |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%> | |
| <html> | |
| <head> | |
| <title>Spring MVC Multiple File Upload</title> | |
| <!-- script | |
| src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> --> | |
| </head> | |
| <body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.gallery.util; | |
| import java.io.BufferedInputStream; | |
| import java.io.BufferedOutputStream; | |
| import java.io.File; | |
| import java.io.FileOutputStream; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| public class FileUtil { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.gallery.dto; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import org.springframework.web.multipart.MultipartFile; | |
| public class UserDetails { | |
| private MultipartFile file; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Find the elements that appears once in a sorted array. | |
| INPUT : | |
| 1,1,2,3,3,4,4 | |
| OUTPUT : 2 | |
| INPUT : | |
| 1,1,2,2,3,3,4,4,5 | |
| OUTPUT : 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Find the element that appear once in a sorted array. | |
| public class AppearOnceAlt{ | |
| public static void main(String[] args){ | |
| int[] arr = new int[]{1,1,1,1,2,2,3,4,4,4,4,5}; | |
| appear(arr); | |
| } | |
| public static void appear(int[] arr){ | |
| int elem = arr[0]; | |
| int old = elem; |
OlderNewer