background preloader

Tech

Facebook Twitter

JavaScript Fundamentals. By Azat Mardanov If it’s not fun, it’s not JavaScript. And you can’t spell fundamentals without fun. Programming languages like BASIC, Python and C have a boring, machine-like nature that requires developers to write extra code that’s not directly related to the solution itself. Think about line numbers in BASIC or interfaces, classes and patterns in Java. On the other hand JavaScript inherits the best traits of pure mathematics, LISP and C# which leads to a great deal of expressiveness (and, arguably, fun). The quintessential “Hello World” example in Java looks like (remember, Java is to JavaScript is what ham to a hamster): public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World"); } } The same example in JavaScript: console.log('Hello World') …or from within an HTML page: <script> document.write('Hello World') </script> JavaScript allows programmers to focus on the solution/problem rather that to jump through hoops and API docs.

Loose Typing …but… Eclipse : Astuces et Optimisations. 16 octobre 2013 La plupart des développeurs qui utilisent l’EDI Eclipse perdent beaucoup de temps chaque jour, du fait des fausses manipulations, des mauvaises utilisations de l’outil, des lenteurs à l’ouverture de fichiers ou changement d’onglets, le temps pour switcher entre le layout graphique et l’éditeur XML… Pour améliorer notre productivité, il existe quelques astuces, des raccourcis claviers et des configurations à faire pour optimiser Eclipse ( quelque soit la version utilisée ). Editer le fichier eclipse.ini, cocher et décocher des options c’est tout ce qu’il faut.

Let’s go! L’Optimisation : Avant d’installer Eclipse , il faut savoir quelle version choisir et connaitre le maximum de mémoire qu’on peut lui réserver pour utiliser efficacement les ressources de notre machine. Optimisation mémoire système : Activation du New garbage Collector (disponible à partir du JDK 1.6) :Choisir le niveau de RAM : On trouve également d’autres options utiles -XX : Optimisation du temps de démarrage : RESTClient, a debugger for RESTful web services. Java: Finding Package Cycles | Matthias Friedrich's Blog. JDepend is a tool for detecting cycles between your Java packages. It is often used from a Maven plugin to generate reports for the project’s Maven site. In most teams, however, people only look at these reports from time to time. So when a cycle has been introduced, it takes a while until someone notices. The later the cycle is detected, the harder it is to fix. Using JDepend’s API, you can add a cycle check to your unit tests.

All you have to do is to add the following test (JUnit 4 syntax): import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import java.io.IOException; import jdepend.framework.JDepend; import org.junit.Test; public class DependenciesTest { @Test public void testCycles() throws IOException { JDepend jdepend = new JDepend(); jdepend.addDirectory("target/classes"); jdepend.analyze(); assertThat(jdepend.containsCycles(), is(false)); } } If your project uses Maven, you have to add the following dependency: Like this: Like Loading... JsPDF - HTML5 PDF Generator | Parallax. PDFs have become an essential element of document sharing. Our team recognised a significant challenge with generating these files and developed jsPDF, the ultimate solution for PDF generation.

We took an innovative approach and made jsPDF open-source to encourage a collaborative community of developers to enhance its features and functionalities. With our easy-to-use application, you can create professional-looking PDFs in a matter of minutes, without the need for complex software or extensive training. Our intuitive interface allows you to generate any document type, including event tickets, reports, certificates, and more. Documentation Our documentation is generated from the source code, and we ensure it's up-to-date and comprehensive. If you do come across any issues, then head over to GitHub and file a new issue. Support While our open-source software doesn't come with free support, we offer competitive pricing for personalised project assistance. Consuming services. Even when this sounds like something easy to do, 1 out of 3 questions we get on #angularjs (IRC channel at Freenode) are about the same problem and that is what I am going to cover in this article.

Let’s write a dummy service for authentication (I promise an article about real auth services in the near future :P): Nothing fancy, we have a function to “login” and one to “logout”. Now we want to consume it in our controller: With our template: We expect that if we click on the login button we are going to be logged in. Try it Uhm, no matter how many times I click on the login button, nothing happens. The problem doesn’t lie in Angular, this is a common misunderstanding of how Javascript works. This is how some people think this is working: But what is really happening is this: Why is this happening? What has happened here? So when we did: Let’s see another example: Notice that our service returns an object, so if we can assign it to our $scope, then we can update the service without fear. Ninja Squad - Angular filter - Part 1. L’une des fonctionalités les plus appréciables et méconnues d’Angular réside dans les filtres disponibles.

Dans toutes applications web, il est courant de devoir filtrer ou réordonner une collection pour l’afficher. Les filtres Angular sont applicables à la fois en HTML ou en Javascript, à un seul élément ou un tableau. En HTML, la syntaxe se rapproche du style Unix, où l’on peut chaîner les commandes à l’aide du pipe. Par exemple, on peut appliquer un filtre nommé ‘uppercase’ sur une expression de la façon suivante : On peut également chaîner plusieurs appels de filtre : Certains filtres prennent des paramètres : c’est le cas du filtre ‘number’, qui nécessite de préciser le nombre de chiffres suivant la virgule. Il est également possible d’invoquer les filtres depuis le code Javascript : Angular va alors retrouver la fonction de filtre correspondant à la chaîne de caractères passée en paramètre.

