Nodejs – Redirect url

The logic of determining a “wrong” url is specific to your application. It could be a simple file not found error or something else if you are doing a RESTful app. Once you’ve figured that out, sending a redirect is as simple as:

Usage of \b and \r in C

The characters will get send just like that to the underlying output device (in your case probably a terminal emulator). It is up to the terminal’s implementation then how those characters get actually displayed. For example, a bell (\a) could trigger a beep sound on some terminals, a flash of the screen on others, or … Read more

Categories C Tags

How to make an installer for my C# application?

Add a new install project to your solution. Add targets from all projects you want to be installed. Configure pre-requirements and choose “Check for .NET 3.5 and SQL Express” option. Choose the location from where missing components must be installed. Configure your installer settings – company name, version, copyright, etc. Build and go!

Git Bash doesn’t see my PATH

Got it. As a Windows user, I’m used to type executable names without extensions. In my case, I wanted to execute a file called cup.bat. In a Windows shell, typing cup would be enough. Bash doesn’t work this way, it wants the full name. Typing cup.bat solved the problem. (I wasn’t able to run the file though, since apparently bash … Read more

fgetc(stdin) in a loop is producing strange behaviour

Terminals tend to be line-buffered, meaning that stream contents are accessible on a line-by-line basis. So, when fgetc starts reading from STDIN, it’s reading a full line, which includes the newline character that ended that line. That’s the second character you’re reading. As for fflush, that’s for flushing output buffers, not input buffers. So, what … Read more

Logout button php

Instead of a button, put a link and navigate it to another page Then in logout.php page, use