Jul.02

Php function change string number into unicode number

I have used the date conversion function for converting the english letter date to nepali letter date by changing the unique letter to unicode letter. I created my own function for  converting ( 2017 to २०७१) , which gets the number of string as input and returns the number changed by unicode converted string.

 

/* Called function / function definition */

function get_change_to_unicodes($str) {
$strout = “”;
$strchar = “”;
for ($i = 0; $i < strlen($str); $i++) {
$strchar = substr($str, $i, 1);

if ($strchar == ‘1’) {
$strout .= ‘१’;
}
if ($strchar == ‘2’) {
$strout .= ‘२’;
}
if ($strchar == ‘3’) {
$strout .= ‘३’;
}
if ($strchar == ‘4’) {
$strout .= ‘४’;
}
if ($strchar == ‘5’) {
$strout .= ‘५’;
}
if ($strchar == ‘6’) {
$strout .= ‘6’;
}

if ($strchar == ‘7’) {
$strout .= ‘७’;
}
if ($strchar == ‘8’) {
$strout .= ‘८’;
}
if ($strchar == ‘9’) {
$strout .= ‘९’;
}
if ($strchar == ‘0’) {
$strout .= ‘०’;
}
}

return $strout;

}

/* calling function */

get_change_to_unicodes(‘2070’);

 

…………………………..

// it returns २०७१

 

Jun.21

How To Enable,Disable Write Protection Of USB Devices Under Windows

You have probably seen the following scenario in multiple thriller and spy movies; A spy connects an USB stick to a computer to copy data from the computer to the device. Movies do not necessarily reflect reality but there is some truth to this scenario after all. It is indeed possible to connect an USB device to a computer running Windows to copy data from that computer to the removable storage device.

It is sometimes in the best interest of companies, organizations and individuals to protect the data on their computer from being copied this way.

Microsoft has added options to the Windows operating system (more precisely to Windows XP and newer operating systems) to write protect all USB devices that are connected to it. This indicates that it may not always be possible to protect the computer this way, for instance if data needs to be written to USB devices regularly.

Write Protection adds another layer of defense to the computer. The system is not fool proof on its own, as it is still possible to copy data, for instance by uploading it to the Internet or a network connection.

Write Protecting USB Devices

You can enable or disable write protection of all USB devices that are connected to the Windows operating system. Both settings are configured in the Windows Registry. Here is how this is done.

Open the Windows Registry editor with the shortcut Windows-r, enter regedit into the form and press the return key on the keyboard.

Navigate to the following Registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies

Please note that you may need to create the key StorageDevicePolicies if it does not exist. Select the key afterwards and right-click into the right window. Select New > Dword (32-bit) Value from the context menu and name the entry WriteProtect.

Double-click the new entry afterwards and change the value from 0 to 1. A value of 1 disables writing to all connected USB devices. If you want to enable writing again you need to change the value of the key to 0.

write_protetion

 

The new setting takes effect immediately. Every user who tries to copy data to USB devices with write protection enabled receives the following notification window.

disk-is-write-protected

Jun.19

Enabling Nepali Unicode in Keyword for XP and Windows 7

For Windows XP

Instructions for installing Nepali Unicode font in Windows XP
=============================================================

1. download the nepali_Unicode.zip
2. unzip nepali_Unicode.zip file
3. run setup.exe from Nepali_Romanized for Windows XP or Nepali_Traditional for Windows XP (whichever suits you) and follow the instructions below:

Instructions:
————-
4. go to Start>Settings>Control Panel > Regional and language Options
5. go to “languages” tab
6. click “Details” button
7. click “Add” button
8. check “Keyboard Layouts/IME” and select Nepali Unicode romanized / Nepali Unicode Traditional layout in dropdown list.

Download Unicode Traditional

Nepali_Romanised for Windows XP

 

 

 

For Windows 7Nepali_Language_Input_in_Windows_7

 

 

Jun.19

Exporting outlook 2006 for microsoft office outlook 2007

