Showing posts with label text. Show all posts
Showing posts with label text. Show all posts

Friday, 16 June 2017

Copy Paste Text but Strip the Formatting and HTML Tags

Copy Paste Text but Strip the Formatting and HTML Tags


Its a common problem. What you get from the clipboard is not what you want.

When you copy some text from a web page or a Word document to the clipboard and then paste that text inside an email message or another rich text editor, the formatting (font sizes, colors, images) stays intact.

For Microsoft Word and other Office programs, you can use the "Paste Special" command that will auto-convert the pasted content from rich text as plain text format.

See: Copy Command Line Output to Clipboard

Alternatively, you can copy the text to the clipboard and paste everything into Notepad. Select the content in Notepad and copy to clipboard again. In this process, all the document formatting and HTML tags will be remove the clipboard content will be in plain text.

You can also (optionally) remove all HTML tags from the clipboard text, which is excellent for copying and pasting things from the web, without getting all the extra markup.

Then theres Clipboard Fusion which automatically strips the text of all formatting as soon as you copy it to the clipboard. Everything that gets to clipboard after you hit Ctrl+C is converted to plain text.
{ Read More }


Wednesday, 31 May 2017

Convert text files to MP3 under Linux

Convert text files to MP3 under Linux


Even though I am not a fan of audio books and the only thing I use my iPod for is listening music still while exploring Festival(which is basically a General multi-lingual speech synthesis system) I found out that its very easy to convert normal text files into mp3 using festival . Now this could be especially useful for people who either listen to audio books or people who have difficulty in reading.

First we would need to install festival. We can install festival with the following command :

sudo apt-get install festival


Now we need to install voices which would be used to dictate the text (install any one of the following ) :

To install British Accented male voice issue the following command :

sudo apt-get install festvox-rablpc16k

To install American Accented male voice issue the following command:

sudo apt-get install festival festvox-kallpc16k


Now once you have installed festival and voice package we are ready to convert text files .wav files .

Lets say you want computer to read file named kaddu.txt you would need to pipe(send output of one command to other ) the cat command to festival. You can do so by issuing the following command :
cat -A kaddu.txt | festival --tts
Now instead if you want to convert kaddu.txt to kaddu.wav you can do so by piping the output of cat to a tool that comes with festival text2wave. You can do so by issuing the following command in the terminal window :
cat -A kaddu.txt | text2wave -o kaddu.wav
Now however if you want to remove special characters and want festival/text2wav to read only a to z,A to Z, space, �,�,�.�,�!�,�?�. You can do so by piping the output of cat to sed and then piping the output of sed to text2wav/festival.
cat kaddu.txt |sed s/[^a-zA-Z .,!?]//g|festival --tts

or
cat kaddu.txt|sed s/[^a-zA-Z .,!?]//g|text2wave -o kaddu.wav
Now the (.wav) file produced is uncompressed and are huge in size so you might like to convert it to mp3 to reduce its size and to allow the files to be played on iPod or any other mp3 player. You can convert .wav files easily to (.mp3) file format by using lame .

To install lame issue the following command in the terminal window :
sudo apt-get install lame
after istallation is over to convert say kaddu.wav to kaddu.mp3 issue the following command :
lame -f kaddu.wav kaddu.mp3
NOTE : I am using -f switch here which basically encodes mp3 file faster and in lower quality .

Article Written by : Ambuj Varshney (blogambuj@gmail.com)
For Desktop on Linux Blog , http://linuxondesktop.blogspot.com
(C) 2008 , Ambuj Varshney

{ Read More }


Saturday, 27 May 2017

Cross Platform Collaborative real time Text Editor Gobby

Cross Platform Collaborative real time Text Editor Gobby


Collaborative file (text file in this case) editing is a pretty common thing these days because computer networks or Cloud computing in general is becoming a "major thing" these days.

So basically if youre a part of a network and looking for a way to edit a document (in simple text format) with multiple users without having to lock it... then Gobby is a cross-platform ready, free application that can do, just that!.

Although dont hope it to be an advanced or a fully featured text editor since its purpose is to let you create a basic document that can be proof-read later. Its designed using the GTK+ toolkit yet integrates with GNU/Linux, MS Windows and Mac OSX platforms quite well too.

Main features...

*. Comes with a simple UI.


