Warning: hardcoded values below will need to be modified for testing against different hostnames and/or IPs
apt-get update && \| const fs = require('fs'); | |
| const Converter = require('./converter.js'); | |
| const options = { | |
| name: process.argv[3], | |
| description: process.argv[4], | |
| activate: process.argv[5], | |
| }; | |
| const converter = new Converter(JSON.parse(fs.readFileSync(process.argv[2])), options); |
| # Make sure you grab the latest version | |
| curl -OL https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip | |
| # Unzip | |
| unzip protoc-3.5.1-linux-x86_64.zip -d protoc3 | |
| # Move protoc to /usr/local/bin/ | |
| sudo mv protoc3/bin/* /usr/local/bin/ | |
| # Move protoc3/include to /usr/local/include/ |
| public static InputStream resizeImage(InputStream inputStream, int width, int height) throws IOException { | |
| BufferedImage sourceImage = ImageIO.read(inputStream); | |
| Image thumbnail = sourceImage.getScaledInstance(width, height, Image.SCALE_SMOOTH); | |
| BufferedImage bufferedThumbnail = new BufferedImage(thumbnail.getWidth(null), | |
| thumbnail.getHeight(null), | |
| BufferedImage.TYPE_INT_RGB); | |
| bufferedThumbnail.getGraphics().drawImage(thumbnail, 0, 0, null); | |
| ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |
| ImageIO.write(bufferedThumbnail, "jpeg", baos); | |
| return new ByteArrayInputStream(baos.toByteArray()); |
| package com.solarfighter.activities; | |
| import java.io.IOException; | |
| import java.net.InetAddress; | |
| import javax.jmdns.JmDNS; | |
| import javax.jmdns.ServiceEvent; | |
| import javax.jmdns.ServiceListener; | |
| import android.content.Context; |