What is the difference between require() and library()?

In addition to the good advice already given, I would add this: It is probably best to avoid using require() unless you actually will be using the value it returns e.g in some error checking loop such as given by thierry. In most other cases it is better to use library(), because this will give an error message at … Read more

Checking letter case (Upper/Lower) within a string in Java

To determine if a String contains an upper case and a lower case char, you can use the following: This allows you to check: Essentially, this works by checking if the String is equal to its entirely lowercase, or uppercase equivalent. If this is not true, then there must be at least one character that … Read more

What does ‘wb’ mean in this code, using Python?

File mode, write and binary. Since you are writing a .jpg file, it looks fine. But if you supposed to read that jpg file you need to use ‘rb’ More info On Windows, ‘b’ appended to the mode opens the file in binary mode, so there are also modes like ‘rb’, ‘wb’, and ‘r+b’. Python on … Read more

getc() vs fgetc() – What are the major differences?

From the Advanced Programming in Unix Environment: … The difference between getc and fgetc is that getc can be implemented as a macro, whereas fgetc cannot be implemented as a macro. This means three things: The argument to getc should not be an expression with side effects. Since fgetc is guaranteed to be a function, we can take its address. This allows us to pass the address of fgetc as … Read more