*. Connect/Disconnect with other networks using different ports, user authentications, create a session or simply open your previously used session.

*. As said its a basic text editor but lets you do things like: Find and replace text, go to lines, enable/disable automated indention, change font related settings (size, bold, etc) ...

... although most of these feature will have to be accessed via the "Preferences" window using the menu which is not the most efficient way to do that and could be the only complaint here (or perhaps its more oriented around computer programmers). 

*. You can start a text file from scratch or can open an existing one.

*. Syntax highlighting for various programming languages: C/C++, Java, HTML, XML, Perl, Prolog, etc.


*. Text wrapping.

*. Automatic recognition of various programming language related file extensions.

*. Send live messages. 

*. Show/Hide connected users or document lists... are among its main features to mention.

You can install Gobby in Ubuntu 11.04 Natty Narwhal, 11.10, 10.10 and 10.04 by using the below command in your Terminal window.
sudo apt-get install gobby
Anyhow, if youre looking for a free text editor that supports collaborative editing + can be used on Ubuntu (GNU/Linux in general) and other OS platforms, but can cope with the fact that perhaps its more of A programmer friendly (concerning the fact that font changing, etc type usual settings are hard to access) one, then Gobby is a pretty simple yet an effective opensource "solution" nonetheless.
{ Read More }


Wednesday, 17 May 2017

Create corrupted text using Zalgo

Create corrupted text using Zalgo


One of the most common and useless things on the Internet is corrupted texts, everyone hate them, including me, but then again, curiosity killed the cat.

Corrupted Text

One easy tool to use is Zalgo Text Generator, just copy and paste the text that appears in the text box you want to use it. But keep in mind that Facebook limits the size of the text, and it won�t appear complete.

Corrupted text

{ Read More }


Monday, 15 May 2017

Create Text Editor using HTML Jquery like in Blogger

Create Text Editor using HTML Jquery like in Blogger


You might have seen text editors where you can bold a text, italic a text etc... The perfect example of this the Blogger Post Text Editor
This is a simple tutorial that will create a text editor using HTML, Jquery & JavaScript.
We have two files, index.html which contains the HTML code and texteditor.js which contains the jQuery code. You should include the texteditor.js in index.html.

index.html
<!DOCTYPE html><html>
 <head>
  <script src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
  <script src="texteditor.js"></script>
 </head>
 <body>
  <center style="margin-bottom:20px;">
   <div class="ze ie"></div>
   <style>
   .font-bold.bold{font-weight:bold;}.italic{font-style:italic;}.selected{background-color: orange;}#openpb{margin:15px;}
   </style>
   <button type="button" class="g-button g-button-submit" id=stext>Text</button>&nbsp;&nbsp;&nbsp;&nbsp;
   <button type="button" class="g-button g-button-submit" id=shtml>HTML</button>
   <div id="controls" style="margin-bottom: 10px;">
    <a id="bold" style="color:black;display: inline-block;" class="font-bold">
     <button type="button">B</button>
    </a>&nbsp;&nbsp;&nbsp;
    <a id="italic" style="color:black !important;display: inline-block;"class="italic">
     <button type="button">I</button>
    </a>&nbsp;&nbsp;&nbsp;&nbsp;
    <a id="link" class="link" style="display: inline-block;">
     <button type="button">Link</button>
    </a>&nbsp;&nbsp;&nbsp;&nbsp;
    <select id="fonts" class="g-button">
     <option value="Normal">Normal</option>
     <option value="Arial">Arial</option>
     <option value="Comic Sans MS">Comic Sans MS</option>
     <option value="Courier New">Courier New</option>
     <option value="Monotype Corsiva">Monotype</option>
     <option value="Tahoma New">Tahoma</option>
     <option value="Times">Times</option>
     <option value="Trebuchet New">Trebuchet</option>
     <option value="Ubuntu">Ubuntu</option>
    </select>
   </div>
   <iframe frameborder="0" id="textEditor" style="width:500px; height:80px;border:2px solid #CCC;border-radius:20px;overflow:auto;"></iframe>
  </div>
  <textarea name="text" id=text style="border-radius:20px;overflow:auto;display:none;padding-left: 10px;" rows="6" cols="53"></textarea>
 </center>
 </body>
