Showing posts with label Leisure Pursuit. Show all posts
Showing posts with label Leisure Pursuit. Show all posts

Tuesday, December 11, 2012

" 'Model': object is null " error in Telerik RadSchedular

Recently I was using RadSchedular on an application page for SharePoint. I came across this weird problem on the navigation of the RadSchedular. i.e "Day", "Week", "Month" etc. I can switch it once, but afterwards I cannot switch it back. I noticed an script error shown in the browser as.

" Scriptresource.axd of the property 'Model': object is null "

So I googled and found a similar problem in the Telerik forum

http://www.telerik.com/community/forums/aspnet-ajax/scheduler/asp-updatepanel-and-radscheduler-issues.aspx

The Fix :

Add this tag to the telerik control.
EnableEmbeddedScripts="false"

Then in the OnInit function of the page, do this...
protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            ScriptManager scriptManager = ScriptManager.GetCurrent(Page);
            scriptManager.ScriptMode = ScriptMode.Debug;
            string telerikAssembly = typeof(RadScheduler).Assembly.FullName;
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.Core.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.jQuery.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.jQueryPlugins.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.Popup.PopupScripts.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Common.Navigation.NavigationScripts.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Menu.RadMenuScripts.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Menu.ContextMenu.RadContextMenuScripts.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Input.TextBox.RadInputScript.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Input.DateInput.RadDateInputScript.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Input.NumericTextBox.RadNumericInputScript.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadTimeViewScripts.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadCalendarCommonScript.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadCalendarScript.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadDatePicker.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Calendar.RadDateTimePickerScript.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.ComboBox.RadComboBoxScripts.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Helpers.DateTime.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.RadSchedulerScripts.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.RecurrenceEditor.RecurrenceEditor.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.ContextMenu.RadScheduler.ContextMenu.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Week.Model.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Week.GroupedByResource.Model.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Week.GroupedByDate.Model.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.MultiDay.Model.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.MultiDay.GroupedByResource.Model.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.MultiDay.GroupedByResource.Model.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Day.Model.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Day.GroupedByResource.Model.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Month.Model.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Month.GroupedByResource.Model.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Month.GroupedByDate.Model.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Timeline.Model.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByResource.Model.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByDate.Model.js", telerikAssembly));
            scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.Scheduling.AdvancedTemplate.js", telerikAssembly));
        }

For some reason I had to comment this line, It gave an error on the page load.
scriptManager.Scripts.Add(new ScriptReference("Telerik.Web.UI.Scheduler.ContextMenu.RadScheduler.ContextMenu.js", telerikAssembly));

Afterwards the navigation worked like a charm.


Updates : This issue was also solved by Update Sharepoint 2010.

Thursday, December 6, 2012

Honey_Bunny

I dont know how I came across this video. But seemed to cheer up my mood. Enjoy!


Lyrics at hello-honey-bunny-lyrics
Keeping this video for someone special.

Tuesday, December 4, 2012

E-Sports in Sri Lanka


This video was made by one of my clan mate (clan : n00b Alliance). The clips were taken at SLCG (Sri Lanka Cyber Games) 2012.

SLCG had lots of sponsors and a lot of competitors participating for games such as COD4, CS, NFS Most Wanted, Dota and some other console games. In Sri Lanka, COD4 is much more popular these days. There are plenty of clans that are into COD4.

For more information about Sri Lankan E-Sports, Surf to http://gamer.lk/

I am not in the gaming scene anymore though... But I do have all the gaming gear i'll ever need ;-) .
n00b!

Something Worth Watching



For some reason, This made my day. Was wondering what I am doing with my life after watching this. The song played here is by "Roger Hodgson" with the title "Give a little bit". Chilling song....

Enjoy

Sunday, January 8, 2012

Connecting a phpMyAdmin DB to Eclipse

This is a small tutorial on how to connecting a phpMyAdmin database to Eclipse.
Things you need - Eclipse , mySQLConnectorJXAMPP

Step 1
Once you install XAMPP, Open the install folder. There you will find 'xampp-control.exe' . Open it configure it to the following setting. Apache and Mysql are initiated by their start buttons.



Go to your browser, type 'localhost' to the address bar. Then click phpMyAdmin on the left side bar.

In the phpMyAdmin page, you are able to create the database of what you want and the tables necessary.

For more help -
InstallingConfiguringDevelopingWithXAMPP

Step 2
Open Eclipse. Create a project in where you want to connect to the database. Right click the project file > Build Path > Add External Archives

From the selection window, select the 'mysql-connector-java-5.1.18-bin.jar' file in the mySQLConnectorJ folder. (You may have a different version of the jar file)

Step 3
The code below is a class I made in connecting to a database in XAMPP.

//THE_CODE

package database;
import java.sql.Connection;
import java.sql.DriverManager;

public final class Connect {
private Connection conn;
public Connect(){
conn = null;
try{
String userName = "root";
String password = "";
String url = "jdbc:mysql://localhost/shop";
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
conn = DriverManager.getConnection(url, userName, password);
}
catch(Exception e){
System.out.println("Exception found");
}
}
public Connection getConnection(){
return conn;
}
public void closeConnection(){
try{
conn.close ();
}catch (Exception e) {
System.out.println ("Connection close error");
}
}
}


//DESCRIPTION
The code below is the main part in connecting to the database.


String userName = "root";
String password = "";
String url = "jdbc:mysql://localhost/shop";
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
conn = DriverManager.getConnection(url, userName, password);

The Strings userName and password are the username and password for the database.
"shop" mentioned there is the name of the database.
To execute SQL statements, follow the tutorial link given below -
http://www.kitebird.com/articles/jdbc.html