We have no option of exporting and importing the outlook express (XP outlook) to Windows 7 (Office Outlook 2007 ). We need to convert the dbx into pst format. I have invested many hours into interneet but i dont get direct export and import method of these two different mailing.

Finally i found that the outlook express have stored is stored into .dbx format and window 7 (office outlook 2007 ) is stored on .pst format.

so I can solve my email expoerting problem by software tool which will give me the way of of converting .dbx file to .pst file.

If we are able to convert the Outlook express into to .pst it is easily imported by Microsoft office outlook 2007.

 

Outlook express(Windows XP) to Office Outlook 2007( Windows 7):

1. Software tool which have only export the body content of email .

It dont include title of email , Attached files etc.

Stellar DBX To PST Converter Download.

Click here to download this software.

It is around 9MB file size

2. Software which only keeps 25 email export of every folder like (inbox,sent …)

SysTools DBX Converter  Download

Click here to download this software

The file size is 10MB.

 

Jun.15

Set and Get image of Uploaded to this page or post

uploaded_to_this_page

Insert the image into related post .and display into in to the post page.

Display all images which are inserted into Uploaded to this page.

 

The post id can get the all media which are setted as Uploaded to this page media.

$args = array(
‘post_type’ => ‘attachment’,
‘numberposts’ => -1,
‘post_status’ => null,
‘post_parent’ => get_the_ID()
);

 

This parameter gets all possible images which are inserted.  It gets all attached images with giving the media name. if we need the image thumbnail with fix size we need to send array as second parameter array(150,150).

$attachments = get_posts( $args );
if ( $attachments ) {
foreach ( $attachments as $attachment ) {

echo wp_get_attachment_image( $attachment->ID, ‘full’ );
}
}

 

If we require the image name only with out full image. We can do that by using

$full_img = wp_get_attachment_image_src($attachment->ID, ‘full’);

$thumb_img = wp_get_attachment_image_src($attachment->ID, array(50,50));

This can get the array of image with width height if we need the url we need to use  $full_img[0] for fullimage and $thumb_img[0] for small thumbnail with 50X 50px size.

Returns

  • [0] => url
  • [1] => width
  • [2] => height
  • [3] => boolean: true if $url is a resized image, false if it is the original.

 

//if ( have_posts() ) : while ( have_posts() ) : the_post();

$attachments = get_posts( $args );
if ( $attachments ) {
foreach ( $attachments as $attachment ) {
echo ‘<li>’;
//echo wp_get_attachment_image( $attachment->ID, ‘full’ );
$full_img = wp_get_attachment_image_src($attachment->ID, ‘full’);
$thumb_img = wp_get_attachment_image_src($attachment->ID, array(50,50));
//echo $full_img[0];
//echo $thumb_img[0];
echo”<img src='”.$thumb_img[0].”‘ full_img='”.$full_img[0].”‘>”;
//echo ‘<p>’;
//echo apply_filters( ‘the_title’, $attachment->post_title );
//echo ‘</p>’;
echo ‘</li>’;
}
}

//endwhile; endif;

prakashbhandari

 

Jun.15

Convert Images To Black & White Using CSS

prakashbhandari

Filters allow us to visually process an image in the browser without needing to go through or use cycle-intensive, script-heavy methods in or PHP. are broadly supported in the most recent versions of Firefox, Safari and Chrome, and we can gain support in older versions and alternative browsers – even IE –  by using a combination of techniques.

In this article we’ll convert an image to black & white with pure CSS using the classic test image of Lena Söderberg. In other articles in this series I discuss how to achieve sepia toning, blurring, and other visual effects.

The CSS3 greyscale filter

Desaturating a color image couldn’t be simpler with CSS3. We’ll apply the filter as a class, as you’d typically desire several images to be affected by the code at the same time:

 

img.desaturate { -webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
filter: grayscale(100%);
}

 

Applying the class to the image is easy:

img src="lena-söderberg.png" alt="Lena Söderberg" style="width: 512px; height: 512px;" 
class="desaturate"

Add An SVG Filter Effect

