Sunday, August 10, 2014

<![if !supportMisalignedColumns]>
<![endif]> 
The goal


The goal of Proxy Rental API functions is to provide user an ability to switch IPS. For that purpose several API calls have to be made in certain sequence. Below we will describe each necessary operation, functions used for this operations with their appropriate parameters, while further down we will provide an example application demonstrating their usage.

Downloading The PRSetup.exe


You can download the PRSetup.exe from http://www.proxyrental.net/thankyou/. Navigating to this page will download the installation package. You will need proxy Rental program installed in order to use Proxy Rental APIs.

Recommended Software

<![if !supportLists]>·       <![endif]>.NET compiler that supports .NET 4.0: Microsoft Visual Studio 2010
<![if !supportLists]>·       <![endif]>Microsoft Visual C# 2010 Express
<![if !supportLists]>·       <![endif]>Microsoft Visual Basic 2010 Express
<![if !supportLists]>·       <![endif]>Microsoft Visual Studio 2012
<![if !supportLists]>·       <![endif]>Microsoft Visual Studio Express 2012 for Windows Desktop

Add Service Reference

Prior to using ProxyRental APIs, add the following Service Reference to your c# project
http://mprs.proxyrental.net:45679/ProxyRental/SoapClientService (Screenshot)

Opening new session

A Proxy Rental user can switch IPs multiple times.  The actual number depends on the program purchased from Proxy Rental.  However, in order to accomplish any operation with Proxy Rental APIs a user have to have an open SOAP session.
private Session session;
...
session = new Session();
session = client.TryRestoreOrLogin(user, session);

This call authenticates user on the server side and allows subsequent calls to change IPS.
Session type is defined in ProxyRental service reference that should be included in the program.  
Client parameter is of SoapClientServiceClient type and is also defined in ProxyRental service reference as is the user parameter.

User user = new User();
user.Name = userName;
user.Hash = GetEncryptedString(userPwd);

User type has two properties Name and Hash.   Name is self explanatory, while Hash is Encrypted user password.  Each user selects his or her own user name and password during ProxyRental Install procedure, prior to login in.

Encryption is provider via MD5CryptoService defined in System.Security.Cryptography  A sample of encryption function is provided below in the subsequent example. 

In case of success the function  session = client.TryRestoreOrLogin(user, session);
returns session id that needs to be supplied to subsequent functions.  If this function fails then the function might return the following error values.

Error Value
Meaning
00000000-0000-0000-0000-000000000000
unknown behavior (example user is not logged in)
10000000-0000-0000-0000-000000000000
user subscription has expired
20000000-0000-0000-0000-000000000000
Number of allowed sessions has expired
30000000-0000-0000-0000-000000000000
incorrect user name or user password
40000000-0000-0000-0000-000000000000
server is under diagnostics

Change Proxy

Now, once session is established, a user can start changing IPs.  For that purpose one should use Proxy Rental method ChangeProxy.

ChangeProxyResult changeProxyResult = client.ChangeProxy(session);

ChangeProxy method is also defined in ProxyRental service reference.  It accepts session parameter, changes IP, does a number of other internal operations and collects important information that is made available  by calling the following method:
GlobalInfo ginfo = client.GetProxyInfo(session, sort);

Global Information


GetProxyInfo method accepts two parameters: sessionID and sort, where sort could have two possible values specified in enumerator GlobalInfoSort 

GlobalInfoSort.ByDistance
or
GlobalInfoSort.ByState

Sort order starts matter when user deals with geo-location associated with the new IP and will be discussed below.  When changing ip is the only purpose of the call, the sort parameter can be passed as null.  GlobalInfo ginfo = client.GetProxyInfo(session, null);

GlobalInfo structure returns the following information:

public class GlobalInfo
{
  private GlobalInfo[] nearestInfos;
  public string   CurrentIP { get; set; }
  public string   City { get; set; }
  public string   CityCode { get; set; }
  public string   CountryName { get; set; }
  public string   AreaCode { get; set; }
  public string   State { get; set; }
  public string   Latitude { get; set; }
  public string   Longitude { get; set; }
  public TimeSpan ProxyTimeout { get; set; }
  public int      NonDstTimeZone { get; set; }
  public long     CLTime { get; set; }
  public long     CLTimeActuality { get; set; }
  public string   TimeZoneID { get; set; }
  public double   Persistence;
  public double   Health;
}

Below is the description of those data members that are usually are most useful.
Field
Description
nearestInfos
Array containing a list of locations nearest to the Current IP
AreaCode
Area Code of the Current IP
City
City of the Current IP
CityCode
Craigs's List City Code
CountryName
Country of the current IP
CurrentIP
New IP that user gains after switch
Lattitude
Lattitude of the Current IP
Longitude
Longitide of the Current IP
State
State of the Current IP
Persistence
Proxy stability - a value between 0 and 10

Global Information[] nearestInfos
This array, containing the information about nearest locations to the current IP, deserves special consideration.   This information becomes pertinent when an IP happens to be located not in the vicinity of a CL city, but, for example, in some rural area.   In this case, nearestInfos  array provides information regarding surrounding CL cities.  Latitude and  longitude information can be used to determine the distance from the IP location to the CL city.  Please click here for example.






public struct ProxyFilterParams
{
       public float? Persistance;
       public int? ProxyTimeout;
       public ProxyFilterClassification ProxyKind;
       public float SpeedQuality;
}


Test Project




