Wednesday, March 9, 2016
Tuesday, February 16, 2016
Thursday, November 5, 2015
Friday, April 19, 2013
"why Bush hid the facts" showing bug?
This Problem because of some certain combination and frequency of letters in character string because "Notepad" misinterpret the
encoding of the file when it is re-opened. There are lot of other reason because using of Unicode characters. Previous version of notepad not using UNICODE thats why error will not come using previous version.
for more details. visit this website
http://www.hoax-slayer.com/bush-hid-the-facts-notepad.html
HAPPY CODING
for more details. visit this website
http://www.hoax-slayer.com/bush-hid-the-facts-notepad.html
HAPPY CODING
why we can't create folder with name 'con'?
Hi,
You can't make folders on the desktop that have "System Action" or "Device" references such
as con, nul and prn. Solution is to use another name or use 0 instead of o,O for C0n.
Here are others :
CON, PRN, AUX, CLOCK$, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9,
LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9
Can you create “con” folder on windows os ?
http://freetechjournal.com/windows-tips/create-con-folder-windows-xp-os.html
HAPPY CODING
You can't make folders on the desktop that have "System Action" or "Device" references such
as con, nul and prn. Solution is to use another name or use 0 instead of o,O for C0n.
Here are others :
CON, PRN, AUX, CLOCK$, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9,
LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9
Can you create “con” folder on windows os ?
http://freetechjournal.com/windows-tips/create-con-folder-windows-xp-os.html
HAPPY CODING
Wednesday, April 10, 2013
How to get/set Selected Values of Select2 Multi Selection List in MVC?
Hi
Here you can get selected element of Multi selection list using Select2 Jqyery.
Jquery Code
var AuthorList= $("select#AuthorList").select2("val");
-----------------------------------------------------------------------
2. How to set MultiSelection List?
First Get Selected value from your database and add into Hidden Field
like.
Then
Var authlist="";
var a_options = [];
$.each($("#AuthorListoption"), function () {
if (authlist.toLowerCase().indexOf($(this).attr("value")) >= 0) {
a_options.push($(this).attr("value"));
}
});
$("select#AuthorList").select2("val", a_authlist);
HAPPY CODING
Here you can get selected element of Multi selection list using Select2 Jqyery.
Jquery Code
var AuthorList= $("select#AuthorList").select2("val");
-----------------------------------------------------------------------
2. How to set MultiSelection List?
First Get Selected value from your database and add into Hidden Field
like.
Then
Var authlist="";
var a_options = [];
$.each($("#AuthorListoption"), function () {
if (authlist.toLowerCase().indexOf($(this).attr("value")) >= 0) {
a_options.push($(this).attr("value"));
}
});
$("select#AuthorList").select2("val", a_authlist);
HAPPY CODING
How To Bind MultiSelection List with Select2 Jquery in MVC
Action
------------------
Public ActionResult Author()
{
SelectList AuthorList= null;
IEnumerable Author = AuthorList.AsEnumerable().Select(c => new SelectListItem()
{
Text = objauth.ReplaceTagValueToTerm(c.TagValue, c.Term),
Value = c.Id.ToString(),
Selected = true,
});
Newterms = new SelectList(Author, "Value", "Text");
ViewBag.AuthorList= Newterms;
}
}
-------------------------------------------------------------------------------------
View Page
@Html.DropDownList("infoTypes", (SelectList)ViewData["AuthorList"], new { @class = "NewCssdropdown", multiple = "" })
---------------------------------------------------------------------
Jquery
$("#AuthorList").select2(
{
maximumSelectionSize: 4 // Here You can define maximum selection
});
HAPPY CODING
------------------
Public ActionResult Author()
{
SelectList AuthorList= null;
IEnumerable Author = AuthorList.AsEnumerable().Select(c => new SelectListItem()
{
Text = objauth.ReplaceTagValueToTerm(c.TagValue, c.Term),
Value = c.Id.ToString(),
Selected = true,
});
Newterms = new SelectList(Author, "Value", "Text");
ViewBag.AuthorList= Newterms;
}
}
-------------------------------------------------------------------------------------
View Page
@Html.DropDownList("infoTypes", (SelectList)ViewData["AuthorList"], new { @class = "NewCssdropdown", multiple = "" })
---------------------------------------------------------------------
Jquery
$("#AuthorList").select2(
{
maximumSelectionSize: 4 // Here You can define maximum selection
});
HAPPY CODING
How to Bind Select2 Jquery in MVC
Action
------------------
Public ActionResult Author()
{
SelectList Newterms = null;
IEnumerable Author = AuthorList.AsEnumerable().Select(c => new SelectListItem()
{
Text = objauth.ReplaceTagValueToTerm(c.TagValue, c.Term),
Value = c.Id.ToString(),
Selected = true,
});
Newterms = new SelectList(Author, "Value", "Text");
ViewBag.NewTerms = Newterms;
}
}
-------------------------------------------------------------------------------------
View Page
@Html.DropDownList("NewTerms", (SelectList)ViewData["NewTerms"], new { @class = "NewCssdropdown" })
--------------------------------------------------------------------------------------
Jquery
---------------------------------------------------------------------------------------------
HAPPY CODING
------------------
Public ActionResult Author()
{
SelectList Newterms = null;
IEnumerable
{
Text = objauth.ReplaceTagValueToTerm(c.TagValue, c.Term),
Value = c.Id.ToString(),
Selected = true,
});
Newterms = new SelectList(Author, "Value", "Text");
ViewBag.NewTerms = Newterms;
}
}
-------------------------------------------------------------------------------------
View Page
@Html.DropDownList("NewTerms", (SelectList)ViewData["NewTerms"], new { @class = "NewCssdropdown" })
--------------------------------------------------------------------------------------
Jquery
---------------------------------------------------------------------------------------------
HAPPY CODING
How to get selected Value from Select2 Jquery.
Hi To know how to bind Dropdown using Select2. Please reffer my old Post
How To Bind Select2
Now i will give you one example to Get Selected Value.
Jquery
--------
var AuthorList= $("#AuthorList").val();
HAPPY CODING
How To Bind Select2
Now i will give you one example to Get Selected Value.
Jquery
--------
var AuthorList= $("#AuthorList").val();
HAPPY CODING
Wednesday, July 25, 2012
CS0012: The type 'System.Data.Objects.DataClasses.EntityObject' is defined in an assembly that is not referenced.
When using Entity frame work . passing the data with control i got one error
"Compiler Error Message: CS0012:
The type 'System.Data.Objects.DataClasses.EntityObject' is defined in
an assembly that is not referenced. You must add a reference to assembly
'System.Data.Entity, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'."
After R & D i found solution. so i am posting this solutions because i don't want to waste your lot of time like as i did.
here is solution type following code in your web config file
" "
Thanks Happy Coding
Tuesday, July 17, 2012
Hide/Show Div With Smooth Effect.
Hi i am giving you one example to show and hide div with smooth effect .
My html Code:
<div id="done" style="display:none;">
write content here
</div>
My Java Script Code
<script>
$('#done').fadeIn('slow');
setTimeout(function () {
$('#done').fadeOut('slow');
}, 2000);
</script>
My text To Show
Happy Coding
My html Code:
<div id="done" style="display:none;">
write content here
</div>
My Java Script Code
<script>
$('#done').fadeIn('slow');
setTimeout(function () {
$('#done').fadeOut('slow');
}, 2000);
</script>
My text To Show
Happy Coding
Wednesday, July 11, 2012
How to Define action Link Using Areas In MVC
Hi..
I am giving one example to define Action Link Url Using Multiple Areas..
I am using two areas with Name
a) Control
b) System
.
@Html.ActionLink("Main Home", "Index", "Home", new { Area = "" }, null)
@Html.ActionLink("
Control Home", "Index", "ControlHome", new { Area = "Control" }, null)
@Html.ActionLink("
System Home", "Index", "SystemHome", new { Area = "System" }, null)
Happy Coding
I am giving one example to define Action Link Url Using Multiple Areas..
I am using two areas with Name
a) Control
b) System
.
Happy Coding
Monday, July 9, 2012
Import Excell,csv file into Linq
I have csv file with name infocontext, having two fileds
1.Alies
2. ShortDesc
Now i am importing My Excel data from csv file to database using Linq (Entity Framework in MVC3)
I have table Infocontext
1. Create properties of class for Table
--->
public class InfoContext
{
public string Tag { get; set; }
public string Alias { get; set; }
}
2. Now Write this Method
public ActionResult ImportCSV()
{
// Object of My Class
InfoContext Dtinfo = new InfoContext();
// Import data from csv file
var dataImport = System.IO.File.ReadAllLines(Server.MapPath("~/Areas/Cataloging/infocontext.csv"));
for(int i=0;i<=dataImport.Length;i++)
{
// Split data from Excel by column
string[] word = dataImport[i].Split(',');
for(int k=0;k<=word.Length-1;i++)
{
Dtinfo.Alias = word[0];
Dtinfo.ShortDesc = word[1];
db.InfoContext.Add(Dtinfo); // Saving data by code first tech. you can write your own method to save data
db.SaveChanges();
}
}
return View();
}
Data is Saved..
Happy Programing
1.Alies
2. ShortDesc
Now i am importing My Excel data from csv file to database using Linq (Entity Framework in MVC3)
I have table Infocontext
1. Create properties of class for Table
--->
public class InfoContext
{
public string Tag { get; set; }
public string Alias { get; set; }
}
2. Now Write this Method
public ActionResult ImportCSV()
{
// Object of My Class
InfoContext Dtinfo = new InfoContext();
// Import data from csv file
var dataImport = System.IO.File.ReadAllLines(Server.MapPath("~/Areas/Cataloging/infocontext.csv"));
for(int i=0;i<=dataImport.Length;i++)
{
// Split data from Excel by column
string[] word = dataImport[i].Split(',');
for(int k=0;k<=word.Length-1;i++)
{
Dtinfo.Alias = word[0];
Dtinfo.ShortDesc = word[1];
db.InfoContext.Add(Dtinfo); // Saving data by code first tech. you can write your own method to save data
db.SaveChanges();
}
}
return View();
}
Data is Saved..
Happy Programing
Saturday, June 9, 2012
Google Map in 3d
Now explore your Maps View in 3d with New Google 3d Map 6.0.
Features
- Tilt
- Rotate
- Compass Mode
- Smooth Zooming
- Offline Reliability
- Offline Building and Rerouting
Friday, June 8, 2012
Write a program to list files in the current working directory depending upon a given pattern.?
♣♣♣ WRITE A PROGRAM TO LIST FILES IN THE CURRENT WORKING
DIRECTORY DEPENDING UPON A GIVEN PATTERN. ♣♣♣
import java.lang.*;
import java.io.*;
class pro15
{
public static void
main(String ar[]) throws IOException
{
InputStreamReader
a=new InputStreamReader(System.in);
BufferedReader
b=new BufferedReader(a);
System.out.print("\n\tEnter
the Directory Name : ");
String
s=b.readLine();
File f=new
File(s);
if(f.exists())
{
if(f.isDirectory())
{
String []f1=f.list();
int i;
for(i=0;i
{
String tp=f1[i];
if(tp.endsWith("java"))
System.out.println("\n\t\t"+tp);
if(tp.endsWith("class"))
System.out.println("\n\t\t"+tp);
}
}
}
}
}
OUTPUT :-
Enter
The Directory Name : d:\
Test.java
Test.class
Abc.java
Abc.class
Applet2.java
Write a program to get a file name at run time and display number of lines and words in that file.?
♣♣♣ WRITE A PROGRAM TO GET A FILE NAME AT RUN TIME AND
DISPLAY NUMBER OF LINES AND WORDS IN THAT FILE. ♣♣♣
import java.lang.*;
import java.io.*;
class pro14
{
public static
void main(String ar[]) throws IOException
{
InputStreamReader a=new InputStreamReader(System.in);
BufferedReader
b=new BufferedReader(a);
int
lines=0,words=0;
System.out.print("\n\tEnter The File
Name : ");
String
s=b.readLine();
File f=new
File(s);
InputStreamReader in=new InputStreamReader(new FileInputStream(f));
StreamTokenizer
st=new StreamTokenizer(in);
st.wordChars(0,255);
st.whitespaceChars(0,' ');
st.eolIsSignificant(true);
while(st.nextToken()!=
st.TT_EOF)
{
if(st.ttype==st.TT_EOL)
lines++;
if(st.ttype==st.TT_WORD)
words++;
}
System.out.println("\n\tNumber of Lines :
"+lines+"\n\t Number of words : "+words);
}
}
OUTPUT :-
Enter
The File Name : c:\test.txt
Number
of Lines : 0
Number
of Words : 2
Enter
The File Name : c:\hook.log
Number
of Lines : 238
Number
of Words : 357
Write a program to copy a file to another file using java.io package classes. Get the file names at run time and if the target file existed then ask confirmation to overwrite and take necessary actions.?
♣♣♣ WRITE A PROGRAM TO COPY A FILE TO ANOTHER FILE USING
JAVA.IO PACKAGE CLASSES. GET THE FILE NAMES AT RUN TIME AND IF THE TARGET FILE
EXISTED THEN ASK CONFIRMATION TO OVERWRITE AND TAKE NECESSARY ACTIONS. ♣♣♣
import java.lang.*;
import java.io.*;
class pro13
{
public static
void main(String ar[]) throws IOException
{
InputStreamReader a =new InputStreamReader(System.in);
BufferedReader b=new BufferedReader(a);
int i;
FileInputStream fin=null;
FileOutputStream fout=null;
String
filename=null;
try
{
System.out.print("\n\tEnter the file name to copy to another file :
");
filename=b.readLine();
try
{
fin=new
FileInputStream(filename);
}
catch(Exception e)
{
System.out.println("\n\tFile
Not Found");
return;
}
try
{
System.out.print("\n\tEnter the file name to copy : ");
filename=b.readLine();
fout=new
FileOutputStream(filename);
}
catch(Exception e)
{}
}
catch(Exception e)
{}
try
{
do
{
i=fin.read();
if(i!=-1)
fout.write(i);
}while(i!=-1);
System.out.println("\n\tFile copied to
"+filename+" Sucessfully");
}
catch(IOException e)
{
System.out.println("\n\tFile Error");
}
fin.close();
fout.close();
}
}
OUTPUT :-
Enter
the file name to copy to another file : c:\test.txt
Enter
the file name to copy : c:\hello.txt
File
copied to c:\hello.txt successfully
Enter
the file name to copy to another file : c:\tests.txt
File
Not Found
Write a program to find the total memory, free memory and free memory after executing garbage collection gc(()).?
♣♣♣ WRITE A PROGRAM TO FIND THE TOTAL MEMORY, FREE MEMORY
AND FREE MEMORY AFTER EXECUTING GARBAGE COLLECTION gc(()).♣♣♣
import java.io.*;
class pro12
{
public static void main(String ar[])
throws IOException
{
InputStreamReader a =new InputStreamReader(System.in);
BufferedReader b=new BufferedReader(a);
Runtime
rn=Runtime.getRuntime();
long mem1=0,mem2=0;
Integer arr[]=new Integer[1000];
System.out.println("\n\t\tTotal Memory
is "+rn.totalMemory());
mem1=rn.freeMemory();
System.out.println("\n\tInital Free
Memory is "+mem1);
rn.gc();
mem1=rn.freeMemory();
System.out.println("\n\tFree Memory
after Garbage Collector "+mem1);
for(int i=0;i<1000;i++)
arr[i]=new Integer(i);
mem2=rn.freeMemory();
System.out.println("\n\tFree Memory
after allocation "+mem2);
System.out.println("\n\tMemory used by
alloction "+ (mem1-mem2));
for(int
i=0;i<1000;i++)
arr[i]=null;
rn.gc();
mem2=rn.freeMemory();
System.out.println("\n\tFree
Memory after collecting discarded integers
"+mem2);
}
}
OUTPUT :-
Total
Memory is 5177344
Initial
Free Memory is 4949960
Free
Memory after Garbage Collector 5039128
Free
Memory after allocation 5020712
Memory
used by allocation 18416
Free
Memory after collecting discarded integer 5039128
Write a program to check all the math class functions.?
♣♣♣ WRITE A PROGRAM TO CHECK ALL THE MATH CLASS
FUNCTIONS. ♣♣♣
import java.io.*;
class pro10
{
public
static void main(String ar[]) throws IOException
{
InputStreamReader a =new InputStreamReader(System.in);
BufferedReader b=new BufferedReader(a);
System.out.println("\n\n\t\t
****** Mathematical Functions ***** \n");
System.out.println("\n\t\t-----------------------------------------\n");
System.out.println("\n\n\t\t\t<== Exponential Functions
==>\n");
System.out.println("\n\t\t\t-----------------------------\n");
System.out.println("\n\tExponential
Value = "+Math.exp(3));
System.out.println("\n\tpower Value = "+Math.pow(2,2));
System.out.println("\n\n\t\t\t<==
Trignometrical Functions ==>\n");
System.out.println("\n\t\t\t--------------------------------\n");
System.out.println("\n\t sin Value =
"+Math.sin(30));
System.out.println("\n\t
cos Value = "+Math.cos(30));
System.out.println("\n\t
tan Value = "+Math.tan(30));
System.out.println("\n\t
cot Value = "+Math.atan(30));
System.out.println("\n\t <== Ordinary Mathematical Functions
==>\n");
System.out.println("\n\t\t\t---------------------------------------\n");
System.out.println("\n\tAbsolute
Value = "+Math.abs(-30));
System.out.println("\n\tRound Value = "+Math.abs(10.456));
System.out.println("\n\tCeil Value = "+Math.ceil(10.4));
System.out.println("\n\tFloor
Value = "+Math.floor(10.456));
System.out.println("\n\tSquare Root Value = "+Math.sqrt(9));
}
}
OUTPUT :-
******
Mathematical Functions *****
-------------------------------------------------------
<==
Exponential Functions ==>
---------------------------------------
Exponential
Value = 20.085536923187668
Power
Value = 4.0
<== Trignometrical Functions
==>
------------------------------------------
Sin
Value = -0.9880316240928618
Cos
Value = 0.15425144988758405
Tan
Value = -6.405331196646276
Cot
Value = 1.5374753309166493
<==
Ordinary Mathematical Functions ==>
----------------------------------------------------
Absolute
Value = 30
Round Value = 10.456
Floor Value = 10.0
Square Root Value = 3.0
Write a program to check all the math class functions.?
♣♣♣ Write a program to check all the math class functions. ♣♣♣
import java.io.*;
import
java.util.*;
import java.lang.*;
class pro9
{
public static
void main(String args[]) throws IOException
{
InputStreamReader
a =new InputStreamReader(System.in);
BufferedReader
b =new BufferedReader(a);
Stack
st=new Stack();
char
ans='y';
while(ans=='y' || ans=='Y')
{
System.out.println("\n\tMENU
FOR STACK OPERATION");
System.out.println("\n\t1.\t
PUSH");
System.out.println("\n\t2.\t
POP");
System.out.println("\n\t3.\t
PEEK");
System.out.println("\n\t4.\t
SEARCH");
System.out.println("\n\t5.\t
DISPLAY");
System.out.println("\n\t6.\t
EXIT");
System.out.print("\n\nEnter
your choice : ");
int
ch=Integer.parseInt(b.readLine());
switch(ch)
{
case
1:
System.out.print("Enter
the total number of element to be push : ");
int n=Integer.parseInt(b.readLine());
for(int i=1;i<=n;i++)
{
System.out.print("\n\tEnter
the "+i+" Element : ");
int
val=Integer.parseInt(b.readLine());
st.push(new
Integer(val));
}
break;
case
2:
try
{
System.out.print("\n\tElement
poped is "+st.pop());
}
catch(Exception e)
{
System.out.println("\n\tStack
is underflow........");
}
break;
case
3:
try
{
System.out.println("\n\tElement on the
top of the Stack is "+(Integer)st.peek());
}
catch(Exception
e)
{
System.out.print("\n\tStack
is Empty");
}
break;
case
4:
System.out.print("\n\tEnter
the element to be searched : ");
int
num=Integer.parseInt(b.readLine());
int
sr=st.search(new Integer(num));
if(sr==-1)
System.out.println("\nElemet
does not found in the stack");
else
System.out.println("\nElement
found in the Stack at "+sr+"position");
break;
case
5:
System.out.println("Elemets
of the stack are ");
System.out.println(st);
break;
case
6:
System.exit(0);
default:
System.out.print("Invalid
Choice.......Please enter the correct choice");
}
System.out.print("Do
you want to continue (Y/N) : ");
String
s=b.readLine();
ans=s.charAt(0);
}
}
}
OUTPUT :-
MENU FOR
STACK OPERATION
1.
PUSH
2.
POP
3.
PEEK
4.
SEARCH
5.
DISPLAY
6.
EXIT
Enter your choice : 1
Enter the total number of
element to be push : 2
Enter
the 1 Element : 23
Enter
the 2 Element : 45
Do you want to continue(Y/N) : y
MENU FOR STACK OPERATION
1.
PUSH
2.
POP
3.
PEEK
4.
SEARCH
5.
DISPLAY
6.
EXIT
Enter your choice : 4
Enter the total element to be searched
: 55
Element does not found in the
stack
Do you want to continue(Y/N) : y
MENU FOR STACK OPERATION
1.
PUSH
2.
POP
3.
PEEK
4.
SEARCH
5.
DISPLAY
6.
EXIT
Enter your choice :5
Elements
of the stack are
[23, 45]
Do you want to continue(Y/N) : n
Subscribe to:
Posts (Atom)