Angular propose par défaut certains filtres communs : Like this: J'aime chargement… AngularJS. Learn AngularJS in 5 steps - revolunet blog. I’ve seen some developers quite shy about AngularJS when confronted to all the magical powers; don’t be afraid, AngularJS indeed introduces several new concepts but you can get them in just a few weeks of practice… The Google team is working hard to lower the Angular entry barrier and to make everything as simple as possible for developers. AngularJS is a new disruptive innovation in the Javascript frameworks world and it prefigures the future of web browsers : templates, data-binding, web components… In this post i’ll give some advices for the AngularJS newbies and share with you the best pointers to learn and understand the core concepts quickly.

First, to understand AngularJS you of course need to know a bit of Javascript. If you’re not comfortable enough yet, pick a free book on JSbooks and practice . If you have a jQuery background, you absolutely need to read this in-depth Stack Overflow answer : How to think in AngularJS if i have a jQuery background . Need help ? AngularJS Twitter Search. Continuous Integration and Delivery: Slides.

Perl

Learn CSS Layout. A visual regular expression debugger. Spark - A small web framework for Java. Ssh. NoSql. Testing. CodeStory. Capcha. Git. Logstash - open source log management. File Juicer - Recherche brute dans tout format de fichier sur Mac OS X. File Juicer extrait de fichiers principalement des formats énumérés à gauche. L'extraction de File Juicer n'est pas une conversion. Exemples : un fichier JPEG enregistré à l'intérieur d'un document PDF est extrait comme un fichier JPEG et la vidéo WMV dans un document Word est extraite comme un fichier WMV. File Juicer regarde les données binaires, et n'interprète pas le format du fichier qu'il recherche. Par conséquent, vous pouvez déposer n'importe quel fichier sur File Juicer pour une recherche. Les descriptions de chaque format sont des directives sur ce que vous pouvez compter trouver. File Juicer indique qu'il ne trouve rien à l'intérieur d'un fichier, c'est parce qu'il n'est pas enregistré intérieurement dans aucun des formats énumérés dans les préférences.

InDesign d'Adobe est un exemple. File Juicer n'est pas strict quand il recherche des fichiers et il acceptera quelques erreurs dans le fichier pour essayer de récupérer même les fichiers endommagés. Olamy open source hacker. In the 7.x releases of Apache Tomcat, some maven artifacts are now published which include a nice and fluent embeded api to run a Tomcat instance. So it's a nice opportunity to use it writing units to test servlets, rest api etc..But until 7.0.25 it was only possible to do it with using a barcoding port which can cause some issues on ci servers where you are not sure ports are not used by something else running. I have personally sended a RFC to ITEF to have port allocation for only my personal use on my birthday year or zip code port but strangely this RFC was never approved :-). Now you can use the java ServerSocket port 0 feature to use any free port available on the machine.

It has been fixed with the issue 52028. So now you can write a unit test as it (here a test with a REST service provided by Apache CXF). @Before public void startTomcat() throws Exception { tomcat = new Tomcat(); tomcat.setBaseDir( System.getProperty( "java.io.tmpdir" ) ); tomcat.setPort( 0 ); In the code In the code:

Rest

TDD in action : creating a jquery plugin. Quick Setup - Persona. Adding the Persona login system to your site takes just five steps: Include the Persona JavaScript library on your pages. Add “login” and “logout” buttons. Watch for login and logout actions. Verify the user’s credentials. Review best practices. You should be able to get up and running in a single afternoon, but first things first: If you’re going to use Persona on your site, please take a moment and subscribe to the Persona notices mailing list. It’s extremely low traffic, only being used to announce changes or security issues which may adversely impact your site. Step 1: Include the Persona library Persona is designed to be browser-neutral and works well on all major desktop and mobile browsers. In the future we expect browsers to provide native support for Persona, but in the meantime we provide a JavaScript library that fully implements the user interface and client-side part of the protocol.

You must include this on every page which uses navigator.id functions. For example: Yammer Metrics, A new way to monitor your application. When you are running long term applications like web applications, it is good to know some statistics about them, like number of requests served, request durations, or the number active requests. But also some more generic information like the state of your internal collections, how many times some portion of code is being executed, or health checks like database availability, or any kind of connection to an external system. All this kind of instrumentalization can be achieved by using native JMX or using a modular project like Metrics.

Metrics provides a powerful way to measure the behaviour of your critical components and reporting them to a variety of systems like, JConsole, System Console, Ganglia, Graphite, CSV, or making them available through a web server. To install Metrics, we only have to add metrics dependency. In this example we are going to use Maven. Now it is time to add some metrics to our code. In Metrics we can use 6 types of metrics: Related Whitepaper: