Thursday, October 27, 2011

Xoom apps


I just got the Motorola Xoom and its the coolest piece of technology Ivé held ... until now.
The Xoom runs Android HoneyComb 3.1, and you can watch enormous amount of videos on youtube
Its powered by Nvidia terga2 1Ghz processor, 32 GB space with a resolution of 1280 x 800 pixels.
See the complete specs here

Ivé downloaded some apps, and here goes

Adobe reader ... all the pdfs that I need to read, essential app

Nook for android book reader

Google books is a cool app, but it did not install the free books and when I when to shop for books, (by clicking the link on the top right corner) it said its not there in your area... man! like i'm not in Antarctica!

Wyse PocketCloud RDP This is one useful app, it helps me control my PC, of course youu need the client installed on your PC.

WiFi Finder This simply finds WiFi networks near you. Really cool app

Google Sky Map is another nice app... (if you're wannabe astronomer)

Google earth is there alright, but this hangs on Xoom, so I recommend dont install this yet, I hope there will be an update coming soon.

Google maps .. I had the pre-installed.. and so was Street view

Press Reader Gets what you want .. I mean all the news papers around, it downloads them on demand, and of course, most of the news papers and magazines are paid for log term usage.

Draw Free Is nice bit does not have many brushes or marker options, you can change colors ... thats it.. not much of a freehand draw tool.

Shazam 'Which song is that'. This app is innovative and cool. One downside though... this app is not optimized for the tablet. Yet.

Quick Office Pro For your office apps

NDTV is a news app for India and it comes with a cool widget, too bad it works only vertical.

CNN for android tabletsThis is a really well built app

IMDB Essential for tablets For movie buffs

FlickFolio This is a paid app for flickr fans.

File Manager HD This is a really useful app for those of us used to seeing the windows explorer. And is optimized for HoneyComb.

And note: I recommend not using App Killers (for those of us used to taskmanage) coz' HonayComb is designed for multitasking.

Tablet Keyboard is very useful, it does need a bit of practice to type with you thumbs. There are paid keyboard out there, but this works like a charm.

And here are the games!
Gaming is just awesome on the Xoom
See this youtube video http://www.youtube.com/watch?v=zi7kcknBAf8


Lets start Angry
Angry birds is the most popular and fun game around, anyone who owns (or doesn't own) an Android phone will know. On the Xoom, you can see the whole perspective , angling the shots is easier. There are many many versions of the game available.

Shortyz Crosswords This is for crossword people, it downloads new games from various sources.

Gun Bros If you wanna' see the Terga2 in action this is the game.

Deer Hunter is good looking as well, its paid though.

Fruit Ninja THD This is real fun on the Xoom

Rocket Bunnies This is the most addictive and fun game.

Tic Tac Toe Traditional....I wish there was a multiplayer option.

I bought my Xoom on FlipKart (India) it came in 3 days and they sent a Motorola case with it.
And the Box was way different and better here (in india) that in other places.
I mean
This is what I thought i'd get
this is what I got


I'll have to update the games soon,

Keep Xoomin

Sunday, October 16, 2011

Add tooltip to each item of a DropDown list

You can do a simple DataBind() to bind the DataValue and the DataText fields To populate data into a dropdown list, I thought that binding it with the DropDown1.ToolTip = would do it, yes it does add ToolTip to each item but does not bind a different values.
like I tried to do this on a databind


    private DataTable makeTable()
    {
        DataTable t = new DataTable();
        t.Columns.Add("id");
        t.Columns.Add("display");
        t.Columns.Add("description"); // I thought this would add a tooltip to each item
        t.Rows.Add("1","item1","item1 desc");
        t.Rows.Add("2","item2","item2 desc");
        return t;
    }
    private void bingdd()
    { 
        DataTable t = makeTable();
        DropDownList1.DataValueField = "id";
        DropDownList1.DataTextField = "display";
        DropDownList1.ToolTip = "description";
        DropDownList1.DataSource = t;
        DropDownList1.DataBind();
    }

If you have table where the value, text and description are placed (I just made a datatable), and you want to display the description on mouseover of each item, then use the databound even to add attibutes each item.
The comes in the databound event that will be used to add a 'title' to each item


    private string[] descArray = new string[8];//array to store descriptions

    private void bingdd() //modified bind method
    { 
        DataTable t = makeTable();
        DropDownList1.DataValueField = "id";
        DropDownList1.DataTextField = "display";
       // DropDownList1.ToolTip = "description";
        for (int i = 0; i < t.Rows.Count; i++)
        {
            descArray[i] = t.Rows[i][2].ToString();
        }
        DropDownList1.DataSource = t;
        DropDownList1.DataBind();
    }
    protected void DropDownList1_DataBound(object sender, EventArgs e)
    {
        int i = 0;
        foreach (ListItem l in DropDownList1.Items)
        {
            l.Attributes.Add("title", descArray[i]);
            i++;
        }
    }

Then you get something like

If there is a faster or better way, tell me please

Hope this helps

Sunday, June 5, 2011

InfoPath for the web

There are some constraints while designing InfoPath forms for the web.
First thing is that it does not support views!
If you wanna make a readonly view, then .... not possible ...
But, you can write a rule for every element by sing the username() function to see who has logged in
like
I wanted to disable a textbox when someone login, other than the administrator (the system account)
so, put a textbox on a form , in its properties window click on the fx button

Select username function as shown above and click ok for every window.
Once you have this text box, it can be used to validate every other control on the form
Suppose I have another txtbox called field2, and I need to enable it only if system logs in then,
Double click the textbox to see its properties (for IP 2010, add a new formatting rule)
then ....


In the display tab click conditional formatting to get the window shown above
Then select field1 (or whatever you called the username textbox) then select no equal to in the second and type system in the third, then check read-only.
Click ok for every window.

After publishing this form, you can only find field2 enabled when you login with the system account.

Another thing in web enabled forms is that they don’t allow a section within a section!
That’s one great feature in InfoPath, maybe you won't require it, but what if you want to hide a datepicker that is in a repeating table?
You need to use a section and put the formatting rules in there.
Like: http://www.infopathdev.com/blogs/shiraz/archive/2006/09/08/Hide-a-Date-Picker-Control.aspx
How can you show this web?
please, tell me if you know....

Friday, May 20, 2011

Create an approval workflow In SharePoint designer

 To create a Workflow in SPD 2010 see this video http://office.microsoft.com/en-us/sharepoint-designer-help/video-create-an-approval-workflow-in-sharepoint-designer-2010-VA101897477.aspx

I used the SPD 2007 to create an approval workflow for an InfoPath form library.
It had to work by sending an email and getting the approve or reject status to a form an approver, then send emails to users, notifying them of their status
The only thing was, that the approvers had to be a list of users who would be selected from the InfoPath form .
I started off from here http://www.u2u.info/Blogs/Kevin/Lists/Posts/Post.aspx?ID=39
Thats a cool post that help to start off (and end ) . Thanks Kevin.
here's a nice post too http://cycogeek.fiesta25.com/blogs/cycogeek/page/Create-Custom-Approval-Workflow-with-SharePoint-Designer.aspx
In the step called 'user' (in the above link) I had to choose a variable from the InfoPath form. please refer to my earlier posthttp://saudkhansblog.blogspot.com/2011/05/send-mail-from-infopath.html form sending mail from InfoPath.
After gathering the approver process and other variables, namely- comments and approve
I had to send two mails at once, ie. one to the creator and a cc to the person holiday is requested for.
If it were the same person, then it should send just one email, else should send two mails .
This can be done by adding 3 else if conditions, (and the first if , so totally 4)

like :
if Holiday Approve equals Approve
and if created by equals accountID
then send one mail to created by(approved mail)
else iff Holiday Approve equals Reject
and if created by equals accountID
then send one mail to created by(reject mail)
else if Holiday Approve equals Approve
and if created by not equals accountID
then send mail to created by with cc to accountID (approve mail)
else if Holiday Approve equals Reject
and if created by not equals accountID
then send mail to created by with cc to accountID (reject mail)

not another thing when you send the mail, you send the URL form current items, dont do that
coz if the url has spaces it won't work
Use EncodedUrl instead, this will have the whole correct path to the document.
If you need any help just ask
Thanks


Sunday, May 15, 2011

send mail from InfoPath

To send mails from InfoPath ,a customized workflow should do

 see here first http://www.youtube.com/watch?v=Xe6b3zegpEU

The SharePoint designer can be used to create custom workflows, and hence send simple emails
The idea is to create a workflow that uses form library in the workflow to use at least one of its column fields (by column field I mean, one that is promoted to be shown on the SharePoint library) .

Once that is defined then use the actions in the workflow settings to send the mail.

Friday, May 6, 2011

InfoPath forms in webpages

On SharePoint 2007 it is possible to display an InfoPath form as a web page Provided the form is developed in web compatibility mode
and ofcourse there are the other settings, in SharePoint Administration that need to be taken care of.
Here is a checklist that helps a lot http://vspug.com/aziz/2008/01/27/a-checklist-for-enabling-browser-forms-with-forms-services-and-sharepoint-2007/ and to design a form so that it shows up fine on a web page this link helps http://blogs.technet.com/b/jessmeats/archive/2009/05/11/infopath-forms-within-sharepoint-pages.aspx
The thing is I had InfoPath 2010 and SharePoint 2007 to work with and also I was using some controls on a form that had to be 2010 (i mean InfoPath 2010) like the people picker
So I started off with the checklist;
I did the SharePoint 2007 administration part, i.e :

  • Go to Central Administration, then  choose the Application Management tab on the top of the page. Click on Configure InfoPath Forms Services in the InfoPath Forms Services section and check both "Allow users to browser-enable form templates" and "Render form templates that are browser-enabled by users" checkboxes, then OK this page.
Then
  • Open your SharePoint site, click on Site Actions -> Site Settings, select Site collection features under Site Collection Administration and activate InfoPath Forms Services support.
The next step is to design the form. Like I said I had InfoPath 2010, there is some difference in the way the check for compatibility for the web page is done,
Once the form is developed , you have to go to the file menu and click on the 'Design Checker'
then it checks wether the form is of to be opened in a web page.
While publishing the form, in step 3 , 'Enable this form to be filled out by using a browser' is to be checked and the last step remains the same i.e

  • At the end of the publishing wizard, select "Open this document
    library" and click on Close. This will open the document library in the
    browser. Click on Settings/Form Library Settings, then click on
    Advanced Settings and select the "Display as a Web page"
    option in the Browser-enabled Documents category. If you don't choose
    this option, the form will be opened in InfoPath if it's installed on
    the client. Otherwise, it's going to be opened in the browser.
If InfoPath is not installed, then the form opens in a browser, else, it opens using the InfoPath.

Thursday, April 21, 2011

CSS animations (google)

Did you todays http://www.google.com/ page?
Its got this earth day image instead of the multicolored google.
Its not a gif or a silverlight or JS or flash, as I see it, it might be simple CSS animation
(of course some jquery stuff included)
see http://www.the-art-of-web.com/css/css-animation/
css animations load faster are browser plugin independent
and some of us find it cool.

Monday, April 4, 2011

Weekly report with weekly date selection

     In my previous post, I had used the calendar extender to show days by weeks upon selection, Using the same thing, I used it to generate a weekly report.
     Upon selection of the date the corresponding week is automatically selected and linkbuttons show the next and previous weeks.
     Upon first selection, the textbox (showing the selected week) is populated by JavaScript and so are the links, when report generation is done all the dates are on the server, hence, after the first selection, things are done from the server in C#.
     I use the NorthWind database's OrderDetails table. You can get the sample database script from here.

and ofcourse you can download the source from here

Saturday, April 2, 2011

Calender Extender and weekly dates

 I was using this with a ajax calender extender.
You have to use the OnClientDateSelectionChanged event fired on the client and pass the sender and args like

<ajaxToolKit:CalendarExtender ID="CalendarExtender1" 
TargetControlID="txtWeek"  runat="server" PopupButtonID=imgBtnCalWeek 
OnClientDateSelectionChanged =foo FirstDayOfWeek=Monday >
</ajaxToolKit:CalendarExtender>

and the javascript

function foo(sender, args)
{
  var selectedDate = new Date();
  selectedDate = sender._selectedDate;
  alert(selectedDate);
}

you can also do document.getElementById('txtweek').value;
to get the date selected but I guess you need to convert the text into date before moving ahead.

Anyway here I was, thinkin of a login to find monday of any selected week,
and then I found http://www.datejs.com/ this stuff is awesome!
download just one .js file and include it in your project and we're done.
Then you get loads of Date functions see the Example Usage  here http://code.google.com/p/datejs/
it doesn't get simpler....
finding 'monday' of the selected week is as simple as Date.today().last().monday()

and so I wrote this but I tried the normal way first, so I did the Date.getDay(); method available already.

the aspx

<asp:TextBox ID=txtWeek runat=server ReadOnly=true Width=220></asp:TextBox>
&nbsp;&nbsp;
   <asp:ImageButton runat="Server" ID="imgBtnCalWeek"ImageUrl="~/Calendar_scheduleHS.png"
AlternateText="Click to show calendar"/>
   <ajaxToolKit:CalendarExtender ID="CalendarExtender1" 
TargetControlID="txtWeek"  runat="server" PopupButtonID=imgBtnCalWeek 
OnClientDateSelectionChanged =getWeek FirstDayOfWeek=Monday 
PopupPosition=BottomRight ></ajaxToolKit:CalendarExtender>

JavaScript

function getWeek(sender, args) {
            var startDate = new Date();
            var endDate = new Date();
            var selectedDate = new Date();
            selectedDate = sender._selectedDate;
            var d = getDayString(selectedDate.getDay());
            switch (d.toString()) {
                case "Sunday":
                    startDate = selectedDate.addDays(-6);
                    endDate = selectedDate;
                    break;
                case "Monday":
                    startDate = selectedDate;
                    endDate = selectedDate.addDays(6);
                    break;
                case "Tuesday":
                    startDate = selectedDate.addDays(-1);
                    endDate = selectedDate.addDays(5);
                    break;
                case "Wednesday":
                    startDate = selectedDate.addDays(-2);
                    endDate = selectedDate.addDays(4);
                    break;
                case "Thursday":
                    startDate = selectedDate.addDays(-3);
                    endDate = selectedDate.addDays(3);
                    break;
                case "Friday":
                    startDate = selectedDate.addDays(-4);
                    endDate = selectedDate.addDays(2);
                    break;
                case "Saturday":
                    startDate = selectedDate.addDays(-5);
                    endDate = selectedDate.addDays(1);
                    break;
                default:
                    selectedDate = new Date();

            }
            var link1 = startDate.addDays(-7);
            var link2 = startDate.addDays(-1);
            var link3 = endDate.addDays(1);
            var link4 = endDate.addDays(7);
            document.getElementById('txtWeek').value = startDate.toDateString() + " to " + endDate.toDateString();
         
        }
and
function getDayString(num) {
            var day;    //Create a local variable to hold the string
            switch (num) {
                case 0:
                    day = "Sunday";
                    break;
                case 1:
                    day = "Monday";
                    break;
                case 2:
                    day = "Tuesday";
                    break;
                case 3:
                    day = "Wednesday";
                    break;
                case 4:
                    day = "Thursday";
                    break;
                case 5:
                    day = "Friday";
                    break;
                case 6:
                    day = "Saturday";
                    break;
                default:
                    day = "Invalid day";
            }
            return day;
        }

and this is the function to add days

Date.prototype.addDays = function (days) {
            var dat = new Date(this.valueOf())
            dat.setDate(dat.getDate() + days);
            return dat;
        }

I got it from here http://stackoverflow.com/questions/563406/add-days-to-datetime-using-java-script
from a js guru.

Saturday, March 26, 2011

Literal

I found out something today the Literal control that we use so much with dynamic displays (at least I do) does not support cssClass.
I had a literal control and all I did was added class="msg" ...

<asp:Literal ID="litContactMsg" runat="server"></asp:Literal>

I tried this

<asp:Literal ID="litContactMsg" runat="server" class="msg"></asp:Literal>

and I got the error creating control message
and then i read http://msdn.microsoft.com/en-us/library/system.web.ui.literalcontrol.aspx
and it was some straight thinking that got me to the fact that its a container since it has the childcontrol property
well so what if it is....I mean hey ... there are others with children.... and then W3C showed up
see this..

http://www.w3schools.com/ASPNET/control_literal.asp




my God! its simple things that bowl you over.

Flip video

When you capture video from s phone, its not horizontal after you transfer it to the PC, I tried downloading softwares to flip videos but all the time, it was right there, in VLC player
I asked Mr.Google and I found this
 http://www.howtogeek.com/howto/14751/rotate-a-video-90-degrees-with-vlc-or-windows-live-movie-maker/

Friday, March 25, 2011

NamingContainer

This article here http://aspadvice.com/blogs/joteke/archive/2007/02/25/Understanding-the-naming-container-hierarchy-of-ASP.NET-databound-controls.aspx decribes the NamingContainer property.

When using a TemplateField in a GridView i.e. when you use... a checkbox to update the database OnCheckChanged of the checkbox


<asp:TemplateField HeaderText="active">
            <ItemTemplate>
            <asp:CheckBox ID=chkEmpActive AutoPostBack=true Checked='<%#Eval("active")%>' runat=server OnCheckedChanged=chkEmpActive_CheckedChanged />
            <asp:HiddenField ID=hidActive runat=server Value='<%#Eval("emp_id")%>' />
            </ItemTemplate>
 </asp:TemplateField>

its easier to have a hidden field with it;helps with the update and to find it,  the NamingContainer of the CheckBox can be used to get to the hiddenfield

when you do


protected void checkbox1_oncheckchange(object sender, EventArgs e)
{
    CheckBoc chk =(CheckBox)sender;
    GridViewRow row = (GridViewRow)chk.NaminConatiner;
    HiddenField hidEmp = (HiddenField)row.FindControl("hidActive");
    empNo = HiddenField.Value; // where empNo is a global var
}

you can use the empNo variable in JavaScript

<script>
var empno = <%=empNo%>

//and use it some calculations

</script>

I used the empNo to call an ASP page using the httpXml object and do some database operations





Monday, March 21, 2011

run query on DataSet


I had a stored procedure that returned indistinct data... like it returned
P1
CompanyProductTotal
C1P1T1
C1P2T2
C2P3T3
C2P4P4

I wanted a report like

Company 1
P1T1
P2T2
Company 1
P3T3
P4P4

instead of running a query on the database again and again, I wanted to do it using the table returned by the DataSet

using a datalist that has a grid in its template colum see http://www.aspdotnetcodes.com/GridView_Inside_DataList.aspx

Using the above technique ,
when binding the list

private void bindList()
        {
            string prevCo = "";
            DataTable table = new DataTable();
            table.Columns.Add("CompanyName");
            //get the companies
            //if 'Dictinct' could be run on the dataset, it would be cool
            foreach (DataRow row in mainDs.Tables[0].Rows)
            {
                if (prevCo == row["CompanyName"].ToString())
                {
                    //do nothin'
                }
                else
                {
                    DataRow dr = table.NewRow();
                    dr["CompanyName"] = row["CompanyName"].ToString();
                    table.Rows.Add(dr);
                }
                prevCo = row["CompanyName"].ToString();
            }
            table.AcceptChanges();

            DataList1.DataSource = table;
            DataList1.DataBind();
        }

and bind the grid on DataList's itemdatabound method

protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            GridView GridView1 = (GridView)e.Item.FindControl("GridView1");
            BindGrid(GridView1, DataList1.DataKeys[e.Item.ItemIndex].ToString());
        }

where datakeys[] is set to the company name.
<asp:DataList id=DataList1 runat=server DataKeyField="CompanyName" OnItemDataBound="DataList1_ItemDataBound" >

and

private void BindGrid(GridView GridView, string CompanyName)
        {

            DataTable table = new DataTable();
            table.Columns.Add("Sno");
            table.Columns.Add("ProductName");
            table.Columns.Add("Total");
            int counter = 1;
            foreach (DataRow row in mainDs.Tables[0].Rows)
            {
                if (row["CompanyName"].ToString() == CompanyName)
                {
                    DataRow dr1 = table.NewRow();
                    dr1["Sno"] = counter.ToString();
                    dr1["ProductName"] = row[0].ToString();
                    dr1["Total"] = row[2].ToString();
                    table.Rows.Add(dr1);
                }
                counter++;
            }
            table.AcceptChanges();

            GridView.DataSource = table;
            GridView.DataBind();
        }

Im sure this can be done better with Linq.
this seemed pretty easy in this scenario.

and there is also http://www.queryadataset.com/

UPDATE: you can download the source of the test site I created, and please make sure you have the nothwind database of the SQL server sample databases.
download : http://saudkhan.net/work/Web/dataListTest.rar

Sunday, March 13, 2011

CheckBox onmouseover and Classic ASP update DB

Im working on an old application in ASP 3.0. There is page that displays a grid (not GridView but a few Response.Writes with <TR><TD>...) A CheckBox (<input type... not <asp:...) is displayed on one of the colums that need have an updated database value. Thank heavens, the database contained a bit field and a checked or unchecked value is displayed depending on the database query results.In ASP (VB) .
The thing is I had to display a message layer (div) near (zindex=2) the cursor when the user moved the cursor near the CheckBox.
The CheckBox is contained in the layer. And with proper width you could display the message layer starting from anywhere until the containing layer goes.
One other thing is that a different message is to be displayed it the user is about to check or uncheck it.
This can be done by using the recordset retured value for the bit field that we are checking and name the div layer (container div) and checkbox with a leading 1 or 0 like this
<%
if CStr((rs("active").Value)) = CStr("True")) Then
Response.Write "<div id=div1 align=center style='width:25Px;height:30Px;background-color:Aqua' onmouseover=ShowContent('msg',this);  onmouseout=HideContent('msg'); ><input type=checkbox id=chk1 onmouseover=ShowContent('msg',this); onmouseout=HideContent('msg'); checked=checked/></div>"
Else

