Subscribe and Follow

  HTML-5 Email Validation html-5 EMail Validation for text box <form> <input type = "email" /> </form&g...

 HTML-5 Email Validation





html-5 EMail Validation for text box <form><input type="email" /></form>

 

 

0 comments:

HTML 5 Alpha Numeric Validation HTML 5 Alpha Numeric Values only allowed the textbox Added  'pattern="[a-zA-Z0-9\s]+" &...

HTML 5 Alpha Numeric Validation


HTML 5 Alpha Numeric Values only allowed the textbox Added  'pattern="[a-zA-Z0-9\s]+" '

0 comments:

Tips to speed up your database

Know what you should optimize         If you want to optimize a specific query, it is extremely useful to be able to get an in-depth loo...

Know what you should optimize

        If you want to optimize a specific query, it is extremely useful to be able to get an in-depth look at the result of a query. Using the EXPLAIN statement, you will get lots of useful info on the result produced by a specific query, as shown in the example below:
ex:
EXPLAIN SELECT * FROM ref_table,other_table WHERE ref_table.key_column=other_table.column;
 

Don’t select what you don’t need

          A very common way to get the desired data is to use the * symbol, which will get all fields from the desired table
  •   SELECT * FROM Posts;
        Instead, you should definitely select only the desired fields as shown in the example below. On a very small site with, let’s say, one visitor per minute, that wouldn’t make a difference. But on a site such as Cats Who Code, it saves a lot of work for the database.
  • SELECT title, excerpt, author FROM Posts;
 

Use join instead of subqueries

         As a programmer, subqueries are something that you can be tempted to use and abuse. Subqueries, as show below, can be very useful:
  • SELECT a.id, (SELECT MAX(created) FROM posts WHERE author_id = a.id) AS latest_post FROM authors a
 
          Although subqueries are useful, they often can be replaced by a join, which is definitely faster to execute.
  • SELECT a.id, MAX(p.created) AS latest_post FROM authors a INNER JOIN posts p ON (a.id = p.author_id) GROUP BY a.id
 

Use UNION instead of OR

The following example use the OR statement to get the result:
  • SELECT * FROM a, b WHERE a.p = b.q or a.x = b.y;
The UNION statement allows you to combine the result sets of 2 or more select queries. The following example will return the same result that the above query gets, but it will be faster:
  • SELECT * FROM a, b WHERE a.p = b.q UNION SELECT * FROM a, b WHERE a.x = b.y

Use indexes

         Database indexes are similar to those you can find in libraries: They allow the database to find the requested information faster, just like a library index will allow a reader to find what they’re looking for without loosing time.
An Index can be created on a single column or a combination of columns in a database table. A table index is a database structure that arranges the values of one or more columns in a database table in specific order.
The following query will create an index on the Model column from the Product table. The index is called idxModel:
  • CREATE INDEX idxModel ON Product (Model);

Be careful when using wildcards

          Wildcards are very useful because they can substitute for one or more characters when searching for data in a database. I’m not saying that you shouldn’t use them, but instead, you should use them with caution and not use the full wildcard when the prefix or postfix wildcard can do the same job.
In fact, doing a full wildcard search on a million records will certainly kill your database.
  • #Full wildcard -  SELECT * FROM TABLE WHERE COLUMN LIKE '%hello%'; 
  • #Post fix wildcard  -SELECT * FROM TABLE WHERE COLUMN LIKE 'hello%'; 
  • #Prefix wildcard - SELECT * FROM TABLE WHERE COLUMN LIKE '%hello';
 Source: http://hungred.com/useful-information/ways-optimize-sql-queries/

0 comments:

How to WhatsApp Send message in C#

What's App Number Send Message For C# code   Dim3 Technology and solutions Visual studio solution Right click-->manage nuget pa...

What's App Number Send Message For C# code  
Dim3 Technology and solutions
 Visual studio solution Right click-->manage nuget packages for solution -->search whatsapp api install

string from = "9199********";
        string to = txtTo.Text;//Sender Mobile
        string msg = txtMessage.Text;

        WhatsApp waobj = new WhatsApp(from, "BnXk*******B0=", "NickName", true, true);

        waobj.OnConnectSuccess += () =>        {
            MessageBox.Show("Connected to whatsapp...");

            waobj.OnLoginSuccess += (phoneNumber, data) =>            {
                wa.SendMessage(to, msg);
                MessageBox.Show("Message Sent...");
            };

            waobj.OnLoginFailed += (data) =>            {
                MessageBox.Show("Login Failed : {0}", data); 
            };

            waobj.Login();        };

        waobj.OnConnectFailed += (ex) =>        {
            MessageBox.Show("Connection Failed...");
        };

        waobj.Connect();

