Friday, September 29, 2017

SQL JOINS


  • Using those new standard and earlier standard will execute in same way(Speed etc) , but this new standard is more useful , powerful  .

Sunday, September 10, 2017

Git - Commands


     
  •  Suppose $COMMIT_id  was the last commit id before you performed git pull. What you need to undo the last pull is         

                    git reset --hard $COMMIT_id 
  •  git diff   -   Show unstaged changes between your index and working directory.                                                                                                                                          
  •  git pull    -    This update whole  branches of  local  repository   .                                                                                                                                                                                  
  •  The git pull  command is actually a combination of two other commands, git fetch  followed by git merge ,
    it does a git fetch and then a git merge where it merges branches that have been setup to be merged in your config
                  git fetch just "downloads" the changes from the remote to your local repository. git pull downloads the changes and merges them into your
                  current branch. "In its default  mode, git pull is shorthand for git fetch followed by git merge FETCH_HEAD
  • If you want to  get a file( src/main/resources/application-dev.properties) from another branch (master)  to your current working branch then,                                                                               
                  git checkout dev
                  git pull origin  dev
                  git checkout  master -- src/main/resources/application-dev.properties                                                   
  • To remove last commit
     git pull origin  dev
    git reset --hard HEAD~1  //Remove last commit ,1  means one last commit, if  it  is  2,then last two commits gitk git push       origin dev --force
  •  To change commit message  use command ,
     $ git commit --amend
     Then window that will open , change message .Then click Esc  button and type :wq
     Finally push changes.
     
  • If you are currently working on local branch master, and the new remote branch has not been created yet:


    git checkout -b new_branch_name //Creates a local branch(as a copy of the current)
    git push origin new_branch_name //Push it to the remote server 
     
     
     
     
     
     
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    Image result for git  local operations of reset 
     
     
     Image result for git  local operations of reset
    
    
 
 
 

Thursday, September 7, 2017

ReadMe File Creating Using Markdown (MD) Format

If you  are  creating readMe file ,using  Markdown ,Then there  is several tools  that you  can  use  to online create .


 Below some links to markdown tutorials

Tuesday, September 5, 2017

Abbrevations

  •  APM   -  Application Performance Management
  •  DTO    -  Data Transfer Object
  • REST API   -   Representational State Transfer  Application Programming Interface

35 Java Programming Tips And Best Practices For Beginners (Extracted from Freelancer Community)

Java is claimed to be used in more than 3 billion devices and according to Oracle, there are 5 billion active Java cards in the world today. This means Java is everywhere, literally. Let’s look at some of the best tips for you to join the 9M+ programmers using it every day.
These are some simple tips to get started with JAVA on your own. Don’t panic if you have a hard time with them, you can always hire a consultant professional as a freelancer at www.freelancer.com to correct your lines and make your programming perfect.
1. Trace your codes on paper
If you are a complete beginner, the only way to closely follow up on trial and error is by writing it down.
2. Practice in a safe environment
In order to make your mistakes (you’re going to make plenty, believe me) and not destroy anything valuable, practicing in a safe environment is a must. Check here for the basics.
3. Plan the needed objects before you start
Always keep object requirements under check so you don’t create unwanted or unnecessary objects in the code. Remember that every object you create takes memory and processor resources from the system.
4. Avoid the most expensive unnecessary objects first
You have “cheap” and “expensive” operations; this is exactly why it is important Objects are created or initialized if needed. When in doubt, always go for the cheapest.
5. Solving the dilemma; should you use ArrayList or Array?
This choice depends on your requirements. Let´s see some differences in each:
  • It’s easier to remove or add elements from ArrayList than Array.
  • ArrayList can be only one dimension, while an Array can be multi-dimensional
  • ArrayLists have variable sizes, while Arrays have a fixed size.
6. The moment Finally isn’t executed with Try
JVM performs two clear-out tasks before turning off.
  • First, it goes for all the Shutdown hooks registered. It releases the resources to JVM and because of it this, it is very useful.
  • Second, the finalizers. They have been belittled for a long time since they can run on live objects when manipulated by other threads. This ends in undesirable results, or even in a deadlock.
7. Oddity not allowed
Considering Negative Odd Numbers is always a must when you put together your lines, otherwise you will end up with a false result returned, which is incorrect.
8. Quotes, make it a Double?
Whenever you use double quotes, characters are treated as a string. Simple quotes convert to int values through a process known as widening primitive conversion.
9. Memory leaks can be avoided by implementing these simple tricks
Memory leaks often cause the degradation of the software they compose. There are some standard techniques to prevent memory leakage, even though Java manages memory automatically and doesn’t leave much room for programmers to tinker with it.
  • Always release database connections (when querying is complete).
  • Final block is a must whenever possible.
  • The instances which are stored in Static Tables should always be released.
10. No more Deadlocks
When do they occur? Deadlocks are very common and can happen for diverse reasons. While there’s no definitive process for avoiding deadlocks, they normally follow when one synchronized object is waiting for the latch resources that are locked by another synchronized object.
  • Beware of resources locking!
