Spin “Spinning Syntax” Text Using VB.Net

A simple text spinner program using VB.Net, used  to spin text written in the familiar spinning syntax e.g. {sample|example|exhibit}

This program doesn’t spin nested syntax.

You’ll need:

2 Text Boxes (TextBox1, TextBox2)

1 Button (Button1)

Code:



Public Class Form1
    Dim str As String
    Dim strAll
    Dim strStart = 1
    Dim strEnd = 1
    Dim words As Array
    Dim word
    Dim intRWord As Integer
    Dim spin = 1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        TextBox2.Text = TextBox1.Text

        Do While spin = 1
            If InStr(strEnd, TextBox2.Text, "{", CompareMethod.Text) > 0 Then
                strStart = InStr(strEnd, TextBox2.Text, "{", CompareMethod.Text)
                strEnd = InStr(strStart, TextBox2.Text, "}", CompareMethod.Text)
                strAll = Mid(TextBox2.Text, strStart, strEnd - strStart + 1)
                str = Mid(TextBox2.Text, strStart + 1, strEnd - strStart - 1)
                words = Split(str, "|", -1, CompareMethod.Text)
                intRWord = words.GetUpperBound(0) * Rnd()
                word = words.GetValue(intRWord)

                TextBox2.Text = Replace(TextBox2.Text, strAll, word, 1, 1, CompareMethod.Text)
                strStart = 1
                strEnd = 1
            Else
                spin = 0

            End If
        Loop
        spin = 1
    End Sub
End Class

Text Spinner Using VB.Net

How to Run Linux Mint from a USB Flash Drive

You’ll need:

Steps:

  1. Run Disk Imager
  2. Click on the blue folder icon to select the Mint Linux .iso file
  3. Display all file by selecting *.* instead of *.img;*.IMG
  4. Click “Save”
  5. Select the USB flash drive in the Device section
  6. Click “Write”

That’s it.. now you have a bootable Linux Mint on your USB flash drive.

 

Win32 Disk Imager

Change Facebook Thumbnail Image on Like Button

Here a quick and easy way to change the thumbnail image that Facebook picks for your website when a users clicks on the Like button or shares a link of your website on Facebook; Add the following line of code in HEAD section of the page:

 

where THUMBNAIL_IMAGE.JPG is the URL to the image that you’d like Facebook to use a the thumbnail.

Mohammed Almadhoun: Gets an Award from Google

My 14 year old brother Mohammed Almadhoun, won a programming contest at Google’s event in Gaza, Palestine and was awarded an Android Nexus S phone.

This is what a representative from Google had to say about him:

“To continue on this, there is actually one more person that I would like to put a little bit of spot light on; I’ve been really impressed by him, and I’d like to ask him to come to the front; Mohammed Almadhoun. I’ll give a little bit of a background story about Mohammed [Salam Alykom]. This is my hero and my role model. To give a little bit of a background; Mohammed is a 14 year old developer and I’m really impressed by the things he showed me today, but also the things that he’s doing beyond the event today. He’s done for us today the Android challenge that we had over lunch. He managed to completely solve the problem except for a little detail which is irregular expression which a lot of people at Google still don’t know how it works, and his solution was completely correct. Not only that, we had a very nice conversation in which I was really impressed by his applications are not great only but also very relevant to the local community. Give the example of Tasawaq [Is anybody familiar with Tasawaq?] This is the hero behind Tasawaq. Tasawaq is an online project which allow merchants to sell their products to all of you , and I heard of many more examples of you […] I’m really really very impressed and I would like to give this to you as a little support for your great efforts and your energy. And I look forward to using your Android apps next year hopefully. Yes, so Thank you!”

The video:

httpv://www.youtube.com/watch?v=4VsqDOz8KZ4

 

JavaScript: Convert String to Integer (int)

To convert strings (text) to integer (number) in JavaScript use the parseInt function.

For example:

document.write(parseInt("23 years"));

Will return the number 23, the function ignores the string “years” and return the integer 23 only.

Another common example is:





 

If you enter 4 and 5, the script will return “45”  instead of 9.  To fix use the parseInt function as follows:






 

 

PHP: Check If Two Strings Are Similar

In php, to check the similarity between to strings (text) use the similar_text for example:

Here’s a PHP function that’ll help you check if two strings (texts) are similar. If the strings are 50% similar then the function will output “Duplicate Entries”.

 0) {
	if (count($result)>(count($array1)/2)){
		echo "Duplicate Entries";
	};

};
}

issimilar ( "Hello World Foo Bar Baz", "Hello Foo Bar Baz");

?>

Free Online Website Performance Testings Tools

Here is a list of 10 of my favorite website / web page performance testing tools. The tools test things such as load time, load speed and web server stress, many of them provide helpful tips on how to increases website performance.

GTmetrix | Website Speed and Performance Optimization
http://gtmetrix.com/

 

Broswer Mob Website Performance Test
https://browsermob.com/free-website-performance-test/

 

WebPageTest.org Web Page Performance Test
http://www.webpagetest.org/

 

Pingdom Tools – Test the load time of a web page
http://tools.pingdom.com/

 

Load Impact
http://loadimpact.com/

 

Gomez Web Site Performance Test
http://www.gomeznetworks.com/custom/instant_test.html

 

Web Page Analyzer – 0.98 – from Website Optimization
http://www.websiteoptimization.com/services/analyze/

 

Benchmark your website or test the speed of your web connection.
http://webwait.com/

 

Gomez Instant Test Center
http://www.gomez.com/resources/instant-test-center/

 

Webserver Stress Tool – 30 Day Free Trial Software
http://www.paessler.com/webstress