code
stringlengths
3
1.18M
language
stringclasses
1 value
package com.googlecode.pngtastic.core; import java.io.UnsupportedEncodingException; import java.util.zip.CRC32; /** * Represents a PNG chunk * * @author rayvanderborght */ public class PngChunk { /** critical chunks */ public static final String IMAGE_HEADER = "IHDR"; public static final String PALETTE = "...
Java
package com.googlecode.pngtastic.core; import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IO...
Java
package com.googlecode.pngtastic.core; import java.util.Arrays; import java.util.List; /** * Custom logger because I want to have zero dependancies; perhaps to be replaced with java.util logging. * * @author rayvanderborght */ public class Logger { static final String NONE = "NONE"; static final String DEBUG =...
Java
package com.googlecode.pngtastic.core; /** * Exception type for pngtastic code * * @author rayvanderborght */ @SuppressWarnings("serial") public class PngException extends Exception { /** */ public PngException() { } /** */ public PngException(String message) { super(message); } /** */ public PngExcept...
Java
package com.googlecode.pngtastic.core; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import com.googlecode.pngtastic.c...
Java
package com.googlecode.pngtastic.core.processing; import java.io.ByteArrayOutputStream; import java.io.IOException; /** * Apply PNG compression and decompression. Implies zlib format, aka LZ77. * * @author rayvanderborght */ public interface PngCompressionHandler { /** * Inflate (decompress) the compressed ima...
Java
package com.googlecode.pngtastic.core.processing; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import java.util.zip.InflaterInpu...
Java
package com.googlecode.pngtastic.core.processing; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FilterOutputStream; import java.io.IOException; import ja...
Java
package com.googlecode.pngtastic.core.processing; import java.util.ArrayList; import java.util.List; import com.googlecode.pngtastic.core.Logger; import com.googlecode.pngtastic.core.PngException; /** * Implement PNG interlacing and deinterlacing * * @author rayvanderborght */ public class PngtasticInterlaceHand...
Java
package com.googlecode.pngtastic.core.processing; import java.util.List; /** * Apply PNG interlacing and deinterlacing * * @author rayvanderborght */ public interface PngInterlaceHandler { /** * Do png interlacing on the data given * * @param width The image width * @param height The image height * @p...
Java
package com.googlecode.pngtastic.core.processing; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.concurrent.Cal...
Java
package com.googlecode.pngtastic.core.processing; import java.io.IOException; import java.util.List; import java.util.Map; import com.googlecode.pngtastic.core.PngException; import com.googlecode.pngtastic.core.PngFilterType; /** * Apply PNG filtering and defiltering * * @author rayvanderborght */ public interfa...
Java
package com.googlecode.pngtastic.core.processing; import java.io.IOException; import java.util.List; import java.util.Map; import com.googlecode.pngtastic.core.Logger; import com.googlecode.pngtastic.core.PngException; import com.googlecode.pngtastic.core.PngFilterType; /** * Implement PNG filtering and defiltering...
Java
package com.googlecode.pngtastic.core; /** * Represents the available PNG filter types. * @see <a href="http://www.w3.org/TR/PNG/#9Filters">Filtering</a> * * @author rayvanderborght */ public enum PngFilterType { ADAPTIVE(-1), // NOTE: not a real filter type NONE(0), SUB(1), UP(2), AVERAGE(3), PAETH(4); /...
Java
package com.googlecode.pngtastic.core; /** * Represents the image types available in PNG images * <pre> * Table 11.1 - Allowed combinations of colour type and bit depth * PNG image type Colour type Allowed bit depths Interpretation * Greyscale 0 1, 2, 4, 8, 16 Each pixel is a greyscale sample * Truecolou...
Java
package com.googlecode.pngtastic.core; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintW...
Java
package com.annasanches.orkut.client; import com.annasanches.orkut.shared.FieldVerifier; import com.google.gwt.core.client.GWT; import com.google.gwt.junit.client.GWTTestCase; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.rpc.ServiceDefTarget; /** * GWT JUnit <b>inte...
Java
package com.annasanches.orkut.client.servicos; import com.annasanches.orkut.shared.beans.Agencia; import com.google.gwt.user.client.rpc.AsyncCallback; public interface ServicoAgenciaAsync { void cadastrarAgencia(Agencia agencia, AsyncCallback<Void> callback); void consultarAgencia(int codigo, AsyncCallba...
Java
package com.annasanches.orkut.client.servicos; import com.annasanches.orkut.shared.beans.Agencia; import com.google.gwt.user.client.rpc.RemoteService; import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; @RemoteServiceRelativePath("agencia.rpc") public interface ServicoAgencia extends RemoteService...
Java
package com.annasanches.orkut.client.editoragencia; import com.annasanches.orkut.client.servicos.ServicoAgencia; import com.annasanches.orkut.client.servicos.ServicoAgenciaAsync; import com.annasanches.orkut.shared.beans.Agencia; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.Click...
Java
package com.annasanches.orkut.client; import com.google.gwt.user.client.rpc.RemoteService; import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; /** * The client side stub for the RPC service. */ @RemoteServiceRelativePath("greet") public interface GreetingService extends RemoteService { Stri...
Java
package com.annasanches.orkut.client; import com.annasanches.orkut.client.editoragencia.EditorAgencia; import com.google.gwt.core.client.EntryPoint; /*import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.user.client.ui.Button; import com....
Java
package com.annasanches.orkut.shared.beans; import com.google.gwt.user.client.rpc.IsSerializable; public class Agencia implements IsSerializable{ private int codigo; private String nome; private String endereco; private String cnpj; private boolean ativa; public int getCodigo() { return codig...
Java
package com.annasanches.orkut.shared; /** * <p> * FieldVerifier validates that the name the user enters is valid. * </p> * <p> * This class is in the <code>shared</code> packing because we use it in both * the client code and on the server. On the client, we verify that the name is * valid before sendi...
Java
package com.annasanches.orkut.server; import com.annasanches.orkut.client.GreetingService; import com.annasanches.orkut.shared.FieldVerifier; import com.google.gwt.user.server.rpc.RemoteServiceServlet; /** * The server side implementation of the RPC service. */ @SuppressWarnings("serial") public class Gre...
Java
package com.annasanches.orkut.server.servicos; import java.util.LinkedList; import java.util.List; import com.annasanches.orkut.client.servicos.ServicoAgencia; import com.annasanches.orkut.shared.beans.Agencia; import com.google.gwt.user.server.rpc.RemoteServiceServlet; public class ServicoAgenciaImpl ext...
Java
package runTimeCompile; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.Writer; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URL; import java.net.URLClassLoader; import java.util.logging.Level; import java.util.loggi...
Java
/* * Copyright (c) 2009, Oracle * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of cond...
Java
package threadHandlers; import com.sun.javafx.runtime.Entry; import annCode.TrainANNCpuMode; import annCode.TrainANNGpuMode; import annCode.TrainANN; import javafx.async.RunnableFuture; /** * This class helps in launching of thread which will take care of training ANN. * Throughout the life of application this thr...
Java
package threadHandlers; /** * This interface contains four methods whose implementation will be executed when * postMessage() method of JavaTrainingThreadTask is executed. * These methods are responsible for update of UI * @author praveen_kulkarni */ public interface TrainingThreadListener { public void commu...
Java
package annCode; import javax.swing.JFrame; import javax.swing.JOptionPane; import threadHandlers.JavaTrainingThreadTask; /** * This abstract class is parent class for the two classes TrainANNCpuMode and TrainANNGpuMode. * It holds some common abstract methods which are to be implemented by child classes. * * @a...
Java
package annCode; import java.util.Random; import javax.swing.JFrame; import javax.swing.JOptionPane; import jcuda.Pointer; import jcuda.Sizeof; import jcuda.driver.CUdeviceptr; import jcuda.driver.JCudaDriver; import jcuda.utils.KernelLauncher; import threadHandlers.JavaTrainingThreadTask; /** * This class involves ...
Java
package annCode; import threadHandlers.JavaTrainingThreadTask; import java.util.Random; import javax.swing.JFrame; import javax.swing.JOptionPane; /** * This class involves code that will execute code on CPU in sequential way. * It extends TrainANN abstract classes and implements its abstract method. * @author pra...
Java
/* * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
Java
/* * Copyright (C) 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
Java
/* * Copyright (C) 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
Java
/* * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
Java
/* * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
Java
/* * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
Java
/* * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
Java
/* * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
Java
/* * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
Java
/* * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
Java
/* * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
Java
/* * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
Java
/* * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
Java
/* * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
Java
/* * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
Java
/* * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
Java
/* * Copyright (C) 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
Java
package vcard.io; import java.io.IOException; /** * A Base64 Encoder/Decoder. * * <p> * This class is used to encode and decode data in Base64 format as described in RFC 1521. * * <p> * This is "Open Source" software and released under the <a href="http://www.gnu.org/licenses/lgpl.html">GNU/LGPL</a> license.<br> * It...
Java
package vcard.io; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import android.app.Notification; import android.app.NotificationManager; import android.app.Pendi...
Java
/* * Funambol is a mobile platform developed by Funambol, Inc. * Copyright (C) 2003 - 2007 Funambol, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License version 3 as published by * the Free Software Foundation with the addit...
Java
package vcard.io; import android.app.Activity; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.view.View; import android.view.Win...
Java
/* * Funambol is a mobile platform developed by Funambol, Inc. * Copyright (C) 2003 - 2007 Funambol, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License version 3 as published by * the Free Software Foundation with the addit...
Java
/* * Funambol is a mobile platform developed by Funambol, Inc. * Copyright (C) 2003 - 2007 Funambol, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License version 3 as published by * the Free Software Foundation with the additio...
Java
/* * Funambol is a mobile platform developed by Funambol, Inc. * Copyright (C) 2003 - 2007 Funambol, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License version 3 as published by * the Free Software Foundation with the additio...
Java
/* * Funambol is a mobile platform developed by Funambol, Inc. * Copyright (C) 2003 - 2007 Funambol, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License version 3 as published by * the Free Software Foundation with the addit...
Java
/* * Funambol is a mobile platform developed by Funambol, Inc. * Copyright (C) 2003 - 2007 Funambol, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License version 3 as published by * the Free Software Foundation with the addit...
Java
/* * Funambol is a mobile platform developed by Funambol, Inc. * Copyright (C) 2003 - 2007 Funambol, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License version 3 as published by * the Free Software Foundation with the addit...
Java
/* * Funambol is a mobile platform developed by Funambol, Inc. * Copyright (C) 2003 - 2007 Funambol, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License version 3 as published by * the Free Software Foundation with the addit...
Java
/* * Copyright 2011 BTI360 Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to...
Java
package org.bti.ws.model; import javax.xml.bind.annotation.XmlRootElement; /** * A simple word object that contains a name and some definitions. * * @author david */ @XmlRootElement public class Word { private String name; private String definition; public Word() { } public Word(String nam...
Java
package org.bti.ws.persistence; import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.bti.ws.model.Word; /** * This is an implementation of a very simple dictionary that remains in * memory. * * @author david */ public class InMemoryDictionary { private static InMemoryDicti...
Java
package org.bti.ws.resource; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.Path; import javax.ws.rs.GET; import javax.ws.rs.PUT; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.Response; import javax.xml.bind.JAXBElement; import org.bti.ws.model.Word; imp...
Java
package com.bti.ws.model; import javax.xml.bind.annotation.XmlRootElement; /** * A simple word object that contains a name and some definitions. * * @author david */ @XmlRootElement public class Word { private String name; private String definition; public Word() { } public Word(Str...
Java
package com.bti.ws.model; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name="words") public class WordList { private static final long serialVersionUID = 1L; @XmlElement(name="word") List<Word>...
Java
package com.bti.ws.persistence; import java.util.List; import com.bti.ws.model.Word; public interface DictionaryDao { void putWord(Word word); Word getWord(String word); void removeWord(String word); List<Word> getWords(); }
Java
package com.bti.ws.persistence; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.stereotype.Repository; import com.bti.ws.model.Word; @Repository public class DictionaryDaoImpl implements DictionaryDao { private Map<String, Word> map = n...
Java
package com.bti.ws.controller; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springf...
Java
package org.bti.ws.model; import org.springframework.ui.ModelMap; public class ExtModelMap extends ModelMap { private static final long serialVersionUID = 1L; private static final String SUCCESS = "success"; private static final String ROOT = "data"; public ExtModelMap(){ this.addAttribute(SUCCESS, true);...
Java
package org.bti.ws.model; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name="root") public class ExtWrapper { private static final long serialVersionUID = 1L; @XmlElement(name="data") Word[] data; @XmlElement(name="success") boolean success = ...
Java
package org.bti.ws.model; import javax.xml.bind.annotation.XmlRootElement; /** * A simple word object that contains a name and some definitions. */ @XmlRootElement public class Word { private Integer id; private String name; private String definition; public Word() { } public Word(S...
Java
package org.bti.ws.persistence; import java.util.List; import org.bti.ws.model.Word; public interface DictionaryDao { void putWord(Word word); Word getWord(int word); void removeWord(int word); List<Word> getWords(); }
Java
package org.bti.ws.persistence; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.bti.ws.model.Word; import org.springframework.stereotype.Repository; @Repository public class DictionaryDaoImpl implements DictionaryDao { private Map<Integer, Word> map = n...
Java
package org.bti.ws.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; import org.bti.ws.model.ExtModelMap; import org.bti.ws.model.ExtWrapper; import org.bti.ws.model.Word; import org.bti.ws.persistence.DictionaryDao; import org.springframework.beans.factory.annotation.Autowired; impor...
Java
package com.bti.http.client; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.util.zip.GZIPInputStream; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.client.ClientHttpResponse; import org.s...
Java
package com.bti.http.client; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URI; import java.net.URL; import java.net.URLConnection; import org.springframework.http.HttpMethod; import org.springframework.http.client.ClientHttpRequest; import org.springframework.http.client.ClientHttpRe...
Java
package com.bti.http.client.test; import java.io.IOException; import java.net.URI; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.http.client.ClientHttpRequest; import org.springframework.util.StringUt...
Java
package com.bti.http.client; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URI; import java.net.URISyntaxException; import java.util.List; import java.util.Map; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.cli...
Java
package com.bti.ws.controller; import com.bti.ws.domain.Word; import org.springframework.roo.addon.web.mvc.controller.RooWebScaffold; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @RooWebScaffold(path = "words", formBackingObject = Word.class) @Reques...
Java
package com.bti.ws.controller; import org.springframework.format.FormatterRegistry; import org.springframework.format.support.FormattingConversionServiceFactoryBean; import org.springframework.roo.addon.web.mvc.controller.RooConversionService; /** * A central place to register application Converters and Form...
Java
package com.bti.ws.domain; import org.springframework.roo.addon.entity.RooEntity; import org.springframework.roo.addon.javabean.RooJavaBean; import org.springframework.roo.addon.tostring.RooToString; import javax.validation.constraints.NotNull; import javax.persistence.Column; import org.springframework.roo.addon.json...
Java
package controllers; import play.*; import play.libs.WS; import play.libs.WS.HttpResponse; import play.libs.WS.WSRequest; import play.mvc.*; import java.io.IOException; import java.util.*; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import models.*; public class Dictionary extends Control...
Java
package com.bti.model; public class Word { private String name; private String definition; public Word() { } public Word(String name) { this.name = name; } public Word(String name, String definition) { this.name = name; this.definition = definition; } ...
Java
package com.bti.client; public class DictionaryClientException extends RuntimeException { /** * */ private static final long serialVersionUID = 1L; public DictionaryClientException(Exception e) { super(e); } public DictionaryClientException(String message) { super(message); } }
Java
package com.bti.client; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.client.HttpClient; i...
Java
package com.bti.client; import java.util.List; import com.bti.model.Word; public interface DictionaryClient { void post(String name, String definition); void put(Word word); Word get(String word); List<Word> getAll(); void delete(String word); }
Java
import java.util.*; import play.jobs.*; import play.test.*; import models.*; @OnApplicationStart public class Bootstrap extends Job { public void doJob() { if(Word.count() == 0) { Fixtures.load("data.yml"); } } }
Java
package models; import javax.persistence.Entity; import play.data.validation.Required; import play.db.jpa.Model; @Entity public class Word extends Model { @Required public String name; @Required public String definition; public Word(String name, String definition) { this.name = name; this.definit...
Java
package controllers; import java.util.Date; import java.util.List; import models.Word; import play.data.validation.Valid; import play.mvc.Controller; public class Dictionary extends Controller { public static void all() { List<Word> words = Word.find("order by name").fetch(); renderJSON(word...
Java
import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.text.DecimalFormat; public class LoanApplet extends JApplet { private JPanel panel; private JPanel pan; private JPanel pan1; private JPanel pan2; private JPanel pan3; private JPanel pan4; private JPanel pan5; privat...
Java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package conversores; import java.sql.SQLException; import java.util.logging.Level; import java.util.logging.Logger; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import ja...
Java
package modelo; import java.util.Objects; public class CategoriaProduto { private int id; private String nome; public CategoriaProduto(){ } public CategoriaProduto(int id, String nome){ this.setId(id); this.setNome(nome); } public int ...
Java
package modelo; public class Produto { private int id; private String codigoInterno; private String nome; private float valor; private CategoriaProduto categoriaProduto; public Produto(){ } public Produto(int id, String codigoInterno, String nome, flo...
Java
package controle; import java.sql.SQLException; import java.util.List; import javax.enterprise.context.RequestScoped; import javax.inject.Named; import modelo.Produto; import persistencia.ProdutoDAO; import modelo.CategoriaProduto; import persistencia.CategoriaProdutoDAO; @Named(value = "produtoMB") @Requ...
Java
package controle; import java.sql.SQLException; import java.util.List; import javax.enterprise.context.RequestScoped; import javax.inject.Named; import modelo.CategoriaProduto; import persistencia.CategoriaProdutoDAO; @Named(value = "categoriaProdutoMB") @RequestScoped public class CategoriaProdutoMB {...
Java
package persistencia; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class Conexao { private Connection con; private PreparedStatement pstm; private ResultSet rs; public C...
Java
package persistencia; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import modelo.CategoriaProduto; public class CategoriaProdutoDAO extends Conexao { public CategoriaProdutoDAO() throws SQLException { super(); } public void inserir(CategoriaProdut...
Java
package persistencia; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import modelo.Produto; public class ProdutoDAO extends Conexao { private CategoriaProdutoDAO categoriaProdutoDAO; public ProdutoDAO() throws SQLException { super(); categoriaPro...
Java