Skip to content

Instantly share code, notes, and snippets.

View carlosdlf's full-sized avatar

Carlos DLF carlosdlf

View GitHub Profile
JRExporter exporter = new JRPdfExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, new FileOutputStream("zxc"+ ".pdf")); // your output goes here
public class ContarVocales {
public static void main(String[] args) {
String vocales = "aeiou";
String palabra = "murcielago";
int cantidadVocales = 0;
for (int i = 0; i < palabra.length(); i++) {
char letter = palabra.charAt(i);
@carlosdlf
carlosdlf / MainClass.java
Created November 7, 2015 15:56
Util Date to Sql Date
public class MainClass {
public static void main(String[] args) {
java.util.Date utilDate = new java.util.Date();
java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());
System.out.println("utilDate:" + utilDate);
System.out.println("sqlDate:" + sqlDate);
}
//see CONSOLE!
var votes = [
"angular",
"angular",
"react",
"react",
"react",
"angular",
"ember",
"react",
@carlosdlf
carlosdlf / App.js
Created May 1, 2015 00:46
Mount and unmount - reactjs
/**
* Created by clarico on 30/04/2015.
*/
var Button = React.createClass({
getInitialState: function () {
return {val : 0}
},
update : function () {
this.setState({val: this.state.val +1});
},
@carlosdlf
carlosdlf / App.js
Created May 1, 2015 00:25
React Children
/**
* Created by clarico on 30/04/2015.
*/
var App = React.createClass({
render:function(){
return <Button>I <Heart/> React</Button>
}
});
var Button = React.createClass({
@carlosdlf
carlosdlf / app.js
Created April 30, 2015 20:20
REFS -REACT JS
/**
* Created by clarico on 29/04/2015.
*/
var App = React.createClass({
getInitialState: function () {
return {
red : 0,
blue : 0,
green : 0
}
@carlosdlf
carlosdlf / app.js
Created April 30, 2015 19:47
Widget Basic ReactJs
/**
* Created by clarico on 29/04/2015.
*/
var App = React.createClass({
getInitialState: function () {
return {
txt: ""
}
},
update: function (e) {
@carlosdlf
carlosdlf / app.js
Created April 30, 2015 03:52
React input text
/**
* Created by clarico on 29/04/2015.
*/
var App;
App = React.createClass({
getInitialState: function () {
return {
txt: "the state txt",
id: 0
}
@carlosdlf
carlosdlf / app.js
Created April 30, 2015 03:40
Jugando con propiedads
/**
* Created by clarico on 29/04/2015.
*/
var App = React.createClass({
getDefaultProps: function () { /*defaults*/
return {
txt:'default :D',
cat: 404
}
},