background preloader

Software Development & Entrepreneurship Tutorials

Software Development & Entrepreneurship Tutorials
Related:  excpectocodo

State Machines | Unit 1: Software Engineering | Introduction to Electrical Engineering and Computer Science I | Electrical Engineering and Computer Science st - A place for geeks to share what they've done, who they did it with and connect with great companies Zip File System Provider Introduction The zip file system provider introduced in the Java SE 7 release is an implementation of a custom file system provider. The zip file system provider treats a zip or JAR file as a file system and provides the ability to manipulate the contents of the file. The zip file system provider creates multiple file systems — one file system for each zip or JAR file. The demo/nio/zipfs/src.zip file in your Java SE 7 installation contains the source code for the zip file system provider. It also contains the Demo.java class that shows how to use the zip file system provider. Using the Zip File System Provider You can use the factory methods of the java.nio.file.FileSystems class to create a new zip file system or to obtain a reference to an existing zip file system. Specify the configuration options for the zip file system in the java.util.Map object passed to the FileSystems.newFileSystem method. Resources

Java Tutorial | Learn Java Our core Java programming tutorial is designed for students and working professionals. Java is an object-oriented, class-based, concurrent, secured and general-purpose computer-programming language. It is a widely used robust technology. What is Java? Java is a programming language and a platform. Java was developed by Sun Microsystems (which is now the subsidiary of Oracle) in the year 1995. Platform: Any hardware or software environment in which a program runs, is known as a platform. Java Example Let's have a quick look at Java programming example. Simple.java class Simple{ public static void main(String args[]){ System.out.println("Hello Java"); } } class Simple{ public static void main(String args[]){ System.out.println("Hello Java"); } } Test it Now Application According to Sun, 3 billion devices run Java. Types of Java Applications There are mainly 4 types of applications that can be created using Java programming: 1) Standalone Application 2) Web Application 3) Enterprise Application

NoClassDefFoundError I know how frustrating is to see Exception in thread "main" java.lang.NoClassDefFoundError, which is a manifestation of NoClassDefFoundError in Java. I have seen it couple of times and spent quite a lot time initially to figure out what is wrong , which class is missing etc. First mistake I did was mingling java.lang.ClassNotfoundException and NoClassDefFoundError, in reality they are totally different, and my second mistake was using trial and error method to solve this java.lang.NoClassDefFoundError instead of understanding why NoClassDefFoundError is coming, what is real reason behind NoClassDefFoundError and how to resolve this. In this Java tutorial I have tried to rectify that mistakes and uncover some secrets of NoClassDefFoundError in Java and will share my experience around it. NoClassDefFoundError is not something which cannot be resolved or hard to resolve it’s just its manifestation which puzzles most of Java developer. What is reason of NoClassDefFoundError in Java? 1. 2.

