<commit_before>#include <pebble.h>

#define KEY_TEMPERATURE 0
#define KEY_CONDITIONS 1

static Window *s_main_window;
static TextLayer *s_time_layer;
static TextLayer *s_date_layer;
static TextLayer *s_weather_layer;
static TextLayer *s_battery_layer;

// // Debugging var
// static GSize s_time_layer_size;
static GFont s_time_font;
static GFont s_status_font;

static BitmapLayer *s_background_layer;
static GBitmap *s_background_bitmap;

static GBitmap *s_battery01_bitmap;
static BitmapLayer *s_battery01_layer;

static GBitmap *s_battery02_bitmap;
static BitmapLayer *s_battery02_layer;

static GBitmap *s_battery03_bitmap;
static BitmapLayer *s_battery03_layer;

static GBitmap *s_battery04_bitmap;
static BitmapLayer *s_battery04_layer;

static GBitmap *s_battery05_bitmap;
static BitmapLayer *s_battery05_layer;

static GBitmap *s_battery06_bitmap;
static BitmapLayer *s_battery06_layer;

static GBitmap *s_battery07_bitmap;
static BitmapLayer *s_battery07_layer;

static GBitmap *s_battery08_bitmap;
static BitmapLayer *s_battery08_layer;

static GBitmap *s_battery09_bitmap;
static BitmapLayer *s_battery09_layer;

static void update_time() {
  // Get a tm structure
  time_t temp = time(NULL);
  struct tm *tick_time = localtime(&temp);

  // Create a long-lived buffer
  static char buffer[] = "00:00";

  // Write the current hours and minutes into the buffer
  if(clock_is_24h_style() == true) {
    //Use 2h hour format
    strftime(buffer, sizeof("00:00"), "%H:%M", tick_time);
  } else {
    //Use 12 hour format
    strftime(buffer, sizeof("00:00"), "%I:%M", tick_time);
  }

  // Display this time on the TextLayer
  text_layer_set_text(s_time_layer, buffer);

  // Create buffer and write date into buffer
  static char date_text[] = "Xxxxxxxxx 00";
  strftime(date_text, sizeof(date_text), "%B %e", tick_time);
  // Set date text
  text_layer_set_text(s_date_layer, date_text);
}

static void battery_handler(BatteryChargeState new_state) {
  // Write to buffer and display
  static char s_battery_buffer[32];
  snprintf(s_battery_buffer, sizeof(s_battery_buffer), "%d%%", new_state.charge_percent);
  APP_LOG(APP_LOG_LEVEL_INFO, "%s", s_battery_buffer);
//   text_layer_set_text(s_battery_layer, s_battery_buffer);
}

static void main_window_load(Window *window) {
  //Create GBitmap, then set to created BitmapLayer
  s_background_bitmap = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_BACKGROUND);
  s_background_layer = bitmap_layer_create(GRect(0, 0, 144, 168));
  bitmap_layer_set_bitmap(s_background_layer, s_background_bitmap);
  layer_add_child(window_get_root_layer(window), bitmap_layer_get_layer(s_background_layer));

  s_battery01_bitmap = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_BATTERY01);
  s_battery01_layer = bitmap_layer_create(GRect(0, 0, 144, 168));
  bitmap_layer_set_bitmap(s_battery01_layer, s_battery01_bitmap);
  layer_add_child(window_get_root_layer(window), bitmap_layer_get_layer(s_battery01_layer));

  // Create GFont for Time Layer
  s_time_font = fonts_get_system_font(FONT_KEY_BITHAM_42_BOLD);


  // Figure out dimensions for Time Layer
  GSize time_max_size = graphics_text_layout_get_content_size("00:00", s_time_font, GRect(7, 41, 132, 88), GTextOverflowModeWordWrap , GTextAlignmentCenter);
//   // Debugging
//   APP_LOG(APP_LOG_LEVEL_INFO , "Max Layer Height is %i", time_max_size.h);
//   APP_LOG(APP_LOG_LEVEL_INFO , "Max Layer Width is %i", time_max_size.w);

  // Background Image section sizes
  int bg_header_size = 5;
  int bg_window_size = 88;

  // Default textlayer padding value
  int textlayer_padding = 5;

  int time_text_y = bg_header_size + (bg_window_size / 2) - (time_max_size.h / 2) - textlayer_padding;
  // Create time TextLayer
  s_time_layer = text_layer_create(GRect(7, time_text_y, 132, 88));
  text_layer_set_background_color(s_time_layer, GColorClear);<commit_msg>I have no idea what I am doing<commit_after>#include <pebble.h>

#define KEY_TEMPERATURE 0
#define KEY_CONDITIONS 1

