1. Calling statement should be like:
callingFunc(ref x, ref y)
2. Definition statement should be like:
public void callingFunc(ref int x, ref string y)
NOTE: Classes and objects are passed by reference by default in C#.
Distributed & scalable systems, Test Driven Development… and simply how to get things done!
Author: usenkanov
1. Calling statement should be like:
callingFunc(ref x, ref y)
2. Definition statement should be like:
public void callingFunc(ref int x, ref string y)
NOTE: Classes and objects are passed by reference by default in C#.
configSections should be directly after <configuration>
<configuration>
<configSections></configSections>
You can either ask someone on the other side to change the port of the server…..
OR you could just use port forwarder for windows.
This one is neat and simple!
http://www.quantumg.net/portforward.php
public class Access2 { public void f() { for (int i=0; i<10; i++) { final int value = i; Runnable runnable = new Runnable() { public void run() { System.out.println(value); } }; } } }
From the Java Language Specification:
Variables may be marked transient to indicate that they are not part of the persistent state of an object.
For instance, fields in the class that can be derived from other fields in the class. Good example would be to save Image objects as transient object. When object is being de-serialized transient fields usually need to be reinitialized.
Eg:
private void readObject(ObjectInputStream inputStream) throws IOException, ClassNotFoundException{inputStream.defaultReadObject();generateImage();}
In this example generateImage method needs to be called to read the image based on some non-transient variables (such as path to the image) 🙂
JTA – Java Transaction API – allows multiple transactions (thus, distributed) to be performed on more than one XA resources in Java environment.
Note: XA describes the interface between the global transaction manager and the local resource manager. The goal of XA is to allow multiple resources (such as databases, application servers, message queues, transactional caches, etc.) to be accessed within the same transaction, thereby preserving the ACID properties across applications. XA uses a two-phase commit to ensure that all resources either commit or rollback any particular transaction consistently (all do the same).
JTS – Java Transaction Service – is a specification for building a transaction manager that maps onto the Object Management Group’s (OMG) Object Transaction Service (OTS) used in the CORBA (Common Object Request Broker Architecture) architecture.
* note: Due to late criticism and decline in popularity of CORBA (WebServices are getting more and more popular) JTS is primarily used within J2EE architecture and rarely supports integration with other languages/architectures.
More information:
http://www.ibm.com/developerworks/java/library/j-jtp0305/index.html
http://www.ibm.com/developerworks/java/library/j-jtp0410/index.html
JAAS – Java Authentication and Authorization Service – provides a way for a J2EE application to authenticate and authorize a specific user or group of users to run it. It is a standard Pluggable Authentication Module (PAM) framework that extends the Java 2 platform security architecture to support user-based authorization.
SaaS – software as a service:
– “on-demand” delivery model for business applications
– has been incorporated into the strategy of all leading enterprise software companies
– has been popularized by salesforce.com
IaaS – Infrastructure as a service
– eg: Amazon Cloud` services
PaaS – Platform as a service
– eg: Google Web Toolkit
Program can store its data in 3 places:
– data area (contains only static variables)
– stack (contains local variables and return addresses when subroutine is called)
– heap (dynamically allocated memory, objects are allocated here due to their size)
Buffer overflow:
– Stack overflow
Limited amount of memory (usually determined when program starts)
Usually caused by 2 errors:
– infinite recursion
– very large stack variables (usually creating too large local variables, therefore arrays larger than a few KB should be allocated dynamically)
ex:
int foo() {
double x[1000000];
}
* when a single-threaded program runs as a multi-threaded, it will be allocated less space per thread. Therefore program that runs OK might crush when multi-threaded.
– Heap overflow
Memory is allocated dynamically
Primarily program DATA is contained
* on average, half of all critical security leaks are based on heap overflows (ex: iPhone, PS3 homebrews)
* more information: http://www.h-online.com/security/features/A-Heap-of-Risk-747161.html
To set proxy
1. run cmd as administrator (find it in the start menu, right click and run as admin.)
2. netsh
3. winhttp
4. set proxy myproxy.address.here:8080
To unset proxy
netsh
winhttp
reset proxy
For help
netsh
winhttp
help
To see proxy settings
netsh
winhttp
show proxy