1 comments:

How to JQ Grid Session Maintain Search Filters and pagination

 JQ grid How to Search sorting  Maintenance jq grid search ,sorting ,filter and page column chooser Maintain the browser cookies below...

 JQ grid How to Search sorting Maintenance


jq grid search ,sorting ,filter and page column chooser Maintain the browser cookies below code only copy  past and reference added the


<script type="text/javascriptsrc="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<script type="text/javascriptsrc="ui.multiselect.js"></script>
<script type="text/javascriptsrc="grid.locale-en.js"></script>
<script type="text/javascriptsrc="jquery.jqGrid.src-multiselect.js"></script>
<script type="text/javascriptsrc="jqGrid/json2.js"></script>
<script type="text/javascript"> 
//<![CDATA[


$.jgrid.formatter.integer.thousandsSeparator = ',';
$.jgrid.formatter.number.thousandsSeparator = ',';
$.jgrid.formatter.currency.thousandsSeparator = ',';
$(document).ready(function () {
'use strict';
var myData = [
{id: "1", invdate: "2007-10-01", name: "test", note: "note", amount: "200.00", tax: "10.00", closed: true, ship_via: "TN", total: "210.00"},

{id: "2", invdate: "2011-07-30", name: "test7", note: "note7", amount: "200.00", tax: "10.00", closed: true, ship_via: "TN", total: "210.00"},
{id: "3", invdate: "2007-10-03", name: "test8", note: "note8", amount: "300.00", tax: "20.00", closed: true, ship_via: "FE", total: "320.00"},
{id: "4", invdate: "2007-09-01", name: "test9", note: "note9", amount: "400.00", tax: "30.00", closed: false, ship_via: "TN", total: "430.00"},
{id: "5", invdate: "2007-09-08", name: "test10", note: "note10", amount: "500.00", tax: "30.00", closed: true, ship_via: "TN", total: "530.00"}
],
$grid = $("#list"),
initDateSearch = function (elem) {
setTimeout(function () {
$(elem).datepicker({
dateFormat: 'dd-M-yy',
autoSize: true,
//showOn: 'button', // it dosn't work in searching dialog
changeYear: true,
changeMonth: true,
showButtonPanel: true,
showWeek: true,
onSelect: function () {
if (this.id.substr(0, 3) === "gs_") {
setTimeout(function () {
$grid[0].triggerToolbar();
}, 50);
} else {
// to refresh the filter
$(this).trigger('change');
}
}
});
}, 100);
},
numberSearchOptions = ['eq', 'ne', 'lt', 'le', 'gt', 'ge', 'nu', 'nn', 'in', 'ni'],
numberTemplate = {formatter: 'number', align: 'right', sorttype: 'number',
searchoptions: { sopt: numberSearchOptions }},
myDefaultSearch = 'cn',
getColumnIndex = function (grid, columnIndex) {
var cm = grid.jqGrid('getGridParam', 'colModel'), i, l = cm.length;
for (i = 0; i < l; i++) {
if ((cm[i].index || cm[i].name) === columnIndex) {
return i; // return the colModel index
}
}
return -1;
},
refreshSerchingToolbar = function ($grid, myDefaultSearch) {
var postData = $grid.jqGrid('getGridParam', 'postData'), filters, i, l,
rules, rule, iCol, cm = $grid.jqGrid('getGridParam', 'colModel'),
cmi, control, tagName;
for (i = 0, l = cm.length; i < l; i++) {
control = $("#gs_" + $.jgrid.jqID(cm[i].name));
if (control.length > 0) {
tagName = control[0].tagName.toUpperCase();
if (tagName === "SELECT") { // && cmi.stype === "select"
control.find("option[value='']")
.attr('selected', 'selected');
} else if (tagName === "INPUT") {
control.val('');
}
}
}
if (typeof (postData.filters) === "string" &&
typeof ($grid[0].ftoolbar) === "boolean" && $grid[0].ftoolbar) {
filters = $.parseJSON(postData.filters);
if (filters && filters.groupOp === "AND" && typeof (filters.groups) === "undefined") {
// only in case of advance searching without grouping we import filters in the
// searching toolbar
rules = filters.rules;
for (i = 0, l = rules.length; i < l; i++) {
rule = rules[i];
iCol = getColumnIndex($grid, rule.field);
if (iCol >= 0) {
cmi = cm[iCol];
control = $("#gs_" + $.jgrid.jqID(cmi.name));
if (control.length > 0 &&
(((typeof (cmi.searchoptions) === "undefined" ||
typeof (cmi.searchoptions.sopt) === "undefined")
&& rule.op === myDefaultSearch) ||
(typeof (cmi.searchoptions) === "object" &&
$.isArray(cmi.searchoptions.sopt) &&
cmi.searchoptions.sopt.length > 0 &&
cmi.searchoptions.sopt[0] === rule.op))) {
tagName = control[0].tagName.toUpperCase();
if (tagName === "SELECT") { // && cmi.stype === "select"
control.find("option[value='" + $.jgrid.jqID(rule.data) + "']")
.attr('selected', 'selected');
} else if (tagName === "INPUT") {
control.val(rule.data);
}
}
}
}
}
}
},
cm = [
//{name: 'id', index: 'id', width: 70, align: 'center', sorttype: 'int', formatter: 'int'},
{name: 'invdate', index: 'invdate', width: 75, align: 'center', sorttype: 'date',
formatter: 'date', formatoptions: {newformat: 'd-M-Y'}, datefmt: 'd-M-Y',
searchoptions: {
sopt: ['eq', 'ne'],
dataInit: initDateSearch
}},
{name: 'name', index: 'name', width: 65},
{name: 'amount', index: 'amount', width: 75, template: numberTemplate},
{name: 'tax', index: 'tax', width: 52, template: numberTemplate},
{name: 'total', index: 'total', width: 60, search: false, template: numberTemplate},
{name: 'closed', index: 'closed', width: 67, align: 'center', formatter: 'checkbox',
edittype: 'checkbox', editoptions: {value: 'Yes:No', defaultValue: 'Yes'},
stype: 'select', searchoptions: { sopt: ['eq', 'ne'], value: ':Any;true:Yes;false:No' }},
{name: 'ship_via', index: 'ship_via', width: 95, align: 'center', formatter: 'select',
edittype: 'select', editoptions: {value: 'FE:FedEx;TN:TNT;IN:Intim', defaultValue: 'Intime'},
stype: 'select', searchoptions: { sopt: ['eq', 'ne'], value: ':Any;FE:FedEx;TN:TNT;IN:Intim'}},
{name: 'note', index: 'note', width: 60, sortable: false}
],
saveObjectInLocalStorage = function (storageItemName, object) {
if (typeof window.localStorage !== 'undefined') {
window.localStorage.setItem(storageItemName, JSON.stringify(object));
}
},
removeObjectFromLocalStorage = function (storageItemName) {
if (typeof window.localStorage !== 'undefined') {
window.localStorage.removeItem(storageItemName);
}
},
getObjectFromLocalStorage = function (storageItemName) {
if (typeof window.localStorage !== 'undefined') {
return JSON.parse(window.localStorage.getItem(storageItemName)); 
}
},
myColumnStateName = function (grid) {
return window.location.pathname + '#' + grid[0].id;
},
idsOfSelectedRows = [],
saveColumnState = function (perm) {
var colModel = this.jqGrid('getGridParam', 'colModel'), i, l = colModel.length, colItem, cmName,
postData = this.jqGrid('getGridParam', 'postData'),
columnsState = {
search: this.jqGrid('getGridParam', 'search'),
page: this.jqGrid('getGridParam', 'page'),
rowNum: this.jqGrid('getGridParam', 'rowNum'),
sortname: this.jqGrid('getGridParam', 'sortname'),
sortorder: this.jqGrid('getGridParam', 'sortorder'),
permutation: perm,
selectedRows: idsOfSelectedRows,
colStates: {}
},
colStates = columnsState.colStates;
if (typeof (postData.filters) !== 'undefined') {
columnsState.filters = postData.filters;
}
for (i = 0; i < l; i++) {
colItem = colModel[i];
cmName = colItem.name;
if (cmName !== 'rn' && cmName !== 'cb' && cmName !== 'subgrid') {
colStates[cmName] = {
width: colItem.width,
hidden: colItem.hidden
};
}
}
saveObjectInLocalStorage(myColumnStateName(this), columnsState);
},
myColumnsState,
isColState,
restoreColumnState = function (colModel) {
var colItem, i, l = colModel.length, colStates, cmName,
columnsState = getObjectFromLocalStorage(myColumnStateName(this));
if (columnsState) {
colStates = columnsState.colStates;
for (i = 0; i < l; i++) {
colItem = colModel[i];
cmName = colItem.name;
if (cmName !== 'rn' && cmName !== 'cb' && cmName !== 'subgrid') {
colModel[i] = $.extend(true, {}, colModel[i], colStates[cmName]);
}
}
}
return columnsState;
},
updateIdsOfSelectedRows = function (id, isSelected) {
var index = $.inArray(id, idsOfSelectedRows);
if (!isSelected && index >= 0) {
idsOfSelectedRows.splice(index, 1); // remove id from the list
} else if (index < 0) {
idsOfSelectedRows.push(id);
}
},
firstLoad = true;
myColumnsState = restoreColumnState.call($grid, cm);
isColState = typeof (myColumnsState) !== 'undefined' && myColumnsState !== null;
idsOfSelectedRows = isColState && typeof (myColumnsState.selectedRows) !== "undefined" ? myColumnsState.selectedRows : [];
$grid.jqGrid({
datatype: 'local',
data: myData,
colNames: [/*'Inv No',*/'Date', 'Client', 'Amount', 'Tax', 'Total', 'Closed', 'Shipped via', 'Notes'],
colModel: cm,
rowNum: isColState ? myColumnsState.rowNum : 10,
rowList: [5, 10, 20],
pager: '#pager',
gridview: true,
page: isColState ? myColumnsState.page : 1,
search: isColState ? myColumnsState.search : false,
postData: isColState ? { filters: myColumnsState.filters } : {},
sortname: isColState ? myColumnsState.sortname : 'invdate',
sortorder: isColState ? myColumnsState.sortorder : 'desc',
rownumbers: true,
ignoreCase: true,
multiselect: true,
//shrinkToFit: false,
//viewrecords: true,
caption: 'The usage of localStorage to save jqGrid preferences',
height: 'auto',
onSelectRow: function (id, isSelected) {
updateIdsOfSelectedRows(id, isSelected);
saveColumnState.call($grid, $grid[0].p.remapColumns);
},
onSelectAll: function (aRowids, isSelected) {
var i, count, id;
for (i = 0, count = aRowids.length; i < count; i++) {
id = aRowids[i];
updateIdsOfSelectedRows(id, isSelected);
}
saveColumnState.call($grid, $grid[0].p.remapColumns);
},
loadComplete: function () {
var $this = $(this), i, count;
if (firstLoad) {
firstLoad = false;
if (isColState) {
$this.jqGrid("remapColumns", myColumnsState.permutation, true);
}
if (typeof (this.ftoolbar) !== "boolean" || !this.ftoolbar) {
// create toolbar if needed
$this.jqGrid('filterToolbar',
{stringResult: true, searchOnEnter: true, defaultSearch: myDefaultSearch});
}
}
refreshSerchingToolbar($this, myDefaultSearch);
for (i = 0, count = idsOfSelectedRows.length; i < count; i++) {
$this.jqGrid('setSelection', idsOfSelectedRows[i], false);
}
saveColumnState.call($this, this.p.remapColumns);
},
resizeStop: function () {
saveColumnState.call($grid, $grid[0].p.remapColumns);
}
});
$.extend($.jgrid.search, {
multipleSearch: true,
multipleGroup: true,
recreateFilter: true,
closeOnEscape: true,
closeAfterSearch: true,
overlay: 0
});
$grid.jqGrid('navGrid', '#pager', {edit: false, add: false, del: false});
$grid.jqGrid('navButtonAdd', '#pager', {
caption: "",
buttonicon: "ui-icon-calculator",
title: "Choose columns",
onClickButton: function () {
$(this).jqGrid('columnChooser', {
done: function (perm) {
if (perm) {
this.jqGrid("remapColumns", perm, true);
saveColumnState.call(this, perm);
}
}
});
}
});
$grid.jqGrid('navButtonAdd', '#pager', {
caption: "",
buttonicon: "ui-icon-closethick",
title: "Clear saved grid's settings",
onClickButton: function () {
removeObjectFromLocalStorage(myColumnStateName($(this)));
window.location.reload();
}
});
});
//]]>
</script>