Response.Write "<div id=div0 align=center style='width:25Px;height:30Px;background-color:Aqua' onmouseover=ShowContent('msg',this);  onmouseout=HideContent('msg'); ><input type=checkbox id=chk0 onmouseover=ShowContent('msg',this); onmouseout=HideContent('msg');/></div>"
End if
%>

Then in JavaScript 
<script>
 var Xpos = 0; 
 var Ypos = 0;
 var cX = 0;
 var cY = 0;

//event to get mouse positions
 function GetMouse(e) {
    cX = e.pageX; cY = e.pageY;
 }

 function GetMouseForAll(e) {
     cX = event.clientX; cY = event.clientY;
 }
 if (document.all) {
     document.onmousemove = GetMouseForAll; 
 }
 else {
     document.onmousemove = GetMouse;
 }

 function ShowContent(d, chk) {
        if(d.length < 1) { return; } //error check if there is no div...that wont happen
        var dd = document.getElementById(d);
        AssignPosition(dd); //
        dd.style.display = "block";
        if(chk.id.indexOf("1")<=0)
        dd.innerHTML = 'Uncheck here to make user Active';
        else
        dd.innerHTML = 'Check here to make use InActive';
}
function HideContent(d) {
        if (d.length < 1) { return; } //error check if there is no div...that wont happen
        document.getElementById(d).style.display = "none";
}


