Thursday, June 23, 2016

android webcam

Android Webcam Server 10.0.0.232

bookmarks

hacks

Hack a Day
PWeb
ICKC
Android Webcam Server
What Is My IP Address - Shows Your IP Address
element14: Community: The Ben Heck Show
InventorSpot
iFixit
quirky projects | participate
KC Gig Ideas - KCGigIdeas
Smooth-On Mold Making & Casting Materials
This to That (Glue Advice)
linux cheat sheet
USB Bike Generator
TV Volume Loudness Guard using Arduino
Variations on normal by Dominic Wilcox | Ideas, observations and inventions

JCL

Android

APK Downloader [Latest] Download Directly | Chrome Extension v3 (Evozi Official)
Android APK Decompiler

Olathe Public Library
60 Minutes
FRONTLINE Online | PBS
American Public Television
App Inventor for Android
Charlie Rose
HowStuffWorks
PBS
TED
Wired Video
npr
Lifehacker
Gizmodo
Atomic Shrimp
Merriam-Webster
Instructables
Invention City | Invention Prototype and Prototyping Companies - How to Make Prototypes of Invention Ideas - Invention Prototyp
Popular Science
Popular Mechanics
Inventor's Handbook
blekko | invention /support
meaning of life
Body browser
NOVA | PBS
Electronics for you
Mobile World Live
nasa tv
Android dev
Google Translate
Cowtown Computer Congress
MAKE magazine on Vimeo
Mechanical Mashup
makezine
Prezi - The Zooming Presentation Editor
DIYGenius.tv
Wolfram|Alpha
Learn C++
Inventables: Find new materials
codepad
Thesaurus
Inventor's Center of KC
Jim Emery
C3KC University
Android Location API - Tutorial
TechStars
Startup Foundation
How It's Made Videos
Google Zeitgeist
Khan Academy
Facebook HTML5
HTML5 New Elements
TSN: V.S. Ramachandran
Google Maps API
Maps
Hadoop
keyword spy
Online Edu links
Udacity
Learn About Electronics
CircuitLab
Coursera
Coursera human physio
http://physicsdatabase.com/book-list-by-title/
Welcome to Facebook - Log In, Sign Up or Learn More
This Old House
ODA - The Online Disassembler
Auto Repair Group
Car How-to videos
10 Apps to Get Kids Excited About Science
Eneregy saving tips KCPL
Find the right glue
What are the best travel hacks? - Quora
House DIY
HowStuffWorks "Appliances Deconstructed Videos"
Computer Language Benchmarks Game
Openculture
Gotinvention radio show
McMaster-Carr
rtl-sdr.com
hetland.org : Instant Python
One Month Python
TED-Ed Blog» Blog Archive » Quantum mechanics 101: Demystifying tough physics in 4 easy lessons
Interview with snuke, Winner of the August Writer’s Incentive TCO Trip – topcoder
TopCoder Statistics - Problem Archive
The Naked Scientists Online, Science Podcast and Science Radio Show
Ron Hazelton Online • DIY Ideas & Projects
Bjarne Stroustrup's Homepage
Learn Programming, Web Design, Business | General Assembly
thenewboston - Free Educational Video Tutorials on Computer Programming, Web Design, Game Development and More!
Open SecurityTraining - YouTube
g33k/ArduinoProjects/RF/ESP8266/NodeMCU/Lua at master · hwiguna/g33k · GitHub
NASA Television | NASA
United Nations Statistics Division - National Accounts
Difference Between Similar Terms and Things

Monday, July 11, 2011

Send mail with Lotus Notes from Java

import java.util.ArrayList;
import java.util.List;
 
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
 
/**
 * 
 * @author Toni Bünter, SRZXML
 * This class provides a services that connects to LN.
 */
public class LotusMailService {
 
    private static Log logger = LogFactory.getLog(LotusMailService.class);
 
    private String loginUrl = "http://intrawes-ite.zrh.swissre.com/webapp/sls/login";
    private String targetUrl = "http://intrawes-ite.zrh.swissre.com/webapp/idomzht1aa/DOMAPP/gurptest.nsf/fmMail?CreateDocument";
    private String flushUrl = "http://intrawes-ite.zrh.swissre.com/webapp/idomzht1aa/DOMAPP/gurptest.nsf/agMailSend?OpenAgent";
    private String userid;
    private String passwd;
 
    public void setLoginUrl(String loginUrl) {
        this.loginUrl = loginUrl;
    }
 
    public void setTargetUrl(String targetUrl) {
        this.targetUrl = targetUrl;
    }
 
    public void setFlushURL(String flushUrl) {
        this.flushUrl = flushUrl;
    }
 
    public void setUserid(String userid) {
        this.userid = userid;
    }
 
    public void setPasswd(String passwd) {
        this.passwd = passwd;
    }
     
    /**
     * 
     * @param receiver mail address or receivers (could be 
     * SRZXLM, or toni_buenter@rcomext.com, or toni.buenter@ooit.com)
     * @param subject mail subject
     * @param body mail content (could contain a restricted set of HTML tags)
     * @throws Exception
     */
    public void sendMail(String receiver, String subject, String body)
            throws Exception {
        logger.info("INTRAWES_LOGIN_URL   : " + loginUrl);
        logger.info("LOTUS_MAILSERVER_URL : " + targetUrl);
        logger.info("LOTUS_MAILFLUSH_URL  : " + flushUrl);
        logger.debug("receiver            : " + receiver);
        logger.debug("subject             : " + subject);
        logger.debug("body                : " + body);
 
        DefaultHttpClient httpclient = new DefaultHttpClient();
 
        HttpPost httpPost = new HttpPost(loginUrl);
        List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
        nameValuePairs.add(new BasicNameValuePair("userName", userid));
        nameValuePairs.add(new BasicNameValuePair("pin", passwd));
        httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
        HttpResponse rs = httpclient.execute(httpPost);
        Header statusHeader = rs.getFirstHeader("SLSStatus");
        httpPost.abort();
        if (statusHeader != null && "200".equals(statusHeader.getValue())) {
            HttpEntity ent = rs.getEntity();
            if (ent != null) {
                ent.consumeContent();
            }
            httpPost = new HttpPost(targetUrl);
            httpPost.addHeader("Content-Type",
                    "application/x-www-form-urlencoded");
            nameValuePairs = new ArrayList<NameValuePair>(3);
            nameValuePairs.add(new BasicNameValuePair("SendTo", receiver));
            nameValuePairs.add(new BasicNameValuePair("Subject", subject));
            nameValuePairs.add(new BasicNameValuePair("Body", body));
            httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
            rs = httpclient.execute(httpPost);
            logger.info("status line: " + rs.getStatusLine().getReasonPhrase());
            ent = rs.getEntity();
            if (ent != null) {
                String s = EntityUtils.toString(ent);
                logger.info("return message post: " + s);
                ent.consumeContent();
            }
            //
            // FLUSH
            //
            HttpGet httpget = new HttpGet(flushUrl);
            rs = httpclient.execute(httpget);
            ent = rs.getEntity();
            if (ent != null) {
                String s = EntityUtils.toString(ent);
                logger.info("return message flush: " + s);
                ent.consumeContent();
            }
            //
            //
            //
        } else {
            HttpEntity ent = rs.getEntity();
            logger.warn("Failed to logon");
            if (ent != null) {
                String s = EntityUtils.toString(ent);
                logger.info("return message: " + s);
                ent.consumeContent();
            }
        }
    }
 
 
}