<commit_before><%@ page import="edu.vt.vbi.patric.common.ImageBuilder"
%><%@ page import="javax.servlet.ServletOutputStream"
%><%
	int i = 0, j = 0, k=0, left=0, top=0, width=0, height=0, flag=0;
	String html="", color="";
	
	// getting common params
	String map_id = request.getParameter("map"); 
	String filename = map_id + "patric.png";

	String div = request.getParameter("mapdiv");

	String[] div_split = div.split("AA"); 
	
	ImageBuilder img = new ImageBuilder(map_id);
	
	response.setContentType("application/octetstream");<commit_msg>KEGG save map gives NULL pointer exception #402<commit_after><%@ page import="edu.vt.vbi.patric.common.ImageBuilder"
%><%@ page import="javax.servlet.ServletOutputStream"
%><%@ page import="java.io.BufferedReader"
%><%@ page import="java.io.IOException"
%><%
	int i = 0, j = 0, k=0, left=0, top=0, width=0, height=0, flag=0;
	String html="", color="";
	
	// getting common params
	// process post stream
	String map_id = "", div = "";

	StringBuilder stringBuilder = new StringBuilder();
	BufferedReader bufferedReader = null;
	try {
		bufferedReader = request.getReader();
		char[] charBuffer = new char[1024];
		int bytesRead = -1;
		while ((bytesRead = bufferedReader.read(charBuffer)) > 0) {
			stringBuilder.append(charBuffer, 0, bytesRead);
		}
	}
	catch (IOException ex) {
		throw ex;
	} finally {
		if (bufferedReader != null) {
			try {
				bufferedReader.close();
			} catch (IOException ex) {
				throw ex;
			}
		}
	}

	String[] params = stringBuilder.toString().split("&");

	for (String param : params) {
		if (param.contains("map=")) {
			map_id = param.replace("map=", "");
		}
		else if (param.contains("mapdiv=")) {
			div = java.net.URLDecoder.decode(param.replace("mapdiv=",""), "UTF-8");
		}
	}
//	System.out.println("map_id: " + map_id);
//	System.out.println("div: " + div);

	String filename = map_id + "patric.png";
	String[] div_split = div.split("AA");

	ImageBuilder img = new ImageBuilder(map_id);
	
	response.setContentType("application/octetstream");
{'fraction_non_alphanumeric': 0.17745921898171033, 'fraction_numerical': 0.013346515076618883, 'mean_word_length': 4.455525606469003, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2559778', 'n_tokens_mistral': 750, 'n_tokens_neox': 687, 'n_words': 151}