How can I get the count of line in a file in an efficient way?

Update: To answer the performance-question raised here, I made a measurement. First thing: 20.000 lines are too few, to get the program running for a noticeable time. I created a text-file with 5 million lines. This solution (started with java without parameters like -server or -XX-options) needed around 11 seconds on my box. The same with wc … Read more

Printf was not declared in this scope

The compiler didn’t find declaration for printf function. That’s why it shows compilation error. The correct declaration (ISO/IEC 9899:1999) of printf function is: You can either declare the function like above before calling it or you can include header file which contains declaration of that function. But it would be easiest and safest to just include the header file which contains … Read more

Categories c Tags

Vim Opening File E325 Attention Error

By closing the console without exiting Vim first, the Vim process got killed, and Vim didn’t have a chance to properly shut down. Vim uses swap files to store the last unpersisted changes to a buffer to avoid data loss in case of a crash; you can read the whole story at :help E325. In your case, as … Read more

Fastest way to extract frames using ffmpeg?

If the JPEG encoding step is too performance intensive, you could always store the frames uncompressed as BMP images: This also has the advantage of not incurring more quality loss through quantization by transcoding to JPEG. (PNG is also lossless but tends to take much longer than JPEG to encode.)

What is the difference between the remap, noremap, nnoremap and vnoremap mapping commands in Vim?

remap is an option that makes mappings work recursively. By default it is on and I’d recommend you leave it that way. The rest are mapping commands, described below: :map and :noremap are recursive and non-recursive versions of the various mapping commands. For example, if we run: Then: j will be mapped to gg. Q will also be mapped to gg, because j will be expanded for the recursive mapping. W will be mapped to j (and … Read more