Monday, June 30, 2014

A Letter to David

I wanted to tell you about my A and B priority theory, but just it didn’t come to pass and I didn’t want to talk about it around everybody to avoid interruptions and side-tracking.
Here ‘s what it is in the nutshell.
I think that destiny is predefined, like you’ve seen in that astrology prediction, but only to a degree.  In other words a human being has several predefined, but different trajectories and it’s up to a person, which one he or she would select.  For example, I could have stayed in Russia and my life would go in a different way from what it was when I immigrated to America, but it would still be my predefined path, not the path of Stalin.

So a person, especially a man, has its “best”or  an “A”  path, along which he accomplishes something significant, like Moses who was able to state his case with the pharaoh or Einstein developing his Theory of Relativity, etc.  Gustave Flaubert, for example, who, in my view, wasn’t a very talented writer, and should he have taken a different one of his paths, could have easily remain nobody, nevertheless struck gold and came up with his immortal novel Madame Bovary.


Certainly, it is important to know “what is your main talent?” in order to pursue your plan “A.”  Talent reduces the competition, or rather gives you a head start over people having no talent in the particular area.
The problem is – most people don’t know what their main talent or main area is; and here where they sit, and feel sad and miserable about themselves, thus taking the lower path of their life. 

In its time Lui Paster (The inventor of pasteurized milk) said that “Discoveries favor trained minds.” That’s very much true.  The inventor is the person who knows everything that everybody else know, plus the little new piece that only he or she knows.  That piece makes all the difference, but by itself is worthless.  It’s only great as a part of the set. 
In art things happen in about the same way.  I recall reading this book about famous Spanish painter Francisco Goya.  In one of the chapters, the author describes how he worked on one of his famous paintings, where he used the absolutely new approach to painting.  The painting seemed complete, and in according with his vision.  He was working on it already for 3 weeks, much longer than usual, but something was off, something he couldn’t quite put his finger on.  Then something happen in his life and it clicked – he’s gotten an inspiration.  In a flash he saw what needed to be done.  It was very little, but infinitely significant.  So he fixed the painting in a matter of half an hour. 

Sure.  But he had the painting done already, in which he put 3 week worth of hard work.
That’s where I am coming to a plan “B,” which is nothing else, but accumulation of knowledge and skills.   The question is, of course, is what knowledge to pick?  That’s the tough one and each person answers it differently.  I used to work with one man from India.  He said that he became a programmer because when he was at the age to acquire a profession that’s where the money was.   If you think about it, this makes quite a bit of sense.  If you have parents who provide for you, then you can allow yourself to think of liking or disliking, your purpose in the World, philosophy, happiness, contribution, etc, but  if are only counting on yourself, you think of how to survive.  I’d imagine when little Leonardo da Vinci chose his professions he thought to himself, “Hm, the money, nowadays, are in art.  So why don’t I try to go and become the Verrocchio apprentice.”  Coming back to my Indian co-worker… the question of liking or disliking programming hasn’t ever been raised.  In America to and a couple of other rich countries people have the luxury to experience doubts, search yourself, or in general be fondle with their time.   But in most places in the World, poof, you snooze you lose.  So, regardless of whether you like crafting stone axes or not, if better learn how to make them, or else during the next big hunt a bear will eat you.   The Bible explains it a bit differently, but the essence of the issue,  I think, is the same.    

Lucky for us, we live much later than these sorrow times and live in a blessed place that allows us to eat joyfully, procrastinate and be philosophical, but even this eventually comes to an end – one has to do something in order to survive.
So, since we have to do something, how do we chose what to do?  We pick something that is down on our list of hated things.  I, for one thing, hate doing taxes, real estate contracts, everything that has to do with buildings or court systems.  But a skill that deals with arts and crafts, applied science, and medicine seems ok.  Also although I don’t know how to fix a car, if I were to study this, I can imagine myself being car mechanic, chef or even working on land or with animals.   




 







Sunday, April 20, 2014

For Yigal and Roxanne

Furniture Sale
Dining Table: Marble
Length: 71 1/2"
Width: 34 1/2"
Height: 30"
Dining Table 1
Dining Table 2
Dining Table 3
Square Coffee Table
Length: 24"
Width: 24"
Height: 19 1/2"
Quantity: 2
SquareCoffeeTable1
SquareCoffeeTable2
Couch
Length: 91"
Width: 41"
Height: 29 1/2"
Couch1
Couch2
Couch3
Walk in Closet Dresser
Length: 35 1/2"
Width: 19"
Height: 69 1/2"
CDressor1
Dressor2
Dressor3
Master Bedroom Dresser
Length: 71"
Width: 19"
Height: 29"
Mirror
Length: 40 1/2"
Width: 42 1/2"
Height: 1"
MBDressor
Bed #1
Length: 84"
Width: 64"
Height: 25"
w/Headboard: 34"
Rocking Chairs
Bed #2
Length: 84"
Width: 64"
Height: 25"
w/Headboard: 34"
Bed 2
Rocking Chair
Length: 27"
Width: 34"
Height: 34"
Quantity: 2
Rocking Chairs
Arm Chair
Length: 25"
Width: 31"
Height: 42"
Quantity: 1
Rocking Chairs
Kitchen Table
Diameter: 59"
Height: 31"
Quantity: 1
Rocking Chairs
Double Chair with leg extensions
Length: 77"
Width: 44"
Height: 38"
Quantity: 1
Rocking Chairs