11. Java needs memory, reserve it!
A proper command line can be auxiliary to preserve RAM for high-demanding. Some of the characters to be used are:
  • XX:PermSize = This is the initial size owed during startup of the JVM.
  • Xms = Minimum memory provision pool.
  • XX:MaxPermSize = This is the maximum scope allocated during startup of the JVM.
  • Xmx = Maximum memory provision pool.
12. Can operations be timed in Java?
The time processes in Java have two main formats. Is there a better one to be used? It depends on the circumstances; basically System.nanoTime() is always faster.
13. Should I choose Double or Float?
Double offers far more accuracy, and most processors take the same quantity of processing interval to perform both kinds of procedures. Go for Double whenever possible.
14. The calculation of power
You should always use Multiplication since it is 300-600 times faster.
15. Null Pointer Exceptions treatment
The trick to avoid this collective exclusion is to check Nulls prematurely. This is  so they can be eliminated, and you don’t call any method upon them.
16. Always encode using JSON
This is becoming increasingly widespread due to being extremely light-weight. An ordinary data structure can be programmed in JSON and effortlessly shared all along the pages.
17. Before decoding from JSON
Before doing this, you should be aware of the schema.
18. Searching for the missing Simple String
Java will return the position of index of the desired String Object. When missing, it comes back as -1.
19. How to list the content of a directory
A program can be used to list the insides of a directory. It will simply obtain all the titles, of all the sub-directory and files in an Array.
20. As simple as a Simple IO
Used to read and write a file, this service can generate input and output streams. It is vital to close the streams when the file management is done.
21. Shell Command execution within the Java environment
For running them, Java offers Runtime Class. These are external commands and the exemptions should be handled cautiously, because they are very important.
22. The use of Regex
This is a summary of the most popular expression constructs regularly used that can be found here.
23. Java´s Simple Swing
Javax, Swing and GUI can be created with Java’s help. Components like Button, Text Box, Radio Button, etc. are GUI mechanisms. They can be accompaniments to Boxes and should go on top of the Container.
24. Java, the sound player
This is a feature that´s especially popular when playing games. Audio files can be played along with JAVA codes.
25. Exporting PDF files from Java
Using itextpdf makes it a lot easier to export PDF. You should try it, since transferring a table to PDF is a very common requirement in Java programs.
26. Email anyone from the Java Code
You need to install Java Mail Jar and set its route in your program’s classpath. It is very simple, because the elementary properties are set in the code.
27. Time measurements
Java offers two static approaches in static class:
  • currentTimeMillis(): Shows current interval in milliseconds.
  • nanoTime(): Returns the current value in nanoseconds.
28. Rescaling an Image
This can be achieved using AffineTransform. It will buffer the original and then render the scaled one.
29. Can the mouse hove coordinates be captured?
This is attained by applying MouseMotionListner Interface. It activates when the mouse is hovered over a specific section.
29. What’s the use of File Output Stream vs. the use of File Writer?
If you are attempting to write streams of characters, think about using File Writer. For everything related to raw bytes (like image data), you should go with File Output Stream, because it was created for that.
30. Primitive classes are preferred over Wrapper Class
Primitive classes are faster.
32. Always favor returning Empty Collections rather than Null
We always prefer this outcome. It will help you avoid a lot of “if else” testing on those Null ones.
33. Use the Strings very carefully
You create a new String Object every time two Strings are concatenated by “+” functioning in a “for” loop, growing performance time and producing memory depletion. Added to this, you should always evade constructors when instantiating a String Object. It should occur directly. 

34. Always validate all input sources
From all untrusted data sources, no exceptions! If this step is done properly, you can eradicate virtually all vulnerabilities from that specific software. External data sources may include: network interfaces, command line arguments, environmental variables and user controlled files.
35. Default deny
Everything is guilty before proven innocent. This means that access is denied by default, and the defense scheme recognizes conditions under which admission is allowed

Link to Original Post :-  https://www.freelancer.com/community/articles/35-java-programming-tips-and-best-practices-for-beginners?ft_prog=CFC&ft_prog_id=938

Java Productivity Tips: Top Picks From The Community (Extracted from Freelancer)

