<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Zoklet.net - Codes of all kinds</title>
		<link>http://zoklet.net/bbs</link>
		<description>Anything that has to do with programming, scripting, interpreting, compiling, or assembling. Perl, php, lisp, C++, Java, asm, and Python are all welcome. Any others have to wait at the door.</description>
		<language>en</language>
		<lastBuildDate>Sat, 25 May 2013 07:21:25 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.zoklet.net/bbs/images/clean_misc/rss.jpg</url>
			<title>Zoklet.net - Codes of all kinds</title>
			<link>http://zoklet.net/bbs</link>
		</image>
		<item>
			<title>Help Me: Help me send multiple lines at once in a HTTP request(in JAVA)</title>
			<link>http://zoklet.net/bbs/showthread.php?t=273717&amp;goto=newpost</link>
			<pubDate>Mon, 13 May 2013 01:51:36 GMT</pubDate>
			<description><![CDATA[This is my code that I have so far.  I've cut off some of the functions that is was using, and I've tried to place some extra lines in, but I think...]]></description>
			<content:encoded><![CDATA[<div>This is my code that I have so far.  I've cut off some of the functions that is was using, and I've tried to place some extra lines in, but I think that only the last line is being sent, rather than all at once.  So, how could I send them all at once, so that my entire HTTP request is sent?<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">import java.net.*;<br />
import java.util.HashMap;<br />
import java.util.Iterator;<br />
import java.util.Map;<br />
import java.io.*;<br />
import javax.net.ssl.HostnameVerifier;<br />
import javax.net.ssl.HttpsURLConnection;<br />
import javax.net.ssl.SSLSession;<br />
import sun.misc.BASE64Encoder;<br />
<br />
public class RESTBindingAPIExampleHTTPS {<br />
public static class MyHostnameVerifier implements HostnameVerifier {<br />
public boolean verify(String hostname, SSLSession session) {<br />
// verification of hostname is switched off<br />
return true;<br />
}<br />
}<br />
public static void main(String[] args) throws Exception {<br />
// connection and authentication<br />
@SuppressWarnings(&quot;rawtypes&quot;)<br />
Map paramNameToValue = new HashMap(); // parameter name to value map<br />
String URL_BASE = &quot;https://&quot;;<br />
String method = &quot;GET&quot;;<br />
String userName = &quot;admin&quot;;<br />
String password = &quot;admin&quot;;<br />
String authentication = userName + ':' + password;<br />
String host = &quot;123.123.123.123&quot;;<br />
String port = &quot;443&quot;;<br />
final String HTTP_MODE_POST = &quot;GET&quot;;<br />
// command<br />
String xmlFile = &quot;CreateNewProject.xml&quot;;<br />
String command = &quot;create&quot;;<br />
// construct URL<br />
StringBuffer params = new StringBuffer();<br />
if (paramNameToValue.keySet().size() &gt; 0) {<br />
boolean isFirstParam = true;<br />
for (@SuppressWarnings(&quot;rawtypes&quot;)<br />
Iterator paramIter =<br />
paramNameToValue.keySet().iterator();paramIter.hasNext();) {<br />
String paramStr = (String)paramIter.next();<br />
if (isFirstParam) {<br />
params.append(&quot;?&quot; + paramStr);<br />
isFirstParam = false;<br />
} else {<br />
params.append(&quot;&amp;&quot; + paramStr);<br />
}<br />
params.append(&quot;=&quot; +<br />
URLEncoder.encode((String)paramNameToValue.get(paramStr),&quot;UTF-8&quot;));<br />
}<br />
}<br />
URL url = null;<br />
if (method.equals(HTTP_MODE_POST))<br />
url = new URL(URL_BASE + host + ':' + port + &quot;/indexOftheSite/mainpage &quot; + command);<br />
else<br />
url = new URL(URL_BASE + host + ':' + port + &quot;/indexOftheSite/mainpage &quot; + command);<br />
// open HTTPS connection<br />
HttpURLConnection connection = null;<br />
connection = (HttpsURLConnection)url.openConnection();<br />
((HttpsURLConnection) connection).setHostnameVerifier(new MyHostnameVerifier());<br />
connection.setRequestMethod(method); <br />
BASE64Encoder encoder = new BASE64Encoder();<br />
String encoded = encoder.encode((authentication).getBytes(&quot;UTF-8&quot;));<br />
<b>connection.setRequestProperty(&quot;Accept: &quot;, &quot;image/gif, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, */*&quot; + encoded);<br />
connection.setRequestProperty(&quot;Accept-Language: &quot;, &quot;en-us&quot; + encoded);<br />
connection.setRequestProperty(&quot;User-Agent: &quot;, &quot;Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; Trident/5.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.30729; .NET CLR 3.5.30729; .NET4.0C)&quot; + encoded);<br />
connection.setRequestProperty(&quot;Accept-Encoding: &quot;, &quot;html&quot; + encoded);<br />
connection.setRequestProperty(&quot;Host: &quot;, &quot;websiteIlike.com&quot; + encoded);<br />
connection.setRequestProperty(&quot;Connection: &quot;, &quot;Keep-Alive&quot; + encoded);<br />
connection.setRequestProperty(&quot;Cache-Control: &quot;, &quot;no-cache&quot; + encoded);<br />
connection.setRequestProperty(&quot;Cookie: &quot; , &quot;myname=Sally&quot; + encoded);</b><br />
// insert XML file<br />
if (xmlFile != null)<br />
{<br />
connection.setDoOutput(true);<br />
OutputStream out = connection.getOutputStream();<br />
@SuppressWarnings(&quot;resource&quot;)<br />
FileInputStream fileIn = new FileInputStream(xmlFile);<br />
byte[] buffer = new byte[1024];<br />
int nbRead;<br />
do<br />
{<br />
nbRead = fileIn.read(buffer);<br />
if (nbRead&gt;0) {<br />
out.write(buffer, 0, nbRead);<br />
}<br />
} while (nbRead&gt;=0);<br />
out.close();<br />
}<br />
// execute HTTPS request<br />
int returnCode = connection.getResponseCode();<br />
InputStream connectionIn = null;<br />
if (returnCode==200)<br />
connectionIn = connection.getInputStream();<br />
else<br />
connectionIn = connection.getErrorStream();<br />
// print resulting stream<br />
BufferedReader buffer = new BufferedReader(new InputStreamReader(connectionIn));<br />
String inputLine;<br />
while ((inputLine = buffer.readLine()) != null)<br />
System.out.println(inputLine);<br />
buffer.close();<br />
}<br />
}</code><hr />
</div>When I run it without the connection.setRequestProperty statements, the page loads, but says that I need to log in.  When I run it with them, the page displays &quot;Error&quot;.</div>

]]></content:encoded>
			<category domain="http://zoklet.net/bbs/forumdisplay.php?f=9">Codes of all kinds</category>
			<dc:creator>SBTlauien</dc:creator>
			<guid isPermaLink="true">http://zoklet.net/bbs/showthread.php?t=273717</guid>
		</item>
		<item>
			<title>Programming joke...</title>
			<link>http://zoklet.net/bbs/showthread.php?t=273376&amp;goto=newpost</link>
			<pubDate>Thu, 09 May 2013 06:49:30 GMT</pubDate>
			<description><![CDATA[More specifically a javascript joke : 
 
 
Code: 
--------- 
$('randomselector').on('click', function() { 
    var $this = $(this) 
   ...]]></description>
			<content:encoded><![CDATA[<div>More specifically a javascript joke :<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">$('randomselector').on('click', function() {<br />
&nbsp; &nbsp; var $this = $(this)<br />
&nbsp; &nbsp; buildPopup($this)<br />
&nbsp; &nbsp; $this.show()<br />
<br />
&nbsp; &nbsp; // Hahaha, I am using... A closure!<br />
&nbsp; &nbsp; $this.children('.close').click(function() {<br />
&nbsp; &nbsp; &nbsp; // $this isn't actually $(this) in this case. That is to say this this is<br />
&nbsp; &nbsp; &nbsp; // not selected by this $this, but rather by this $(this) where this is<br />
&nbsp; &nbsp; &nbsp; // this this.<br />
&nbsp; &nbsp; &nbsp; $this.hide<br />
})</code><hr />
</div>I thought it was funny :(<br />
<br />
<a href="http://i.imgur.com/sSYZ8Dn.jpg" target="_blank"><img src="http://i.imgur.com/sSYZ8Dn.jpg" height="150" width="150" border="0" alt="" /></a></div>

]]></content:encoded>
			<category domain="http://zoklet.net/bbs/forumdisplay.php?f=9">Codes of all kinds</category>
			<dc:creator>Lanny</dc:creator>
			<guid isPermaLink="true">http://zoklet.net/bbs/showthread.php?t=273376</guid>
		</item>
		<item>
			<title>Want to Do: Make a program that acts like a web browser and sends http GET/POST requests</title>
			<link>http://zoklet.net/bbs/showthread.php?t=273070&amp;goto=newpost</link>
			<pubDate>Sun, 05 May 2013 13:51:32 GMT</pubDate>
			<description>How difficult would it be to make a web browser that will send HTTP GET/POST requests, receive the responses from the website, and output the...</description>
			<content:encoded><![CDATA[<div>How difficult would it be to make a web browser that will send HTTP GET/POST requests, receive the responses from the website, and output the response to a window?<br />
<br />
Are there any open source browsers like this out there?<br />
<br />
How difficult is it to program the HTTP part?</div>

]]></content:encoded>
			<category domain="http://zoklet.net/bbs/forumdisplay.php?f=9">Codes of all kinds</category>
			<dc:creator>SBTlauien</dc:creator>
			<guid isPermaLink="true">http://zoklet.net/bbs/showthread.php?t=273070</guid>
		</item>
		<item>
			<title>Help Me: Is is possible to send cookies via a HTML form during a GET request?</title>
			<link>http://zoklet.net/bbs/showthread.php?t=272860&amp;goto=newpost</link>
			<pubDate>Thu, 02 May 2013 20:21:12 GMT</pubDate>
			<description>Could I turn cookies off in my browser and sill be able to send cookie parameters in a http GET request? 
 
For instance, the table below shows the...</description>
			<content:encoded><![CDATA[<div>Could I turn cookies off in my browser and sill be able to send cookie parameters in a http GET request?<br />
<br />
For instance, the table below shows the type, name, and value of variables that my browser sends to Zoklet in a GET request.  I have, of course, changed the values for my protection.  The URL cookie would just be added after the ? in the URL, but the cookies is what I'm asking about.<br />
<br />
Without cookies enabled, I don't think that logging into the Zoklet bbs would work, due to the bbsessionhash cookie.  Every time I have modified that with a proxy, I get the &quot;You need to login page&quot;.<br />
<br />
My question is, if I turned cookies off in my browser, could I send the values of the cookies(name and value, and somehow type) using a form, and get the same results(which would be my account logged in) as if I had cookies enabled?  I know that I would need the values of the specific cookies, but I am just wondering if the cookies could still be sent within a regular http request, with no proxy involved.<br />
<br />
Type.......Name..................Value<br />
--------------------------------------------------------<br />
URL........f.........................9<br />
Cookie....	IDstack................%2B11687%1B<br />
Cookie....	bblastvisit.............1584681357<br />
Cookie....	bblastactivity........0<br />
Cookie....	__utma................2482584613.1580495047.158049  5047.1485079405.1580495047.1<br />
Cookie....	__utmb................248035413.11.1580484135<br />
Cookie....	__utmz................145873658.1580235079.1.1.utm  csr=(direct)|utmccn=(direct)|utmcmd=(none)<br />
Cookie....	bbsessionhash.......a0201e21cd117ba4a45d23ac753a31  2a<br />
Cookie....	__utmc................158456824</div>

]]></content:encoded>
			<category domain="http://zoklet.net/bbs/forumdisplay.php?f=9">Codes of all kinds</category>
			<dc:creator>SBTlauien</dc:creator>
			<guid isPermaLink="true">http://zoklet.net/bbs/showthread.php?t=272860</guid>
		</item>
		<item>
			<title>Want to Do: Create a program that analyzises lengthy legislation, (theoretical)</title>
			<link>http://zoklet.net/bbs/showthread.php?t=272343&amp;goto=newpost</link>
			<pubDate>Fri, 26 Apr 2013 04:45:25 GMT</pubDate>
			<description>*my idea*: create a program/software that breaks down the long ass legislation into a summary of the things the legislation changes that you...</description>
			<content:encoded><![CDATA[<div><b>my idea</b>: create a program/software that breaks down the long ass legislation into a summary of the things the legislation changes that you like/don't like.<br />
<br />
I'm sure I'm not the only one that feels the government could (legally) fuck me in the ass one day:paranoid:<br />
<br />
It's happened...<br />
<br />
In reality to have everything down to a T, This might require the knowledge of a doctor, a lawyer, a finance guru, an English teacher, an engineer, a priest, and many other professionals I can't think of right. But the idea is to code the logic to analyze pages of mind-numbing junk, and giving the user the important stuff, like backdoors you may not be paying attention to, things thats not gonna be in the news. But I wouldn't be surprised if you could create a crudely effective program using what the average joe knows. Yes one must admit that we can not predict the future and the lasting effects down the road... But a little common sense can go a long way.<br />
<br />
<br />
<b>example</b><br />
How do you know if legislation is beneficial to you or not? How do you know if Obamacare is working for you in the bottom line? You gonna read all 2000 pages of the affordable healthcare act? While at the same time rationalizing every line? Do you think all the other analysts tell you everything that's important to you? ITT, work=dollar/soul dredge. So The way I could see it is it either makes you work more, or pay more. Even if you're paying less, unless you're on public assistance you probably work harder. Nothing goes unaffected. No as far as the magnitude of the effect goes (how much it effects you), that's a different story, which would be up to the interpreter to decide.<br />
<br />
So basically you program criteria to be found, and retrieve the info that'll effect you.<br />
<br />
Of course you'd be looking for points that oppose your viewpoints.<br />
<br />
when an amendment is released you could link it to previous legislation keeping your information updated.<br />
<br />
If I keep this in mind Ill edit the thread as needed, as this is a tricky topic. But It's all in theory for now of course.<br />
<br />
Put shortly, be your own legislation analyst.<br />
<br />
Does anyone get my drift here?</div>

]]></content:encoded>
			<category domain="http://zoklet.net/bbs/forumdisplay.php?f=9">Codes of all kinds</category>
			<dc:creator>SquattingBear</dc:creator>
			<guid isPermaLink="true">http://zoklet.net/bbs/showthread.php?t=272343</guid>
		</item>
	</channel>
</rss>