</html>
texteditor.js
$(document).ready(function(){
 document.getElementById(textEditor).contentWindow.document.designMode="on";
 document.getElementById(textEditor).contentWindow.document.close();
 var edit = document.getElementById("textEditor").contentWindow;
 edit.focus();
 $("#bold").click(function(){
  if($(this).hasClass("selected")){
   $(this).removeClass("selected");
  }else{
   $(this).addClass("selected");
  }
  boldIt();
 });
 $("#italic").click(function(){
  if($(this).hasClass("selected")){
   $(this).removeClass("selected");
  }else{
   $(this).addClass("selected");
  }
  ItalicIt();
 });
 $("#fonts").on(change,function(){
  changeFont($("#fonts").val());
 });
 $("#link").click(function(){
  var urlp=prompt("What is the link:","http://");
  url(urlp);
 }); 
 $("#stext").click(function(){
  $("#text").hide();
  $("#textEditor").show();
  $("#controls").show()
 });
 $("#shtml").on(click,function(){
  $("#text").css("display","block");
  $("#textEditor").hide();
  $("#controls").hide();
 });
});
function boldIt(){
 var edit = document.getElementById("textEditor").contentWindow;
 edit.focus();
  edit.document.execCommand("bold", false, "");
  edit.focus();
}
function ItalicIt(){
 var edit = document.getElementById("textEditor").contentWindow;
 edit.focus();
 edit.document.execCommand("italic", false, "");
 edit.focus();
}
function changeFont(font){
 var edit = document.getElementById("textEditor").contentWindow;
 edit.focus();
 edit.document.execCommand("FontName", false, font);
 edit.focus();
}
function url(url){
 var edit = document.getElementById("textEditor").contentWindow;
 edit.focus();
 edit.document.execCommand("Createlink", false, url);
 edit.focus();
}
setInterval(function(){
 var gyt=$("#textEditor").contents().find("body").html().match(/@/g);
 if($("#textEditor").contents().find("body").html().match(/@/g)>=0){}else{
  $("#text").val($("#textEditor").contents().find("body").html());
 }
 $("#text").val($("#textEditor").contents().find("body").html());
},1000);
The user will type text in the iframe. The HTML of iframe will be added in the textarea. So when the user clicks HTML button he sees the HTML of iframe. You can pass the textarea value to your database if needed, but use htmlspecialchars when passing in PHP, because the user can inject XSS codes.
{ Read More }


Tuesday, 25 April 2017

Copy Text from Images and Flash OCR

Copy Text from Images and Flash OCR


When you surf through web you may have seen some websites which doesn�t allow their content to be copied. In order to protect their data (text) they use images, flash or any other method. Here I am giving you some methods to extract/copy text from images. This can also be used copy text from games and printed notes. Also known as OCR (Optical Character Recognition). I don�t know whether it can copy text from Hand written. Check it out yourself. Here are the steps�


1) Open file or website which you want to copy the text.
2) Press the Print Screen button (Prt Scr � just above the delete button).
3) Using Photoshop or any other image editing tools crop the area only you want.
4) Drag the picture to Microsoft office Onenote. Right click and �Copy Text from picture�.
5) Paste the text any where you want.

If you don�t have MS office Onenote logon to www.free-ocr.com

{ Read More }


Wednesday, 5 April 2017

Count the Occurence of All Words in a Number of Text Files

Count the Occurence of All Words in a Number of Text Files


Recently I was given the task to analyse a range of files (around 300) and count the occurrence of all the words in each file. So the aim was to put together a piece of code that goes through all files in a directory, reads in a file, lists all the words occurring in it and counting how many time each word has occurred.

I quickly found out that in case of a single file the process is rather simple, the following code does a fine job,

for w in `cat FILE.txt`; do echo $w;done|sort|uniq -c >> results.out
This code reads in FILE.txt and for each word in it counts its occurrence and the creates a list from it.

However putting this into a recursive script was a little more complicated. So I took another direction and found a piece of code using sed to do the same job on a single file. With this and some scripting knowledge I was able to put together just what I needed.

Additionally, I used the command basename to output the name of the file so I know which file was which.

The final piece of code looks like this,

for file in `ls /PATH/TO/DIRECTORY/`
do
basename /PATH/TO/DIRECTORY/FILE >>
results.out        sed s/ /n/g /PATH/TO/DIRECTORY/FILE | sort | uniq -c | sort -nr >>  results.out
echo "" >>  results.out
done