0 comments:

Next Move Android- M

Android- M   Features The Mountain View company also released the new Android M developer preview, just like how Android Lollipop was...

Android- M  Features

The Mountain View company also released the new Android M developer preview, just like how Android Lollipop was released as Android L at last year's I/O conference. Similarly, the official name of the new OS version will only be revealed at the time of the next Nexus device launch, expected in October. Google also stressed that for Android M, the company has focused on improving the core experience of Android and has made some changes to the fundamentals of the platform apart from fixing several bugs. During the Google I/O keynote, the company also revealed that this time it will provide a clear timeline for Android M Developer Preview for testing and feedback to the preview build.


Dim3 Technology And solution
  1. App Links
  2. Web Experience
  3. Mobile Payments
  4. Fingerprint Support
  5. New RAM manager
  6. Adoptable Storage Devices
  7. Auto Backup and Restore for Apps


0 comments:

ASP .Net 5 Framework features

           Asp DotNet 5 New fetures ASP.NET 5 includes frameworks for building Web apps and services such as MVC, Web API, Web Pages...


           Asp DotNet 5 New fetures

ASP.NET 5 includes frameworks for building Web apps and services such as MVC, Web API, Web Pages (coming in a future release), SignalR and Identity. Each of these frameworks has been ported to work on the new HTTP request pipeline and has been built to support running on the .NET Framework, .NET Core or cross-platform.
Today, the existing implementations of MVC, Web API and Web Pages share many concepts and duplicate abstractions, but share very little in the way of actual implementation. As part of porting these frameworks to ASP.NET 5, Microsoft decided to take a fresh look at combining these frameworks into a single unified Web stack. ASP.NET MVC 6 takes the best of MVC, Web API and Web Pages and combines it into a single framework for building Web UI and Web APIs. This means from a single controller you can just as easily render a view as return formatted data based on content negotiation.
In addition to unification, ASP.NET MVC 6 introduces a host of new features:
  • Built-in DI support
  • Ability to create controllers from any class—no base class required
  • Action-based request dispatching
  • View Components—a simple replacement for child actions
  • Routing improvements, including simplified attribute routing
  • Async views with flush points
  • Ability to inject servers and helpers into views using @inject
  • ViewStart inheritance
  • Tag helpers