Do you find yourself distracted when trying to complete the programming tasks on your to-do list? Many software developers blame Facebook, Twitter, and YouTube for their inefficiencies. Some computer programmers get distracted by PlayStation, and offline computer games.
Are you ready to drop the bad habits that are stopping you being productive?  Incorporate these tips into your professional life:
1. Use Bash scripts
A Bash script is a blank text file that supports a chain of commands. It is superior to the Command Line because you can execute numerous complex commands. This helps a software developer accomplish many tasks through automation. You can also use alias commands to make work easier.
Freelance developers may receive overwhelming orders from clients. A Bash Script comes in handy since it helps them multitask on various complex projects using alias commands. You can access your automation using unlimited shortcuts.
2. Present your code in a reader-friendly format
One common mistake new programmers make is providing codes without reference comments. This makes it hard for a second party to understand certain aspects, or track additional changes, and it can discourage software developers from making valuable additions to the program. Expert computer programmers use one-liner comments to substitute lengthy bits of logic.
A one-liner comment helps you track the logic behind all changes made to the program.  It also minimizes the time spent tracking bugs. Another benefit is obtaining better rankings from credible search engines, since they prefer websites with simple code. Software developers who are working on a group project work more efficiently when using code that is properly formatted. You can learn how to present your code neatly by downloading free samples in various software developers online forums.
3. Do thorough debugging
A bug is a programming error that limits a software’s effectiveness. A software containing numerous bugs may freeze abruptly during use. These bugs hinder users from accessing features because the program cannot execute incomplete commands. Java lets software developers use the internal debugging tool by setting breakpoints.
Breakpoints enable software developers to analyze their programs line by line. You can use different debugging tools to monitor active processes by running the program step by step. This exercise helps you to identify the common mistakes you unknowingly repeat when coding.
For better results you can hire external people at freelancer.com to do the debugging for you.
4. Monitor your system
Software developing involves a variety of stages before the final product gets released to its end users. You need to test it in various scenarios to observe its performance and effectiveness in solving real life problems. Monitoring helps you notice any bugs you might have missed during debugging, and you can spot incompatibility issues that arise when testing the software on various operating systems.
You can use premium tools to monitor your program. Some reliable open sourced tools are  Chef and Puppet.
5. Use Batch processing
Batch processing helps smart software developers execute various recurrent tasks without additional time or costs. You can manage your phone calls, emails, appointments and business social media posts by grouping them into a single batch. Batch processing is popular because no special hardware is required. Most multinational corporations use batch processing for daily data management operations, and handling daily office tasks.
As a team leader, you can use batch processing to handle your group’s daily activities such as posting daily updates of pending projects via email.
6. List the tools you require
Software developers who dive into a project without researching what they require end up wasting time and money. Research helps computer programmers identify software tools that enable them to deliver high-quality results in the shortest time possible. You may realize that you need a different IDE or new library updates to handle a client’s project.
Researching also helps you to identify all possible challenges that may arise during developing and testing. By having an accurate understanding of the project, you’ll formulate a realistic strategy to boost your performance.
7. Develop testable codes
Successful people achieve their dreams by visualizing the desired end product. They develop strategies by beginning with the end in mind. This is a reliable approach to identifying any issues that may pop up during the software’s testing stage. You’ll also spend less time designing a testable code by doing it bit by bit.
Developing testable codes is suitable when working on a group project because it’s easier to track and correct all changes.  Having a testable code ensures you don’t execute your software manually whenever you want to test it.
8. Join online Java forums
Online forums provide unlimited opportunities for both upcoming and established software developers to gain useful knowledge. Popular Java online forums such as StackOverFlowOracle Java Forum or Java Forum are free, and contain links to useful eBooks, video tutorials and blog posts on various Java topics. Many seasoned computer programmers on these forums provide swift answers to questions posted by fellow members.
A majority of novice computer programmers are struggling with Java programming because they lack mentors. It may be difficult to approach a college professor because they might be too busy helping other students. However, it’s easier to approach a fellow Java programmer on an online forum.
9. Tackle new projects
Learning takes place when you expose your mind to different projects that require new skills and programming methods. Handling new programming projects helps budding software developers learn how to use different tools to obtain a variety of results. When you take on a new programming task that’s beyond your current experience, it builds your self-confidence to handle difficult projects.
Various online Java forums host friendly programming tournaments for beginners, intermediate, and expert software developers. These challenges provide ideal opportunities to enhance your programming skills without incurring additional expenses.
To handle new projects, you can utilize the services of other coders at freelancer.com.
10. Maintain a calm state of mind
Software coding is a rigorous mental process that demands attention at all times. A simple distraction could lead to numerous software bugs. To function efficiently, you need 6-8 hours of uninterrupted sleep. Always eat a nutritionally-balanced breakfast to keep your mind alert during your morning coding sessions.  Avoid dwelling on negative situations that increase mental stress, and affect your concentration on pending projects.
How to maximize your daily efficiency
To effectively apply the tips shared above, you need to manage the usual distractions which every software developer deals with on a daily basis.
  • Read your emails towards the end of your day- Your main objective is developing software that functions effectively. This means that you’ll spend a huge portion of your day typing commands and testing the software. Responding to emails at the wrong time distracts your attention from important tasks at hand.
  • Set daily objectives. Most programmers experience slow progress in their projects because they lack goals to guide their efforts. Setting daily goals helps to channel your time and resources to accelerate progress wisely. It’s easy to beat deadlines in good time when you meet your daily objectives.
  • Create a motivating playlist. Did you know that music keeps the mind alert for lengthy periods? It’s a great alternative to consuming coffee and energy drinks to retain alertness. Before commencing on your tasks, take about ten minutes to create a playlist from your favorite songs.
  • Close all idle tabs on your browser. It will prevent you from getting distracted by social media websites.
You don’t need expensive hardware or software to improve your productivity. Simply apply these tips, and you’ll notice improvements in no time.

The AI Driven Software Developer, Optimize Innovate Transform

  The AI-Driven Software Developer: Optimize, Innovate, Transform": AI Transformation in Software Development : Understand how AI is re...