<commit_before>
#include <iostream>

#import <Cocoa/Cocoa.h>
#import <Webkit/WebKit.h>


@interface AppDelegate : NSObject <NSApplicationDelegate> {
}
@end

@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{

}

- (void)applicationWillTerminate:(NSNotification *)notification
{

}

- (BOOL) canBecomeKeyWindow
{
    return YES;
}

- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)inSender
{
   return YES;
}

@end

int main(int argc, char* argv[])
{
   // Autorelease Pool:
   // Objects declared in this scope will be automatically
   // released at the end of it, when the pool is "drained".
   NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

   // Create a shared app instance.
   // This will initialize the global variable
   // 'NSApp' with the application instance.
   [NSApplication sharedApplication];

   // Create a window:

   // Style flags
   NSUInteger windowStyle =
   (NSTitledWindowMask |
   NSClosableWindowMask |
   NSResizableWindowMask);

   // Window bounds (x, y, width, height)
   NSRect windowRect = NSMakeRect(100, 100, 1024, 768);

   NSWindow * window = [[NSWindow alloc] initWithContentRect:windowRect
   styleMask:windowStyle
   backing:NSBackingStoreBuffered
   defer:NO];
   [window autorelease];

   // Window controller
   NSWindowController * windowController =
   [[NSWindowController alloc] initWithWindow:window];
   [windowController autorelease];

   // App Delegate
   AppDelegate* appDelegate = [[[AppDelegate alloc] init] autorelease];
   [NSApp setDelegate: appDelegate];

   // Load content view
   NSString *urlAddress = @"http://www.google.com";
   NSURL *url = [NSURL URLWithString:urlAddress];
   NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
   WebView *webView = [[WebView alloc] initWithFrame:NSMakeRect(100,100,1024,768)];
   [webView autorelease];
   [[webView mainFrame] loadRequest:requestObj];
   [window setContentView:webView];

   id menubar = [[NSMenu new] autorelease];
   id appMenuItem = [[NSMenuItem new] autorelease];
   [menubar addItem:appMenuItem];
   [NSApp setMainMenu:menubar];
   id appMenu = [[NSMenu new] autorelease];
   id appName = [[NSProcessInfo processInfo] processName];
   id quitTitle = [@"Quit " stringByAppendingString:appName];<commit_msg>autosave window position and size<commit_after>
#include <iostream>

#import <Cocoa/Cocoa.h>
#import <Webkit/WebKit.h>


@interface AppDelegate : NSObject <NSApplicationDelegate> {
}
@end

@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{

}

- (void)applicationWillTerminate:(NSNotification *)notification
{

}

- (BOOL) canBecomeKeyWindow
{
    return YES;
}

- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)inSender
{
   return YES;
}

@end

int main(int argc, char* argv[])
{
   // Autorelease Pool:
   // Objects declared in this scope will be automatically
   // released at the end of it, when the pool is "drained".
   NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

   // Create a shared app instance.
   // This will initialize the global variable
   // 'NSApp' with the application instance.
   [NSApplication sharedApplication];

   // Create a window:

   // Style flags
   NSUInteger windowStyle =
   (NSTitledWindowMask |
   NSClosableWindowMask |
   NSResizableWindowMask);

   // Window bounds (x, y, width, height)
   NSRect windowRect = NSMakeRect(100, 100, 1024, 768);

   NSWindow * window = [[NSWindow alloc] initWithContentRect:windowRect
   styleMask:windowStyle
   backing:NSBackingStoreBuffered
   defer:NO];
   [window autorelease];

   // Window controller
   NSWindowController * windowController =
   [[NSWindowController alloc] initWithWindow:window];
   [windowController autorelease];
   [windowController setWindowFrameAutosaveName: @"RStudio"];

   // App Delegate
   AppDelegate* appDelegate = [[[AppDelegate alloc] init] autorelease];
   [NSApp setDelegate: appDelegate];

   // Load content view
   NSString *urlAddress = @"http://www.google.com";
   NSURL *url = [NSURL URLWithString:urlAddress];
   NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
   WebView *webView = [[WebView alloc] initWithFrame:NSMakeRect(100,100,1024,768)];
   [webView autorelease];
   [[webView mainFrame] loadRequest:requestObj];
   [window setContentView:webView];

   id menubar = [[NSMenu new] autorelease];
   id appMenuItem = [[NSMenuItem new] autorelease];
   [menubar addItem:appMenuItem];
   [NSApp setMainMenu:menubar];
   id appMenu = [[NSMenu new] autorelease];
   id appName = [[NSProcessInfo processInfo] processName];
   id quitTitle = [@"Quit " stringByAppendingString:appName];
{'fraction_non_alphanumeric': 0.10902572754112189, 'fraction_numerical': 0.010965837199493884, 'mean_word_length': 4.508710801393728, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4720117', 'n_tokens_mistral': 1528, 'n_tokens_neox': 1417, 'n_words': 368}