zeddie's blog

By zeddie, history, 6 years ago, In English

I am using the sublime editor for running my code on my machine. And I am using File I/O like this:

#ifndef ONLINE_JUDGE freopen("/home/zeddie/Documents/input.txt","r",stdin); freopen("/home/zeddie/Documents/output.txt","w",stdout); freopen("/home/zeddie/Documents/error.txt","w",stderr); #endif __

#### PROBLEM: Sometimes when I do some error in my program that leads to an infinite loop, then my programs produce infinite output and programs keeps on running and my system starts lagging. Only option I have now is to reboot my machine.

Can anyone help me with this?

  • Vote: I like it
  • -19
  • Vote: I do not like it

| Write comment?
»
6 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by zeddie (previous revision, new revision, compare).

»
6 years ago, hide # |
 
Vote: I like it +16 Vote: I do not like it

Go to Preferences -> Key Bindings, then add

[
	{ "keys": ["ctrl+alt+b"], "command": "cancel_build" }
]

on the right. Then you'll be able to press ctrl+alt+b to cancel your build.

»
6 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

You can create a new build system in sublime. You can refer to this build system that allows you to set a custom timeout.

Github Repo