This does a perfect job and creates a single file with the output containing,
  • File name of each file
  • Occurrence of each word in the file, sorted from high to low
  • Empty line to separate data from each other
If anyone has any other suggestion or comment I am happy to hear it!



{ Read More }


Saturday, 1 April 2017

Create a Fun Floral 3D Text Design

Create a Fun Floral 3D Text Design



Introduction

In this tutorial I will show you how to create a lovely floral style 3D text effect using only Photoshop and Illustrator. The idea is to add the elements we like while keeping the design subtle, pleasing to the eye, and having some fun along the way.
We�ll be using Illustrator for the 3D effect because it�s more user friendly than other 3D programs like 3ds Max, and it can do an equally good job for what we require.

Resources

If you�re following along, you�ll want to grab these resources.

  • Levenim MT Bold
  • Flower Pack
  • Nebula 1
  • Nebula 2
  • Nebula 3
  • Elephant
  • Flowersn�swirls
  • Parrot
  • Butterfly Brushes III
Thanks to the artists who provided these. Please remember to follow their rules and credit them where it is appropriate. Let�s get started.

Step 1

To start, create a new document sized at 1200 x 770, and fill the canvas with a radial gradient that goes from #a1dbff to #f0f9ff, transitioning from dark in the center to light at the edges.

Step 2

Download this font, Levenim MT Bold. Load the font, then open up Illustrator, and type out �MYINKBLOG�.

Step 3

In Illustrator, select the text and choose effect 3D, extrude and bevel. Proceed by choosing the settings shown below. At this stage it is a good idea to play with the different 3D settings and see what results you like, but for now the following are a good selection.

Step 4

Copy and paste the text into your Photoshop document as a smart object, this allows you to resize the text as much as you like without losing quality.

Step 5

The next step is my favorite part, we need to cut out the faces of the letters with the pen tool. Make sure you save your path, and cut out the letters on the same work path too. Now select the faces of the letters, inverse the selection, and  fill them with a gradient from #ffd24e to #ecb207, leave the gradient defaults as they are. Finally, add a stroke of yellow set to 2 pixels and an opacity of 38%. These will blend in subtly with the addition of other elements.

Step 6

Select the text , Ctrl + Shift + D should reselect it, fill with any color and reduce the fill to zero. Then, add an outer glow set to white  with the settings shown below. This will add a nice glow to the edges of the text, subtly increasing the overall energy.

Step 7

Download this flower pack, I used 7 on the right, and 8 on the left. Arrange them to face upwards on one side and down on the other, so they balance each other. Change the blend mode to multiply to eliminate the white areas.

Step 8

Next download nebula 1, 2 and 3. Place them into your document and change the blend mode to either hard light or screen and lower the opacity to around 30%. As you can see it�s a delicate effect. If it needs further reducing, add a layer mask and brush over areas so the whole image blends in better.

Step 9

Download this image of an elephant, and extract it. Place the extracted elephant in the image, underneath the nebula, and the text layers. Reduce the size to approximately twice the height of the letters.


Step 10

Now, for the flowery part download these amazing brushes. Using the first brush in the pack make a shape on the top left hand side. Here we can see the composition really beginning to take effect, keeping the design simple and refined.

Step 11

Now, we�ll add a gradient overlay. Double click the layer to get to the layer styles, and use a light pastel green gradient. We use a layer style because it�s a lot easier to change at a later stage.

Step 12

Continue adding floral elements until you are pleased with the look, just remember less really is more, and subtle is more effective than having too many patterns. The gradients and the positioning of the flowers give the peaceful sense of movement.

Step 13

Download this image of a parrot. Then extract it using your favorite extraction method and paste it into the composition. Next, add some adjustment layers with the follow settings.

Step 14

Add a butterfly or two with these brushes. You can continue to add additional butterflies, or other creatures, just be sure to keep it simple.

Step 15

Add another layer, select the text, and add an outer glow with the following settings, remember to reduce the fill to �0?.


In Conclusion

This is a good tutorial to practice combining elements to create a well-rounded composition. You should now have a firm understanding of 3D text, and how to blend objects together in Photoshop.
{ Read More }