function AssignPosition(d) {
//the self.pageXoffset willwork in firefox and chrome but for IE 
//documentelement.scrollLeft or right Im not so sure so please look it up
   Xpos = self.pageXOffset;
           Ypos = self.pageYOffset;
         
           d.style.left = (cX-180) + "px";
           d.style.top = (cY-100) + "px";
}

</script>


Add a div in the html page 

<div  id="msg" 
   style="display:none; position:absolute; background-color: purple; color=white; padding: 5px;">
   Activate/De-Activate user<br />for timesheet approval process
</div>

after this each time the chebox in checked we have to update the database
I simply did a form.submit()
but using httpXML stuff of ASP Classic is better
here is an awesome example that even demonstrates usage with google API's
here is the example learning example that I like

At the end of the day, thank god for ASP.NET 

Thursday, March 10, 2011

Hello world on monodroid

I started with monodroid recently . When you start you notice the programming structure is very different.
Droid stuff starts off with a Activity class. this is where the application starts, its like our very own program.cs.
Lets begin at the beginning
in visual studio 2010, the android template see installation instructions here : http://mono-android.net/Installation
visual studio writes a start up application for you. once you  run it http://mono-android.net/Tutorials/Hello_World
the emulator starts off and the program is deployed to the emulator.
I directly ran the code VS wrote, and it did come up with a decent looking program that had a button that counted the number of clicks.
The code in the class itself is not used for the UI, there is a Xaml file that is used for this purpose.
I will work on creating some UI and update  soon hopefully.