*Remember to close the connection after using it. The closeConnection function will execute it.

Hope all this is clear for you. :D

GO_HOME ?

As I was in the informatics Olympiad training pool sometime back. I used to be addicted in solving problems. This post is one such problem I solved on the 5th of May 2011 when I was bored. The problem is where a maze is given and a path needs to be found from a given source and a destination. The code was developed in 'Dev C++' .

//THE_CODE!!!!!

#include<iostream>
using namespace std;

const int mapWidth =10;
const int mapHeight=10;
char map[mapHeight][mapWidth]={' '};
int startY ;
int startX ;
int height, width;
int pathSteps=0;
int steps=0;
int tempSteps=0;
 
void displayMap(){
     for(int i=0;i<height;i++){
            for(int k=0;k<width;k++){
                    cout << map[i][k] ;
            }      
            cout << endl;
    }  
}

bool maze(int y, int x){
     if(y<0 || x<0 || y>height-1 || x>width-1){
            return false;    
     }  
     if(map[y][x]=='*' || map[y][x]=='d' ){
            return false;                            
     }
     if(y==startY && x==startX){
            return false;                
     }
     if(map[y][x]=='h'){
            cout << "FOUND! " << endl;
            return true;                            
     }
   
     map[y][x]='d';
     steps++;
   
     if(maze(y, x+1)){
            return true;        
     }
     if(maze(y+1, x)){
            return true;        
     }
     if(maze(y, x-1)){
            return true;        
     }
     if(maze(y-1, x)){
            return true;        
     }
     steps--;
     return false;
}


int main(){
    cin >> width;
    cin >> height;
    for(int i=0;i<height;i++){
            for(int k=0;k<width;k++){
                    cin >> map[i][k] ;
                    if(map[i][k]=='s'){
                              startY=i;
                              startX=k;                          
                    }
            }      
    }
    //displayMap();
    maze(startY, startX+1);
    tempSteps = steps;
    maze(startY+1, startX);
    if(steps<tempSteps){
            tempSteps = steps;                  
    }
    maze(startY-1, startX);
    if(steps<tempSteps){
            tempSteps = steps;                  
    }
    maze(startY, startX-1);
    if(steps<tempSteps){
            tempSteps = steps;                  
    }
    if(steps==0){
            cout << "NO PATH TO HOME!" <<  endl;          
    }else{
          cout << "Steps = " << steps << endl;
    }
    system("PAUSE");
    return 0;
}

//THE_INPUT
"
10
10
**********
*s****xx**
*x**xxx***
*xxxx*x***
*x****x***
*x****xx**
***hxxx***
**********
**********
**********
"

's' is the source;
'h' is destination;
'*' are blocks which cannot go through;
'x' are independent paths;

*Enter the above without quotes

//THE_OUTPUT


The output for the following maze, the number of steps needed to reach from 's' to 'd' is 14.

//DESCRIPTION
The solution is made using recursion. Rather than using 'for' loops, I thought it would be interesting to find the solution using recursion. The maze function solves the maze using each possible path. This algorithm does not find the shortest path.



FLASHY ENUF_?

As my life is almost being online on the internet, most of the time is spent on Facebook and Youtube. Recently I hit an interesting social entertainment known as a "Flash Mob". Flash mobs is where a group of people gather unexpectedly in public places performing an entertainment act.  I also checked Wikipedia, they say that is it an "pointless act". But I beg to differ. It is one of the most COOLEST things I've seen on my life. After watching videos of flash mobs in youtube so much, I hope to join a flash job later on ;) . I also noticed the it is kind of embarrassing at the start. But later on it gets better and better. Some of my favorite flash mob videos are linked here..




much love <3

Saturday, January 7, 2012

QR Code

Recently I noticed there are these weird looking square images used in banners, advertisements in the internet and as well as on the road. So I did some research on it and was able to find out what it is. Its called a QR Code.

qrcode

QR code stands for quick response code. This was used by the Toyota company to track vehicles in the manufacturing process in 1994.

I believe it seems to be a quick way to send messages using a security facility.
The internet has websites in encoding and decoding the QR Code.

Encoder - http://qrcode.kaywa.com/

Decoder - http://zxing.org/w/decode.jspx

This may be useful some day.... ;=)

Vertigo Cinema

I am currently in a team of people creating frag movies names "Vertigo Cinema". You may be wondering what frag movies are. They are actually a movie made up of game-plays of a games. These movies are created using different softwares such as Sony Vegas, Fraps, VDub, etc.

This is frag movie of a Call of Duty 4 player named robbye.


A frag movie by me... :)

WHOSE_TAIL?

I know the television can bring many weird and bad ideas. This is one of them. Cocktails!!!. Cocktails are alcoholic mixed drinks usually containing more than one ingredient. I still haven't consumed any cocktail in my life yet. But for now, I must say that there are some really interesting cocktails out there in the world. I will share 2 of my favorite cocktails for now.

The Grasshopper...


The grasshopper is a sweet, mint-flavored drink.
The recipe -


  • 3/4 oz green creme de menthe
  • 3/4 oz white creme de cacao
  • 3/4 oz light cream

Tequila Sunrise..
The Tequila Sunrise is considered a long drink with the sweetness of orange.
The recipe - 
  • 4 oz orange juice
  • 2 oz tequila
  • 1/2 oz grenadine
  • orange slice for garnish
  • maraschino cherry for garnish


Dont think anything bad of this :P  . But sometimes in life, you just gotta enjoy whats out there.