Sunday, July 14, 2019

Proxy Server


Proxy Server: Server placed in between Client and Internet.

Before forwarding response back to the client, it can filter them to ensure they are safe to receive.

Network Security:
Any request need to be passed through Proxy Server and real IP of the client is not shown. Instead Proxy Server provides its own logical IP address to the Web Server. So any hacker is unable to hack Client as IP is made unavailable.

Network Performance Improvement:
Proxy Server has a cache, so if any client looking for updates then for first time the Proxy will download from internet and saves in the cache. For subsequent client requires the same updates instead of downloading from internet it provides from Cache. Thus, provides congestion free.

Monitor User in the Network:

Block Website: A network admin can block a particular website.

Access Control: Block Facebook and set rule to bypass for particular users.





PhantomJS HTMLUnitDriver Headless -todo-


hi

http://www.automationtestinghub.com/selenium-headless-chrome-firefox/


synchronous vs asynchronous

Link:
https://stackoverflow.com/questions/36213948/what-is-the-difference-between-asynchronous-calls-and-callbacks

Synchronous: Consumer and Provider should be present at same time to communication take page.
Ex: Web Page

In API, the code will be blocked until callback is returned.This means that until a response is returned by the API, your application will not execute any further.


asynchronous: Sender and Receiver does not need to present at same time.
Email or SMS.

Asynchronous calls do not block (or wait) for the API call to return from the server. Execution continues on in your program, and when the call returns from the server, a "callback" function is executed.

ORM : Object Relational Mapping


Mapping data which is in row and columns wise (relational database) to Object 

Serialization vs De-serialization


Serialization: Converting an object into stream of bytes.

De-Serialization: Creating an object from the stream of bytes.


.Net Memory Management : Garbage Collector


Allocates Objects into one of 2 heaps

SOH : Small Object Heap : <    85KB   : Allocated on Contiguous heap, Objects allocated continuously.



When Object B and Object A finishes its work.(no longer is used) it looses it root reference, when the function allocates and finishes.


Garbage collector: Reclaims memory from rootless objects.
GC: runs whenever the memory usage reaches certain threshold.
GCollector: Freezes all execution threads during Garbage Collection and hits the performance of your application.

LOH : Large                      : > = 85KB

You allocate on to heap whenever you are using new Keyword in Code.


Conditions for a garbage collection

Garbage collection occurs when one of the following conditions is true:
  • The system has low physical memory. This is detected by either the low memory notification from the OS or low memory indicated by the host.
  • The memory that is used by allocated objects on the managed heap surpasses an acceptable threshold. This threshold is continuously adjusted as the process runs.
  • The GC.Collect method is called. In almost all cases, you do not have to call this method, because the garbage collector runs continuously. This method is primarily used for unique situations and testing.



Tuesday, March 6, 2018

XSLT




XSLT is used to transform XML documents into other XML documents  and other formats such as HTML or plain text.

XML --> other XML formats
XML --> HTML
XML --> Plain Text

the converted files subsequently converted to other formats, such as PDFPostScript and PNG.

https://www.w3schools.com/xml/xsl_intro.asp








C# code:

public static string TransformXMLToHTML(string inputXml, string xsltString)
{
    XslCompiledTransform transform = new XslCompiledTransform();
    using(XmlReader reader = XmlReader.Create(new StringReader(xsltString))) {
        transform.Load(reader);
    }
    StringWriter results = new StringWriter();
    using(XmlReader reader = XmlReader.Create(new StringReader(inputXml))) {
        transform.Transform(reader, null, results);
    }
    return results.ToString();
}

JMeter Simple Controller

  Simple Controller is just a  container  for user request.