The CSS shown to this point works only in Chrome 18+, with support in other browsers expected to arrive soon. To gain the same effect in Firefox 4+, we need to use an filter, which I’ll create as a separate document named desaturate.svg. The code for that file will be:

<svg version="1.1" xmlns="http://www.w3.org/2000/svg">
<filter id="greyscale">
<feColorMatrix type="matrix" values="0.3333 0.3333 0.3333 0 0
 0.3333 0.3333 0.3333 0 0
 0.3333 0.3333 0.3333 0 0
 0  0  0  1 0" />
 </filter>
 </svg>

If the SVG code looks slightly daunting – and the matrix math behind it is somewhat complex – don’t worry. This is one piece of code that I’d actually encourage you to copy and paste as a generic “recipe”. I’ll explain matrix transformations in a future article.

With the SVG file saved beside our page and test image, we will extend the CSS to become:


img.desaturate{
-webkit-filter: grayscale(100%); -moz-filter: grayscale(100%);
filter: grayscale(100%);
filter: url(desaturate.svg#greyscale);
}

Add Support for IE

So far our code covers future browsers, recent versions of Chrome and Firefox 4+. To include IE 6 – 9, we’ll apply Microsoft’s simple but proprietary use of filter:


img.desaturate{
-webkit-filter: grayscale(100%); -moz-filter: grayscale(100%);
filter: gray; filter: grayscale(100%);
filter: url(desaturate.svg#greyscale);
}

If you want to add in support for older versions of Webkit:


img.desaturate{
-webkit-filter: grayscale(1); -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%);
filter: gray; filter: grayscale(100%);
filter: url(desaturate.svg#greyscale);
}


Jun.13

Slc Result

The Office of Controller of Examinations (OCE) is likely to publish the results of School Leaving Certificate (SLC) Examinations-2070 on Friday at 5:00 PM.

According to Bishu Bahadur Dware, the Exam Controller at OEC, the final preparations for the publication of the SLC results have already been completed.

A total of 566,085 students, including 419,352 regular and 146,733 exempted, who have appeared in the School Leaving Certificate (SLC).

prakashbhandari

 

There are Various site which will show the Slc Result with including Mark sheet and Without Mark sheet:

Online Media:

Education Khabar : http://www.educationkhabar.com/

Education Sansar : http://www.educationsansar.com/

Education Khabar : http://edukhabar.com/

Nepal Telecom : http://www.slc.ntc.net.np/

Slc Result : http://slc.ntc.net.np/

 

 

Sms Partner :

SLC Result via SMS: sparrowsms

SLC<space>Symbol-number and send it to 5001 to get the slc result of 2013 in Nepal without any hassle.

or go through link : http:// sparrowsms.com/results/slc-results-nepal

slc

 

 

 

Feb.03

How to create repository of SVM?

What is SVN Server?

VisualSVN Server allows you to easily install and manage a fully-functional Subversion server on the Windows platform. It can maintain an Apache Subversion server on the Windows platform. for file and sharing option to the.

Download Visual SVN Server

 

We need to install the SVN server on our computer. There have following stages to crate svn repository.

How to Create SVN repository?

I have assumed the repository folder name onsnews for below example.

Step1 : open the system file in installed location of VisusalSVN Server Manager.

 

Step 2: Create new Repository. [the server interface displays the creating of repository area. create repository as same below the image.]

 

[ After Create the repository folder It Creates three sub folder [i. branches, ii. tags , iii. trunk] in every repository]

Copy the URL to clipboard of the created folder.

There would be link in this form we need to replace the name by ip

https://Prakash-PC/svn/onsnews/

replaced ip

https://192.168.1.10/svn/onsnews/

 

After copying the Repository link

Go to your project folder

Right click choose TortoiseSVN  –> Import …

 

It puts files and folder in SVN Server

We need to confirm it is on the server

 {repository}à{project_folder_name} => {list of imported files}.

It displays all imported data available from previous stage.

 

In the previous stage we find the data are on SVN repository server. Then we need to sink the data from local and server machine.

Our above folder onsnews folder in the D:\wanp\www

Have need to sink to our SVN server.

Right Click on the folder name which you want to replicate from svn server

SVN Checkout =>

Make sure that the repository folder name with

Syntax: https//{computer server ip}/{project repository name}/trunk

https://192.168.1.10/onsnews/trunk

and

Checkout directory is path of your local folder what you want to checkout.

Example Like

D:\wamp\www\onsnews

 

Feb.02

Maxmium upload file size setting on Apache Php

The default size of upload file on Apache setting is 2mb. We need to change the setting of maximum upload file size when we wants to upload grater than 2MB file size.

The default setting of the Uploaded File Size  is located on php.ini file which is located on your installed directory of XAMPP or WAMP server.

 

Note:   When we change the maximum file upload file size (upload_max_filesize) we also need to increase the maximum size of post data (post_max_size).

For example if we can set maximum file size to 100M and we are going to upload 100 mb file but the post size is 8m by default; in that case it gets error when uploading so we need to change both the file size and post size with increment with ratio. Below is the php.ini file location and the setting of size with line number.

 

XAMPP Server:

The maximum file size is setting on XAMPP server line 513 or find upload_max_filesize. which is default set as 2M you can change as you required ie. 8M,20M,100M…

Location : <xampp_install_dirtectory>/xampp/php/php.ini

line :: 513 ::

; Maximum allowed size for uploaded files.
upload_max_filesize = 2M

line :: 409::

; Maximum size of POST data that PHP will accept.
post_max_size = 8M

 

WAMP Server:

The maximum file size is setting on WAMP server line 513 or find upload_max_filesize. which is default set as 2M you can change as you required ie. 8M,20M,100M…

Location : <wamp_install_dirtectory>/wamp/bin/php/php<with_version>/php.ini

line :: 884 ::

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 2M

line :: 734 ::

; Maximum size of POST data that PHP will accept.
; http://php.net/post-max-size
post_max_size = 8M

 

 

Jan.29

User Roles and Capability of WordPress user

WordPress have different types user with having different capability. When I am going to built the news portal site it is required the user role and ability.

    • Super Admin – somebody with access to the site network administration features and all other features. See the Create a Network article. First user who have crate the wordpress site using username and password is called the superuser.
      This is little different cability than the administrator when we are building multi site on WordPress. this user have
    • Administrator – somebody who has access to all the administration features within a single site.
Administrator capability
activate_plugins
delete_others_pages
delete_others_posts
delete_pages
delete_plugins
delete_posts
delete_private_pages
delete_private_posts
delete_published_pages
delete_published_posts
edit_dashboard
edit_files
edit_others_pages
edit_others_posts
edit_pages
edit_posts
edit_private_pages
edit_private_posts
edit_published_pages
edit_published_posts
edit_theme_options
export
import
list_users
manage_categories
manage_links
manage_options
moderate_comments
promote_users
publish_pages
publish_posts
read_private_pages
read_private_posts
read
remove_users
switch_themes
upload_files
create_product

    • Editor – somebody who can publish and manage posts including the posts of other users.
Editor Capability
delete_others_pages
delete_others_posts
delete_pages
delete_posts
delete_private_pages
delete_private_posts
delete_published_pages
delete_published_posts
edit_others_pages
edit_others_posts
edit_pages
edit_posts
edit_private_pages
edit_private_posts
edit_published_pages
edit_published_posts
manage_categories
manage_links
moderate_comments
publish_pages
publish_posts
read
read_private_pages
read_private_posts
unfiltered_html (not with Multisite. See Unfiltered MU)
upload_files

    • Author – somebody who can publish and manage their own posts.
Author Capability
delete_posts
delete_published_posts
edit_posts
edit_published_posts
publish_posts
read
upload_files

    • Contributor – somebody who can write and manage their own posts but cannot publish them.
Contributor Capability
add new post
delete_posts his inserted post
edit_posts his inserted post
read all post

  • Subscriber – somebody who can only manage their profile.
Subscriber Capability
Edit his profile and change password.