This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try{ | |
FileWriter fw = new FileWriter("salida.txt"); | |
BufferedWriter bw = new BufferedWriter(fw); | |
PrintWriter salida = new PrintWriter(bw); | |
salida.println("Primera linea"); | |
salida.close(); | |
//Modo append | |
bw = new BufferedWriter(new FileWriter("salida.txt",true)); | |
salida.print("Segunda Linea"); | |
double b = 123.45; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Button; | |
import java.awt.FileDialog; | |
import java.awt.FlowLayout; | |
import java.awt.Font; | |
import java.awt.Frame; | |
import java.awt.Panel; | |
import java.awt.TextArea; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.awt.event.WindowAdapter; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.zetcode; | |
import javax.swing.JFrame; | |
import javax.swing.SwingUtilities; | |
public class SimpleExample extends JFrame { | |
public SimpleExample() { | |
setTitle("Simple example"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import javax.swing.JButton; | |
import javax.swing.JFrame; | |
import javax.swing.JPanel; | |
import javax.swing.SwingUtilities; | |
public class QuitButtonExample extends JFrame { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.awt.event.KeyEvent; | |
import javax.swing.ImageIcon; | |
import javax.swing.JFrame; | |
import javax.swing.JMenu; | |
import javax.swing.JMenuBar; | |
import javax.swing.JMenuItem; | |
import javax.swing.SwingUtilities; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package javamysql; | |
import java.sql.*; | |
public class Main { | |
//variables | |
private static Connection conexion; | |
private static String bd="javamysql"; | |
private static String user="test"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#The mocked method to test | |
def save_obj(self, original_obj): | |
obj = super(CampaignProcessor, self).save_obj(original_obj) | |
for r in original_obj.featured_reviews.all(): | |
review = ( | |
r and | |
review_processor.get_or_create_obj(r)[0] | |
or None) | |
if review: | |
obj.featured_reviews.add(review) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Statement stmt = null; | |
String query = | |
"select attr1, attr2 from TU_TABLA"; | |
try { | |
stmt = con.createStatement(); | |
ResultSet rs = stmt.executeQuery(query); | |
while (rs.next()) { | |
String attr1 = rs.getString("attr1"); | |
int attr2 = rs.getInt("attr2"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tripOverviewController ($scope, pricingService) { | |
this.includeMeetAndGreet = function () { | |
if(this.checkoutData){ | |
return this.checkoutData.trip.includeMeetAndGreet === 1; | |
} | |
return false; | |
}; | |
this.showCouponField = function () { | |
if(this.checkoutData){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(window, document, undefined) { | |
<!-- | |
here goes entire AngularJS code | |
including functions, services, providers etc related code goes here | |
--> | |
if (window.angular.bootstrap) { | |
//AngularJS is already loaded, so we can return here... | |
console.log('WARNING: Tried to load angular more than once.'); | |
return; | |
} |