-
Convert Maven build to gradle
gradle init -
Initialise new project folder structure (Java example)
gradle init --type java-library
| package com.autodesk.adn.viewanddata; | |
| import java.io.BufferedReader; | |
| import java.io.IOException; | |
| import java.io.PrintWriter; | |
| import java.util.Collection; | |
| import java.util.HashMap; | |
| import java.util.UUID; | |
| import javax.servlet.ServletException; |
| var Comparator=Comparator||(function(){var c=function(g,f){return this[g]===f};var a=function(f){if(!this.hasOwnProperty(f)){this[f]=undefined}};var b=function(g,m,f){var k=g.prototype,o=(f?f.length:0),j=0,l,h;for(j;j<o;j++){l=f[j];h="is"+l.replace(/^./,l.match(/^./)[0].toUpperCase());if(k[h]===undefined){k[h]=(function(){return c}(m,l))}}};var d=function(g,k,f){var i=g.prototype,h,j;for(h in f){j=f[h];if(i[h]===undefined){i[h]=(function(){return c}(k,j))}}};var e=function(g,h,f){if(g.constructor!=Object){a.call(g.prototype,h);if(Object.prototype.toString.call(f)==="[object Array]"){return b(g,h,f)}return d(g,h,f)}else{throw new Error("Attempting to augment Object prototype")}};return{each:e}}()); |
| <script src="catMonitor.js"></script> | |
| <script lang="javascript"> | |
| const dog1 = makeDog( | |
| { | |
| name:"Mark Pure object" , | |
| id: 1 , | |
| } | |
| ); | |
| dog1.fly(); |
| Recentemente enfrentei problemas em um aplicativo Android que desenvolvi, o qual se comunica com o banco de dados de um dos sistemas da empresa, codificado em ISO-8859-1 (Firebird) através de um web service. | |
| Os dados eram gravados de forma errada, muitas vezes truncavam e as vezes apareciam caracteres estranhos. | |
| Depois de algumas tentativas, cheguei até a seguinte solução: |
| dependencies { runtime 'org.postgresql:postgresql:9.2-1003-jdbc4' } | |
| task installPostgreSQL(type: Copy) { | |
| def postgreJar = configurations.runtime.find { it.name.contains('postgresql') } | |
| def moduleDir = "$jbossHome/modules/system/layers/base/org/postgresql/main" | |
| from postgreJar | |
| into moduleDir | |
| doLast { |
This is a collection of books that I've researched, scanned the TOCs of, and am currently working through. The books are selected based on quality of content, reviews, and reccommendations of various 'best of' lists.
The goal of this collection is to promote mastery of generally applicable programming concepts.
Most topics are covered with Python as the primary language due to its conciseness, which is ideal for learning & practicing new concepts with minimal syntactic boilerplate.
JavaScript & Kotlin are listed in the Tooling section; as they allow extension of VS Code and the IntelliJ suite of IDEs, which cover most development needs.
| import java.awt.Color; | |
| import net.sf.jasperreports.engine.*; | |
| import net.sf.jasperreports.engine.design.*; | |
| import net.sf.jasperreports.engine.type.*; | |
| import net.sf.jasperreports.view.JasperViewer | |
| class GroovierReport { | |
| static void main(String[] args) { | |
| def builder = new ObjectGraphBuilder() |
"The trick is to catch exceptions at the proper layer, where your program can either meaningfully recover from the exception and continue without causing further errors, or provide the user with specific information, including instructions on how to recover from the error. When it is not practical for a method to do either of these, simply let the exception go so it can be caught later on and handled at the appropriate level."
Advantages of Exceptions
Excellent example of separating error-handling code from program logic
Three Rules for Effective Exception Handling
Longer explanation and case study of exception use, including the basic principles of "throw early" and "catch late". Clear and thorough.
$ uname -r