Posts

How to rebase chain of git changes on master ?

 If you have splitted your commit in a chain and asume something is changed on master. Here is easiest trick to rebase on master.  1. Checkout topmost change in change branch like  git fetch ssh://gitrepoexample/changes/00/00000/0 && git checkout -b change-000000 FETCH_HEAD 2. Now rebase your branch on master  git rebase master  3.  Ammend your last change and push  git commit --amend && git push origin HEAD:refs/for/master  All done. Best of luck.

input stream or file to X509Certificate

InputStream inStream = null; try { inStream = new FileInputStream("fileName-of-cert"); CertificateFactory cf = CertificateFactory.getInstance("X.509"); X509Certificate cert = (X509Certificate)cf.generateCertificate(inStream); } finally { if (inStream != null) { inStream.close(); } }

currency convertor

View Local Commit that are not pushed to remote

git log --branches --not --remotes

Git reset to HEAD from cherry-pick

A cherry-pick is basically a commit, so if you want to undo it, you just undo the commit. when I have other local changes Stash your current changes so you can reapply them after resetting the commit. $ git stash $ git reset --hard HEAD^ $ git stash pop # or `git stash apply`, if you want to keep the changeset in the stash when I have no other local changes $ git reset --hard HEAD^

Freezing Android Studio

Is your android studio is freezing? 1. Are you using ubuntu ? Yes , then kill your studio process. 2. Still studio is not going away. Yes, Go to search apps and open task manager and kill studio process and java process.

Software Qualities

1. Maintainability. 2. Correctness. 3. Re-usability. 4. Reliability. 5. Portability. 6. Efficiency. 

Paypal Setup

1. Setup and configure your receiver paypal account. 2. Create your simple "SandBox" Buy Now order page in ASP. 3. Create your "SandBox" IPN processing page in ASP. 4. Create your "SandBox" PDT processing page in ASP. 5. Setup and configure your "SandBox" paypal accounts. 6. Successfully Testing with the PayPal "SandBox". 7. Finally, getting everything to work live. 1. Set up and configure your receiver paypal account. a) Go to www.paypal.com and create your account. EASY! (Make sure you do all the account verification stuff.) b) Log in to the account and go to My Account...Profile c) Under "Selling Preferences" on the right, click "Instant Payment Notification Preferences". d) Check the "Instant Payment Notification integrates..." checkbox. e) Enter the URL of what will be your IPN processing page. (Ex. http://www.yourdomain.com/pp_ipn.asp) f) Click Save. g) Click "Back to Profile Sum...

HTML Calculator

Programming language

Image
Programming language Programming language is set of instruction which can be given as input to some software component like compiler or interpreter to make it machine understandable. Compiler :   A  compiler  is a  computer program  (or set of programs) that transforms  source code  written in a  programming language  (the  source language ) into another computer language.

Oracle Java

Java Java is a programming language and computing platform first released by Sun Microsystems in 1995. It is the underlying technology that powers state-of-the-art programs including utilities, games, and business applications. Java runs on more than 850 million personal computers worldwide, and on billions of devices worldwide, including mobile and TV devices. Java is a computer programming language. It enables programmers to write computer instructions using English based commands, instead of having to write in numeric codes. It’s known as a “high-level” language because it can be read and written easily by humans. Like English, Java has a set of rules that determine how the instructions are written. These rules are known as its “syntax”. Once a program has been written, the high-level instructions are translated into numeric codes that computers can understand and execute.

PHP: Sending Email (Text/HTML/Attachments)

PHP: Sending Email (Text/HTML/Attachments) Sending a Simple Text Email At first let's consider how to send a simple text email messages. PHP includes the  mail()  function for sending email, which takes three basic and two optional parameters. These parameters are, in order, the email address to send to, the subject of the email, the message to be sent, additional headers you want to include and finally an additional parameter to the Sendmail program. The  mail()  function returns True if the message is sent successfully and False otherwise.  Example: //define the receiver of the email $to = 'youraddress@example.com'; //define the subject of the email $subject = 'Test email'; //define the message to be sent. Each line should be separated with \n $message = "Hello World!\n\nThis is my first mail."; //define the headers we want passed. Note that they are separated with \r\n $headers = "From: webmaster@example.com\r\nReply-To:...

Creating a Custom Cell Renderer in a JTable Component

Creating a Custom Cell Renderer in a JTable Component table cell renderer need to implement method  getTableCellRendererComponent() from TableCellRenderer  

SWT Shell

Instances of this class represent the "windows" which the desktop or "window manager" is managing. Instances that do not have a parent (that is, they are built using the constructor, which takes a  Display  as the argument) are described as  top level  shells. Instances that do have a parent are described as  secondary  or  dialog  shells. Instances are always displayed in one of the maximized, minimized or normal states: When an instance is marked as  maximized , the window manager will typically resize it to fill the entire visible area of the display, and the instance is usually put in a state where it can not be resized (even if it has style  RESIZE ) until it is no longer maximized. When an instance is in the  normal  state (neither maximized or minimized), its appearance is controlled by the style constants which were specified when it was created and the restrictions of the window manager (see below). When an instanc...

The Session Initiation Protocol (SIP)

The  Session Initiation Protocol  ( SIP ) is an  IETF -defined  signaling   protocol , widely used for controlling  multimedia   communication sessions  such as  voice  and  video  calls over  Internet Protocol (IP). The protocol can be used for creating, modifying and terminating two-party ( unicast ) or multiparty ( multicast )  sessions  consisting of one or several  media streams . The modification can involve changing addresses or  ports , inviting more participants, and adding or deleting media streams. Other feasible application examples include  video conferencing , streaming multimedia distribution,  instant messaging ,  presence information ,  file transfer  and  online games . SIP was originally designed by  Henning Schulzrinne  and  Mark Handley  starting in 1996. The latest version of the specification is RFC 3261 from the  I...

Layouts in SWT

Overview When writing applications in the  Standard Widget Toolkit  (SWT), you may need to use  layouts  to give your windows a specific look. A layout controls the position and size of children in a  Composite . Layout classes are subclasses of the abstract class  Layout . SWT provides several standard layout classes, and you can write custom layout classes. In SWT, positioning and sizing does not happen automatically. Applications can decide to size and place a  Composite 's children initially, or in a resize listener. Another option is to specify a layout class to position and size the children. If children are not given a size, they will have zero size and they cannot be seen. The diagram below illustrates a few general terms that are used when discussing layouts. The  Composite  (in this case, a  TabFolder ) has a  location ,  clientArea  and  trim . The size of the  Composite  is the size of the ...

Integrating Swing into Eclipse RCPs

Rich Client Applications (RCPs) typically require complex, interactive charts and other non-standard widgets. Unfortunately, there are not many open source (or even commercial) SWT charting libraries yet, so RCP developers either have to develop their own or use an existing Swing components. Fortunately, the RCP 3.x platform includes the SWT_AWT bridge, which allows RCPs to integrate Swing components (at least on Windows and Linux) The SWT_AWT Bridge What is the SWT_AWT Bridge and how does it work? Suppose we want to embed a Swing JPanel inside an Eclipse RCP View: Composite swtAwtComponent = new Composite(parent, SWT.EMBEDDED); java.awt.Frame frame = SWT_AWT.new_Frame( swtAwtComponent ); javax.swing.JPanel panel = new javax.swing.JPanel( ); frame.add(panel); The  new_Frame()  method creates a  partially  thread-safe SWT Composite container, swtAwtComponent  , for the AWT or Swing component. Notice that the  swtAwtComponent must be created using the SW...