29 March 2016

How to play LAN games using a wireless router



This is for people owning a WiFi router, who are just looking to setup a simple LAN game on their personal LAN network. Not via internet.

Assuming you have two systems: A PC and a laptop, with two different versions of Windows OS. Let's say Windows XP and Windows 8.


Setting the IP address:
  • Connect the wireless router to the PC using a LAN cable and connect it to a power source.
  • Switch on the PC.
  • Goto Windows network settings, click on the network properties and in IPv4, set the IP address of the PC to 192.168.1.10. Set the subnet mask to 255.255.255.0.
  • Switch on the laptop and allow it to connect to the wireless connection from the router.
  • Goto the laptop's Windows network settings, click on the network properties and in IPv4, set the IP address to 192.168.1.11. Set the subnet mask to 255.255.255.0.
  • Like this you could add a few more computers if you want, ensuring that you set the IP address to a different number.

Ensuring that the computers can talk to each other:
  • Temporarily switch off the firewalls on both computers (and ensure that they aren't connected to the internet for safety reasons). You could also keep the firewall on and allow the specific ports that the LAN games require for communication, but switching the firewall off is the easiest way.
  • Open up a DOS terminal (cmd.exe) in both computers.
  • In the PC, type ping 192.168.1.11
  • In the laptop, type ping 192.168.1.10
  • In both terminals, you should see a successful ping happening with no losses. If it happens, then you are ready to start gaming. If not, you need to check why the networks aren't able to connect with each other.

Now open up the game on both computers and enjoy!


13 March 2016

Waterproofing and cement

When it comes to finding good workmanship in India for plumbing, masonry or electrical work, it's hard to find good people (I hear HR departments in all companies face that difficulty too).
Once you find people with good workmanship, you are at times presented with the danger of them ripping you off.


Insider lingo

Something that helps in such situations, is in knowing what are called "insider terms". When giving your car for servicing, if the mechanic starts speaking about the "manifold" and you don't know what that means, he's likely to recommend cleaning the pipes that lead to and lead out of it. What he doesn't tell you is that it's going to cost a small fortune to unmount it and clean it. But if you know the lingo and the recommended servicing mentioned in the manual, you can flatly refuse the cleaning which is actually un-necessary.

Same goes with other small work. A mason may tell you about the "white cement" (with an expression on his face that it's something very great) he's going to use on your house, along with waterproofing cement and some other cement. But he does not want to be questioned about anything and he's going to charge a fixed price.

Don't fall for it. Find out. Also search for complaints on Mouthshut.com or one of the many consumer complaints forums.


Cement is...

Unless you know what cement is, why sand is added to it and what kind of cement can give you proper waterproofing, the contractor or the mason can rip you off, by citing the high cost/quality of the materials they use or the so-called extra care they take to do the work very well.

Here are some things you need to know:

How hydraulic cement is created: 
Put simply, limestone is crushed to a powder and heated at 3500 degrees Celsius. This causes the Hydrogen molecules in it to escape, and the resulting powder is cement. During construction, you add water to the cement, and the hydrogen from the water combines with the cement to become hard. One such hydraulic cement is called "Portland cement". Hydraulic cements can be used to seal even swimming pools. Some of these cements can be used even underwater.

Mike Haduck explains it well, and I recommend his other videos too where he explains various types of masonry work.




Why sand is added to cement:
Sand has Silica, which increases the strength of the cement. Sand also happens to be an additive, which like other additives (fiber-glass, gravel, stones), adds to the compressive strength of the cement. Basically, too much sand or too much cement can make the resultant concrete/mortar brittle.
Cement is basically the binder that binds all the aggregates like sand and stone into a solid mass called concrete.

What is concrete and mortar?
  • Cement + water + sand + gravel = concrete
  • Cement + water + sand                = plaster
  • Cement + water + sand + lime    = mortar

Cement is just the dry powder you get. When it's added to water and sand, it becomes hard, and that's called concrete.
If you have to use cement with brick-work, make sure you use mortar instead of Portland concrete. For side-walks, patio's, highways, swimming pools, roof-work etc, Portland is better.

How much of waterproofing liquid should I add to the cement?
You add waterproofing liquid to the water; not the cement. The liquid will be miscible and you then add the mixture to the cement. The packet will have instructions on what ratio to follow. Generally, the waterproofing liquid should not be more than 2% to 5% of the cement. There are people who say that if the quality of the sand is not good enough, then it's ok to add upto 20% of the liquid.
Careful though, since the purpose of the waterproofing liquid is just to give the cement more plasticity. If you add too much, the cement will lose its strength. Hydraulic concrete by itself has a sufficient amount of waterproofing property. Make sure you cure it well.

What is curing and how much of it should I do?
The hardening of concrete happens by a process called "hydration", during which the mineral hydrates solidify. For hydraulic cements like Portland cement, the concrete hardens better not if you leave it alone to dry, but it hardens better if there's moisture present during the hardening. Remember I mentioned that the hydrogen molecules from the water go back to the cement and make it hard?
If you don't have curing oils/compounds or plastic shields, then the simpler way of ensuring that the moisture remains with the cement, is to use a gunny bag or cloth that's placed on the cement and to pour water over it. Make sure the moisture is retained for around 28 days, as this is the curing time that it is designed for. Of course, this may also vary based on the additives and mixture chosen.

What is so great about white cement?
Actually, nothing. Grey cement and white cement have almost the same chemical composition. All cements when manufactured, are white. It's the additives that change the colour of the cement. White cement has certain ferrous or other metallic oxides added to it. For decorative purposes, other additives may be added to give the white cement some other colour.


When you know just this much of information and speak to a mason, you'll see that they don't really know much about their job. They've been taught through the years to use certain materials and ratios, but they have no clue why. It's always better to

Find an engineer or a contractor who:
  • Knows the what and why of the ratios of materials to mix.
  • Patiently explains the process to you and allows you to ask doubts.
  • Allows you to supervise the cementing process (though they prefer it if you stay out of their hair when the work is going on)
  • Asks his workers to use protective gloves and masks (the contents of cement and waterproofing agents are harmful chemicals)

Search for people with knowledge. Get people who don't rip you off.



Although these videos are taken abroad, the same scams happen in India too. At hospitals, bike/car servicing, plumbing, masonry, electrical work, computer servicing and well...basically any other business that is trying to beat the competition or is having to pay someone in black.


Your best bet is in learning what needs to be learnt and consulting with many contractors. Don't wait for the day you badly need plumbing/masonry work to be done. Search for these people even when you don't have any emergency, so that you'll get the right person during an emergency.

04 March 2016

Generate a gitignore for Netbeans, Eclipse, IntelliJ Idea, Gradle or anything else!

I've written about gitignore for Netbeans, but recently came across something much better. There's actually a gitignore generator which can generate the file and folder list that Git should ignore. It's available for 255 types of IDE's, OS'es etc.

Either just type the name of the IDE, OS or programming language and click "Generate"...

OR

... install the commandline version of it and at the terminal, simply type:

gi <IDE or language or OS name>

and the custom gitignore gets generated.

or if you want to directly generate the file, just add the redirection operator:

gi <IDE or language or OS name>  >>  .gitignore

or if you don't want to generate specific gitignores for every project, simply generate a global one.

Eg:
gi linux, netbeans >> ~/.gitignore_global



As simple as that. It's quite amazing that someone took the time to actually create a gitignore generator. Thoughtful, and very much a gem for programmers around the world!



A little video if you still need help: