background preloader

Java Programming Cheatsheet

Java Programming Cheatsheet
This appendix summarizes the most commonly-used Java language features in the textbook. Here are the APIs of the most common libraries. Hello, World. Editing, compiling, and executing. Built-in data types. Declaration and assignment statements. Integers. Floating-point numbers. Booleans. Comparison operators. Printing. Parsing command-line arguments. Math library. The full java.lang.Math API. Java library calls. Type conversion. Anatomy of an if statement. If and if-else statements. Nested if-else statement. Anatomy of a while loop. Anatomy of a for loop. Loops. Break statement. Do-while loop. Switch statement. Arrays. Inline array initialization. Typical array-processing code. Two-dimensional arrays. Inline initialization. Our standard output library. The full StdOut API. Our standard input library. The full StdIn API. Our standard drawing library. The full StdDraw API. Our standard audio library. The full StdAudio API. Command line. Redirection and piping. Functions. Libraries of functions. Our standard random library.

FBI The FBI’s Reading Room contains many files of public interest and historical value. In compliance with the National Archives and Records Administration (NARA) requirements, some of these records are no longer in the physical possession of the FBI, eliminating the FBI’s capability to re-review and/or re-process this material. Please note, that the information found in these files may no longer reflect the current beliefs, positions, opinions, or policies currently held by the FBI. The image quality contained within this site is subject to the condition of the original documents and original scanning efforts. These older files may contain processing procedures that are not compliant with current FOIA processing standards. All recently scanned images posted to the Reading Room adhere to the NARA 300 DPI standard. Some material contained in this site may contain actions, words, or images of a graphic nature that may be offensive and/or emotionally disturbing.

Why every Java field should have been final by default. « Javarizon Introduction Note to clarify the post: by default I mean having to write something like ‘var’ to have the current behavior (fields can be reassigned), so that if you write nothing the field is automatically final. You still have the choice about being able to reassign or not by using some kind of keyword like ‘var’. I hope it is clearer now ! We all like freedom, but what is freedom when we talk about code ? You have a lot of freedom with mutable fields, too much, why not let the compiler help you by telling it that your data is immutable ? You sure do not want to, and please do not tell me the final keywords make your code hard to read, it does the exact opposite: it tells the compiler and the reader that your data will never change and this is important information. (Note: this post is NOT about the ‘other’ final keyword, the one used on classes and methods. Examples that illustrate why every Java field should have been final by default: Example 1: Bad initialization in constructors.

10 Must Have JavaScript Cheat Sheets More and more websites are realizing the power of client side scripting and AJAX to bring their site to the next level of interaction as JavaScript is becoming a second hand language to almost every serious web developer today. Here is our collection of 10 must have JS cheat sheets to help you along on your web developing adventures. I hope you enjoy and find this as useful as many developers did! Related Posts: 1. QuicklyCode – Cheat Sheets and Programming Stuff This website links you to various cheat sheets and other developer resources to aid you in your programming, including JavaScript and other applications. Source + Demo 2. gotAPI – Instant Search In Developer Documentation Handy quick reference search for JavaScript and HTML (including HTML, CSS, JavaScript, AJAX, Web2.0) and other software/technologies. Source + Demo 3. A quick reference guide for JavaScript, listing methods and functions, and including a guide to regular expressions and the XMLHttpRequest object. Source + Demo 4. 5.

How to Send Text Messages with PHP Text messaging has become extremely widespread throughout the world -- to the point where an increasing number of web applications have integrated SMS to notify users of events, sales or coupons directly through their mobile devices. In this tutorial, we will cover the fundamentals of sending text messages with PHP. Overview Sending a text message (SMS) message is actually pretty easy. Below is a simplified diagram of how a message can be sent from a web application to a wireless device. We'll break this down -- one piece at a time: The message is composed using a web application that is stored and executed on a HTTP server and then sent through the internet ("the cloud") as an email message. Most wireless networks have a SMS gateway through which email messages can be sent as text messages to a mobile device. Email to SMS To send a SMS via email, you'll generally require only two things: The following convention can be followed for most carriers: To send a text to Mr. Pretty awesome! The Style

Chart: Should You Have Kids? momlogic's Momstrosity: To procreate or not to procreate -- that is the question. Here is the answer. ( Click on image to enlarge) Learn Java by Examples - How do I create Hibernate's SessionFactory? When creating an application the use Hibernate to manage our application persistence object we’ll need a SessionFactory. This factory creates or open a session to talk to a database. To create a SessionFactory we can define the configuration in hibernate.properties, hibernate.cfg.xml or create it programatically. In this example we’ll use the hibernate.cfg.xml configuration file, which is mostly use when creating Hibernate application. Below is our session configuration files. <? Now we have the configuration file done, let’s create a helper class that will configure and build the SessionFactory object. package org.kodejava.example.hibernate.app; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; public class SessionFactoryHelper { private static final SessionFactory sessionFactory; static { try { // // Build a SessionFactory object from session-factory configuration // defined in the hibernate.cfg.xml file. About Wayan Saryada

JavaScript & AJAX For Dummies Cheat Sheet Cheat Sheet The tables you find here offer a one-stop reference for the most common programming variables, commands, methods, and coding miscellany used in JavaScript programs, jQuery, and AJAX. Code to Use in JavaScript Variable Manipulation Functions As shown in the following table, you can use these JavaScript statements in your own code to create and modify variables in your JavaScript functions. Basic I/O Commands in JavaScript JavaScript programmers commonly use the commands shown in the following table for controlling dialog-based input and output in programs to be used on the Web. JavaScript Conditions and Branching Code Structures Look to the following table for JavaScript control structures you can use in your program code to add branching and looping behavior to your JavaScript programs. Add JavaScript Comparison Operators to Condition Statements Create JavaScript Structures and Objects Change Your Web Page with JavaScript Document Object Model Methods Common Methods of the jQuery Node

Google facts and figures (massive infographic) Posted in Tech blog on February 24th, 2010 by Pingdom Google has perhaps more than any other company become “The Internet Company.” It’s grown hand in hand with the internet and its entire business model has from the start been totally focused on the internet as a delivery platform. And let’s face it, Google is a pretty interesting company. Updated, Feb 25, 13:40 CET: The first version contained an error, that 270,000 words were written on Blogger per day. Did you like this post? Java programming test, hands-on skills - BetterProgrammer.com The True Facts about Bottled Water that Science doesn't want you to know | The following infograph will change the way that you will think about bottled water for the rest of your life.

J2J development tool J2J - Java to JavaScript integration ver. 1.5 What is this for ? It is a development tool lets you integrate Java classes and JavaScript within your HTML pages. The main idea behind this product is how to call methods of Java classes right from JavaScript functions. 1. <html> Our form:<br> <form> <input type="text" name="textField"><br> <input type="button" value="Click" onClick="updateField();"> </form> <script> function updateField() { document.forms[0].textField.value=java.dbConnection.getData('some_SQL_expr'); } </script> </html> So when user clicks on the button we can call method getData from the class dbConnection and use results in our JavaScript application. Suppose you are going to use browser's DOM and need to update some part of your page. <html> <p> current paragraph text </p> <script> function changeParagraph() { pp=document.all.tags("p"); pp(0).innerText=java.myClass.myFunc('give me new text, please'); } </script> </html> That is a main idea. How does it work ? you can use:

Related: