Código (java) [Seleccionar]
Ventana v1 = new Ventana("Ventana 1", true);
v1.mover()
Los atributos suelen ser privados y es bueno especificarlo.
Más info: http://foro.elhacker.net/empty-t345736.0.html
Saludos
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú
Ventana v1 = new Ventana("Ventana 1", true);
v1.mover()
if (ARGV[0])=="-h" or "--help"
help()
if (File.exist?(path_to_file))
print "ERROR!!"
def reemplazar(caracter_a_reemplazar, nuevo_caracter)
Find.find(ARGV[1].gsub("\\", "/")) { |path|
path = path.encode('utf-8')
if path[caracter_a_reemplazar] then
File.rename(path, path.gsub(caracter_a_reemplazar, nuevo_caracter))
$renamed += 1
end
$total += 1
}
end
if (ARGV[0] == "-c" or "--comilla")
reemplazar("\u004B", "\u0027")
else if ...
if (ARGV.empty?) then
print "ARGV Vacio"
end
def reset()
$renamed = 0
$total = -1
end
print ' -comilla (Reemplaza "´" por "'")' + "\n"
print ' -comilla (Reemplaza "´" por "\'")' + "\n"
# -*- coding: UTF-8 -*-
def help()
print "\n Opciones: \n\n"
print ' -? (Elimina el caracter "¿")' + "\n"
print ' -comilla (Reemplaza "´" por "\'")' + "\n"
print ' -ft (Reemplaza " ft " por " feat. ")' + "\n"
print ' -ft. (Reemplaza " ft. " por " feat. ")' + "\n"
print " -guion (Reemplaza \"\u2013\" por \"-\")" + "\n"
end
ARGV.empty?
chcp 1252>NUL
# -*- coding: UTF-8 -*-
require 'find'
exit if Object.const_defined?(:Ocra)
rename = 0
total = 0
Find.find(ARGV[0].gsub("\\", "/")) { |path|
path = path.encode('utf-8')
if path["\u2013"] then
File.rename(path, path.gsub("\u2013", "-"))
rename += 1
end
total += 1
}
puts "Procesados: #{total} archivos" + " | " + "Renombrados: #{rename} archivos"
Cita de: EleKtro H@cker en 20 Febrero 2012, 03:47 AM
Tienes razón me estaba dando cuenta de eso ahora iba a editar el script
Y esto debe quedar así:total = -1
Salu2
# -*- coding: UTF-8 -*-
require 'find'
exit if Object.const_defined?(:Ocra)
rename = 0
total = 0
Find.find(ARGV[0].gsub("\\", "/").encode('utf-8')) { |path|
path = path.encode('utf-8')
if path["\u2013"] then
File.rename(path, path.gsub("\u2013", "-"))
rename += 1
end
total += 1
}
puts "Procesados: #{total} archivos" + " | " + "Renombrados: #{rename} archivos"
package jtarea;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.JTextField;
/**
*
* @author ryogi
*/
public class JTArea extends JFrame implements ActionListener{
private JTextArea textArea = new JTextArea(10, 10);
private JTextField textToAppend = new JTextField(15);
private JButton button = new JButton("Agregar a JTextArea");
public JTArea() {
setSize(200, 300);
setResizable(false);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setLayout(new FlowLayout());
button.addActionListener(this);
button.setActionCommand("Append");
add(textArea);
add(textToAppend);
add(button);
setVisible(true);
}
public static void main(String[] args) {
JTArea jtarea = new JTArea();
}
@Override
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals("Append")) {
textArea.append(textToAppend.getText());
}
}
}
Cita de: WaAYa HaCK en 19 Febrero 2012, 23:52 PM
Eso del ARGV[0] me parece raro, ya que argv(0) siempre ha sido el propio script.
__FILE__