Saturday, February 19, 2011

gacutill

To install an assembly in the Global assembly cache (GAC) I simply used to copy the .dll into the assembly (C:\Windows\Assembly) folder; This was Windows XP.
On Windows 7 though, the drag and drop won't work, it can only be done by using the gacutil.
we can do this by running the command prompt as administrator navigate to the folder where the gacutil and type gacutl /i <assembly> like C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin> gacutil /i c:\myassembly.dll .
There is also Mscorcfg.msc (.NET Framework Configuration Tool)
You can also install dll into the gac using the windows installer. To install an assembly using the Windows Installer, create a new installer project and click on the menu View the File System. On the left hand side, right click and select "add global assembly cache folder", click on the GAC then in the right hand side click add. Browse to the assembly to be installed and compile the project.
This is probably most effective for windows applications and installations.

Monday, February 14, 2011

monodroid

Java was never my forte, I did some Java swing apps in college for academic purposes, and that was it, so I was kind of hesitant to try out Android development, I started off from this site http://developer.android.com/resources/tutorials/hello-world.html
Now there is this android development in .Net with C# :) http://monodroid.net/
and yes it can be done right from VS 2010 see here http://monodroid.net/Tutorials/Hello_World The thing is the process starts off with installing Android SDK and configuring a simulator and install the plugin see here http://monodroid.net/Installation