You can find more information and samples at github.com/aspnet/mvc.
Web Forms isn’t available on ASP.NET 5, but is still fully supported on the .NET Framework. There are a number of important new features coming to Web Forms in the upcoming version of the .NET Framework, including support for HTTP 2.0, async model binding and a Roslyn-based CodeDom provider. We’re also working on various features reminiscent of Web Forms in MVC 6, such as tag helpers and other Razor improvements.




0 comments:

Macro In Visual Studio

Macro Used In Visual studio There are many tasks that we do in Visual Studio that are repetitive and which can be automated using macros...

Macro Used In Visual studio


There are many tasks that we do in Visual Studio that are repetitive and which can be automated using macros. One such example is attaching to process for debugging. Having the ability to debug an existing running process (Ex: Process of a .net console application exe) is a common requirement. The usual way would be using the Attach To Process window from Debug -> Attach To Process in Visual Studio. But this can become cumbersome and irritating if we have to do it again and again to test iterative changes. This is where macros come to our rescue.


 We want to debug from the second breakpoint by attaching to this process so, Now we start recording our macro in 5 simple steps –

 Click Record Temporary Macro from the Tool -> Macros menu as shown below:


Recording is started. Now perform the necessary actions to attach to the process as below:

Click Debug -> Attach to Process

In the popup below find your process and click Attach.

 Stop recording the macro using Tools -> Macros as below:

 Save the macro using Tools -> Macros as below:




 Upon saving, the macro will appear in the Macro Explorer. I have named it Attach To My Program.


 Lastly we can also place a shortcut to this macro on the Debug toolbar to make things even simpler.

 Go to Tools -> Customize -> Commands and under Toolbar dropdown select Debug as below:


 Hit the Add Command button and on the below popup select macros under Categories andAttachToMyProgram under commands:

 Now from under the Modify Selection rename the command as shown below:

Now the AttachToMyProgram shortcut show appear in the Debug toolbar as shown below:

6. Now close the console application and start again. We will again see the “I am started” message. Now simply hit the AttachToMyProcess shortcut on the Debug bar and press any key in the console application window. There you are! You are in the debug session and the second breakpoint is hit. Now you can easily attach to your process with a click of a button.

0 comments: