Tesseract OCR (Optical character recognition)

Optical character recognition (OCR)

Optical character recognition is the mechanical or electronic conversion of images of typed, handwritten or printed text into machine-encoded text, whether from a scanned document, a photo of a document, a scene-photo (for example the text on signs and billboards in a landscape photo)

Tesseract OCR

  • Tesseract is an open source OCR engine maintained by Google.
  • It can run in windows , Linux & mac
  • Written in C, C++ and it have good performance
  • We can add training data to improve the handwritten data
  • It can be deployed in amazon EBS, find the link for installing Tesseract on EBS 

URL : https://github.com/tesseract-ocr/tesseract

Installation

 

Running the Application

Command

tesseract image.tif output

  1. tesseract  – is the command to use tesseract .
  2. image.tif  – is the path to the image on which we are running OCR. Assuming that image.png is in same directory .
  3. output  – The output file name to stored text in an image , By default output.txt will be stored in the current directory.

You will get lot of spelling mistake, to avoid this issue Increase the image resolution, you use Image magick command line tool to increase the image resolution

Image magick command to increase the resolution

magick image.jpg -resize 10000 output_image.tif

Optical character recognition software list & its Comparison

Refer the below wiki URL

https://en.wikipedia.org/wiki/Comparison_of_optical_character_recognition_software

 

 

Laravel TestTools chrome extension

Laravel TestTools

Create Laravel integration tests while surfing your website.

Testing a Laravel application really is an easy task – the “Integrated” package from Jeffrey Way, that later got merged into the core framework is fantastic and helps you with the otherwise cumbersome task of testing and interacting with your application. But still – are you actually using tests?

A lot of times people really love the idea of tests, but simply don’t get their asses up to start using them in their own projects. That’s why I created a chrome extension that hopefully saves you some time when you need to test your app.

Get the extension

Using the chrome extension

The chrome extension allows you to “record” your activity on the page you’re currently viewing and translates these activies into Laravels testing syntax.

Take a look at the extension in action.

With just a few clicks, you just magically created a integration test for your registration process.

But wait! There’s more you can do!

If you, for example, want to generate dynamic data within your test, you can do this by using the Laravel TestTools context menu. The menu gives you access to some handy faker methods to generate emails, names or words on the fly.

Limitations

You can not test your Javascript/VueJS/AngularJS single page application with this. Even though the extension will generate the test code for you it will not work with Laravel. That’s because when Laravel is running these tests it doesn’t have Javascript. What happens, when Javascript runs your tests is that it simulates a GET/POST/whatever request to the specified URL and fetches and parses the resulting HTML DOM. That DOM is then used to modify input fields, search text and submit forms.

If you really need to test Javascript in a browser – take a look at “Selenium”. Jeffrey Way has you covered – https://laracasts.com/series/intuitive-integration-testing/episodes/5

This is awesome – can I help you?

You sure can – the source code is available on Github. This is the very first version of the Laravel TestTools extension, so there might be bugs, quirks or unexpected behavior. If you need any help, get in touch with me via Twitter or create an issue on the Github repository.

 

@refer:  http://marcelpociot.com/blog/2016-03-21-laravel-testtools

 

CSS Best architecture – CCSS [Component CSS]

Elements of CCSS

Below are the major elements used either fully or in a modified way to achieve the best configuration for the CCSS architecture.

SMACSS

SMACSS stands for Scalable and Modular Architecture for CSS. It is more of a style guide than a rigid framework. Read about SMACSS for background on the structure as CCSS uses it.

BEM

BEM stands for “Block”, “Element”, “Modifier”. It is a front-end methodology which is a new way of thinking when developing web interfaces. The guys at Yandex came up with BEM and more information can be found here.

SASS

SASS is CSS with superpowers. Highly recommend it but you can also use LESS if you prefer that. Please refer to the SASS documentation for more information.

try to follow : http://sass-guidelin.es/

Compass

Compass has no class definitions, it is an extension of SASS which provides a lot of utilities. It is used for general useful mixins, and sass compilation. Compass mixins should nearly always be used in cases where vendor prefixes are required. This again is a nice to have and Bourbon, on the first look is a great alternative.

 

Refer : https://github.com/sathify/CCSS

Refer this link for other standard practices : http://www.leemunroe.com/css/

black-swift is a tiny coin-sized embedded computer and Completely Open Source

Black Swift is a tiny — coin-sized — embedded computer with powerful CPU, integrated Wi-Fi and USB interface, and OpenWRT support. It was created to make home appliances smarter, turn Internet of Things into reality, build some funny robotics, or create your very own project with powerful wireless computer at the center of it. The choice is yours.

slider-small

 

Internet of Smart Things

Black Swift is an ideal choice to make your home appliances smarter, no matter what — existing devices or completely new development.

  • Ultra-compact at just 25×35 mm (1×1.4 in)
  • All necessary components on a single board, including Wi-Fi
  • Easy to use, easy to integrate into your design
  • Programming languages from C/C++ to PHP and Python

 

IT IS Completely Open Source

Check out http://www.black-swift.com/

Laravel 5 installation

Requirements

*      PHP 5.4 and above

*     Composer

 

1.1 . Using normal composer Method 

Installation 

        composer create-project laravel/laravel learning-laravel-5  dev-develop

Description 

composer create-project – To create the new project

laravel/laravel   -> vendorname/packege name

learning-laravel-5  -> directory name to create

dev-develop  -> Branch name

 

In our case we can use the command below

composer create-project laravel/laravel learning-laravel-5

 

 

1.2. Using the laravel installer Method.

run

      composer global require "laravel/installer=~1.1"

Note : add laravel composer dir to your path

laravel new learning-laravel-5

 

2 . after the download complete run the server

 

2.1 Using PHP inbuld  server

          php -S localhost:8888 -t public

2.2 Using laravel artisan

        php artisan serve

3. maintenance mode / live mode

   php artisan down  -> to make the application to maintenance mode

php artisan up       -> to make the application to live mode from maintenance mode

 

 

 

MD5 in Oracle Sql & MySql

How to use MD5 in Oracle Sql & MySql

Sample Query Oracle Sql

SELECT LOWER( RAWTOHEX(UTL_RAW.CAST_TO_RAW(dbms_obfuscation_toolkit.md5(input_string=>”PASSWORD”)))) PASS FROM DUAL;

 

Sample Query MySql

SELECT MD5(“PASSWORD”)  AS PASS

 

OUTPUT :

PASS
319f4d26e3c536b5dd871bb2c52e3178

 

note: in am using oracle 10 above

 

FOR Update password Query Oracle Sql

UPDATE USER_TABLE SET PASSWORD = LOWER( RAWTOHEX(UTL_RAW.CAST_TO_RAW(dbms_obfuscation_toolkit.md5(input_string=>PASSWORD)))) WHERE PASSWORD IS NOT NULL;
commit;

group_concat in Mysql

How to use GROUP_CONCAT in a CONCAT in mysql

My Sample table

CREATE TABLE `mytbl` (
`id` int,
`Name` varchar(10),
`Value` int
);

INSERT INTO `mytbl` (`id`, `name`,`value`) VALUES
(1,’A’, ‘4’),
(1,’A’, ‘5’),
(1,’B’, ‘8’),
(2,’C’, ‘9’);

Group concat Example Query

select
id,group_concat(concat(`name`,’:’,`value`) separator ‘,’)
as `Column` from mytbl group by id

This MySQL statement will return unique concat string of name & values with “:” as concat string like “name:value” , as a list of strings separated by the commas Like   “name:values,name2:values2”     , order for each group of ‘id’ from the mytbl  table.

  Output 

1 A:4,A:5,B:8
2 C:9

Reference

http://sqlfiddle.com/#!2/e51b7/9

‘SRCSET’ ATTRIBUTE SOLVING RESPONSIVE IMAGE STANDARD

Not only do you need to accommodate design layouts for mobile devices, but you also need to take into account high pixel density displays, like Apple’s Retina devices. These displays have a pixel density up to 326 pixels per inch compared to standard desktop monitors which are around 100 ppi.

Responsive Web Design is a simple technique until you consider images. There are a number of issues:

  1. Bandwidth can be saved if smaller images are sent to smaller-screen devices.
  2. On lower resolutions, it may be preferable to show a cropped image with the main detail rather than a resized view of the whole image.
  3. Devices with higher-density displays (Retina) could be sent higher resolution images.

I have a suspicion the problem has been overstated. Few of us will ever bother to create numerous device-targeted images; there are too many options and life is too short. That said…

Are Displays So Different?

If we look at the lower end of the display spectrum, we find mobile phones. Even the cheapest smartphone has a 800×480 display. That’s approximately half the dimensions (quarter the area) of a mid-range laptop but it’s still a reasonable resolution. And remember the browser runs full-screen which few people would do on a PC.

To the other extreme we have double-density displays, commonly known by Apple’s trademarked term — Retina. Recent iPads have a native resolution of 2,048×1,536 or 264 pixels per inch where individual pixels can be too small for the naked eye. To ensure websites and apps remain usable, the device reverts to a standard 1,024×768 resolution but uses the extra pixels for smoother fonts and icons.

My point is: display specifications are converging. High-end mobile resolutions already match or exceed typical PC screens and display densities can only go so far; why create triple-density displays when double-density pixels are already invisible? The need for responsive images will reduce as hardware improves.

My Images are Blocky!

I’m yet to be convinced Retina image quality is a major problem…

  • Images are usable.
  • Relatively few people (currently) own double-density devices.
  • The majority of Retina devices are smartphones and tablets. Should we be sending higher-resolution images to gadgets with more limited processing power and network availability?
  • Finally, why are we adding high-resolution photographs to our websites when bandwidth and responsiveness remain so important?

Of course, none of this matters when your boss demands “less-blocky” images on his iPad. However, I would recommend a more pragmatic cross-browser approach in preference to larger images, i.e. replace bitmaps with SVG images, CSS3 effects or webfont icons when possible (refer to 5 Ways to Support High-Density Retina Displays).

The Industry Decides

I may be slightly dismissive, but many people care about the responsive image problem. A recent meeting of W3C members finally reached a consensus and vendors are likely to support the imagesrcset attribute proposal. When implemented, you will be able to use code such as:

 
<img src="normal.jpg" srcset="midres.jpg 1.5x, highres.jpg 2x" />

Devices with standard resolutions or browsers which don’t support srcset will load normal.jpg. Devices with 1.5x density screens will show midres.jpg and 2x density screens will show highres.jpg.

Unfortunately, pixel density is not the only factor and the viewport width (and possibly height) should also be considered. Therefore, srcset could eventually support the following cryptic syntax:

 <img src="x.jpg" srcset="y.jpg 800w 1x, y.jpg 400w 2x, z.jpg 1200w 1x, z.jpg 600w 2x" />

In this example, y.jpg is loaded on standard-resolution devices with a maximum 800 pixel width and double-density devices with a maximum 400 pixel width.

srcset is hard to read, prone to errors and I suspect it will be too easy to incorrectly target or miss a range of devices. However, it was considered more backward-compatible and easier to implement than other proposals.

Of course, the proposition could still change. I have a horrible feeling we’ll all be using double-density displays and extra-large images before this becomes a usable standard!

check out the http://www.webkit.org/demos/srcset/

helper tab in wordpress

Pranjithkumar's Blog

Helper tab in wordpress

 /* * helper class for all admin pages */ class my_wp_helper_class { public function __construct() { if (defined('WP_ADMIN') && WP_ADMIN) { global $page_hook; $this->current_screen = get_current_screen(); if (method_exists($this, $page_hook)) { add_action("load-".$page_hook,array($this,$page_hook)); } } } /* To add helper tab * Accept the array in $args default is shown below * $defaults = array('title' => false,'id'=> false,'content' => '','callback' => false); */ protected function add_help_tab($args) { $this->current_screen->add_help_tab($args); } /* * accept the string in $content args * $content =" sample content"; */ protected function set_help_sidebar($content) { $this->current_screen->$args($content); } public function plugin_page_my_page() { // function name must be $page_hook name echo the $page_hook in the __construct() $options_help = 'helper message for tab1'; $this->add_help_tab(array( 'id' => 'tab1', 'title' => __('tab1'), 'content' => $options_help, )); $options_help2 = 'helper message for tab2'; $this->add_help_tab(array( 'id' => 'tab2', 'title' => __('tab2'), 'content' => $options_help2, )); $this->set_help_sidebar("side bar content"); } } add_action('current_screen', create_function('', 'new…

View original post 1 more word