Mono for Android also offers the following:
  • The same OpenTK library popular among .NET developers on Windows, Linux, iPhone, allowing you to share the same OpenGL logic across platforms.
  • Support for the full JIT (unlike iOS)
  • Templates for C# (but other .NET compilers should work, if they reference MonoDroid's libraries).
  • Last, but certainly not least, MonoDroid is now supported on Mac OS X.
source : http://www.androidguys.com/2011/01/06/mono-android-open-developer-testing/

Friday, February 11, 2011

Custom Validator

There are two ways to use the custom validator, the client side validation and the server side. I think the server side keeps thing simple, I was using one on my form, and I intended to use it on the client side i.e. call a function in javascript with two parameters like

function validate(sender args)
{
      //validation code
      args.isValid=true; //or false
}
the validator itself has the OnClientValidate=validate()

I was saying the server validation does not slow thing its almost equal in time limit to the client validation.
The server side validation is similar have a validate function that returns isValid:

protected void validate(sender as Object, args as ServerValidateEventArgs)
{
//validation code
args.isValid = true // or false
}

I did put the validation into an update panel, like

<asp:ScriptManager ID="ScriptManager1" runat="server" />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="Error" ClientValidationFunction></asp:CustomValidator>
            <asp:CustomValidator ID="CustomValidator2" runat="server" ErrorMessage="Error" OnServerValidate></asp:CustomValidator>
....

Maybe that did something to the updation of the control 

Wednesday, February 9, 2011

Vanity GUIDs


Heard about Vanity GUIDs , Apparently these king of GUIds are ubiqu but have pattern to them embedded in their text . They can be used for Branded software (e.g., your company or product ID), Debugging (no idea) or humor read this article for more on C#411 . And you can see some code there to make them.
I foound a comment down there interesting
Mike writes:
You can't guarantee that a System.Guid will be globally unique either, to the point of it being fairly pointless using the Guid class to create a few billion GUIDs just to force retrieve what is essentially a manually created one anyway.
may god have mercy on your soul


Its usage might get a little offbeat.