static Window *s_main_window;
static TextLayer *s_time_layer;
static TextLayer *s_date_layer;
static TextLayer *s_weather_layer;
static TextLayer *s_battery_layer;

// // Debugging var
// static GSize s_time_layer_size;
static GFont s_time_font;
static GFont s_status_font;

static BitmapLayer *s_background_layer;
static GBitmap *s_background_bitmap;

static GBitmap *s_battery01_bitmap;
static BitmapLayer *s_battery01_layer;

static GBitmap *s_battery02_bitmap;
static BitmapLayer *s_battery02_layer;

static GBitmap *s_battery03_bitmap;
static BitmapLayer *s_battery03_layer;

static GBitmap *s_battery04_bitmap;
static BitmapLayer *s_battery04_layer;

static GBitmap *s_battery05_bitmap;
static BitmapLayer *s_battery05_layer;

static GBitmap *s_battery06_bitmap;
static BitmapLayer *s_battery06_layer;

static GBitmap *s_battery07_bitmap;
static BitmapLayer *s_battery07_layer;

static GBitmap *s_battery08_bitmap;
static BitmapLayer *s_battery08_layer;

static GBitmap *s_battery09_bitmap;
static BitmapLayer *s_battery09_layer;

static void update_time() {
  // Get a tm structure
  time_t temp = time(NULL);
  struct tm *tick_time = localtime(&temp);

  // Create a long-lived buffer
  static char buffer[] = "00:00";

  // Write the current hours and minutes into the buffer
  if(clock_is_24h_style() == true) {
    //Use 2h hour format
    strftime(buffer, sizeof("00:00"), "%H:%M", tick_time);
  } else {
    //Use 12 hour format
    strftime(buffer, sizeof("00:00"), "%I:%M", tick_time);
  }

  // Display this time on the TextLayer
  text_layer_set_text(s_time_layer, buffer);

  // Create buffer and write date into buffer
  static char date_text[] = "Xxxxxxxxx 00";
  strftime(date_text, sizeof(date_text), "%B %e", tick_time);
  // Set date text
  text_layer_set_text(s_date_layer, date_text);
}

static void battery_handler(BatteryChargeState new_state) {
  // Write to buffer and display
  static char s_battery_buffer[32];
  snprintf(s_battery_buffer, sizeof(s_battery_buffer), "%d%%", new_state.charge_percent);
  APP_LOG(APP_LOG_LEVEL_INFO, "%s", s_battery_buffer);
//   text_layer_set_text(s_battery_layer, s_battery_buffer);
}

static void main_window_load(Window *window) {
  //Create GBitmap, then set to created BitmapLayer
  s_background_bitmap = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_BACKGROUND);
  s_background_layer = bitmap_layer_create(GRect(0, 0, 144, 168));
  bitmap_layer_set_bitmap(s_background_layer, s_background_bitmap);
  layer_add_child(window_get_root_layer(window), bitmap_layer_get_layer(s_background_layer));

  s_battery01_bitmap = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_BATTERY01);
  s_battery01_layer = bitmap_layer_create(GRect(0, 0, 144, 168));
  bitmap_layer_set_bitmap(s_battery01_layer, s_battery01_bitmap);
  layer_mark_dirty(s_battery01_layer);
  layer_add_child(window_get_root_layer(window), bitmap_layer_get_layer(s_battery01_layer));

  // Create GFont for Time Layer
  s_time_font = fonts_get_system_font(FONT_KEY_BITHAM_42_BOLD);


  // Figure out dimensions for Time Layer
  GSize time_max_size = graphics_text_layout_get_content_size("00:00", s_time_font, GRect(7, 41, 132, 88), GTextOverflowModeWordWrap , GTextAlignmentCenter);
//   // Debugging
//   APP_LOG(APP_LOG_LEVEL_INFO , "Max Layer Height is %i", time_max_size.h);
//   APP_LOG(APP_LOG_LEVEL_INFO , "Max Layer Width is %i", time_max_size.w);

  // Background Image section sizes
  int bg_header_size = 5;
  int bg_window_size = 88;

  // Default textlayer padding value
  int textlayer_padding = 5;

  int time_text_y = bg_header_size + (bg_window_size / 2) - (time_max_size.h / 2) - textlayer_padding;
  // Create time TextLayer
  s_time_layer = text_layer_create(GRect(7, time_text_y, 132, 88));
  text_layer_set_background_color(s_time_layer, GColorClear);
{'fraction_non_alphanumeric': 0.09164524421593831, 'fraction_numerical': 0.02930591259640103, 'mean_word_length': 6.08007279344859, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '7673921', 'n_tokens_mistral': 2963, 'n_tokens_neox': 2767, 'n_words': 609}