ad

Thursday, 31 December 2015

Complete Batch Programming tutorial For Beginners

Batch?
For those wonder what batch is, it's a list of commands for DOS(Disk operating system). It's mostly used to automate windows tasks. It's also a great way for beginners to get started with fundamentals.

How do I create a batch program?
Createa new Notepad document and Save it with .bat extension. All our code will go here. To run, we simple double click open it. If you saved it with right extension, notepad icon should be changed to this.

Now whenever you run this file, it will open CMD and run it.

Lets create our first program
Edit batch file, type "echo Hello world" without quotations and save it. 'echo' command will output/write whatever you write in front of it on CMD screen. Go ahead and open it. You'll notice that CMD opened and closed itself without you having a change to look at the message. Edit the batch and type 'pause' command in new line. Save it and open the batch file again. You should now see your message.

Wait my screen looks a little different than yours, right? While I only see 'Hello world' and 'Press and key to continue..' you also see directory and the command 'echo' you wrote in the batch file? Edit batch file again and this time add '@echo off' at the top, this command will hide the command and show you the result only.

How do I change my program title from C:\Windows... to something nicer?
Use 'title' command with whatever title you want in front of it. For example, 'title Hello world Program'. Here's what I currently have in my program you should understand every bit of it.
@echo off
title Hello world Program
echo Hello world
pause


'title' command in action.


How do I change text or background color?
Use 'color??' command where first '?' means background color and second '?' is foreground color. You might wanna try 'color redgreen' or 'color blue red', go ahead and give it a try. Here's what you'll see, an error! but that's not all CMD also tells you how to use 'color' command.

It tells us to use number instead of color name, so lets try red background and black foreground. Go through the color list and here's what our complete command looks like, 'color 40'.

Here's here's our complete code:
@echo off
title Hello world Program
color 40
echo Hello world
pause


Here's it in action


So you want to see the list of files and folders in a directory?

Assume you wanna see everyting in 'C:\wamp' directory. The command is 'dir' and directory path, or just directory name if you're in a same directory. Here's list of files I've in this directory.


Now lets use 'dir' command to see all the files, edit batch file and put 'dir C:\wamp' note that you should choose different path than mine. Here's command in action.


Variables(VERY IMPORTANT)
Lets say you want to store number 10. You can store it in a variable, variable's like an empty box where you store different values. For example to store number 6 in a 'box' variable you do, 'SET box=10', now box vairables has the value of 10 and to test it out, try 'echo box' you will see it print 10. It it doesn't work make sure there's no space between box and 10. By the way, variables name can me almost anything.. Not to mention you can also store text/string inside a variable like, SET name=jon

Code:
@echo off
SET box=10
echo %box%
pause

or
@echo off
SET name=jones
echo %box%
pause 


Lets run it


continued
http://www.webdevtown.com/2016/01/how-to-loop-in-batch-programing.html

Sunday, 27 December 2015

./composer.json does not contain valid JSON SOLVED

So I was trying to install PHP Google API library using composer. Here's Google official page that gives instructions about installing the library, the first method is using composer and second's cloning git repository. I thought I'd use composer, so I switched to my project directory, created composer.json file and pasted this JSON code as shown on google official page..
"require": {
  "google/apiclient": "1.0.*@beta"
}
    
..and executed the command 'composer install'.. and guess what? it's showed me this error:
   [Seld\JsonLint\ParsingException]
  "./composer.json" does not contain valid JSON
  Parse error on line 1:
                "google/apicl
  ---------^
  Expected one of: 'EOF', '}', ',', ']'


I searched on Google but nothing, I checked with couple of my buddies, nothing..though one of them suggested I paste that JSON string on http://jsonlint.com/ apparently it's poorly written JSON and composer wont run it due to missing  { }.

If you ended up cloning Git repo, good for you, but if you're still trying to figure it out here's working string.
{
    "require": {
      "google/apiclient": "1.0.*@beta"
    }
}

Wednesday, 9 December 2015

2 Minute Tutorial - Remove Duplicate Lines with Notepad ++

1. You should notepad ++ installed with TextFx plugin. To download textFx open notepad++ go to Plugins tag > Plugins > Plugins Manager. When there type Press T on keyboard and look for textFx and install it.

2. Now you've textFx installed select textFx tab, click on 'Sort Output only UNIQUE (at column) lines'.

3. Now select all your data(Contro A), and go back to textFx, then click on 'Sort lines case sensitive (at column)', it's the first option.

You're done!

Monday, 7 December 2015

Who else want a free profitable Niche?

'Someone please help me find a niche' is one of the many frequently posted questions on forums. People want to make thread or sell products that're popular on forums and the easiest way to find out what's popular on fourm is to check out their tags page, tags page checks what's most popular on forum and creates that tag bigger than others, so you pick that topic and start your Niche. Note that this can be misleading sometimes, it's based on tags that user manually adds to their threads.

Examples:
www.codernation.net/tags
http://www.codingforums.com/tags/
www.thebot.net/tags
https://a2s.in/tags/
http://www.warriorforum.com/tags/

Friday, 4 December 2015

Get tons of twitter followers without paying a dime!

We all know how useful social plateform are for marketing these days, but just plateform isn't enough, you'll need a following so whenever you talk about something world will see it. That's what this tutorial's about, cutting corners and getting a huge following!

Proof(..in 5 minutes):
[​IMG]
That's basically equivlent to 18 twitter followers if you use 6 points to get 1 follower.

Prerequisites 1.0
- Firefox
- Download iMarcos
- Download script
- Twitter account
- Youlikehits account
- Twitter Profile details all filled
- A computer that's not in use when script's running.

Prerequisites 1.1
- Go to where iMarco's been installed and create a folder named liker, and put the liker.js file you downloaded. In my case the iMarco folder was in C:\Users\webdevtown\Documents\iMacros

Idea:
We're going to use website called 'youlikehits' where you earn points to follow others, and use those points to get yourself followers, the more points you offer to others, the faster you'll be followed.

Method
- Open firefox and click on 'iOpus iMacros' on the top right side near bookmarks.
[​IMG]

- An interface will open on the right hand side, click on 'Manage' tab, then 'Settings' then select 'liker' folder path.
[​IMG]


Now go back to youlikehits and on the left hand side click on 'Twitter Followers'.
[​IMG]

When clicked on 'Twitter followers' you'll see this:
[​IMG]

Now click on iMarcos menu make sure you've 'liker.js' selected, if favorites did not update ever after you changing the path go back to 'Manage' tab and click 'Refresh Macro List'.
[​IMG]

And finally being on 'Twitter followers' page, click the play on iMarco, when you click the play button, script will automatically start following users, so sit back and enjoy fruit or our hard labour! ; )

Bonus tip
To get followers faster, go to 'Twitter Follower Setting' page and set the 'Points' to highest. I've at 6 right now, which's not the highest but in the middle.
[​IMG]

Please follow the tutorial and let me know if you've any questions ; )