Monday, 9 September 2013

Setting ToolTip for DataGridView automatically created columns

Setting ToolTip for DataGridView automatically created columns

I would like to programatically set tooltips to automatically generated
columns in a DataGridView. I was trying to use AutoGeneratingColumn event
(http://msdn.microsoft.com/en-us/library/cc903950%28VS.95%29.aspx), but
that in fact can only access DataGridColumn, not DataGridViewColumn, and
the former doesn't have ToolTipText property.
Or if I could bind the ToolTips to a source that would also be great. The
goal is to have the ability to manipulate/set tooltips in the same place
where I set the columns for the underlying DataTable.

Login with facebook error, codeigniter invalid url

Login with facebook error, codeigniter invalid url

I am working on a project. I want the user login with facebook. But after
the facebook authentication, I get this error:
Given URL is not allowed by the Application configuration.: One or more of
the given URLs is not allowed by the App's settings. It must match the
Website URL or Canvas URL, or the domain must be a subdomain of one of the
App's domains.
I searched on Google for a long time and everytime I get this answer that
there may be a problem in my facebook application domain name.
I changed my fb application again and again but everytime I get the same
error.
Some settings of my facebook application are:
App Domains: superhitdomains.com
Site URL: http://superhitdomains.com
My view page is :
Login with facebook
and my controller is:
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Social extends CI_Controller {
public function __construct(){
parent::__construct();
parse_str( $_SERVER['QUERY_STRING'], $_REQUEST );
$CI = & get_instance();
$CI->config->load("facebook",TRUE);
$config = $CI->config->item('facebook');
$this->load->library('Facebook', $config);
}
public function fb_request(){
$userId = $this->facebook->getUser();
if($userId == 0){
$data = array(
'redirect_uri'=> base_url().'social/handle_user_fb_login',
'scope'=>'email'
);
redirect($this->facebook->getLoginUrl($data));
//print_r($data); exit;
}
else {
// Get user's data and print it
$user = $this->facebook->api('/me');
print_r($user);
}
}
public function handle_user_fb_login(){
$userId = $this->facebook->getUser();
if($userId !=0){
$user = $this->facebook->api('/me');
print_r($user);
}
else {
echo 'could not connected with facebook';
}
}
}
Can anyone help me what is wrong with my code?
Thanks

Sunday, 8 September 2013

Android Turn Based Game Multiplayer Suggesstion

Android Turn Based Game Multiplayer Suggesstion

i am new in android.
i am making a very simple android turn based game its UI will be like
this. UI Image
Game Concept:
it is a two player game.
Each user place his turn to make the winning sequence.
I want to make this game multiplayer.i want very simple and easy solution.
because it just need only button position to send to other user.
So far i searched there are lot of solutions
Stackmob, Parse, Kinvey, AppEngine
Similar Question but they all look very difficult to me i am confused
please please help me give the suggestion what will be the simplest
solution to accomplish this task??

Shopping bill recognition application OpenCV:Exctact only the bill from the image

Shopping bill recognition application OpenCV:Exctact only the bill from
the image

i have to write a openCV application to extract certain part from an image
(shopping bill). Im not sure which filters or functions i should use to
accomplish this (i.e removing the background noise such as hands).Can some
one give me some hint on which functions and filters will work best to
remove such background noise and to extract the shopping bill part from
the image.
Thanks

Knockout rebinding resets the HTML

Knockout rebinding resets the HTML

With knockout, if a rebinding takes place, why is the HTML reset to its
initial state? Look at the following code
(http://jsfiddle.net/mgs_jsfiddle/KNnmC/)
<div data-bind="with: person">
<p>person <input type="text" data-bind="value: firstName"/></p>
</div>
<div>
<a href="#" data-bind="click: moveNext">moveNext</a>
</div>
$(function() {
function ViewModel() {
var self = this;
self.person = ko.observable({ firstName: "first"});
self.moveNext = function() {
self.person({ firstName: "second"});
};
};
ko.applyBindings(new ViewModel());
$("input").css("background-color", "#ffff00");
});
If the anchor is clicked, the input element looses its background color.
Why isn't just the value changed?

Android NullPointerException while retrieving data from SQLite Database and storing it in an Array

Android NullPointerException while retrieving data from SQLite Database
and storing it in an Array

I am trying to retrieve string data from a column in database and insert
into a string array in android. I have used the following code to retrieve
data - (helper.java)
public String[] personslist() {
// TODO Auto-generated method stub
int i=0;
Cursor c=myDataBase.rawQuery("select PersonName from
Persons;",null);
String[] values = {};
for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext()) {
values[i] = c.getString(c.getColumnIndex("PersonName"));
i++;
}
return values;
}
I have used the following code in "adapter.java" class to return the data
returned by personslist().
public String[] plist() {
// TODO Auto-generated method stub
String[] persons = mDbHelper.personslist(); //this is line no. 131 in
adapter class
return persons;
}
While I am running the application, it is getting crashed and showwing the
following error
09-08 08:23:19.715: E/AndroidRuntime(29373): Caused by:
java.lang.NullPointerException
09-08 08:23:19.715: E/AndroidRuntime(29373): at
com.example.fromstart.adapter.plist(adapter.java:131)
The query, when run on sqlitebrowser, it returns four rows of four persons
names. But, while running on an application, it is returning
NullPointerException. Can you please suggest me, where I might have gone
wrong?
Thanks in advance.

rbenv shell not command

rbenv shell not command

rbenv installed. but rbenv shell not command.
ationtekiMacBook-Air:~ dation$ rbenv versions
system
* 2.0.0-p247 (set by /Users/dation/.ruby-version)
dationtekiMacBook-Air:~ dation$ rbenv version
2.0.0-p247 (set by /Users/dation/.ruby-version)
dationtekiMacBook-Air:~ dation$ rbenv shell
rbenv: no such command `shell'



ationtekiMacBook-Air:~ dation$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]