JavaScript Loops - for | CoderMania Understanding of loops is very important for every programmer. Please pay attention to this lesson. We use loops when we want to repeat some algorithm. For example, we want to print the same text multiple times. We could help Bart to write it for him: for (var i = 0; i < 11; i++) { console.log('I will learn to code. Copy & paste to the code editor Amazing, huh? The first command is definition of variable i. The second command (i < 11) is condition. In the last command (i++), we increment value of the i variable by 1. Notice, we write semicolon after the first and the second command. Look at another example. for (var i = 0; i < 11; i++) { console.log(i); } So you can see that i is 0 in the first iteration and it increases up to 10. Notice that loop runs 11 times and then the code after loop runs: for (var i = 0; i < 11; i++) { console.log(i); } console.log('done'); Notice, we can increment variable i by any value. for (var i = 0; i < 11; i = i + 2) { console.log(i); } Infinite loop

Lorem Ipsum - All the facts - Lipsum generator Java I/O Streams and Channels 15.3. Converting Between Streams and Channels Channels are cool, but streams aren't going away. In many cases, with small amounts of data, streams are just faster. Other times, they're more . And sometimes they're part of a legacy API. The java.nio.Channels class provides eight static utility for connecting channels to streams and vice versa. 15.3.1. The newInputStream( ) method converts any ReadableByteChannel , including FileChannel s, into an InputStream : public static InputStream newInputStream(ReadableByteChannel ch) You can use the methods of the InputStream class to read from the channel. XMLReader parser = XMLReaderFactory.createXMLReader( ); FileInputStream in = new FileInputStream("document.xml"); FileChannel channel = in.getChannel( ); Now say you want to pass this channel to the XML parser. in = Channels.newInputStream(channel); parser.parse(in); At this point you may be objecting. Sometimes it's an OutputStream that's needed. 15.3.2. Example 15-4.

Researchers: Depression May Be a Physical Illness Linked to Inflammation In Brief Scientists are now calling the link between depression and inflammation caused by a faulty immune system definitive. Whether it's causal or not, the connection opens up new avenues for treatment, and new hope for sufferers. Physical Roots of Depression Although current treatments for depression mostly focus on brain chemicals such as serotonin, scientists now think inflammation throughout the entire body (triggered by an overactive immune system) may be the root cause of the problem. A growing body of research, including scientific papers and results from clinical trials, appears to be revealing a connection between treating inflammation and alleviating depression. In October 2016, a major review of research on the next generation anti-inflammatory drugs (most often used to treat autoimmune disorders) revealed a definitive link between inflammation and depression. Immuno-Neurology

Thread-Safe thread-safety or thread-safe code in Java refers to code which can safely be used or shared in concurrent or multi-threading environment and they will behave as expected. any code, class or object which can behave differently from its contract on concurrent environment is not thread-safe. thread-safety is one of the risk introduced by using threads in Java and I have seen java programmers and developers struggling to write thread-safe code or just understanding what is thread-safe code and what is not? This will not be very detailed article on thread-safety or low level details of synchronization in Java instead we will keep it simple and focus on one example of non thread-safe code and try to understand what is thread-safety and how to make an code thread-safe. Example of Non Thread Safe Code in Java Here is an example of non thread-safe code, look at the code and find out why this code is not thread safe ? * Non Thread-Safe Class in Java public class Counter { private int count; Thanks

10 Object Oriented Design principles Java programmer should know (guest post) This article was originally posted by Javin Paul at Javarevisited. Object Oriented Design Principles are core of OOPS programming but I have seen most of Java programmer chasing design patterns like Singleton pattern, Decorator pattern or Observer pattern but not putting enough attention on Object oriented analysis and design or following these design principles. I have regularly seen Java programmers and developers of various experience level who either doesn’t heard about these OOPS and SOLID design principle or simply doesn’t know what benefits a particular design principle offers or how to use these design principle in coding. Bottom line is always strive for highly cohesive and loosely couple solution, code or design and looking open source code from Apache and Sun are good examples of Java design principles or how design principles should be used in Java coding. Object oriented design principle 1 – DRY (Don’t repeat yourself) Always favour composition over inheritance if possible.

SpringSource.org | ThreadLocal, partie 1, principes du stockage magique | Codes et autres, sauce java, parfum objet Dans l’API java, on trouve une classe au comportement tout a fait particulier, ThreadLocal. Son principe: stocker des données dans le Thread courant afin de les récupérer plus tard, dans une autre méthode par exemple, sans avoir à les passer en argument à toute la chaine d’appel. Cette classe peut vous être d’un grand secours, mais elle doit être utilisée judicieusement et surtout en extrêmement précautionneusement! La classe ThreadLocal est apparue dans le JDK1.2, vers la fin 1998 (et oui, elle est méconnue, mais elle date!). Son utilisation principale, permettre à plusieurs threads de travailler simultanément sur une variable statique, tout en permettant à chaque Thread d’avoir sa propre instance de la variable ainsi qu’éventuellement, proposer un constructeur pour créer la valeur par défaut pour les threads qui n’en ont pas encore recu. public class Test { //code java 5 public static ThreadLocal<Integer> x = new ThreadLocal<Integer>(); }

Related: