Search This Blog

Wednesday, June 5, 2013

Microsoft Visual C++ Tips and Tricks

Microsoft Visual C++ Tips and Tricks:

 "0xCDCDCDCD Allocated in heap, but not initialized
0xDDDDDDDD Released heap memory.
0xFDFDFDFD "NoMansLand" fences automatically placed at boundary of heap memory. Should never be overwritten. If you do overwrite one, you're probably walking off the end of an array.
0xCCCCCCCC Allocated on stack, but not initialized"

Develop For Google Glass?

Want To Develop For Google Glass? Watch These Videos | WebProNews:


Wednesday, April 10, 2013

android - How to post data to not verified SSL url

the next code snippets will  allow you to make HTTPS call to non verified SSL certificate.

 HostnameVerifier hostnameVerifier = org.apache.http.conn.ssl.SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER;  
 HttpClient client = new DefaultHttpClient();  
 SchemeRegistry registry = new SchemeRegistry();  
 SSLSocketFactory socketFactory = SSLSocketFactory.getSocketFactory();  
 socketFactory.setHostnameVerifier((X509HostnameVerifier) hostnameVerifier);  
 registry.register(new Scheme("https", socketFactory, 443));  
 SingleClientConnManager mgr = new SingleClientConnManager(client.getParams(), registry);  
 DefaultHttpClient httpClient = new DefaultHttpClient(mgr, client.getParams());  
 HttpPost post = new HttpPost("https://www.yaniv.co.il/tst/IsValidUser.php");  
 List<NameValuePair> pairs = new ArrayList<NameValuePair>();  
 pairs.add(new BasicNameValuePair("user_name", user));  
 pairs.add(new BasicNameValuePair("password", pwd));  
 pairs.add(new BasicNameValuePair("type", type));                 
 post.setEntity(new UrlEncodedFormEntity(pairs, HTTP.UTF_8));  
 HttpParams params = new BasicHttpParams();  
 int timeoutConnection = 5000;  
 HttpConnectionParams.setConnectionTimeout(params, timeoutConnection);  
 post.setParams(params);  
 HttpResponse response = httpClient.execute(post);  

be aware ,its not safe to make calls to non verified ssl, unless you know what are you doing.

enjoy
yaniv tzanany