<commit_before>#!/usr/bin/env ruby

require 'thread'
require 'Qt'
require './DrawBox'

WIDTH = 600
HEIGHT = 400

class QtApp < Qt::Widget
	def initialize
		super

		setWindowTitle "Draw Box"
		resize WIDTH, HEIGHT

		center
		init_ui
		show
	end

	def center

		qdw = Qt::DesktopWidget.new

		screenWidth = qdw.width 
		screenHeight = qdw.height 

		x = (screenWidth - WIDTH)/2
		y = (screenHeight - HEIGHT)/2

		move x,y
	end

	def init_ui
		grid = Qt::GridLayout.new self

		labelLetters = Qt::Label.new "Letters", self
		labelNumbers = Qt::Label.new "Numbers", self
		@result = Qt::LineEdit.new self
		@result.isReadOnly
		@letters = DrawBox.new self, 1
		@numbers = DrawBox.new self, 2
		quit = Qt::PushButton.new 'Quit', self

		grid.addWidget labelLetters, 0, 0
		grid.addWidget labelNumbers, 0, 2
		grid.setRowStretch 1, 1
        grid.addWidget @letters, 1, 0, 2, 2
        grid.addWidget @numbers, 1, 2, 2, 2
		grid.addWidget @result, 4, 0, 1, 2
		grid.addWidget quit, 4, 3, 1, 1

		connect quit, SIGNAL('clicked()'), $qApp, SLOT('quit()')
	end

	def getResult
		return @result
	end
<commit_msg>drawbox dynamique<commit_after>#!/usr/bin/env ruby

require 'thread'
require 'Qt'
require './DrawBox'

WIDTH = 600
HEIGHT = 400

class QtApp < Qt::Widget
	def initialize
		super

		setWindowTitle "Draw Box"
		resize WIDTH, HEIGHT

		center
		init_ui
		show
	end

	def center

		qdw = Qt::DesktopWidget.new

		screenWidth = qdw.width 
		screenHeight = qdw.height 

		x = (screenWidth - WIDTH)/2
		y = (screenHeight - HEIGHT)/2

		move x,y
	end

	def init_ui
		grid = Qt::GridLayout.new self

		labelLetters = Qt::Label.new "Letters", self
		labelNumbers = Qt::Label.new "Numbers", self
		@result = Qt::LineEdit.new self
		@letters = DrawBox.new self, 1
		@numbers = DrawBox.new self, 2
		quit = Qt::PushButton.new 'Quit', self

		grid.addWidget labelLetters, 0, 0
		grid.addWidget labelNumbers, 0, 2
		grid.setRowStretch 1, 1
        grid.addWidget @letters, 1, 0, 2, 2
        grid.addWidget @numbers, 1, 2, 2, 2
		grid.addWidget @result, 4, 0, 1, 2
		grid.addWidget quit, 4, 3, 1, 1

		connect quit, SIGNAL('clicked()'), $qApp, SLOT('quit()')
	end

	def getResult
		return @result
	end

{'fraction_non_alphanumeric': 0.11866727521679599, 'fraction_numerical': 0.02921040620721132, 'mean_word_length': 3.248062015503876, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3443751', 'n_tokens_mistral': 968, 'n_tokens_neox': 797, 'n_words': 240}