First of you need to go to setting>other in your blogger control panel and click on Export blog.
Home » Posts filed under tutorial
How To Edit/Change Comments In Blogger
First of you need to go to setting>other in your blogger control panel and click on Export blog.
How To Make A Random Text Generator In PHP
I don't do php at all but this is something I had to learn so to begin our Text Generator open your favorite Text Editor, I have Sublime Text 3 beta. First add the usual html>head>body tags and close the tags, after that let's add our css after body tag add these codes.
NOTE: Replace index.php with your PHP file name.
Now run the PHP, here is image of what we've made
I hope this php tutorial was interesting,Thank you for reading & do share if you thing the article deserves.
<style type="text/css"> .refresh { -moz-box-shadow:inset 0px 1px 0px 0px #caefab; -webkit-box-shadow:inset 0px 1px 0px 0px #caefab; box-shadow:inset 0px 1px 0px 0px #caefab; background-color:#77d42a; -moz-border-radius:6px; -webkit-border-radius:6px; border-radius:6px; border:1px solid #268a16; display:inline-block; color:#306108; font-family:arial; font-size:15px; font-weight:bold; padding:6px 24px; text-decoration:none; text-shadow:1px 1px 0px #aade7c; }.refresh:hover { background-color:#5cb811; }.refresh:active { position:relative; top:1px; } h1 { font-family:Verdana, Arial, Helvetica, sans-serif; color:#000000; font-size:33pt } </style>After that we have a PHP function, add these codes after your css codes
<?php
function Generate() {
$var = "abcdefghijkmnopqrstuvwxyz0123456789";
srand((double)microtime()*1000000);
$i = 0;
$code = '' ;
while ($i <= 6) {
$num = rand() % 35;
$tmp = substr($var, $num, 1);
$code = $code . $tmp;
$i++;
}
return $code;
}
?>
Now finally let's call the function with these codes, just add these codes after the function(php)
<center>
<h1>
<?php
echo Generate();
?>
</h1>
<a href="index.php" class="refresh">Refresh</a>
</center>
NOTE: Replace index.php with your PHP file name.
Now run the PHP, here is image of what we've made
I hope this php tutorial was interesting,Thank you for reading & do share if you thing the article deserves.
How To Load Array Values Into Listbox & ComboBox In C#
Last 3 days I have been working on a Library Management System, it's for my college actually it's a group project, but i promised my group members that I will code and design the whole system, by the way i really had lots of problems because this would be my first time doing with a database, also I didn't know how a Library Management System works because I have never been to a Library. Hopefully I am almost done, I am going to meet my group members and ask them to make the Documentation.
Loading Array values into a ComboBox, I had to do it in my Library Management System, I will wrote the same code that I used in my Library Management System.
First we need to create a private Const int(const is a special kind of variable....), a private String Array and set value to them.
Remember we set the public const int to 13, always in computer science you should count from 0 and upwards.
Now we just need to call the Function from an event, I called it from Form_load
Here is a picture of this in ListBox.
Here is a picture of this in ComboBox.
I hope this has helped you in someway, Thanks for reading.
Loading Array values into a ComboBox, I had to do it in my Library Management System, I will wrote the same code that I used in my Library Management System.
First we need to create a private Const int(const is a special kind of variable....), a private String Array and set value to them.
private const int Total = 13; private String[] genre = new String[Total];Now coming to the function, we'll create a Function called LoadBookGenres(), and set set values to the arrays, adding to the listbox or combobox, by the way you can still go straightly without creating a new Function like you can set the values for the arrays, and load(sort) the array values to the listbox or the combobox in an event(ex:Form_Load).
private void LoadBookGenres() { //Assign value into Array genre[0] = "Adventure"; genre[1] = "Animals"; genre[2] = "Computers & Internet"; genre[3] = "Biography"; genre[4] = "Comics"; genre[5] = "Horror"; genre[6] = "Sports"; genre[7] = "Romance"; genre[8] = "Historical"; genre[9] = "Music"; genre[10] = "Religion"; genre[11] = "Mystery"; genre[12] = "Other"; //Sort array and fill listbox with the sorted array Array.Sort(genre); for (int i = 0; i < genre.Length; i++) { listBox1.Items.Add(genre[i]); } }NOTE : Change ListBox1 to your listbox name or your combobox name.
Remember we set the public const int to 13, always in computer science you should count from 0 and upwards.
Now we just need to call the Function from an event, I called it from Form_load
private void Form1_Load(object sender, EventArgs e) { LoadBookGenres(); }
Here is a picture of this in ListBox.
Here is a picture of this in ComboBox.
I hope this has helped you in someway, Thanks for reading.
How To Make a Website Responsive
Being a blogger or a webmaster everyone want's to make their website compatible with any device. Not everyone know this small one line code that makes your website fit with mobile/tablet etc devices size.
All you need to do is just add this one line code under your head.
<meta content='width=device-width, initial-scale=1, maximum-scale=1' name='viewport'/>
After adding it, save your template and let's check if it works, go to http://www.studiopress.com/responsive/ and enter your website URL & hit enter, within seconds you would be able to see how your website looks like and if it fits for other devices.
Theres another way to check it, just resize your webbrowser
As you can see it works, Thanks for reading I hope this helps you.
All you need to do is just add this one line code under your head.
<meta content='width=device-width, initial-scale=1, maximum-scale=1' name='viewport'/>
Theres another way to check it, just resize your webbrowser
As you can see it works, Thanks for reading I hope this helps you.
How To Make A Round Button In C#
Someone has asked me how to make a round button in c#, if I am right it's really easy to make round button with, I didn't have time to do something really advanced, I made something really simple. All you have to do is just create a new class and add all these codes into your class.
using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; class Round : Button { protected override void OnCreateControl() { using (var path = new GraphicsPath()) { path.AddEllipse(new Rectangle(2, 2, this.Width - 5, this.Height - 5)); this.Region = new Region(path); } base.OnCreateControl(); } }Just build the project or debug and look for a new tool in your toolbox
You can add it to your form and use it, by the way I recommend you to use this button http://dotnetrix.co.uk/button.htm also please change the width and other sizes for your needs.
How To Make A Simple Login System In C#
Everyone knows what a login system is ! so i don't think any explanations are needed . i will come to the main thing , Today we are going to make a simple login system in c# .
You need two text boxes,two labels and two buttons.
Now make the controls look like this on form.
Now let's go for login button codes
You need two text boxes,two labels and two buttons.
Now make the controls look like this on form.
Now let's go for login button codes
//if textbox1 text is admin and textbox2 text is 1234567 if ((textBox1.Text == "admin") && (textBox2.Text == "1234567")) { //then show form2 Form2 nextform = new Form2(); nextform.ShowDialog(); } else { //if username and password is incorrect show this message box MessageBox.Show("Username or Password Invalid"); }This is the code for button 2 which is a exit button
Application.Exit();Alright we are done ! I hope this is helpful !
How To Hide Internet Explorer Script Errors In VB.NET & C#
I think most of the people hate web browser control script errors in vb.net and c# . if you don't know what i mean , look at the picture below i hope you know it.
Okay i will straightly come to the main point ! you just need to add this line of code in form_load
Me.WebBrowser1.ScriptErrorsSuppressed = True'change WebBrowser1 to your webbrowser name' , here is the code for c#
this.webBrowser1.ScriptErrorsSuppressed = true;that's a snippet , thanks.
How To Add A Skype Call,Chat Widget To Your Website Or Blog
in
evaphone,
html,
kype,
msn download,
scype,
skaip,
skajp,
skayp,
skaype,
skipe,
skpe,
skupe,
skybe,
skyp,
skypa,
skype,
skyper,
spyke,
sype,
tutorial
- By
Mohamed Shimran
- on 7/20/2013
- 1 comment
2 - Enter your skype ID
3 - Choose what you would like your widget to do
4 - Choose a theme for your widget(button) and size
You can always see a preview of your widget from your right side
5 - Get your widget code
Now put the code in your template where you want to display it.
How To Add A Top Bar To Blogger
Now go to https://www.addthis.com/get/welcome#.UemQQ9JgdeY and create your Welcome Bar . Design the bar as well
Finally get the code right after that designing place , this is my code(don't use this code)
Place that javascript below head or between body tags then as you have settled your Welcome Bar , it will appear. Thanks For Reading .
Syntax Highlighter For Blogger
I have been using Alex Gorbatchev Syntax Highlighter for a long while now . someone requested me to write an article about using this syntax highlighter in blogger so here i go .
Select a theme for the syntax highlighter , those links have previews of the theme.
After adding those codes now it's time to set your theme to the syntax highlighter , in the third line of code that i gave before . this parameter is what i meant
now after styles/ add the theme style , you can see the theme style right after the theme preview link . for example i have selected shThemeRDark.css then my parameter would look like this
Select a theme for the syntax highlighter , those links have previews of the theme.
- Default - shThemeDefault.css
- Django - shThemeDjango.css
- Eclipse - shThemeEclipse.css
- Emacs - shThemeEmacs.css
- Fade To Gray - shThemeFadeToGray.css
- Midnight - shThemeMidnight.css
- RDark - shThemeRDark.css
After adding those codes now it's time to set your theme to the syntax highlighter , in the third line of code that i gave before . this parameter is what i meant
now after styles/ add the theme style , you can see the theme style right after the theme preview link . for example i have selected shThemeRDark.css then my parameter would look like this
Now you have successfully added the syntax highlighter now save your template and now we will test the syntax highlighter . you cannot just add the code and let it define the language , you should define the language in the tag . you can see what language we can highlight from here . coming to the point i will show you how to syntax highlight a java hello world program .
go to the HTML tab in your post and find where you want the syntax highlighter to be and here we go
replace ____ with your language name and replace codes with your codes and that's how it works . here is a sample of the syntax highlighter.
public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World"); } }Thanks For Reading , Have A Great day .
How To : Change Drive Name Or Label In C#
Changing Drive things are pretty easy with kernel32 so what we are going to do is just change the name or label , okay okay i know it's called label and not name most of the times :D . first of all let's design the Form .
Add two text boxes and two labels and a button and make your look like this(if you believe in my UI design)
Now coming to the coding , hmm we need to add kernel32 to the project so add the namespace using System.Runtime.InteropServices; , Now import the kernel32.dll to your project by adding these codes under or on top of
Add two text boxes and two labels and a button and make your look like this(if you believe in my UI design)
Now coming to the coding , hmm we need to add kernel32 to the project so add the namespace using System.Runtime.InteropServices; , Now import the kernel32.dll to your project by adding these codes under or on top of
public Form1() { InitializeComponent(); }The codes(kernel32)
[DllImport("kernel32")] static extern long SetVolumeLabelA(string lpRootName, string lpVolumeName);After that go to your button(rename) click codes and add these
long lab; lab = SetVolumeLabelA(textBox1.Text, textBox2.Text);Now test your project , if it didn't work for you please let me know by commenting on this post or else contact me via the contact page I hope explanations are not needed for this simple codes , Thank you.
How To : Check Internet Connection In C#
Amm, i think i wrote something about connecting and disconnecting the internet in vb.net that's actually a simple matter(process commands) . We are going to use wininet.dll in this tutorial so first of all add this namespace using System.Runtime.InteropServices; after that add this codes after InitializeComponent();
}
[DllImport("wininet.dll")] private extern static bool InternetGetConnectedState(out int Description, int ReservedValue); bool IsConnectedToInternet() { bool a; int xs; a = InternetGetConnectedState(out xs, 0); return a; }What those lines of codes does is , it first adds the dll and then creates a function to use the API,So now to check the state of your internet connection let's use a if condition(;).
if (IsConnectedToInternet() == true) MessageBox.Show("Internet Is Working"); if (IsConnectedToInternet() == false) MessageBox.Show("Internet Is Not Working");Just add those lines for a event to check the internet . Thanks For Reading , Peace.
How To Put HTML,CSS,JAVASCRIPT Codes In Your Blogger Articles
Yes this is my second blogger tutorial , actually this is something i had to do to solve a problem . i use alexgorbatchev.com/SyntaxHighlighter but it seems that if i use anything similar to class in any language then some span tags cover them so the code goes wrong so i was looking for something that will fix my big problem then i found prism.js so i tried it and it's really great those span tags were not there so i wanted to share this with you .
Details of the script
So to use it in your blogger blog or normal website , just add these under your head tag
Usage :
replace markup with your language name :).
by the way they also provide themes and plugins also you can select the languages , just go to prismjs.com and then go to download there you will be able to select the languages and plugins finally download the css and js.
Hope you like this tutorial , peace.
Details of the script
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
So to use it in your blogger blog or normal website , just add these under your head tag
Usage :
replace markup with your language name :).
by the way they also provide themes and plugins also you can select the languages , just go to prismjs.com and then go to download there you will be able to select the languages and plugins finally download the css and js.
Hope you like this tutorial , peace.
How To Capture Entire Screen In Java
Another quick tutorial on capturing your entire screen with java actually sometimes java makes me mad because sometimes i have to import loads of namespaces than c# or vb.net anyways , as usual to do something in system we import IO thingy yes we are using it here .
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.*;
import javax.imageio.*;
class Snap
{
public static void main(String args[]) throws Exception
{
Robot awt_robot = new Robot();
BufferedImage Entire_Screen = awt_robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
ImageIO.write(Entire_Screen, "PNG", new File("Entire_Screen.png"));
}
}
How To List Down Countries In Java
Java is something what really impressed me than other programming languages anyways today we'll see how to list down all the countries and their country code . I don't know whether you know theres a small library called Locale in java.util namspace so that's what i am using here to do the thing .
import java.util.*;
/* Author : Mohamed Shimran
Blog : http://ultimateprogrammingtutorials.blogspot.com
*/
class Countries {
public static void main(String args[]) {
String[] cntry = Locale.getISOCountries();
for (String countryCode : cntry) {
Locale obj = new Locale("", countryCode);
System.out.println("Country Code = " + obj.getCountry()
+ ", Country Name = " + obj.getDisplayCountry());
}
}
}
NOTE: i was using public class but i had to remove it because my class thingy goes mad still it works actually public class is not needed.How To Get Mouse Location(X,Y) In C#
The program we are going to make will show you the mouse cursor location, okay first of all click your form and then go to event (the lightning icon in your properties tab) and then search for MouseMove and just double click on it.
After that you will fall into the mouse_move event , go to designer and add two labels and just write down the below codes in MouseMove
label1.Text = "X : "+e.X.ToString(); label2.Text = "Y : "+e.Y.ToString();
Now debug and try moving your mouse .
How To Add Values To ListBox In C#
You need to add these things to your project first of all
- Three buttons (add,show,clear)
- Listbox
- Textbox
Inter Process Communication in C#
Introduction
Alright, so you guys might know about the famous web-browser, Google Chrome. One remarkable thing in this (pretty) simple looking application is the use of a programming technique called IPC or Interprocess Communication; with IPC you can communicate with another process without invoking and other third party events. One of the most irritating about .Net is that the app freezes if it is trying to communicate with a web-service. With IPC we can eradicate this problem.What can you do with it?
So, lets first take an example of what exactly we can do with this: suppose that you have a licensing application named LicMan.exe and a processing app called LicPro.exe. LicMan has the UI and every other part of standard human interference. And LicPro.exe just takes the License Key provided and then processes it and sends it back to LicMan.exe for display. This way the app would not hang and you have a happy customer :-)Lots of bad ways of doing IPC:
- Shared Memory: Difficult to manage and set-up.
- Shared Files / Registry: Very slow doe to the writing & reading to/from disk. Difficult to manage as well.
- SendMessage / PostMessage: Locks up the UI thread while the message is processed. Messages are limited to integer values. Can't communicate from a non-admin process to a admin process. Assumes that your process has a window.
How To Make A Proxy Grabber In VB.NET
Let's start ,
First go ahead and create a new project and we need a ListBox and Three Buttons so just add them . After adding them to your form arrange as you see in the below picture.
Now coming to the coding point , first add Imports System.Text.RegularExpressions namespace because we use regex as i said before , first open the button click event which is the grab button and add this codes.
'creating our httpwebrequest target NOTE: you can use any websites that use to provide proxies directly Dim the_request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://proxy-ip-list.com") 'creating the httpwebresponce Dim the_response As System.Net.HttpWebResponse = the_request.GetResponse 'defining the stream reader to read the data from the httpwebresponse Dim stream_reader As System.IO.StreamReader = New System.IO.StreamReader(the_response.GetResponseStream()) 'defining a string to stream reader fisnished streaming Dim code As String = stream_reader.ReadToEnd 'haha here we use the regex Dim expression As New System.Text.RegularExpressions.Regex("[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}:[0-9]{1,4}") 'adding the proxies to the listbox Dim mtac As MatchCollection = expression.Matches(code) For Each itemcode As Match In mtac ListBox1.Items.Add(itemcode) NextAfter the first button we will see the second button which save.
If ListBox1.Items.Count = (0) Then MessageBox.Show("Please click grab to grab proxies and then try saving", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) Else 'defining a streamwriter Dim S_W As IO.StreamWriter 'converting listbox items to string Dim itms() As String = {ListBox1.Items.ToString} ''defining a savefiledialog Dim save As New SaveFileDialog Dim it As Integer save.FileName = "Grabbed Proxies" save.Filter = "Grabbed Proxies (*.txt)|*.txt|ALL Files (*.*)|*.*" save.CheckPathExists = True save.ShowDialog(Me) S_W = New IO.StreamWriter(save.FileName) For it = 0 To ListBox1.Items.Count - 1 S_W.WriteLine(ListBox1.Items.Item(it)) Next S_W.Close() End IfAt last we need to add a line of code to clear the listbox which is
ListBox1.Items.Clear()
Finally debug your program and test test ..
YAY it's working ,I have explained the code by commenting over the codes and i hope this is helpful . thanks
The Types Of Message Boxes In C#
I am sorry guys , i have so many problems nowadays so I cannot concentrate on blogging, by the way I came through some forums posts and I really wanted to write something so today you will be learning the Types of Message Boxes in C# and the same types of Message Boxes are available in VB.NET .
What is a Message Box?
Shortly I can say Message Boxes are used to show Messages/Alerts to the user.
What are the types of Message Boxes?
The types of Message Boxes are something very important, if you want to display a message box you should know what is the type of the Message Box is going to be(ie:if you display "Cannot Convert" then that's a Error Message.
Error : Error is something that stops the system from doing it or else we can say something that does not allow doing it.
Exception : Problems that occur during the run of a program or during the usage of a function or a statement.
What is a Message Box?
Shortly I can say Message Boxes are used to show Messages/Alerts to the user.
What are the types of Message Boxes?
The types of Message Boxes are something very important, if you want to display a message box you should know what is the type of the Message Box is going to be(ie:if you display "Cannot Convert" then that's a Error Message.
- Error Message Boxes.
- Information/Detail Message Boxes.
- Warning Message Boxes.
- Empty Message Boxes.
- Questioning Message Boxes.
- Exception Message Boxes.
Error : Error is something that stops the system from doing it or else we can say something that does not allow doing it.
Exception : Problems that occur during the run of a program or during the usage of a function or a statement.