change contents of error output in ELMAH
I am trying to figure out if there is a way to hook into elmah in such a
way that I change the detail of the logged messages without explicitly
catching them all.
I would like to log the contents of DbEntityValidationException.
I would need to access the EntityValidationErrors property of the
exception, and log the details in the exception message. Is there a
mechanism for this.
Saturday, 31 August 2013
Generating unique token on the fly with Rails
Generating unique token on the fly with Rails
I want to generate a token in my controller for a user in the
"user_info_token" column. However, I want to check that no user currently
has that token. Would this code suffice?
begin
@new_token = SecureRandom.urlsafe_base64
user = User.find_by_user_info_token(@new_token)
end while user != nil
@seller.user_info_token = @new_token
Or is there a much cleaner way to do this?
I want to generate a token in my controller for a user in the
"user_info_token" column. However, I want to check that no user currently
has that token. Would this code suffice?
begin
@new_token = SecureRandom.urlsafe_base64
user = User.find_by_user_info_token(@new_token)
end while user != nil
@seller.user_info_token = @new_token
Or is there a much cleaner way to do this?
php - storing value returned by a prepared statement
php - storing value returned by a prepared statement
$query= "SELECT pass FROM USER WHERE email= ?;";
if($stmt= $this->con->prepare($query))
{ $stmt->bind_param('s', $un);
$stmt->execute();
$stmt->bind_result($db_hash);
}
the query would return 'pass'. How can i Store pass into a variable?
Like $abc = 'pass';
$query= "SELECT pass FROM USER WHERE email= ?;";
if($stmt= $this->con->prepare($query))
{ $stmt->bind_param('s', $un);
$stmt->execute();
$stmt->bind_result($db_hash);
}
the query would return 'pass'. How can i Store pass into a variable?
Like $abc = 'pass';
Passing selected value of a listbox to another listbox in google-apps-script
Passing selected value of a listbox to another listbox in google-apps-script
I am building a google apps UI and I am having trouble determining the
value of an item in one listbox from the call back event in a separate
listbox. I tried passing hidden events but this did not work out. How do I
pass the selected grade to _clickCourse
This is a rough description of the code in english:
1) Populate the first listbox with all available unique grades 2) Attach a
function to be triggered when the content of the grade listbox changes 3)
In the function created in 2, I know the selected grade via the even, use
that info to filter on the correct courses, populate the course listbox
with the valid courses. 4) Attach a callback function to the courses
listbox 5) Inside this function, filter on the selected grade + selected
course to determine the valid semesters.
... The issue is that the last Function knows the selected course via the
event that google UI passed to it, but it does not know the selected
grade.
Sample Data:
Grade Semester Course Unit
1 1 Chemistry101 Chemistry
3 2 Physics321 Physics
2 1 Chemistry101 Chemistry
function executionStartsHere() {
var doc = SpreadsheetApp.getActiveSpreadsheet();
var app = UiApp.createApplication().setTitle('Course Planner');
var panel = app.createVerticalPanel();
panel.setId("main-panel");
//grades
panel.add(_getLabel("Grades"));
uniqueGrades = _findUniqueGrades();
gradeListBox = _getListBox(app,uniqueGrades,"grade-listbox","grades");
var gradeHandler = app.createServerHandler('_clickGrade');
gradeListBox.addChangeHandler(gradeHandler);
panel.add(gradeListBox);
//courses
panel.add(_getLabel("Courses"));
courseListBox = _getListBox(app,{},"course-listbox","courses");
var courseHandler = app.createServerHandler('_clickCourse');
courseListBox.addChangeHandler(courseHandler);
panel.add(courseListBox);
//semester
panel.add(_getLabel("Semester"));
semesterListBox = _getListBox(app,{},"semester-listbox","semesters");
panel.add(semesterListBox);
h = app.createHidden("selectedGrade").setId("selectedGrade");
h.setValue("1");
panel.add(h);
//finally
app.add(panel);
doc.show(app);
}
function _clickGrade(eventInfo) {
var app = UiApp.getActiveApplication();
// get value of ListBox based on name
var selectedGrade = eventInfo.parameter.grades;
Logger.log("In clickGrade, selected:"+selectedGrade);
//eventInfo.parameter.selectedGrade=selectedGrade;
app.getElementById("selectedGrade").setValue(selectedGrade);
Logger.log("eventInfo.parameter.selectedGrade:
"+eventInfo.parameter.selectedGrade);
_displayCourses(selectedGrade);
return app;
}
function _clickCourse(eventInfo) {
//WE NEED TO SOMEHOW PASS THE SELCTED GRADE IN HERE
var app = UiApp.getActiveApplication();
var grade = app.getElementById("selectedGrade")
var grade2 = eventInfo.parameter.selectedGrade;
var course = eventInfo.parameter.courses;
Logger.log("Selected grade, grade2, course: "+grade+" ,"+grade2+"
,"+course);
_displaySemesters(grade,course);
return app;
}
function _displayCourses(grade) {
var app = UiApp.getActiveApplication();
validCourses = _findValidCourses(grade);
lb = app.getElementById("course-listbox");
_populateListBox(lb,validCourses);
}
function _displaySemesters(grade,course){
var app = UiApp.getActiveApplication();
validSemesters = _findValidSemesters(grade,course);
lb = app.getElementById("semester-listbox");
_populateListBox(lb,validSemesters);
}
function _findUniqueGrades(){
var workBook = _getWorkBook();
var sheet = _getLearningOutcomeSheet(workBook);
var graderows = getColumnAsArray(sheet, 1);
var grades= {};
for(var i=1; i<graderows.length; i++) { //skip the first row (labels)
if(graderows[i] != "" && graderows[i] != undefined ) {
grades[graderows[i]]=graderows[i];
}
}
return grades;
}
function _findValidCourses(grade) {
var workBook = _getWorkBook();
var sheet = _getLearningOutcomeSheet(workBook);
var graderows = getColumnAsArray(sheet, 1);
var courserows = getColumnAsArray(sheet, 3);
// loop over courserows
// if the grade for this courserow matches the grade we are searching for
// then store this courserow in an associative array
validCourses = {};
for(var i=0; i< courserows.length; i++) {
if ( graderows[i] == grade ) {
validCourses[courserows[i]] = courserows[i];
}
}
return validCourses;
}
function _findValidSemesters(grade,course){
var workBook = _getWorkBook();
var sheet = _getLearningOutcomeSheet(workBook);
var graderows = getColumnAsArray(sheet, 1);
var courserows = getColumnAsArray(sheet, 3);
var semesterrows = getColumnAsArray(sheet, 2);
validSemesters = {};
for(var i=0; i< semesterrows.length; i++){
if ( courserows[i] == course && graderows[i] == grade ){
validSemesters[semesterrows[i]] = semesterrows[i];
}
}
return validSemesters;
}
function _getListBox(app,items,id,label){
var lb = app.createListBox().setId(id).setName(label);
lb.setVisibleItemCount(1);
//add items, if any
for each ( i in items) {
lb.addItem(i);
}
return lb;
}
function _populateListBox(listBox,items){
listBox.clear();
Logger.log("ListBox ID: "+ listBox.getId());
for each ( i in items) {
Logger.log("adding item: " + i);
listBox.addItem(i);
}
}
function _getWorkBook(){
return SpreadsheetApp.openById(employee_SPREADSHEET);
}
function _getLearningOutcomeSheet(workBook){
return workBook.getSheets()[0];
}
function _getLabel(string){
var app = UiApp.getActiveApplication();
return app.createLabel(string);
}
function getColumnAsArray(sheet,column) {
var dataRange = sheet.getRange(1,column,99,1);
var data = dataRange.getValues()
//Logger.log("column values: " + data);
return data;
}
I am building a google apps UI and I am having trouble determining the
value of an item in one listbox from the call back event in a separate
listbox. I tried passing hidden events but this did not work out. How do I
pass the selected grade to _clickCourse
This is a rough description of the code in english:
1) Populate the first listbox with all available unique grades 2) Attach a
function to be triggered when the content of the grade listbox changes 3)
In the function created in 2, I know the selected grade via the even, use
that info to filter on the correct courses, populate the course listbox
with the valid courses. 4) Attach a callback function to the courses
listbox 5) Inside this function, filter on the selected grade + selected
course to determine the valid semesters.
... The issue is that the last Function knows the selected course via the
event that google UI passed to it, but it does not know the selected
grade.
Sample Data:
Grade Semester Course Unit
1 1 Chemistry101 Chemistry
3 2 Physics321 Physics
2 1 Chemistry101 Chemistry
function executionStartsHere() {
var doc = SpreadsheetApp.getActiveSpreadsheet();
var app = UiApp.createApplication().setTitle('Course Planner');
var panel = app.createVerticalPanel();
panel.setId("main-panel");
//grades
panel.add(_getLabel("Grades"));
uniqueGrades = _findUniqueGrades();
gradeListBox = _getListBox(app,uniqueGrades,"grade-listbox","grades");
var gradeHandler = app.createServerHandler('_clickGrade');
gradeListBox.addChangeHandler(gradeHandler);
panel.add(gradeListBox);
//courses
panel.add(_getLabel("Courses"));
courseListBox = _getListBox(app,{},"course-listbox","courses");
var courseHandler = app.createServerHandler('_clickCourse');
courseListBox.addChangeHandler(courseHandler);
panel.add(courseListBox);
//semester
panel.add(_getLabel("Semester"));
semesterListBox = _getListBox(app,{},"semester-listbox","semesters");
panel.add(semesterListBox);
h = app.createHidden("selectedGrade").setId("selectedGrade");
h.setValue("1");
panel.add(h);
//finally
app.add(panel);
doc.show(app);
}
function _clickGrade(eventInfo) {
var app = UiApp.getActiveApplication();
// get value of ListBox based on name
var selectedGrade = eventInfo.parameter.grades;
Logger.log("In clickGrade, selected:"+selectedGrade);
//eventInfo.parameter.selectedGrade=selectedGrade;
app.getElementById("selectedGrade").setValue(selectedGrade);
Logger.log("eventInfo.parameter.selectedGrade:
"+eventInfo.parameter.selectedGrade);
_displayCourses(selectedGrade);
return app;
}
function _clickCourse(eventInfo) {
//WE NEED TO SOMEHOW PASS THE SELCTED GRADE IN HERE
var app = UiApp.getActiveApplication();
var grade = app.getElementById("selectedGrade")
var grade2 = eventInfo.parameter.selectedGrade;
var course = eventInfo.parameter.courses;
Logger.log("Selected grade, grade2, course: "+grade+" ,"+grade2+"
,"+course);
_displaySemesters(grade,course);
return app;
}
function _displayCourses(grade) {
var app = UiApp.getActiveApplication();
validCourses = _findValidCourses(grade);
lb = app.getElementById("course-listbox");
_populateListBox(lb,validCourses);
}
function _displaySemesters(grade,course){
var app = UiApp.getActiveApplication();
validSemesters = _findValidSemesters(grade,course);
lb = app.getElementById("semester-listbox");
_populateListBox(lb,validSemesters);
}
function _findUniqueGrades(){
var workBook = _getWorkBook();
var sheet = _getLearningOutcomeSheet(workBook);
var graderows = getColumnAsArray(sheet, 1);
var grades= {};
for(var i=1; i<graderows.length; i++) { //skip the first row (labels)
if(graderows[i] != "" && graderows[i] != undefined ) {
grades[graderows[i]]=graderows[i];
}
}
return grades;
}
function _findValidCourses(grade) {
var workBook = _getWorkBook();
var sheet = _getLearningOutcomeSheet(workBook);
var graderows = getColumnAsArray(sheet, 1);
var courserows = getColumnAsArray(sheet, 3);
// loop over courserows
// if the grade for this courserow matches the grade we are searching for
// then store this courserow in an associative array
validCourses = {};
for(var i=0; i< courserows.length; i++) {
if ( graderows[i] == grade ) {
validCourses[courserows[i]] = courserows[i];
}
}
return validCourses;
}
function _findValidSemesters(grade,course){
var workBook = _getWorkBook();
var sheet = _getLearningOutcomeSheet(workBook);
var graderows = getColumnAsArray(sheet, 1);
var courserows = getColumnAsArray(sheet, 3);
var semesterrows = getColumnAsArray(sheet, 2);
validSemesters = {};
for(var i=0; i< semesterrows.length; i++){
if ( courserows[i] == course && graderows[i] == grade ){
validSemesters[semesterrows[i]] = semesterrows[i];
}
}
return validSemesters;
}
function _getListBox(app,items,id,label){
var lb = app.createListBox().setId(id).setName(label);
lb.setVisibleItemCount(1);
//add items, if any
for each ( i in items) {
lb.addItem(i);
}
return lb;
}
function _populateListBox(listBox,items){
listBox.clear();
Logger.log("ListBox ID: "+ listBox.getId());
for each ( i in items) {
Logger.log("adding item: " + i);
listBox.addItem(i);
}
}
function _getWorkBook(){
return SpreadsheetApp.openById(employee_SPREADSHEET);
}
function _getLearningOutcomeSheet(workBook){
return workBook.getSheets()[0];
}
function _getLabel(string){
var app = UiApp.getActiveApplication();
return app.createLabel(string);
}
function getColumnAsArray(sheet,column) {
var dataRange = sheet.getRange(1,column,99,1);
var data = dataRange.getValues()
//Logger.log("column values: " + data);
return data;
}
Preg match text php dont work
Preg match text php dont work
Hello I would like to use preg_match I have it, why don't work?
$source = "<span class=\"middle\">".
"<span class=\"play\"></span>".
"<img width=\"114\"
src=\"http://i.ytimg.com/vi/PnmEKNi1DtY/default.jpg\" alt=\"\"></span>
1";
preg_match("'<span class=\"middle\"><span class=\"play\"></span> <img
width=\"114\" src=\"http://i.ytimg.com/vi/(.*?)/default.jpg\"
alt=\"\"></span> 1'si", $source, $match);
foreach($match[1] as $val)
{
echo $val."<br>";
}
Outputs:
Warning: Invalid argument supplied for foreach()
Hello I would like to use preg_match I have it, why don't work?
$source = "<span class=\"middle\">".
"<span class=\"play\"></span>".
"<img width=\"114\"
src=\"http://i.ytimg.com/vi/PnmEKNi1DtY/default.jpg\" alt=\"\"></span>
1";
preg_match("'<span class=\"middle\"><span class=\"play\"></span> <img
width=\"114\" src=\"http://i.ytimg.com/vi/(.*?)/default.jpg\"
alt=\"\"></span> 1'si", $source, $match);
foreach($match[1] as $val)
{
echo $val."<br>";
}
Outputs:
Warning: Invalid argument supplied for foreach()
SslStream check data available
SslStream check data available
A while ago i wrote some basic Http webserver in vb.net. I tried to avoid
blocking IO, so basically i made one polling thread for all current
connections.
While True
For Each oNetworkstream In lstNetworkstream
If oNetworkstream.DataAvailable Then
'Read from stream
End If
Next
End While
So whenever a connection had some new data, i could read it, otherwise
immediately check the next connection.
Now i'm extending the webserver with https. Therefore, i used the .Net
SslStream Class. I would like to apply the same principle (one polling
thread to read all streams)
Since there is no .DataAvailable property, i tried width .Length > 0, but
this gives a NotSupportedException (This stream does not support seek
operations)
Dim oSslStream As New SslStream(oStream, False)
oSslStream.AuthenticateAsServer(moCertificateKeyPair)
MsgBox(oSslStream.Length)
So, how could i determine if a certain decrypted stream has data available
without blocking the thread?
A while ago i wrote some basic Http webserver in vb.net. I tried to avoid
blocking IO, so basically i made one polling thread for all current
connections.
While True
For Each oNetworkstream In lstNetworkstream
If oNetworkstream.DataAvailable Then
'Read from stream
End If
Next
End While
So whenever a connection had some new data, i could read it, otherwise
immediately check the next connection.
Now i'm extending the webserver with https. Therefore, i used the .Net
SslStream Class. I would like to apply the same principle (one polling
thread to read all streams)
Since there is no .DataAvailable property, i tried width .Length > 0, but
this gives a NotSupportedException (This stream does not support seek
operations)
Dim oSslStream As New SslStream(oStream, False)
oSslStream.AuthenticateAsServer(moCertificateKeyPair)
MsgBox(oSslStream.Length)
So, how could i determine if a certain decrypted stream has data available
without blocking the thread?
validate dynamically created textbox to enter only numbers
validate dynamically created textbox to enter only numbers
I have created textbox dynamically which goes on adding on button click
which is working fine, but now I want to validate that each textbox which
is dynamically created should take only numerical data as input. how can I
do that. I have not used jquery to create textbox dynamically but used C#
in asp.net.
I am new to this I have no Idea, Please help me doing this as it is urgent.
I have created textbox dynamically which goes on adding on button click
which is working fine, but now I want to validate that each textbox which
is dynamically created should take only numerical data as input. how can I
do that. I have not used jquery to create textbox dynamically but used C#
in asp.net.
I am new to this I have no Idea, Please help me doing this as it is urgent.
Friday, 30 August 2013
I can't erase the gap between the image div and my header which contains my nav?
I can't erase the gap between the image div and my header which contains
my nav?
Here is the relevant html (with the image at the top of my page and then
the header containing my nav: `
</style>
<body>
<div id="wrapper">
<ul id="nav">
<li class="current"><a href="http://www.webdesignerwall.com">Home</a></li>
<li><a href="http://www.ndesign-studio.com">Sports</a>
<ul>
<li><a href="#">NFL========></a>
<ul>
<li><a href="http://www.nfl.com/teams">Teams</a></li>
<li><a href="http://www.nfl.com/standings">Tables</a></li>
<li><a href="http://www.nfl.com/news">News</a></li>
<li><a
href="http://www.nfl.com/fantasyfootball">Fantasy</a></li>
<li><a href="#">Discuss</a></li>
</ul>
</li>
<li><a href="#">NBA========></a>
<ul>
<li><a href="http://www.nba.com/teams/">Teams</a></li>
<li><a
href="http://www.nba.com/standings/team_record_comparison/conferenceNew_Std_Cnf.html">Standings</a></li>
<li><a href="http://www.nba.com/news/">News</a></li>
<li><a href="http://www.nba.com/fantasy/">Fantasy</a></li>
<li><a href="#">Discuss</a></li>
</ul>
</li>
<li><a href="#">Football=====></a>
<ul>
<li><a
href="http://www.premierleague.com/en-gb.html">BPL</a></li>
<li><a
href="http://www.premierleague.com/en-gb/matchday/league-table.html">BPL
Table</a></li>
<li><a
href="http://www.bbc.co.uk/sport/football/tables">Tables</a></li>
<li><a
href="http://www.bbc.co.uk/sport/0/football/">News</a></li>
<li><a
href="http://fantasy.premierleague.com/">Fantasy</a></li>
</ul>
</li>
<li><a href="#">Cricket======></a>
<ul>
<li><a href="http://www.ecb.co.uk/">England</a></li>
<li><a
href="http://www.bbc.co.uk/sport/cricket/county-championship-division-one/table">Table</a></li>
<li><a
href="http://www.bbc.co.uk/sport/0/cricket/">News</a></li>
<li><a href="http://www.cricket20.com/">T20</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Games</a>
<ul>
<li><a href="#">Populars====></a>
<ul>
<li><a href="#">game1</a></il>
<li><a href="#">game2</a></il>
<li><a href="#">game3</a></il>
<li><a href="#">game4</a></il>
<li><a href="#">game5</a></il>
</ul>
</il>
<li><a href="#">Recent=====></a>
<ul>
<li><a href="#">game1</a></il>
<li><a href="#">game2</a></il>
<li><a href="#">game3</a></il>
<li><a href="#">game4</a></il>
<li><a href="#">game5</a></il>
</ul>
</il>
<li><a href="#">Categories</a></li>
</ul>
</li>
<li><a href="#">Cool Shit</a>
<ul>
<li><a href="#">Populars====></a>
<ul>
<li><a href="#">thing1</a></il>
<li><a href="#">thing2</a></il>
<li><a href="#">thing3</a></il>
<li><a href="#">thing4</a></il>
<li><a href="#">thing5</a></il>
</ul>
</il>
<li><a href="#">Recent=====></a>
<ul>
<li><a href="#">game1</a></il>
<li><a href="#">game2</a></il>
<li><a href="#">game3</a></il>
</ul>
</il>
<li><a href="#">The Rest</a></li>
</ul>
</li>
<li><a href="#">Forums</a></li>
<li><a href="#">Music</a></li>
<li><a href="#">Contact Us</a></li>
</ul><!-- End Nav -->
</header><!-- End Header -->`
And this is the css which effects the nav and above:
/* Body
--------------------------------------------*/
body {
font: normal .8em/1.5em Arial, Helvetica, sans-serif;
background: #ebebeb;
width: 1200px;
margin: 100px auto;
color: #666;
}
#wrapper {
background-color: #ccc;
margin: 0;
width: 1200px;
display: block;
padding: 0;
}
/* Header
--------------------------------------------*/
header {
background-color: #170a6e;
height: 100px;
width: 1200px;
margin: 0;
padding: 0;
}
header h1 {
font-size: 4.5em;
float: left;
margin: 20px;
padding: 5px;
}
#something {
text-align: center;
padding: 0;
margin: 0;
display: block;
}
#title {
float: left;
margin-left: 25px;
margin-top: 11px;
}
/* Nav
--------------------------------------------*/
#nav {
margin: 0;
padding: 7px 6px 0;
line-height: 100%;
-webkit-border-top-left-radius: 2em;
-moz-border-radius-topleft: 2em;
-webkit-border-top-right-radius: 0;
-moz-border-radius-topright: 0;
-webkit-border-bottom-left-radius: 2em;
-moz-border-radius-bottomleft: 2em;
-webkit-border-bottom-right-radius: 0;
-moz-border-radius-bottomright: 0;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
alignment-adjust: central;
background: #0e0575; /* for non-css3 browsers */
filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr='#a9a9a9',
endColorstr='#7a7a7a'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#a9a9a9),
to(#7a7a7a)); /* for webkit browsers */
background: -moz-linear-gradient(top, #a9a9a9, #7a7a7a); /* for firefox
3.6+ */
border: solid 1px #6d6d6d;
display: inline-block;
float: right;
}
#nav li {
margin: 0 6px;
padding: 0 0 8px;
float: left;
position: relative;
list-style: none;
}
/* main level link */
#nav a {
font-weight: bold;
color: #e7e5e5;
text-decoration: none;
display: block;
padding: 8px 20px;
margin: 0;
-webkit-border-top-left-radius: 1.6em;
-moz-border-radius-topleft: 1.6em;
-webkit-border-top-right-radius: 1.6em;
-moz-border-radius-topright: 1.6em;
-webkit-border-bottom-left-radius: 1.6em;
-moz-border-radius-bottomleft: 1.6em;
-webkit-border-bottom-right-radius: 1.6em;
-moz-border-radius-bottomright: 1.6em;
text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
}
/* main level link hover */
#nav .current a, #nav li:hover > a {
background: #d1d1d1; /* for non-css3 browsers */
filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr='#ebebeb',
endColorstr='#a1a1a1'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#ebebeb),
to(#a1a1a1)); /* for webkit browsers */
background: -moz-linear-gradient(top, #ebebeb, #a1a1a1); /* for firefox
3.6+ */
color: #030375;
border-top: solid 1px #f8f8f8;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}
/* sub levels link hover */
#nav ul li:hover a, #nav li:hover li a {
background: none;
border: none;
color: #1f049f;
-webkit-box-shadow: none;
-moz-box-shadow: none;
}
#nav ul a:hover {
background: #0399d4 !important; /* for non-css3 browsers */
filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr='#04acec',
endColorstr='#0186ba'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#04acec),
to(#0186ba)) !important; /* for webkit browsers */
background: -moz-linear-gradient(top, #04acec, #0186ba) !important; /*
for firefox 3.6+ */
color: #fff !important;
-webkit-border-radius: 0;
-moz-border-radius: 0;
text-shadow: 0 1px 1px rgba(0, 0, 0, .1);
}
/* level 2 list */
#nav ul {
background: #ddd; /* for non-css3 browsers */
filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',
endColorstr='#cfcfcf'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#fff),
to(#cfcfcf)); /* for webkit browsers */
background: -moz-linear-gradient(top, #fff, #cfcfcf); /* for firefox
3.6+ */
display: none;
margin: 0 5px;
padding: 0;
width: 185px;
position: absolute;
top: 35px;
left: 0;
border: solid 1px #b4b4b4;
-webkit-border-top-left-radius: 10px;
-moz-border-radius-topleft: 10px;
-webkit-border-top-right-radius: 10px;
-moz-border-radius-topright: 10px;
-webkit-border-bottom-left-radius: 10px;
-moz-border-radius-bottomleft: 10px;
-webkit-border-bottom-right-radius: 10px;
-moz-border-radius-bottomright: 10px;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
/* dropdown */
#nav li:hover > ul {
display: block;
}
#nav ul li {
float: left;
margin: 0;
padding: 3px;
}
#nav ul a {
font-weight: normal;
text-shadow: 0 1px 1px rgba(255, 255, 255, .9);
}
/* level 3+ list */
#nav ul ul {
left: 181px;
top: -7px;
}
/* rounded corners for first and last child */
#nav ul li:first-child > a {
-webkit-border-top-left-radius: 9px;
-moz-border-radius-topleft: 9px;
-webkit-border-top-right-radius: 9px;
-moz-border-radius-topright: 9px;
}
#nav ul li:last-child > a {
-webkit-border-bottom-left-radius: 9px;
-moz-border-radius-bottomleft: 9px;
-webkit-border-bottom-right-radius: 9px;
-moz-border-radius-bottomright: 9px;
}
/* clearfix */
#nav:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
html[xmlns] #nav {
display: block;
}
* html #nav {
height: 1%;
}
Thanks and just to be clear I want to get rid of the gap between my image
div and header.
my nav?
Here is the relevant html (with the image at the top of my page and then
the header containing my nav: `
</style>
<body>
<div id="wrapper">
<ul id="nav">
<li class="current"><a href="http://www.webdesignerwall.com">Home</a></li>
<li><a href="http://www.ndesign-studio.com">Sports</a>
<ul>
<li><a href="#">NFL========></a>
<ul>
<li><a href="http://www.nfl.com/teams">Teams</a></li>
<li><a href="http://www.nfl.com/standings">Tables</a></li>
<li><a href="http://www.nfl.com/news">News</a></li>
<li><a
href="http://www.nfl.com/fantasyfootball">Fantasy</a></li>
<li><a href="#">Discuss</a></li>
</ul>
</li>
<li><a href="#">NBA========></a>
<ul>
<li><a href="http://www.nba.com/teams/">Teams</a></li>
<li><a
href="http://www.nba.com/standings/team_record_comparison/conferenceNew_Std_Cnf.html">Standings</a></li>
<li><a href="http://www.nba.com/news/">News</a></li>
<li><a href="http://www.nba.com/fantasy/">Fantasy</a></li>
<li><a href="#">Discuss</a></li>
</ul>
</li>
<li><a href="#">Football=====></a>
<ul>
<li><a
href="http://www.premierleague.com/en-gb.html">BPL</a></li>
<li><a
href="http://www.premierleague.com/en-gb/matchday/league-table.html">BPL
Table</a></li>
<li><a
href="http://www.bbc.co.uk/sport/football/tables">Tables</a></li>
<li><a
href="http://www.bbc.co.uk/sport/0/football/">News</a></li>
<li><a
href="http://fantasy.premierleague.com/">Fantasy</a></li>
</ul>
</li>
<li><a href="#">Cricket======></a>
<ul>
<li><a href="http://www.ecb.co.uk/">England</a></li>
<li><a
href="http://www.bbc.co.uk/sport/cricket/county-championship-division-one/table">Table</a></li>
<li><a
href="http://www.bbc.co.uk/sport/0/cricket/">News</a></li>
<li><a href="http://www.cricket20.com/">T20</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Games</a>
<ul>
<li><a href="#">Populars====></a>
<ul>
<li><a href="#">game1</a></il>
<li><a href="#">game2</a></il>
<li><a href="#">game3</a></il>
<li><a href="#">game4</a></il>
<li><a href="#">game5</a></il>
</ul>
</il>
<li><a href="#">Recent=====></a>
<ul>
<li><a href="#">game1</a></il>
<li><a href="#">game2</a></il>
<li><a href="#">game3</a></il>
<li><a href="#">game4</a></il>
<li><a href="#">game5</a></il>
</ul>
</il>
<li><a href="#">Categories</a></li>
</ul>
</li>
<li><a href="#">Cool Shit</a>
<ul>
<li><a href="#">Populars====></a>
<ul>
<li><a href="#">thing1</a></il>
<li><a href="#">thing2</a></il>
<li><a href="#">thing3</a></il>
<li><a href="#">thing4</a></il>
<li><a href="#">thing5</a></il>
</ul>
</il>
<li><a href="#">Recent=====></a>
<ul>
<li><a href="#">game1</a></il>
<li><a href="#">game2</a></il>
<li><a href="#">game3</a></il>
</ul>
</il>
<li><a href="#">The Rest</a></li>
</ul>
</li>
<li><a href="#">Forums</a></li>
<li><a href="#">Music</a></li>
<li><a href="#">Contact Us</a></li>
</ul><!-- End Nav -->
</header><!-- End Header -->`
And this is the css which effects the nav and above:
/* Body
--------------------------------------------*/
body {
font: normal .8em/1.5em Arial, Helvetica, sans-serif;
background: #ebebeb;
width: 1200px;
margin: 100px auto;
color: #666;
}
#wrapper {
background-color: #ccc;
margin: 0;
width: 1200px;
display: block;
padding: 0;
}
/* Header
--------------------------------------------*/
header {
background-color: #170a6e;
height: 100px;
width: 1200px;
margin: 0;
padding: 0;
}
header h1 {
font-size: 4.5em;
float: left;
margin: 20px;
padding: 5px;
}
#something {
text-align: center;
padding: 0;
margin: 0;
display: block;
}
#title {
float: left;
margin-left: 25px;
margin-top: 11px;
}
/* Nav
--------------------------------------------*/
#nav {
margin: 0;
padding: 7px 6px 0;
line-height: 100%;
-webkit-border-top-left-radius: 2em;
-moz-border-radius-topleft: 2em;
-webkit-border-top-right-radius: 0;
-moz-border-radius-topright: 0;
-webkit-border-bottom-left-radius: 2em;
-moz-border-radius-bottomleft: 2em;
-webkit-border-bottom-right-radius: 0;
-moz-border-radius-bottomright: 0;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
alignment-adjust: central;
background: #0e0575; /* for non-css3 browsers */
filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr='#a9a9a9',
endColorstr='#7a7a7a'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#a9a9a9),
to(#7a7a7a)); /* for webkit browsers */
background: -moz-linear-gradient(top, #a9a9a9, #7a7a7a); /* for firefox
3.6+ */
border: solid 1px #6d6d6d;
display: inline-block;
float: right;
}
#nav li {
margin: 0 6px;
padding: 0 0 8px;
float: left;
position: relative;
list-style: none;
}
/* main level link */
#nav a {
font-weight: bold;
color: #e7e5e5;
text-decoration: none;
display: block;
padding: 8px 20px;
margin: 0;
-webkit-border-top-left-radius: 1.6em;
-moz-border-radius-topleft: 1.6em;
-webkit-border-top-right-radius: 1.6em;
-moz-border-radius-topright: 1.6em;
-webkit-border-bottom-left-radius: 1.6em;
-moz-border-radius-bottomleft: 1.6em;
-webkit-border-bottom-right-radius: 1.6em;
-moz-border-radius-bottomright: 1.6em;
text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
}
/* main level link hover */
#nav .current a, #nav li:hover > a {
background: #d1d1d1; /* for non-css3 browsers */
filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr='#ebebeb',
endColorstr='#a1a1a1'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#ebebeb),
to(#a1a1a1)); /* for webkit browsers */
background: -moz-linear-gradient(top, #ebebeb, #a1a1a1); /* for firefox
3.6+ */
color: #030375;
border-top: solid 1px #f8f8f8;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}
/* sub levels link hover */
#nav ul li:hover a, #nav li:hover li a {
background: none;
border: none;
color: #1f049f;
-webkit-box-shadow: none;
-moz-box-shadow: none;
}
#nav ul a:hover {
background: #0399d4 !important; /* for non-css3 browsers */
filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr='#04acec',
endColorstr='#0186ba'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#04acec),
to(#0186ba)) !important; /* for webkit browsers */
background: -moz-linear-gradient(top, #04acec, #0186ba) !important; /*
for firefox 3.6+ */
color: #fff !important;
-webkit-border-radius: 0;
-moz-border-radius: 0;
text-shadow: 0 1px 1px rgba(0, 0, 0, .1);
}
/* level 2 list */
#nav ul {
background: #ddd; /* for non-css3 browsers */
filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',
endColorstr='#cfcfcf'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#fff),
to(#cfcfcf)); /* for webkit browsers */
background: -moz-linear-gradient(top, #fff, #cfcfcf); /* for firefox
3.6+ */
display: none;
margin: 0 5px;
padding: 0;
width: 185px;
position: absolute;
top: 35px;
left: 0;
border: solid 1px #b4b4b4;
-webkit-border-top-left-radius: 10px;
-moz-border-radius-topleft: 10px;
-webkit-border-top-right-radius: 10px;
-moz-border-radius-topright: 10px;
-webkit-border-bottom-left-radius: 10px;
-moz-border-radius-bottomleft: 10px;
-webkit-border-bottom-right-radius: 10px;
-moz-border-radius-bottomright: 10px;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
/* dropdown */
#nav li:hover > ul {
display: block;
}
#nav ul li {
float: left;
margin: 0;
padding: 3px;
}
#nav ul a {
font-weight: normal;
text-shadow: 0 1px 1px rgba(255, 255, 255, .9);
}
/* level 3+ list */
#nav ul ul {
left: 181px;
top: -7px;
}
/* rounded corners for first and last child */
#nav ul li:first-child > a {
-webkit-border-top-left-radius: 9px;
-moz-border-radius-topleft: 9px;
-webkit-border-top-right-radius: 9px;
-moz-border-radius-topright: 9px;
}
#nav ul li:last-child > a {
-webkit-border-bottom-left-radius: 9px;
-moz-border-radius-bottomleft: 9px;
-webkit-border-bottom-right-radius: 9px;
-moz-border-radius-bottomright: 9px;
}
/* clearfix */
#nav:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
html[xmlns] #nav {
display: block;
}
* html #nav {
height: 1%;
}
Thanks and just to be clear I want to get rid of the gap between my image
div and header.
Thursday, 29 August 2013
Strange behaviour when requesting on a ManyToMany relation with composite PrimaryKey
Strange behaviour when requesting on a ManyToMany relation with composite
PrimaryKey
I am trying to create a ManyToMany relation between DocumentModels, with
an additionnal information in the relation (dosIndex)
@Entity
@Table(name = "T_DOCUMENT_MODELS_DMO")
public class TDocumentModelsDmo extends
fr.axigate.nx.frontend.server.common.entity.ValidityPeriodEntity
implements Serializable
{
@Id
@SequenceGenerator(name = "T_DOCUMENT_MODELS_DMO_DMOID_GENERATOR",
sequenceName = "T_DMO_ID_SEQ")
@GeneratedValue(strategy = GenerationType.AUTO, generator =
"T_DOCUMENT_MODELS_DMO_DMOID_GENERATOR")
@Column(name = "DMO_ID", precision = 22)
private Long dmoId;
//Other unrelated members, no reference to TjDocumentSourcesDos
//constructors, getters and setters without annotations
}
@Entity
@Table(name = "TJ_DOCUMENT_SOURCES_DOS")
public class TjDocumentSourcesDos implements Serializable
{
@Column(name = "DOS_INDEX", nullable = false, precision = 22)
private long dosIndex; //the additionnal info on
the relation
@EmbeddedId
private TjDocumentSourcesDosPK id = new
TjDocumentSourcesDosPK();
@ManyToOne
@MapsId("dosParentId")
@JoinColumn(name = "DOS_PARENT_ID", nullable = false, insertable =
false, updatable = false)
private TDocumentModelsDmo TDocumentModelsDmoParent;
@ManyToOne
@MapsId("dosSourceId")
@JoinColumn(name = "DOS_SOURCE_ID", nullable = false, insertable =
false, updatable = false)
private TDocumentModelsDmo TDocumentModelsDmoSource;
//constructors, getters and setters without annotations
}
@Embeddable
public class TjDocumentSourcesDosPK implements Serializable
{
@Column(name = "DOS_PARENT_ID", nullable = false, precision = 22)
private Long dosParentId;
@Column(name = "DOS_SOURCE_ID", nullable = false, precision = 22)
private Long dosSourceId;
//constructors, getters and setters without annotations
//hashCode and equals implemented
}
I can insert datas in both tables, but when I try to request it using an
entityManager, i get something strange :
Query query = entityManager.createQuery("SELECT
dos.TDocumentModelsDmoSource FROM TDocumentModelsDmo AS dmo,
TjDocumentSourcesDos as dos WHERE dmo.dmoId = :modelId AND
dos.TDocumentModelsDmoParent = dmo");
query.setParameter("modelId", someData);
ArrayList<TjDocumentSourcesDos> dosList =
(ArrayList<TjDocumentSourcesDos>) query.getResultList();
will work, while the following will throw an exception :
QuerySyntaxException: dos.TDocumentModelsDmoSource is not mapped
Query query = entityManager.createQuery("SELECT sources FROM
TDocumentModelsDmo AS dmo, TjDocumentSourcesDos as dos,
dos.TDocumentModelsDmoSource AS sources WHERE dmo.dmoId = :modelId AND
dos.TDocumentModelsDmoParent = dmo");
query.setParameter("modelId", someData);
ArrayList<TjDocumentSourcesDos> dosList =
(ArrayList<TjDocumentSourcesDos>) query.getResultList();
This prevents me from doing more complicated requests where I would use my
sources models in the WHERE condition.
I tried adding a referencedColumnName = "DMO_ID" in both my JoinColumn
annotations, but I still get the same error
PrimaryKey
I am trying to create a ManyToMany relation between DocumentModels, with
an additionnal information in the relation (dosIndex)
@Entity
@Table(name = "T_DOCUMENT_MODELS_DMO")
public class TDocumentModelsDmo extends
fr.axigate.nx.frontend.server.common.entity.ValidityPeriodEntity
implements Serializable
{
@Id
@SequenceGenerator(name = "T_DOCUMENT_MODELS_DMO_DMOID_GENERATOR",
sequenceName = "T_DMO_ID_SEQ")
@GeneratedValue(strategy = GenerationType.AUTO, generator =
"T_DOCUMENT_MODELS_DMO_DMOID_GENERATOR")
@Column(name = "DMO_ID", precision = 22)
private Long dmoId;
//Other unrelated members, no reference to TjDocumentSourcesDos
//constructors, getters and setters without annotations
}
@Entity
@Table(name = "TJ_DOCUMENT_SOURCES_DOS")
public class TjDocumentSourcesDos implements Serializable
{
@Column(name = "DOS_INDEX", nullable = false, precision = 22)
private long dosIndex; //the additionnal info on
the relation
@EmbeddedId
private TjDocumentSourcesDosPK id = new
TjDocumentSourcesDosPK();
@ManyToOne
@MapsId("dosParentId")
@JoinColumn(name = "DOS_PARENT_ID", nullable = false, insertable =
false, updatable = false)
private TDocumentModelsDmo TDocumentModelsDmoParent;
@ManyToOne
@MapsId("dosSourceId")
@JoinColumn(name = "DOS_SOURCE_ID", nullable = false, insertable =
false, updatable = false)
private TDocumentModelsDmo TDocumentModelsDmoSource;
//constructors, getters and setters without annotations
}
@Embeddable
public class TjDocumentSourcesDosPK implements Serializable
{
@Column(name = "DOS_PARENT_ID", nullable = false, precision = 22)
private Long dosParentId;
@Column(name = "DOS_SOURCE_ID", nullable = false, precision = 22)
private Long dosSourceId;
//constructors, getters and setters without annotations
//hashCode and equals implemented
}
I can insert datas in both tables, but when I try to request it using an
entityManager, i get something strange :
Query query = entityManager.createQuery("SELECT
dos.TDocumentModelsDmoSource FROM TDocumentModelsDmo AS dmo,
TjDocumentSourcesDos as dos WHERE dmo.dmoId = :modelId AND
dos.TDocumentModelsDmoParent = dmo");
query.setParameter("modelId", someData);
ArrayList<TjDocumentSourcesDos> dosList =
(ArrayList<TjDocumentSourcesDos>) query.getResultList();
will work, while the following will throw an exception :
QuerySyntaxException: dos.TDocumentModelsDmoSource is not mapped
Query query = entityManager.createQuery("SELECT sources FROM
TDocumentModelsDmo AS dmo, TjDocumentSourcesDos as dos,
dos.TDocumentModelsDmoSource AS sources WHERE dmo.dmoId = :modelId AND
dos.TDocumentModelsDmoParent = dmo");
query.setParameter("modelId", someData);
ArrayList<TjDocumentSourcesDos> dosList =
(ArrayList<TjDocumentSourcesDos>) query.getResultList();
This prevents me from doing more complicated requests where I would use my
sources models in the WHERE condition.
I tried adding a referencedColumnName = "DMO_ID" in both my JoinColumn
annotations, but I still get the same error
Accessing particular file in website
Accessing particular file in website
I've developed a push notification using php and put that one inside
server, lets say in the folder
/system/expressionengine/controllers/cp/gcm_server_php/.
But when I type its path:
www.website.com//system/expressionengine/controllers/cp/gcm_server_php/file.html
it shows that the website is not found. Can anyone please help on how to
access that particular file. I'm newbie to this. Thanks
I've developed a push notification using php and put that one inside
server, lets say in the folder
/system/expressionengine/controllers/cp/gcm_server_php/.
But when I type its path:
www.website.com//system/expressionengine/controllers/cp/gcm_server_php/file.html
it shows that the website is not found. Can anyone please help on how to
access that particular file. I'm newbie to this. Thanks
how to read .IGES file in php
how to read .IGES file in php
I want to read .STL, .IGES files in php, these are basically 3D design
files. I want to get image & dimension from file when user uploads the
file.
I want to read .STL, .IGES files in php, these are basically 3D design
files. I want to get image & dimension from file when user uploads the
file.
Wednesday, 28 August 2013
WebApplicationInitializer container.addServlet() returns null
WebApplicationInitializer container.addServlet() returns null
I'm creating a basic web app with maven, then importing to Eclipse 4.2. I
have Tomcat 7 setup as a server. I'm trying configure spring data with
mongodb for a web app.
I'm following the code-based configuration approach found here:
WebApplicationInitializer
When I run the project on the server, I get a null pointer exception in
the WebApplicationInitializer class I have created. The line
container.addServlet("dispatcher", new
DispatcherServlet(dispatcherContext)); is returning null.
What the heck am I missing? I'm a bit new to creating web-apps from
scratch using annotations.
Thanks
I'm creating a basic web app with maven, then importing to Eclipse 4.2. I
have Tomcat 7 setup as a server. I'm trying configure spring data with
mongodb for a web app.
I'm following the code-based configuration approach found here:
WebApplicationInitializer
When I run the project on the server, I get a null pointer exception in
the WebApplicationInitializer class I have created. The line
container.addServlet("dispatcher", new
DispatcherServlet(dispatcherContext)); is returning null.
What the heck am I missing? I'm a bit new to creating web-apps from
scratch using annotations.
Thanks
iMacro form fill from csv
iMacro form fill from csv
Well I´m trying to do this and if anyone could help me i appreciate...
The idea is executing imacro to complete webform, using csv values (SET
!DATASOURCE xxxx.csv)
But in some part of the site i have this...(attached img)
I need complete my macro using EVAL or maybe creating a .js to handle this...
Idea: SEARCH {{COL2}} IF {{COL2}} FOUND THEN TAG POS=1 TYPE=INPUT:CHECKBOX
FORM=ID:aspnetForm ATTR=NAME:{{COL2}} CONTENT=YES ELSE CHECK "2...3" til
find value(col2)
Submit ok
Thanks in advance! :)
posted in imacro forum
Well I´m trying to do this and if anyone could help me i appreciate...
The idea is executing imacro to complete webform, using csv values (SET
!DATASOURCE xxxx.csv)
But in some part of the site i have this...(attached img)
I need complete my macro using EVAL or maybe creating a .js to handle this...
Idea: SEARCH {{COL2}} IF {{COL2}} FOUND THEN TAG POS=1 TYPE=INPUT:CHECKBOX
FORM=ID:aspnetForm ATTR=NAME:{{COL2}} CONTENT=YES ELSE CHECK "2...3" til
find value(col2)
Submit ok
Thanks in advance! :)
posted in imacro forum
how to show imageview with no white space
how to show imageview with no white space
my imageview not fully show on imageview width see this image its show
white space http://imgur.com/3fDXgij but i want to show mageview like this
shape http://imgur.com/g8UeI4b and image show full in imageview no white
space below is my code please help me
<ImageView
android:id="@+id/test_button_image"
android:layout_width="80dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="15dp"
android:layout_height="60dp"
android:layout_alignParentTop="true"
android:background="@drawable/border6"
android:src="@drawable/ic_launcher" >
</ImageView>
my imageview not fully show on imageview width see this image its show
white space http://imgur.com/3fDXgij but i want to show mageview like this
shape http://imgur.com/g8UeI4b and image show full in imageview no white
space below is my code please help me
<ImageView
android:id="@+id/test_button_image"
android:layout_width="80dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="15dp"
android:layout_height="60dp"
android:layout_alignParentTop="true"
android:background="@drawable/border6"
android:src="@drawable/ic_launcher" >
</ImageView>
get an integer from the set of numbers except few set of numbers
get an integer from the set of numbers except few set of numbers
Hi friends I want to get an integer value from the set of numbers. For
example: I want to get a number from 1 to 100 but number should not be 5,
7, 17, 23. So, how can I achieve this?
Hi friends I want to get an integer value from the set of numbers. For
example: I want to get a number from 1 to 100 but number should not be 5,
7, 17, 23. So, how can I achieve this?
Tuesday, 27 August 2013
Can i make my glassware app as a share contact for "TAKE A NOTE" voice command
Can i make my glassware app as a share contact for "TAKE A NOTE" voice
command
"TAKE A NOTE" command is added to XE8 release, which automatically creates
and shares timeline item with "EVERNOTE", i would like to make my
glassware app as similar to "EVERNOTE".
Currently i'm registering my app as a share contact accepting "image
data", if i specify "acceptCommands":[ {"type":"TAKE_A_NOTE"}]
in my app, will share a newly created take a note card to my app?
Thanks
command
"TAKE A NOTE" command is added to XE8 release, which automatically creates
and shares timeline item with "EVERNOTE", i would like to make my
glassware app as similar to "EVERNOTE".
Currently i'm registering my app as a share contact accepting "image
data", if i specify "acceptCommands":[ {"type":"TAKE_A_NOTE"}]
in my app, will share a newly created take a note card to my app?
Thanks
MacPro 3,1 : kernel panic
MacPro 3,1 : kernel panic
I have à MacPro 3,1 8-core and keep getting kernel panics randomly, it
seems. Even running no applications at all. Error message : "uncorrectable
Fbd memory error...
Thank you for helping me
I have à MacPro 3,1 8-core and keep getting kernel panics randomly, it
seems. Even running no applications at all. Error message : "uncorrectable
Fbd memory error...
Thank you for helping me
How to download an image file via HTTP into a temp file?
How to download an image file via HTTP into a temp file?
I've found good examples of NET::HTTP for downloading an image file, and
I've found good examples of creating a temp file. But I don't see how I
can use these libraries together. I.e., how would the creation of the temp
file be worked into this code for downloading a binary file?
require 'net/http'
Net::HTTP.start("somedomain.net/") do |http|
resp = http.get("/flv/sample/sample.flv")
open("sample.flv", "wb") do |file|
file.write(resp.body)
end
end
puts "Done."
I've found good examples of NET::HTTP for downloading an image file, and
I've found good examples of creating a temp file. But I don't see how I
can use these libraries together. I.e., how would the creation of the temp
file be worked into this code for downloading a binary file?
require 'net/http'
Net::HTTP.start("somedomain.net/") do |http|
resp = http.get("/flv/sample/sample.flv")
open("sample.flv", "wb") do |file|
file.write(resp.body)
end
end
puts "Done."
how to get the index number of my Tumblr posts when in Infinite Scroll
how to get the index number of my Tumblr posts when in Infinite Scroll
basically, I want to display the number my Tumblr posts. I have made
different attempts but each time the index numbering starts again from 0
after the new content is loaded. How can I make the number a continuation
from the previously loaded posts.
$('#content').infinitescroll({ binder: $(window), debug: true,
itemSelector : ".post", navSelector : "#pagination", nextSelector :
"#next-page" },function(arrayOfNewElems){
... H.E.L.P
});
basically, I want to display the number my Tumblr posts. I have made
different attempts but each time the index numbering starts again from 0
after the new content is loaded. How can I make the number a continuation
from the previously loaded posts.
$('#content').infinitescroll({ binder: $(window), debug: true,
itemSelector : ".post", navSelector : "#pagination", nextSelector :
"#next-page" },function(arrayOfNewElems){
... H.E.L.P
});
Read array in case of catch exception
Read array in case of catch exception
In case of catch (Exception $e) , the following code fails at the line
$lat = $track[0]. How to fix it?
$track = getPositionalTrack();
$lat = $track[0];
$lon = $track[1];
function getPositionalTrack()
{
$track = array();
$url = "https://...";
try
{
$result = file_get_contents($url);
$obj = json_decode($result, true);
$lat = $obj["lat"];
$lon = $obj["lon"];
$track[0] = $lat;
$track[1] = $lon;
}
catch (Exception $e)
{
die('ERROR: ' . $e->getMessage());
}
return $track;
}
In case of catch (Exception $e) , the following code fails at the line
$lat = $track[0]. How to fix it?
$track = getPositionalTrack();
$lat = $track[0];
$lon = $track[1];
function getPositionalTrack()
{
$track = array();
$url = "https://...";
try
{
$result = file_get_contents($url);
$obj = json_decode($result, true);
$lat = $obj["lat"];
$lon = $obj["lon"];
$track[0] = $lat;
$track[1] = $lon;
}
catch (Exception $e)
{
die('ERROR: ' . $e->getMessage());
}
return $track;
}
Associate a private key with the X509Certificate2 class in .net
Associate a private key with the X509Certificate2 class in .net
I'm working on some code that creates a X509certificate and a
public/private key pair. The public key is added to the certificate and it
is sent to an CA which signs it.
The returned certificate is then accessed through the
System.Security.Cryptography.X509Certificates.X509Certificate2 class. Now
I want to use this certificate to initiate a secure connection with other
clients. Therefore I use the SslStream class. To start the SSL Handshake I
use this method:
server.AssociatedSslStream.AuthenticateAsServer(
MyCertificate, // Client
Certificate
true, // Require
Certificate from connecting Peer
SslProtocols.Tls, // Use TLS 1.0
false // check
Certificate revocation
);
This method requires that the private key is associated with the
certificate. Of course the certificate returned by the CA does not contain
a private key. But it is stored as .key file on the harddrive. The
X509Certificate2 class has a property called PrivateKey which I guess will
associate a private key with the certificate, but I can't find a way to
set this property.
Is there any way I can associate the private key with the .net X509 class?
I'm working on some code that creates a X509certificate and a
public/private key pair. The public key is added to the certificate and it
is sent to an CA which signs it.
The returned certificate is then accessed through the
System.Security.Cryptography.X509Certificates.X509Certificate2 class. Now
I want to use this certificate to initiate a secure connection with other
clients. Therefore I use the SslStream class. To start the SSL Handshake I
use this method:
server.AssociatedSslStream.AuthenticateAsServer(
MyCertificate, // Client
Certificate
true, // Require
Certificate from connecting Peer
SslProtocols.Tls, // Use TLS 1.0
false // check
Certificate revocation
);
This method requires that the private key is associated with the
certificate. Of course the certificate returned by the CA does not contain
a private key. But it is stored as .key file on the harddrive. The
X509Certificate2 class has a property called PrivateKey which I guess will
associate a private key with the certificate, but I can't find a way to
set this property.
Is there any way I can associate the private key with the .net X509 class?
Connection Timeout Expired
Connection Timeout Expired
Message:Connection Timeout Expired. The timeout period elapsed during the
post-login phase. The connection could have timed out while waiting for
server to complete the login process and respond; Or it could have timed
out while attempting to create multiple active connections. The duration
spent while attempting to connect to this server was - [Pre-Login]
initialization=0; handshake=13063; [Login] initialization=16;
authentication=175; [Post-Login] complete=3546;
|DataAccess|ExecuteNonQuery
The client is SQL Server Management Studio 2008 R2. Firewall on the server
is turned on. I can telnet to port 433 & 80. And connecting from Studio on
the server itself works fine. Desktop and Server are on the same segment;
using Windows authentication.
Message:Connection Timeout Expired. The timeout period elapsed during the
post-login phase. The connection could have timed out while waiting for
server to complete the login process and respond; Or it could have timed
out while attempting to create multiple active connections. The duration
spent while attempting to connect to this server was - [Pre-Login]
initialization=0; handshake=13063; [Login] initialization=16;
authentication=175; [Post-Login] complete=3546;
|DataAccess|ExecuteNonQuery
The client is SQL Server Management Studio 2008 R2. Firewall on the server
is turned on. I can telnet to port 433 & 80. And connecting from Studio on
the server itself works fine. Desktop and Server are on the same segment;
using Windows authentication.
Monday, 26 August 2013
Fortran Open from current directory
Fortran Open from current directory
I am writing a fortran program and I would like to know if it is possible
to open a file from the same directory where the program itself is placed.
I am using Ubuntu 12.04 BTW.
For example, if I put the compiled program at the directory
"/home/username/foo" I would like the program to open the file
"/home/username/foo/bar.txt" and write "Hello!" in it.
My minimal working example is the following:
program main
implicit none
open(unit=20,file="bar.txt",action="write")
WRITE(20,*) "Hello!"
close(20)
end program main
When I compile using gfortran it opens and writes in the file
"/home/username/bar.txt" no matter where I put the program file.
On the other hand, when I compile it for windows (using mingw) making a
.exe file and execute it in windows it does what I want, it opens the file
where the executable file is placed.
Can anyone help me with that?
Thanks in advance.
I am writing a fortran program and I would like to know if it is possible
to open a file from the same directory where the program itself is placed.
I am using Ubuntu 12.04 BTW.
For example, if I put the compiled program at the directory
"/home/username/foo" I would like the program to open the file
"/home/username/foo/bar.txt" and write "Hello!" in it.
My minimal working example is the following:
program main
implicit none
open(unit=20,file="bar.txt",action="write")
WRITE(20,*) "Hello!"
close(20)
end program main
When I compile using gfortran it opens and writes in the file
"/home/username/bar.txt" no matter where I put the program file.
On the other hand, when I compile it for windows (using mingw) making a
.exe file and execute it in windows it does what I want, it opens the file
where the executable file is placed.
Can anyone help me with that?
Thanks in advance.
Google Distance Matrix API usage limits - apply to my server or unique users?
Google Distance Matrix API usage limits - apply to my server or unique users?
I'm using the Google Distance Matrix API to sort a list of stores based on
their proximity to my user (using the geocoords of the stores and my
user's phone GPS coords).
Google usage limits:
100 elements per 10 seconds.
2500 elements per 24 hour period.
Do these limits apply to individual users of my server or since my server
is doing the queries / sorting, will they apply to the server as a whole?
I'm using the Google Distance Matrix API to sort a list of stores based on
their proximity to my user (using the geocoords of the stores and my
user's phone GPS coords).
Google usage limits:
100 elements per 10 seconds.
2500 elements per 24 hour period.
Do these limits apply to individual users of my server or since my server
is doing the queries / sorting, will they apply to the server as a whole?
Devise: NameError in ActiveAdmin::Devise::SessionsController#destroy
Devise: NameError in ActiveAdmin::Devise::SessionsController#destroy
I am getting this error :
NameError in ActiveAdmin::Devise::SessionsController#destroy
uninitialized constant AdminUser
Rails.root: /Users/ryanwieghard/code/flamingo-hours
when I click the following link in my app:
<%= link_to('Logout', destroy_user_session_path, :method => :delete) %>
I originally had devise registered with my a AdminUser class, but I
recently refactored it to User. Here is the original line in my routes.rb
devise_for :admin_users, ActiveAdmin::Devise.config
which is now:
devise_for :users, ActiveAdmin::Devise.config
I am running ActiveAdmin, and User is registered with it as well. Here is
the users.rb file in my admin directory.
ActiveAdmin.register User do
index do
column :email
column :current_sign_in_at
column :last_sign_in_at
column :sign_in_count
default_actions
end
filter :email
form do |f|
f.inputs "Admin Details" do
f.input :email
f.input :password
f.input :password_confirmation
end
f.actions
end
end
Here are my devise and activeadmin initializers.
active_admin.rb
ActiveAdmin.setup do |config|
# == Site Title
#
# Set the title that is displayed on the main layout
# for each of the active admin pages.
#
config.site_title = "Flamingo Hours"
# Set the link url for the title. For example, to take
# users to your main site. Defaults to no link.
#
# config.site_title_link = "/"
# Set an optional image to be displayed for the header
# instead of a string (overrides :site_title)
#
# Note: Recommended image height is 21px to properly fit in the header
#
# config.site_title_image = "/images/logo.png"
# == Default Namespace
#
# Set the default namespace each administration resource
# will be added to.
#
# eg:
# config.default_name
#
# This will create resources in the HelloWorld module and
# will namespace routes to /hello_world/*
#
# To set no namespace by default, use:
# config.default_namespace = false
#
# Default:
# config.default_namespace = :admin
#
# You can customize the settings for each namespace by using
# a namespace block. For example, to change the site title
# within a namespace:
#
# config.namespace :admin do |admin|
# admin.site_title = "Custom Admin Title"
# end
#
# == Current User
#
# Active Admin will associate actions with the current
# user performing them.
#
# This setting changes the method which Active Admin calls
# to return the currently logged in user.
config.current_user_method = :current_user
config.logout_link_path = :destroy_user_session_path
config.logout_link_method = :delete
config.authorization_adapter = ActiveAdmin::CanCanAdapter
config.batch_actions = true
end
devise.rb Here is the other one.
Devise.setup do |config|
config.mailer_sender =
"please-change-me-at-config-initializers-devise@example.com"
require 'devise/orm/active_record'
# The same considerations mentioned for authentication_keys also apply
to request_keys.
# config.request_keys = []
# Configure which authentication keys should be case-insensitive.
# These keys will be downcased upon creating or modifying a user and
when used
# to authenticate or find a user. Default is :email.
config.case_insensitive_keys = [ :email ]
# Configure which authentication keys should have whitespace stripped.
# These keys will have whitespace before and after removed upon creating or
# modifying a user and when used to authenticate or find a user. Default
is :email.
config.strip_whitespace_keys = [ :email ]
# By default Devise will store the user in session. You can skip storage
for
# :http_auth and :token_auth by adding those symbols to the array below.
# Notice that if you are skipping storage for all authentication paths, you
# may want to disable generating routes to Devise's sessions controller by
# passing :skip => :sessions to `devise_for` in your config/routes.rb
config.skip_session_storage = [:http_auth]
# Limiting the stretches to just one in testing will increase the
performance of
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to
not use
# a value less than 10 in other environments.
config.stretches = Rails.env.test? ? 1 : 10
# If true, requires any email changes to be confirmed (exactly the same
way as
# initial account confirmation) to be applied. Requires additional
unconfirmed_email
# db field (see migrations). Until confirmed new email is stored in
# unconfirmed email column, and copied to email column on successful
confirmation.
config.reconfirmable = true
# ==> Configuration for :validatable
# Range for password length. Default is 8..128.
config.password_length = 8..128
config.reset_password_within = 6.hours
end
Please let me know if you need to post any more relevant information.
Thanks for your help!
I am getting this error :
NameError in ActiveAdmin::Devise::SessionsController#destroy
uninitialized constant AdminUser
Rails.root: /Users/ryanwieghard/code/flamingo-hours
when I click the following link in my app:
<%= link_to('Logout', destroy_user_session_path, :method => :delete) %>
I originally had devise registered with my a AdminUser class, but I
recently refactored it to User. Here is the original line in my routes.rb
devise_for :admin_users, ActiveAdmin::Devise.config
which is now:
devise_for :users, ActiveAdmin::Devise.config
I am running ActiveAdmin, and User is registered with it as well. Here is
the users.rb file in my admin directory.
ActiveAdmin.register User do
index do
column :email
column :current_sign_in_at
column :last_sign_in_at
column :sign_in_count
default_actions
end
filter :email
form do |f|
f.inputs "Admin Details" do
f.input :email
f.input :password
f.input :password_confirmation
end
f.actions
end
end
Here are my devise and activeadmin initializers.
active_admin.rb
ActiveAdmin.setup do |config|
# == Site Title
#
# Set the title that is displayed on the main layout
# for each of the active admin pages.
#
config.site_title = "Flamingo Hours"
# Set the link url for the title. For example, to take
# users to your main site. Defaults to no link.
#
# config.site_title_link = "/"
# Set an optional image to be displayed for the header
# instead of a string (overrides :site_title)
#
# Note: Recommended image height is 21px to properly fit in the header
#
# config.site_title_image = "/images/logo.png"
# == Default Namespace
#
# Set the default namespace each administration resource
# will be added to.
#
# eg:
# config.default_name
#
# This will create resources in the HelloWorld module and
# will namespace routes to /hello_world/*
#
# To set no namespace by default, use:
# config.default_namespace = false
#
# Default:
# config.default_namespace = :admin
#
# You can customize the settings for each namespace by using
# a namespace block. For example, to change the site title
# within a namespace:
#
# config.namespace :admin do |admin|
# admin.site_title = "Custom Admin Title"
# end
#
# == Current User
#
# Active Admin will associate actions with the current
# user performing them.
#
# This setting changes the method which Active Admin calls
# to return the currently logged in user.
config.current_user_method = :current_user
config.logout_link_path = :destroy_user_session_path
config.logout_link_method = :delete
config.authorization_adapter = ActiveAdmin::CanCanAdapter
config.batch_actions = true
end
devise.rb Here is the other one.
Devise.setup do |config|
config.mailer_sender =
"please-change-me-at-config-initializers-devise@example.com"
require 'devise/orm/active_record'
# The same considerations mentioned for authentication_keys also apply
to request_keys.
# config.request_keys = []
# Configure which authentication keys should be case-insensitive.
# These keys will be downcased upon creating or modifying a user and
when used
# to authenticate or find a user. Default is :email.
config.case_insensitive_keys = [ :email ]
# Configure which authentication keys should have whitespace stripped.
# These keys will have whitespace before and after removed upon creating or
# modifying a user and when used to authenticate or find a user. Default
is :email.
config.strip_whitespace_keys = [ :email ]
# By default Devise will store the user in session. You can skip storage
for
# :http_auth and :token_auth by adding those symbols to the array below.
# Notice that if you are skipping storage for all authentication paths, you
# may want to disable generating routes to Devise's sessions controller by
# passing :skip => :sessions to `devise_for` in your config/routes.rb
config.skip_session_storage = [:http_auth]
# Limiting the stretches to just one in testing will increase the
performance of
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to
not use
# a value less than 10 in other environments.
config.stretches = Rails.env.test? ? 1 : 10
# If true, requires any email changes to be confirmed (exactly the same
way as
# initial account confirmation) to be applied. Requires additional
unconfirmed_email
# db field (see migrations). Until confirmed new email is stored in
# unconfirmed email column, and copied to email column on successful
confirmation.
config.reconfirmable = true
# ==> Configuration for :validatable
# Range for password length. Default is 8..128.
config.password_length = 8..128
config.reset_password_within = 6.hours
end
Please let me know if you need to post any more relevant information.
Thanks for your help!
adobe photoshop for ubuntu 12.04 LTS
adobe photoshop for ubuntu 12.04 LTS
I recently updated to ubuntu 12.04 LTS and somehow lost my adobe photoshop
application (though it still shows up on Dash home but won't open). It may
still be in my computer somewhere but I don't know where it went. It was
photoshop 6.0. Is there a way I can recover this application? Do I have to
get into Wine? p.s. layman's terms please, I am unfamiliar with all of
this
p.p.s. I think the update got rid of Wine as well...I am reinstalling Wine
Windows Program Loader now
I recently updated to ubuntu 12.04 LTS and somehow lost my adobe photoshop
application (though it still shows up on Dash home but won't open). It may
still be in my computer somewhere but I don't know where it went. It was
photoshop 6.0. Is there a way I can recover this application? Do I have to
get into Wine? p.s. layman's terms please, I am unfamiliar with all of
this
p.p.s. I think the update got rid of Wine as well...I am reinstalling Wine
Windows Program Loader now
Compare object name (reference name) with a string
Compare object name (reference name) with a string
How to compare name of an object to a string in Java?
For example:
class_name obj = new class_name();
and I want to compare object name obj with a string. What is the correct
way to do that?
How to compare name of an object to a string in Java?
For example:
class_name obj = new class_name();
and I want to compare object name obj with a string. What is the correct
way to do that?
Do I need to enable MSConfig services for wireless internet access?
Do I need to enable MSConfig services for wireless internet access?
I am trying to disable all MSConfig startups and services for Windows 7
OS. Unfortunately after doing research I still have not identified what
services are needed for wireless internet access. What do I need to
enable?
I am trying to disable all MSConfig startups and services for Windows 7
OS. Unfortunately after doing research I still have not identified what
services are needed for wireless internet access. What do I need to
enable?
Add lines to the beginning and end of the huge file unix.stackexchange.com
Add lines to the beginning and end of the huge file – unix.stackexchange.com
I have the scenario where lines to be added on begining and end of the
huge files. I have tried as shown below. for the first line: sed -i
'1i\'"$FirstLine" $Filename for the last line: sed -i …
I have the scenario where lines to be added on begining and end of the
huge files. I have tried as shown below. for the first line: sed -i
'1i\'"$FirstLine" $Filename for the last line: sed -i …
Wordpress making two URL's in search engines
Wordpress making two URL's in search engines
I have a blog with 10000 article and im trying to get to registered in
google news.
Google is rejecting my application as google finds two URL's:
1) http://url.com/article-name/article-id/
2) http://url.com/article-name/
How do i stop google from indexing the second URL and load only first URL.
I have a blog with 10000 article and im trying to get to registered in
google news.
Google is rejecting my application as google finds two URL's:
1) http://url.com/article-name/article-id/
2) http://url.com/article-name/
How do i stop google from indexing the second URL and load only first URL.
Sunday, 25 August 2013
how to export kendo chart to JPG, PNG, BMP, GIF
how to export kendo chart to JPG, PNG, BMP, GIF
Is there any way to export the kendo chart to the JPG, PNG, BMP, GIF.With
the format type selection using drop downlist.
function createChart() {
$("#chart").kendoChart({
theme: $(document).data("kendoSkin") || "default",
title: {
text: "Internet Users"
},
legend: {
position: "bottom"
},
chartArea: {
//It's important that your background NOT be
transparent for proper exporting
//of some file types - most noticeably Jpeg
background: "white"
},
seriesDefaults: {
type: "bar"
},
series: [{
name: "World",
data: [15.7, 16.7, 20, 23.5, 26.6]
}, {
name: "United States",
data: [67.96, 68.93, 75, 74, 78]
}],
valueAxis: {
labels: {
format: "{0}%"
}
},
categoryAxis: {
categories: [2005, 2006, 2007, 2008, 2009]
},
tooltip: {
visible: true,
format: "{0}%"
}
});
}
$(document).ready(function () {
setTimeout(function () {
// Initialize the chart with a delay to make sure
// the initial animation is visible
createChart();
}, 400);
});
Is there any way to export the kendo chart to the JPG, PNG, BMP, GIF.With
the format type selection using drop downlist.
function createChart() {
$("#chart").kendoChart({
theme: $(document).data("kendoSkin") || "default",
title: {
text: "Internet Users"
},
legend: {
position: "bottom"
},
chartArea: {
//It's important that your background NOT be
transparent for proper exporting
//of some file types - most noticeably Jpeg
background: "white"
},
seriesDefaults: {
type: "bar"
},
series: [{
name: "World",
data: [15.7, 16.7, 20, 23.5, 26.6]
}, {
name: "United States",
data: [67.96, 68.93, 75, 74, 78]
}],
valueAxis: {
labels: {
format: "{0}%"
}
},
categoryAxis: {
categories: [2005, 2006, 2007, 2008, 2009]
},
tooltip: {
visible: true,
format: "{0}%"
}
});
}
$(document).ready(function () {
setTimeout(function () {
// Initialize the chart with a delay to make sure
// the initial animation is visible
createChart();
}, 400);
});
AppCompat and ViewPagerIndicator fragments submenu not showing
AppCompat and ViewPagerIndicator fragments submenu not showing
I have a pretty simple use case which does not work with the AppCompat
library on Android 8.
I have one Activity that includes two fragments that can be swipped
between using a TabPagerIndicator. The first of the fragments shows an
SubMenu on the ActionBar, the second does not.
When starting the activity the first fragment is shown. Clicking the
SubMenu correctly shows the SubMenu items for selection. However, if
swiping to fragment two and back again, clicking the SubMenu does nothing.
Instead of supplying large blocks of code here, I have created a sample
project that shows the problem. It is on github:
https://github.com/foens/appcompatsubmenu/
Shortcuts:
Activity code
Fragment with menu
Fragment without menu
Menu xml
Activity layout
What am I doing wrong?
I have a pretty simple use case which does not work with the AppCompat
library on Android 8.
I have one Activity that includes two fragments that can be swipped
between using a TabPagerIndicator. The first of the fragments shows an
SubMenu on the ActionBar, the second does not.
When starting the activity the first fragment is shown. Clicking the
SubMenu correctly shows the SubMenu items for selection. However, if
swiping to fragment two and back again, clicking the SubMenu does nothing.
Instead of supplying large blocks of code here, I have created a sample
project that shows the problem. It is on github:
https://github.com/foens/appcompatsubmenu/
Shortcuts:
Activity code
Fragment with menu
Fragment without menu
Menu xml
Activity layout
What am I doing wrong?
pass an object from one view controller to another
pass an object from one view controller to another
I have dynamic data that is displayed in a tableview. A detail view is
displayed when you click on one of the elements of the tableview. How to
retrieve the array of values ​​corresponding to the clicked
item on the details page?
My detailView contains only a label in which I want to display a message
from the array element clicked.
I do not know how to achieve such a result. Thank you for your help.
I have dynamic data that is displayed in a tableview. A detail view is
displayed when you click on one of the elements of the tableview. How to
retrieve the array of values ​​corresponding to the clicked
item on the details page?
My detailView contains only a label in which I want to display a message
from the array element clicked.
I do not know how to achieve such a result. Thank you for your help.
Android - shared variable between apps
Android - shared variable between apps
I'm building a shared library that can be shared in many applications
I need global variable that all apps using this library can write and read
the variable.
I check the solutions:
1) shard preference - irrelevant, because I do not have a standalone
application. 2) content Provider- irrelevant, because I do not have a
standalone application. 3) SQLite DB - irrelevant, because I do not have a
standalone application. 4) file in SD card - problem if there is no SD
card.
Does anyone have an idea how to do it?
I'm building a shared library that can be shared in many applications
I need global variable that all apps using this library can write and read
the variable.
I check the solutions:
1) shard preference - irrelevant, because I do not have a standalone
application. 2) content Provider- irrelevant, because I do not have a
standalone application. 3) SQLite DB - irrelevant, because I do not have a
standalone application. 4) file in SD card - problem if there is no SD
card.
Does anyone have an idea how to do it?
Saturday, 24 August 2013
May Composition of a strongly monic and a measurable functions be unmeasurable?
May Composition of a strongly monic and a measurable functions be
unmeasurable?
I'm interested to know that is there any strongly monic function like g
and a lebesgue measurable set E, such that $g^{-1}(E)$ be not Lebesgue
measurable. I think it should exist but I couldn't construct it. I will be
happy if someone here help me with it.
unmeasurable?
I'm interested to know that is there any strongly monic function like g
and a lebesgue measurable set E, such that $g^{-1}(E)$ be not Lebesgue
measurable. I think it should exist but I couldn't construct it. I will be
happy if someone here help me with it.
Making a small program part as a bigger one in java. Multithreading?. Noobs
Making a small program part as a bigger one in java. Multithreading?. Noobs
I am working on a small project where I have to communicate to an Android
app on my phone and with Arduino.
Now, i have the connection between Android and laptop (used as server, I
have a small amount of data stored here), and I can change the contents of
text files when I send certain instructions from Android app.
This is how I do it:
I have a ServerSide class that listens on port 3000 and I read the text I
stream from phone, then I make certain changes in text files for different
messages.
The code: public class ServerSide {
public static void main(String[] args) throws IOException {
while (true) {
ServerSocket serverSocket = null;
// check if client is trying to connect
try {
serverSocket = new ServerSocket(3000);
} catch (IOException e) {
System.err.println("Cannot communicate on this port");
System.exit(1);
}
Socket clientSocket = null;
// move to another socket
try {
clientSocket = serverSocket.accept();
} catch (IOException e) {
System.err.println("Accept failed");
System.exit(1);
}
// stream that will be sent to client. "true" is for creating from
// existing
PrintWriter out = new PrintWriter(clientSocket.getOutputStream(),
true);
// stream that comes from the client
BufferedReader in = new BufferedReader(new InputStreamReader(
clientSocket.getInputStream()));
String recivedData, sendData;
ServerProtocol communicationProtocol = new ServerProtocol();
while ((recivedData = in.readLine()) != null) {
sendData = communicationProtocol.process(recivedData);
out.println(sendData);
System.out.println("The text should now be written in file");
System.out.println(sendData);
}
in.close();
out.close();
clientSocket.close();
serverSocket.close();
}
}
}
ServerProtocol.process() is the method that updates the files
By the way, this is a good version of a program that implies connection
via sockets (if anyone should need information about this, at a future
time).
Everything works great, I can see my updates immediatly after I send them,
the server is up and running, waiting for messages.
I forgot to mention, I am new to java and a novice in programming, in
general.
Now, I want this code I managed to write to be part of a bigger "server".
By "server", I understand a program that "serves", performs a service.
When it runs on my laptop, it takes information that comes from the
Internet on the port I specify, change things in files according to my
messages, keeps theese files updated and in the same time it uses theese
files to "interpert" data I send from phone, and then sends according
messages to Arduino Shield. (THIS IS WHAT I WANT TO ACHIVE)
I guess that what I miss, is the following:
How do i make this code I have written untill now, part of a bigger
project, that does all that?
I managed to split the project in 3 parts: 1.Communication laptop -
Android 2.Constant data updates 3.Communication laptop - Arduino
Ive done some reaserch, and I came accross threads. So I thought about
having the communication with Android on a separate thread of a
MainServer. I clearly got it wrong, because it doesnt do what I expect it
to do, so here is the code:
I create the ServerSide class that extends Thread, and has a run() method
that should be called when I start the thread. The just like the one
above, but it just lays inside a run() method: public class ServerSide
extends Thread {
@Override
public void run() {
while (true) {
ServerSocket serverSocket = null;
// check if client is trying to connect
try {
serverSocket = new ServerSocket(3000);
} catch (IOException e) {
System.err.println("Cannot communicate on this port");
System.exit(1);
}
Socket clientSocket = null;
// move to another socket
try {
clientSocket = serverSocket.accept();
} catch (IOException e) {
System.err.println("Accept failed");
System.exit(1);
}
// stream that will be sent to client. "true" is for creating from
// existing
PrintWriter out = null;
try {
out = new PrintWriter(clientSocket.getOutputStream(), true);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// stream that comes from the client
BufferedReader in = null;
try {
in = new BufferedReader(new InputStreamReader(
clientSocket.getInputStream()));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String recivedData, sendData;
recivedData = null;
sendData = null;
ServerProtocol communicationProtocol = new ServerProtocol();
try {
while ((recivedData = in.readLine()) != null) {
try {
sendData = communicationProtocol.process(recivedData);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
out.println(sendData);
System.out
.println("The text should now be written in file");
System.out.println(sendData);
}
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
in.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
out.close();
try {
clientSocket.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
serverSocket.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
Then, I have the MainServer:
public class MainServer {
public static void main(String[] args) throws IOException {
System.out.println("Started");
Thread myThread = new Thread(new ServerSide());
myThread.start();
System.out.println("Started2");
while (true);
}
}
It should do nothing, just start the new thread. I expect this new thread
do act just like the old ServerSide above (the one with main() method).
Someone, please tell me where I got it wrong !?!
I am working on a small project where I have to communicate to an Android
app on my phone and with Arduino.
Now, i have the connection between Android and laptop (used as server, I
have a small amount of data stored here), and I can change the contents of
text files when I send certain instructions from Android app.
This is how I do it:
I have a ServerSide class that listens on port 3000 and I read the text I
stream from phone, then I make certain changes in text files for different
messages.
The code: public class ServerSide {
public static void main(String[] args) throws IOException {
while (true) {
ServerSocket serverSocket = null;
// check if client is trying to connect
try {
serverSocket = new ServerSocket(3000);
} catch (IOException e) {
System.err.println("Cannot communicate on this port");
System.exit(1);
}
Socket clientSocket = null;
// move to another socket
try {
clientSocket = serverSocket.accept();
} catch (IOException e) {
System.err.println("Accept failed");
System.exit(1);
}
// stream that will be sent to client. "true" is for creating from
// existing
PrintWriter out = new PrintWriter(clientSocket.getOutputStream(),
true);
// stream that comes from the client
BufferedReader in = new BufferedReader(new InputStreamReader(
clientSocket.getInputStream()));
String recivedData, sendData;
ServerProtocol communicationProtocol = new ServerProtocol();
while ((recivedData = in.readLine()) != null) {
sendData = communicationProtocol.process(recivedData);
out.println(sendData);
System.out.println("The text should now be written in file");
System.out.println(sendData);
}
in.close();
out.close();
clientSocket.close();
serverSocket.close();
}
}
}
ServerProtocol.process() is the method that updates the files
By the way, this is a good version of a program that implies connection
via sockets (if anyone should need information about this, at a future
time).
Everything works great, I can see my updates immediatly after I send them,
the server is up and running, waiting for messages.
I forgot to mention, I am new to java and a novice in programming, in
general.
Now, I want this code I managed to write to be part of a bigger "server".
By "server", I understand a program that "serves", performs a service.
When it runs on my laptop, it takes information that comes from the
Internet on the port I specify, change things in files according to my
messages, keeps theese files updated and in the same time it uses theese
files to "interpert" data I send from phone, and then sends according
messages to Arduino Shield. (THIS IS WHAT I WANT TO ACHIVE)
I guess that what I miss, is the following:
How do i make this code I have written untill now, part of a bigger
project, that does all that?
I managed to split the project in 3 parts: 1.Communication laptop -
Android 2.Constant data updates 3.Communication laptop - Arduino
Ive done some reaserch, and I came accross threads. So I thought about
having the communication with Android on a separate thread of a
MainServer. I clearly got it wrong, because it doesnt do what I expect it
to do, so here is the code:
I create the ServerSide class that extends Thread, and has a run() method
that should be called when I start the thread. The just like the one
above, but it just lays inside a run() method: public class ServerSide
extends Thread {
@Override
public void run() {
while (true) {
ServerSocket serverSocket = null;
// check if client is trying to connect
try {
serverSocket = new ServerSocket(3000);
} catch (IOException e) {
System.err.println("Cannot communicate on this port");
System.exit(1);
}
Socket clientSocket = null;
// move to another socket
try {
clientSocket = serverSocket.accept();
} catch (IOException e) {
System.err.println("Accept failed");
System.exit(1);
}
// stream that will be sent to client. "true" is for creating from
// existing
PrintWriter out = null;
try {
out = new PrintWriter(clientSocket.getOutputStream(), true);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// stream that comes from the client
BufferedReader in = null;
try {
in = new BufferedReader(new InputStreamReader(
clientSocket.getInputStream()));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String recivedData, sendData;
recivedData = null;
sendData = null;
ServerProtocol communicationProtocol = new ServerProtocol();
try {
while ((recivedData = in.readLine()) != null) {
try {
sendData = communicationProtocol.process(recivedData);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
out.println(sendData);
System.out
.println("The text should now be written in file");
System.out.println(sendData);
}
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
in.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
out.close();
try {
clientSocket.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
serverSocket.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
Then, I have the MainServer:
public class MainServer {
public static void main(String[] args) throws IOException {
System.out.println("Started");
Thread myThread = new Thread(new ServerSide());
myThread.start();
System.out.println("Started2");
while (true);
}
}
It should do nothing, just start the new thread. I expect this new thread
do act just like the old ServerSide above (the one with main() method).
Someone, please tell me where I got it wrong !?!
Installing XAMPP
Installing XAMPP
I'm new to linux and I'm trying to install XAMPP I downloaded the file and
I cant execute it, I followed the Instruction on
http://www.apachefriends.org/en/xampp-linux.html#374 but whem I'm trying
the command chmod 755 chmod 755 xampp-linux-1.8.2-0-installer.run it's
showing "cannot access 'xampp-linux-x64-1.8.3-0-installer.run': No such
file or directory" I'm using 64bit ubuntu 13.04 please help me
I'm new to linux and I'm trying to install XAMPP I downloaded the file and
I cant execute it, I followed the Instruction on
http://www.apachefriends.org/en/xampp-linux.html#374 but whem I'm trying
the command chmod 755 chmod 755 xampp-linux-1.8.2-0-installer.run it's
showing "cannot access 'xampp-linux-x64-1.8.3-0-installer.run': No such
file or directory" I'm using 64bit ubuntu 13.04 please help me
Error /init line 7 - Cannot install any Debian based distros
Error /init line 7 - Cannot install any Debian based distros
I have an error while booting Ubuntu from live CD/USB.
Since I can't copy and paste the console output during boot (or well, I
don't know how to do it) I made a video that shows the error.
I really don't know why it happens, but it occurs with any Debian-based
distro (tested with Ubuntu, from 10.04 to 13.04, Xubuntu, Debian 6). It's
the same error.
Also tried to disable some options from the boot menu, no luck at all.
The strange thing is that I had Ubuntu before, and it always worked well,
then when I reformatted the PC I can't install it anymore.
This is my HW specs:
MotherBoard: Gigabyte P55-USB3 SKT LGA 1156
Processor: i3 530 @ 2.93Ghz
RAM: x2 2GB DDR3 1333Mhz Kingston
HDD: Seagate SATA2 1TB 7,2K
If anyone knows why this is happening, I'm happy to have my Ubuntu back! =/
I have an error while booting Ubuntu from live CD/USB.
Since I can't copy and paste the console output during boot (or well, I
don't know how to do it) I made a video that shows the error.
I really don't know why it happens, but it occurs with any Debian-based
distro (tested with Ubuntu, from 10.04 to 13.04, Xubuntu, Debian 6). It's
the same error.
Also tried to disable some options from the boot menu, no luck at all.
The strange thing is that I had Ubuntu before, and it always worked well,
then when I reformatted the PC I can't install it anymore.
This is my HW specs:
MotherBoard: Gigabyte P55-USB3 SKT LGA 1156
Processor: i3 530 @ 2.93Ghz
RAM: x2 2GB DDR3 1333Mhz Kingston
HDD: Seagate SATA2 1TB 7,2K
If anyone knows why this is happening, I'm happy to have my Ubuntu back! =/
Sql server Multiple conditions subquery
Sql server Multiple conditions subquery
I tried to use compound conditions in the subquery, but it didn't return
the result expected. Can you look into the example below to see why the
query doesn't work out ?
Table : 1
EntityID StartDate EndDate
121 2013-08-01 2013-08-31
122 2013-08-01 2013-08-31
123 2013-08-01 2013-08-31
Table : 2
EntityID AttributeID AttributeValue
121 41 304
122 41 304
123 41 304
123 54 307
Now I'm trying to fetch based on AttributeID and AttribueValue from
Table-2 and Stardate and enddate from table1 using following query. (Ex:
The 41 and 304 and 54 and 307 got satisfied with 123 only I want fetch
that 123 only one record)
SELECT pe.EntityID
FROM table1 pe
WHERE pe.StartDate = '2013-08-01'
AND pe.EndDate = '2013-08-31'
AND pe.EntityID IN (SELECT peaiv.EntityID
FROM table2 peaiv
WHERE peaiv.AttributeID IN (41)
AND peaiv.[Value] IN (304)
AND peaiv.EntityID IN (SELECT peaiv.EntityID
FROM
PT_EntityAttributesIntValues
peaiv
WHERE
peaiv.AttributeID IN
(54)
AND
peaiv.[Value] IN
(307))
EntitID
--------
121
122
123
The query returning the above result, but I'm expecting result only 123.
Can any one try on this.
I tried to use compound conditions in the subquery, but it didn't return
the result expected. Can you look into the example below to see why the
query doesn't work out ?
Table : 1
EntityID StartDate EndDate
121 2013-08-01 2013-08-31
122 2013-08-01 2013-08-31
123 2013-08-01 2013-08-31
Table : 2
EntityID AttributeID AttributeValue
121 41 304
122 41 304
123 41 304
123 54 307
Now I'm trying to fetch based on AttributeID and AttribueValue from
Table-2 and Stardate and enddate from table1 using following query. (Ex:
The 41 and 304 and 54 and 307 got satisfied with 123 only I want fetch
that 123 only one record)
SELECT pe.EntityID
FROM table1 pe
WHERE pe.StartDate = '2013-08-01'
AND pe.EndDate = '2013-08-31'
AND pe.EntityID IN (SELECT peaiv.EntityID
FROM table2 peaiv
WHERE peaiv.AttributeID IN (41)
AND peaiv.[Value] IN (304)
AND peaiv.EntityID IN (SELECT peaiv.EntityID
FROM
PT_EntityAttributesIntValues
peaiv
WHERE
peaiv.AttributeID IN
(54)
AND
peaiv.[Value] IN
(307))
EntitID
--------
121
122
123
The query returning the above result, but I'm expecting result only 123.
Can any one try on this.
Add main menu to dockbarx in 13.04
Add main menu to dockbarx in 13.04
Since Cardapio is no longer supported in Ubuntu 13.04 can you tell me
which main menu I can use on dockbarx in Ubuntu 13.04.
Since Cardapio is no longer supported in Ubuntu 13.04 can you tell me
which main menu I can use on dockbarx in Ubuntu 13.04.
MySQL - Is it possible to use LIKE on all columns in a table?
MySQL - Is it possible to use LIKE on all columns in a table?
I'm trying to make a simple search bar that searches through my database
for certain words. It is possible to use the LIKE attribute without using
WHERE? I want it to search all columns for the keywords, not just one.
Currently I have this:
mysql_query("SELECT * FROM shoutbox WHERE name LIKE '%$search%' ")
Which obviously only searches for names with the search input. I tried
both of these:
mysql_query("SELECT * FROM shoutbox LIKE '%$search%' ")
mysql_query("SELECT * FROM shoutbox WHERE * LIKE '%$search%' ")
and neither worked. Is this something that is possible or is there another
way to go about it?
I'm trying to make a simple search bar that searches through my database
for certain words. It is possible to use the LIKE attribute without using
WHERE? I want it to search all columns for the keywords, not just one.
Currently I have this:
mysql_query("SELECT * FROM shoutbox WHERE name LIKE '%$search%' ")
Which obviously only searches for names with the search input. I tried
both of these:
mysql_query("SELECT * FROM shoutbox LIKE '%$search%' ")
mysql_query("SELECT * FROM shoutbox WHERE * LIKE '%$search%' ")
and neither worked. Is this something that is possible or is there another
way to go about it?
Friday, 23 August 2013
Why after installing MacPorts the kernel_task RAM size raised x1.5?
Why after installing MacPorts the kernel_task RAM size raised x1.5?
I noticed that before installing MacPorts the kernel_task RAM usage was
about 200-300 Mb. After installing that the process is using 482.5 Mb real
RAM. What are the components (maybe .kexts, which then?) MacPorts has
added to the kernel_task process?
I noticed that before installing MacPorts the kernel_task RAM usage was
about 200-300 Mb. After installing that the process is using 482.5 Mb real
RAM. What are the components (maybe .kexts, which then?) MacPorts has
added to the kernel_task process?
How to make DOM changes done in plain JS available to a jQuery function?
How to make DOM changes done in plain JS available to a jQuery function?
I am adding a row to a table with some form elements using plain JS as:
var newRow = firstRow.cloneNode(true);
table.appendChild(newRow);
var newRowCells = newRow.getElementsByTagName("td");
...
One of the elements in the row is a dropdown. I want the dropdown in this
newly added row to respond to jQuery function that handles
$(#dropdown).change()
Any ideas? Thanks in advance !!
I am adding a row to a table with some form elements using plain JS as:
var newRow = firstRow.cloneNode(true);
table.appendChild(newRow);
var newRowCells = newRow.getElementsByTagName("td");
...
One of the elements in the row is a dropdown. I want the dropdown in this
newly added row to respond to jQuery function that handles
$(#dropdown).change()
Any ideas? Thanks in advance !!
Bootstrap 3 Tooltips or Popovers will not work
Bootstrap 3 Tooltips or Popovers will not work
I have a Django application with the front-end designed in Twitter
Bootstrap 3. All of the my styling and JS is working fine including the
modals, etc... But I cannot for the life of me get the tooltips of
popovers to do anything....
I am not throwing any errors in Firebug.
Here is the order of my includes:
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="{{ STATIC_URL }}js/bootstrap.min.js"></script>
Here is my an example call for the tooltip I took straight from the
bootstrap site:
<a href="#" data-toggle="tooltip" title="first tooltip">Hover over me</a>
Anyone else have trouble with the 2 elements?
I am fairly certain it is something dumb I've done.
All other JS affects provided in Bootstrap 3 like the modals & tabs are
working fine...
I have a Django application with the front-end designed in Twitter
Bootstrap 3. All of the my styling and JS is working fine including the
modals, etc... But I cannot for the life of me get the tooltips of
popovers to do anything....
I am not throwing any errors in Firebug.
Here is the order of my includes:
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="{{ STATIC_URL }}js/bootstrap.min.js"></script>
Here is my an example call for the tooltip I took straight from the
bootstrap site:
<a href="#" data-toggle="tooltip" title="first tooltip">Hover over me</a>
Anyone else have trouble with the 2 elements?
I am fairly certain it is something dumb I've done.
All other JS affects provided in Bootstrap 3 like the modals & tabs are
working fine...
Unable to display view when I call it from a separate ViewController in iOS
Unable to display view when I call it from a separate ViewController in iOS
I have a view controller in my application where on my screen I have a
UIView that the user is required to tap on. When they do that, I want to
call another viewController's view, and display it on the screen for the
user. Unfortunately, I am having trouble displaying the view.
The name of my viewController that I am making the call from is called
"MainViewController", and the ViewController whose view I wish to display
is called, "NextViewController"
Here is my code from where I make the call:
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
NSLog(@"I was touched.");
_nextView = [[NextViewController alloc] init]; //this code is not
being called
[self.view addSubview:_nextView.view]; //neither is this being
called
}
Where _nextView is a property that I declare in the .h file of
MainViewController.
This method is being called, but for some reason because I am able to see
the log statements print to the output, but for some reason I am unable to
call the lines after that. Can anyone see what I'm doing wrong?
Thanks in advance to all who reply.
I have a view controller in my application where on my screen I have a
UIView that the user is required to tap on. When they do that, I want to
call another viewController's view, and display it on the screen for the
user. Unfortunately, I am having trouble displaying the view.
The name of my viewController that I am making the call from is called
"MainViewController", and the ViewController whose view I wish to display
is called, "NextViewController"
Here is my code from where I make the call:
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
NSLog(@"I was touched.");
_nextView = [[NextViewController alloc] init]; //this code is not
being called
[self.view addSubview:_nextView.view]; //neither is this being
called
}
Where _nextView is a property that I declare in the .h file of
MainViewController.
This method is being called, but for some reason because I am able to see
the log statements print to the output, but for some reason I am unable to
call the lines after that. Can anyone see what I'm doing wrong?
Thanks in advance to all who reply.
Segue from Storyboard to XIB
Segue from Storyboard to XIB
I have a storyboard View Controller, which is the first screen in my app.
The rest of the app is designed with xib's. I want to segue from a button
in the storyboard's VC to a XIB file. I know how to do this from a xib to
storyboard, but how about this ?
Thanks in advance !
I have a storyboard View Controller, which is the first screen in my app.
The rest of the app is designed with xib's. I want to segue from a button
in the storyboard's VC to a XIB file. I know how to do this from a xib to
storyboard, but how about this ?
Thanks in advance !
How to convert this Python code to bash?
How to convert this Python code to bash?
This is my intricate python code.
>>> a = ' aa '
>>> a.strip()
'aa'
What it does is, something very intricate. It removes the spaces between "
aa ".
But I need the raw shell version of this so I can test it in terminal
without running python.
So far I tried:
a=' aa '
[root@oooo ~]# a=a.strip()
-bash: syntax error near unexpected token `('
This is my intricate python code.
>>> a = ' aa '
>>> a.strip()
'aa'
What it does is, something very intricate. It removes the spaces between "
aa ".
But I need the raw shell version of this so I can test it in terminal
without running python.
So far I tried:
a=' aa '
[root@oooo ~]# a=a.strip()
-bash: syntax error near unexpected token `('
Thursday, 22 August 2013
__doPostBack() is causing post pack but not calling button click event in aspx page
__doPostBack() is causing post pack but not calling button click event in
aspx page
I am using a aspx page which is having a button.
<asp:Button ID="savebtn" runat="server" OnClick="savebtn_Click"
Style="display: none" />
There are two ways to cause post pack as shown in the below code.
$(document).ready(function () {
var id = document.getElementById('<%= savebtn.ClientID %>');
//Cause post back & calls page load but not savebtn_Click event
__doPostBack('<%= savebtn.ClientID %>', 'OnClick');
});
$(document).ready(function () {
var id = document.getElementById('<%=
savebtn.ClientID %>');
//Cuase postback & calls both PageLoad and savebtn_Click events.
//If I use method, There is no way to know which control caused
postback
id.click();
});
When I use __doPostBack, It calls page load event but not btn click event.
Is there any way using __doPostBack to trigger Page Load as well as
savebtn_Click event.
If I use id.click(); as shown above, I am able to call savebtn_Click but
it does not tells me which control caused the post back.
Please help.
aspx page
I am using a aspx page which is having a button.
<asp:Button ID="savebtn" runat="server" OnClick="savebtn_Click"
Style="display: none" />
There are two ways to cause post pack as shown in the below code.
$(document).ready(function () {
var id = document.getElementById('<%= savebtn.ClientID %>');
//Cause post back & calls page load but not savebtn_Click event
__doPostBack('<%= savebtn.ClientID %>', 'OnClick');
});
$(document).ready(function () {
var id = document.getElementById('<%=
savebtn.ClientID %>');
//Cuase postback & calls both PageLoad and savebtn_Click events.
//If I use method, There is no way to know which control caused
postback
id.click();
});
When I use __doPostBack, It calls page load event but not btn click event.
Is there any way using __doPostBack to trigger Page Load as well as
savebtn_Click event.
If I use id.click(); as shown above, I am able to call savebtn_Click but
it does not tells me which control caused the post back.
Please help.
Using ProgressBar class
Using ProgressBar class
I'm not following how to use the UI type ProgressBar in pyMel.
The old way, or the derivative of this was to do this:
cmds.progressBar('barName', edit=1, progress=50)
However I can't seem to figure out how to use the pymel version of this.
This is what I've tried:
ProgressBar('barName').setProgress(50)
This doesn't work obviously, however I'd much rather use the pymel
version, it's cleaner and easier to read.
I'm not following how to use the UI type ProgressBar in pyMel.
The old way, or the derivative of this was to do this:
cmds.progressBar('barName', edit=1, progress=50)
However I can't seem to figure out how to use the pymel version of this.
This is what I've tried:
ProgressBar('barName').setProgress(50)
This doesn't work obviously, however I'd much rather use the pymel
version, it's cleaner and easier to read.
Adding methods to Object / Number / String prototype
Adding methods to Object / Number / String prototype
Disclaimer
This thread is supposed to serve as a help for other people encountering
similar problems as well as checking whether there are better solutions. I
will attach my own solution, but ideas and improvements (besides making it
more generic) are welcome.
I know that generally, extending the built-in objects is a bad idea. So an
assumption for this thread is that there is a good reason and no way
around it.
Scenario
As a developer, I want to add a method someMethod to all Javascript
objects, wherein the implementation is different for Object, Number and
String.
I want the solution to meet the following acceptance criteria:
A) The solution works in a browser
A1) The solution works in strict mode in case the script is used within a
strict context
A2) The solution works in non-strict mode because 'use strict'; will be
removed during compression in, e.g., the YUI Compressor[1]
B) The solution works in node.js
B1) The solution works in strict mode (reason see A1)
B2) The solution works in non-strict mode for the same reason as in B2,
plus strict mode in node.js cannot be activated on function level[2]
C) I want other objects to be allowed to override this method
D) If possible, I want to have control over whether or not the method
shows up in a for .. in loop to avoid conflicts with other libraries
E) The solution shall actually modify the prototypes.
[1] Minfication removes strict directives
[2] Any way to force strict mode in node?
Disclaimer
This thread is supposed to serve as a help for other people encountering
similar problems as well as checking whether there are better solutions. I
will attach my own solution, but ideas and improvements (besides making it
more generic) are welcome.
I know that generally, extending the built-in objects is a bad idea. So an
assumption for this thread is that there is a good reason and no way
around it.
Scenario
As a developer, I want to add a method someMethod to all Javascript
objects, wherein the implementation is different for Object, Number and
String.
I want the solution to meet the following acceptance criteria:
A) The solution works in a browser
A1) The solution works in strict mode in case the script is used within a
strict context
A2) The solution works in non-strict mode because 'use strict'; will be
removed during compression in, e.g., the YUI Compressor[1]
B) The solution works in node.js
B1) The solution works in strict mode (reason see A1)
B2) The solution works in non-strict mode for the same reason as in B2,
plus strict mode in node.js cannot be activated on function level[2]
C) I want other objects to be allowed to override this method
D) If possible, I want to have control over whether or not the method
shows up in a for .. in loop to avoid conflicts with other libraries
E) The solution shall actually modify the prototypes.
[1] Minfication removes strict directives
[2] Any way to force strict mode in node?
Resolve c++ pointer-to-member error in VS 2003
Resolve c++ pointer-to-member error in VS 2003
I have a c++ program that I'm trying to port from VS98 to VS2003
(incremental steps). One error that occurs throughout is "Error 2275"
For instance: k:\RR\chart\chartdlg.cpp(2025): error C2475:
'CRrDoc::cFldFilter' : forming a pointer-to-member requires explicit use
of the address-of operator ('&') and a qualified name
The offending code is shown below:
void CDataPage::OnBtnLabelField()
{
FLDID fid ;
LPMFFIELD f ;
CRrApp *pApp = (CRrApp *)AfxGetApp();
CMainFrame *pFrame = (CMainFrame *)AfxGetMainWnd();
CRrDoc *pDoc = (CRrDoc *)pFrame->GetActiveDocument();
CSelectFieldDlg dlg;
//**************************************************
//BOOL CRrDoc::*zcFldFilter = &CRrDoc::cFldFilter;
//dlg.ck = CRrDoc->*zcFldFilter;
//**************************************************
dlg.ck = pDoc->cFldFilter ;
dlg.TitleTextID = IDS_2676;
fid = (FLDID)dlg.DoModal();
if (fid != NOID)
{
f = pDoc->m_pComposite->mfbyndx(fid);
// find index
int i, iCount;
iCount = m_lboxLabel.GetCount();
for (i = 0; i < iCount; i++)
{
if(fid == m_lboxLabel.GetItemData(i))
{
m_lboxLabel.SetCurSel(i);
OnSelchangeComboLabel();
}
}
}
}
I tried handling it according to a Microsoft page: But that just generated
a set of other problems (the commented code between the asterisks). Note
that I also commented out the following line:
dlg.ck = pDoc->cFldFilter
Unfortunately, this leads to a new error: k:\RR\chart\chartdlg.cpp(2022):
error C2440: 'initializing' : cannot convert from 'BOOL (__cdecl
)(LPMFFIELD)' to 'BOOL CRrDoc:: '
The definition in the .H file looks like:
public:
static BOOL cFldFilter(LPMFFIELD f);
Any ideas how to handle the pointer-to-member issue?
I have a c++ program that I'm trying to port from VS98 to VS2003
(incremental steps). One error that occurs throughout is "Error 2275"
For instance: k:\RR\chart\chartdlg.cpp(2025): error C2475:
'CRrDoc::cFldFilter' : forming a pointer-to-member requires explicit use
of the address-of operator ('&') and a qualified name
The offending code is shown below:
void CDataPage::OnBtnLabelField()
{
FLDID fid ;
LPMFFIELD f ;
CRrApp *pApp = (CRrApp *)AfxGetApp();
CMainFrame *pFrame = (CMainFrame *)AfxGetMainWnd();
CRrDoc *pDoc = (CRrDoc *)pFrame->GetActiveDocument();
CSelectFieldDlg dlg;
//**************************************************
//BOOL CRrDoc::*zcFldFilter = &CRrDoc::cFldFilter;
//dlg.ck = CRrDoc->*zcFldFilter;
//**************************************************
dlg.ck = pDoc->cFldFilter ;
dlg.TitleTextID = IDS_2676;
fid = (FLDID)dlg.DoModal();
if (fid != NOID)
{
f = pDoc->m_pComposite->mfbyndx(fid);
// find index
int i, iCount;
iCount = m_lboxLabel.GetCount();
for (i = 0; i < iCount; i++)
{
if(fid == m_lboxLabel.GetItemData(i))
{
m_lboxLabel.SetCurSel(i);
OnSelchangeComboLabel();
}
}
}
}
I tried handling it according to a Microsoft page: But that just generated
a set of other problems (the commented code between the asterisks). Note
that I also commented out the following line:
dlg.ck = pDoc->cFldFilter
Unfortunately, this leads to a new error: k:\RR\chart\chartdlg.cpp(2022):
error C2440: 'initializing' : cannot convert from 'BOOL (__cdecl
)(LPMFFIELD)' to 'BOOL CRrDoc:: '
The definition in the .H file looks like:
public:
static BOOL cFldFilter(LPMFFIELD f);
Any ideas how to handle the pointer-to-member issue?
Spring bean not visible: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'reclamationBean' resolved to null
Spring bean not visible: javax.el.PropertyNotFoundException: Target
Unreachable, identifier 'reclamationBean' resolved to null
I am developing a web application using hibernate spring and JSF on
eclipse I have created page:ReclamationList.jsp to list all reclamations
I get an error when I submit my form on first page the code.
This is my page :
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title> Liste des reclamations</title>
</head>
<body>
<f:view>
<h:form id="mainForm">
<rich:scrollableDataTable id="reclamationTable"
binding="#{reclamationBean.reclamationTable}"
value="#{reclamationBean.reclamationList}"
var="reclamation" width="300px" height="200px">
<rich:column id="objet" width="60px">
<f:facet name="header"><h:outputText value="objet"/> </f:facet>
<h:outputText value="#{reclamation.objet}"/>
</rich:column>
<rich:column id="dateCreation" width="60px">
<f:facet name="header"><h:outputText value="dateCreation"/> </f:facet>
<h:outputText value="#{reclamation.dateCreation}"/>
</rich:column>
<rich:column id="priorité" width="60px">
<f:facet name="header"><h:outputText value="priorité"/> </f:facet>
<h:outputText value="#{reclamation.priorité}"/>
</rich:column>
</rich:scrollableDataTable>
</h:form>
</f:view>
</body>
</html>
my class bean is ReclamationBean.java:
package web;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import org.richfaces.component.html.HtmlScrollableDataTable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import DAO.Reclamation;
import service.ReclamationService;
@Component("reclamationBean")
@Scope("session")
public class ReclamationBean implements Serializable {
@Autowired
private List<Reclamation> reclamationList;
private transient ReclamationService reclamationService;
private transient HtmlScrollableDataTable reclamationTable;
public List<Reclamation> getReclamationList() {
return reclamationList;
}
public void setReclamationList(List<Reclamation> reclamationList) {
this.reclamationList = reclamationList;
}
public HtmlScrollableDataTable getReclamationTable() {
return reclamationTable;
}
public void setReclamationTable(HtmlScrollableDataTable
reclamationTable) {
this.reclamationTable = reclamationTable;
}
}
This is the error which I got when I submit my page:
org.apache.jasper.JasperException: javax.faces.FacesException:
javax.faces.el.PropertyNotFoundException:
javax.el.PropertyNotFoundException: Target Unreachable, identifier
'reclamationBean' resolved to null
Unreachable, identifier 'reclamationBean' resolved to null
I am developing a web application using hibernate spring and JSF on
eclipse I have created page:ReclamationList.jsp to list all reclamations
I get an error when I submit my form on first page the code.
This is my page :
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title> Liste des reclamations</title>
</head>
<body>
<f:view>
<h:form id="mainForm">
<rich:scrollableDataTable id="reclamationTable"
binding="#{reclamationBean.reclamationTable}"
value="#{reclamationBean.reclamationList}"
var="reclamation" width="300px" height="200px">
<rich:column id="objet" width="60px">
<f:facet name="header"><h:outputText value="objet"/> </f:facet>
<h:outputText value="#{reclamation.objet}"/>
</rich:column>
<rich:column id="dateCreation" width="60px">
<f:facet name="header"><h:outputText value="dateCreation"/> </f:facet>
<h:outputText value="#{reclamation.dateCreation}"/>
</rich:column>
<rich:column id="priorité" width="60px">
<f:facet name="header"><h:outputText value="priorité"/> </f:facet>
<h:outputText value="#{reclamation.priorité}"/>
</rich:column>
</rich:scrollableDataTable>
</h:form>
</f:view>
</body>
</html>
my class bean is ReclamationBean.java:
package web;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import org.richfaces.component.html.HtmlScrollableDataTable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import DAO.Reclamation;
import service.ReclamationService;
@Component("reclamationBean")
@Scope("session")
public class ReclamationBean implements Serializable {
@Autowired
private List<Reclamation> reclamationList;
private transient ReclamationService reclamationService;
private transient HtmlScrollableDataTable reclamationTable;
public List<Reclamation> getReclamationList() {
return reclamationList;
}
public void setReclamationList(List<Reclamation> reclamationList) {
this.reclamationList = reclamationList;
}
public HtmlScrollableDataTable getReclamationTable() {
return reclamationTable;
}
public void setReclamationTable(HtmlScrollableDataTable
reclamationTable) {
this.reclamationTable = reclamationTable;
}
}
This is the error which I got when I submit my page:
org.apache.jasper.JasperException: javax.faces.FacesException:
javax.faces.el.PropertyNotFoundException:
javax.el.PropertyNotFoundException: Target Unreachable, identifier
'reclamationBean' resolved to null
Uppercase field is not bound properly in template
Uppercase field is not bound properly in template
This is more for reference for others as a real question, since I guess I
have already understood what is going on. But it took a while, so I will
document it here.
In one of my models, I have a field named VAT. I try to bind to this field
in an template:
{{view Ember.TextField valueBinding="VAT" id="VAT-id" placeholder="VAT"
required="true"}}
But this is not working, which was kind of surprising, and took some time
to understand.
Some questions:
Is this a limitation of Ember or ember-data? (I guess ember-data?)
How is an uppercase field name translated by ember? There is a section in
the documentation describing how the REST adapter transforms underscored
attributes, but nothing regarding uppercase fields.
What can I do to refer to this field using the real name? (I guess it is
not possible?)
The only workaround I know is to do:
App.Adapter.map('App.Company', {
...
vat : {key: 'VAT'},
});
which still does not allow to use the real name in the templates; I must
still use vat (in lowercase). I guess it is really not possible to use the
original uppercase field name using ember-data?
NOTE
Oh, and don't forget that the REST adapter must be created after it has
been fully configured, otherwise the configuration is not used. This has
been a source of much confusion too. So do it like this:
App.Adapter = DS.RESTAdapter.extend({ ... });
App.Adapter.configure('plurals', { ... });
App.Adapter.map('App.Company', { ... });
... more adapter configuration
And now you can do:
App.Store = DS.Store.extend({
revision: 13,
adapter: App.Adapter.create(),
...
});
If you invert the order, Ember will not say anything, but the
configuration will not be active.
This is more for reference for others as a real question, since I guess I
have already understood what is going on. But it took a while, so I will
document it here.
In one of my models, I have a field named VAT. I try to bind to this field
in an template:
{{view Ember.TextField valueBinding="VAT" id="VAT-id" placeholder="VAT"
required="true"}}
But this is not working, which was kind of surprising, and took some time
to understand.
Some questions:
Is this a limitation of Ember or ember-data? (I guess ember-data?)
How is an uppercase field name translated by ember? There is a section in
the documentation describing how the REST adapter transforms underscored
attributes, but nothing regarding uppercase fields.
What can I do to refer to this field using the real name? (I guess it is
not possible?)
The only workaround I know is to do:
App.Adapter.map('App.Company', {
...
vat : {key: 'VAT'},
});
which still does not allow to use the real name in the templates; I must
still use vat (in lowercase). I guess it is really not possible to use the
original uppercase field name using ember-data?
NOTE
Oh, and don't forget that the REST adapter must be created after it has
been fully configured, otherwise the configuration is not used. This has
been a source of much confusion too. So do it like this:
App.Adapter = DS.RESTAdapter.extend({ ... });
App.Adapter.configure('plurals', { ... });
App.Adapter.map('App.Company', { ... });
... more adapter configuration
And now you can do:
App.Store = DS.Store.extend({
revision: 13,
adapter: App.Adapter.create(),
...
});
If you invert the order, Ember will not say anything, but the
configuration will not be active.
Combine Netty and Spring MVC
Combine Netty and Spring MVC
How can I configure Netty in Spring MVC. Should I init netty once the
Spring starts? Could someone show me an example such as the Spring
configuration xml file or something eles?
How can I configure Netty in Spring MVC. Should I init netty once the
Spring starts? Could someone show me an example such as the Spring
configuration xml file or something eles?
Wednesday, 21 August 2013
! Undefined control sequence
! Undefined control sequence
I am getting an ! Undefined control sequence error when compiling the
following code:
\documentclass[11pt,table,a5paper]{article}
\usepackage{array,ragged2e}
\usepackage{graphicx}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{lipsum}
\usepackage[top=2cm, bottom=2cm, outer=1cm, inner=2.1cm,twoside,
headsep=26pt]{geometry}
\usepackage{ifthen}
\usepackage{wrapfig}
\usepackage{comment}
\usepackage{parskip}
\usepackage{framed}
\usepackage{sidecap}
\usepackage{longtable}
\begin{longtable}{|p{2.7cm}|p{1.0cm}|p{2.4cm}|p{1.0cm}|p{1.3cm}|p{0.8cm}|}
\hline
\rowcolor{white} \textbf{ \textcolor{white}{A}} &\textbf{
\textcolor{white}{B}} &\textbf{ \textcolor{white}{C}} &\textbf{
\textcolor{white}{D}} &\textbf{ \textcolor{white}{E}} &\textbf{
\textcolor{white}{P}} \\
\endfirsthead
\rowcolor{white} \textbf{ \textcolor{white}{A}} &\textbf{
\textcolor{white}{B}} &\textbf{ \textcolor{white}{C}} &\textbf{
\textcolor{white}{D}} &\textbf{ \textcolor{white}{E}} &\textbf{
\textcolor{white}{P}} \\
\endhead
\hline
\newcommand{\dsr}{\rule[-3.5cm]{0pt}{4cm}}
\dsr XXXXXXX & \dsr 3.38& \multirow{1}{*}{\parbox{2.5cm}
{\textcolor{black}{XXXXXXX >2,~\\
~\\
XXXXXXX~\\
~\\
XXXXXy XXXXX XXXXX XXXXX}}}
&\dsr 2.36\% & \dsr 0.62\% & \dsr 18 \\\cline{1-2} \cline{4-6}
\hline
\end{longtable}}
\end{document}
How to fix this issue?
I am getting an ! Undefined control sequence error when compiling the
following code:
\documentclass[11pt,table,a5paper]{article}
\usepackage{array,ragged2e}
\usepackage{graphicx}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{lipsum}
\usepackage[top=2cm, bottom=2cm, outer=1cm, inner=2.1cm,twoside,
headsep=26pt]{geometry}
\usepackage{ifthen}
\usepackage{wrapfig}
\usepackage{comment}
\usepackage{parskip}
\usepackage{framed}
\usepackage{sidecap}
\usepackage{longtable}
\begin{longtable}{|p{2.7cm}|p{1.0cm}|p{2.4cm}|p{1.0cm}|p{1.3cm}|p{0.8cm}|}
\hline
\rowcolor{white} \textbf{ \textcolor{white}{A}} &\textbf{
\textcolor{white}{B}} &\textbf{ \textcolor{white}{C}} &\textbf{
\textcolor{white}{D}} &\textbf{ \textcolor{white}{E}} &\textbf{
\textcolor{white}{P}} \\
\endfirsthead
\rowcolor{white} \textbf{ \textcolor{white}{A}} &\textbf{
\textcolor{white}{B}} &\textbf{ \textcolor{white}{C}} &\textbf{
\textcolor{white}{D}} &\textbf{ \textcolor{white}{E}} &\textbf{
\textcolor{white}{P}} \\
\endhead
\hline
\newcommand{\dsr}{\rule[-3.5cm]{0pt}{4cm}}
\dsr XXXXXXX & \dsr 3.38& \multirow{1}{*}{\parbox{2.5cm}
{\textcolor{black}{XXXXXXX >2,~\\
~\\
XXXXXXX~\\
~\\
XXXXXy XXXXX XXXXX XXXXX}}}
&\dsr 2.36\% & \dsr 0.62\% & \dsr 18 \\\cline{1-2} \cline{4-6}
\hline
\end{longtable}}
\end{document}
How to fix this issue?
For squarefree $i$ what is $\sum_i^{n} \frac{1}{i}$?
For squarefree $i$ what is $\sum_i^{n} \frac{1}{i}$?
For squarefree $i$ what is $\sum_i^{n} \frac{1}{i}$ ? I use $\sum_m \mu(m)
ln(\frac{n}{m^2}+\frac{1}{2})$. I know about the connection with
$\zeta(2)$ and $\frac{\zeta(s)}{\zeta(2s)}$ but that does not help ??
Can I do better ?
For squarefree $i$ what is $\sum_i^{n} \frac{1}{i}$ ? I use $\sum_m \mu(m)
ln(\frac{n}{m^2}+\frac{1}{2})$. I know about the connection with
$\zeta(2)$ and $\frac{\zeta(s)}{\zeta(2s)}$ but that does not help ??
Can I do better ?
How to drop Oracle LOB
How to drop Oracle LOB
The following query can be used to list the database objects of the user:
select object_name, object_type from user_objects;
There are couple of entries where the object_type is LOB.
How can these LOB objects be dropped in Oracle?
The following query can be used to list the database objects of the user:
select object_name, object_type from user_objects;
There are couple of entries where the object_type is LOB.
How can these LOB objects be dropped in Oracle?
Should MongooseJS be emitting events on replica set disconnection?
Should MongooseJS be emitting events on replica set disconnection?
With a single server setup, I receive events from the driver.
mongoose.connect('mongodb://localhost/mydb');
mongoose.connection.on('disconnected', function() {...});
mongoose.connection.on('error', function(err) {...});
When using a replica set
(mongoose.connect('mongodb://localhost:27017/mydb,mongodb://localhost:27018/mydb');),
shutting down all connected set members doesn't trigger those same events.
I'm not very familiar with the internals of the native driver and I'm
wondering if this is a bug or if I need to manually detect this condition.
I'm using Mongoose 3.6.17 (mongodb driver 1.3.18)
Sans mongoose, I tried this with the same results (no events from a
replica set).
require('mongodb').MongoClient.connect("mongodb://localhost:27017,localhost:27018/mydb",
function(err, db) {
if (db) {
db.on('disconnected', function() {
console.log('disconnected');
}).on('error', function(err) {
console.log('error');
});
}
});
With a single server setup, I receive events from the driver.
mongoose.connect('mongodb://localhost/mydb');
mongoose.connection.on('disconnected', function() {...});
mongoose.connection.on('error', function(err) {...});
When using a replica set
(mongoose.connect('mongodb://localhost:27017/mydb,mongodb://localhost:27018/mydb');),
shutting down all connected set members doesn't trigger those same events.
I'm not very familiar with the internals of the native driver and I'm
wondering if this is a bug or if I need to manually detect this condition.
I'm using Mongoose 3.6.17 (mongodb driver 1.3.18)
Sans mongoose, I tried this with the same results (no events from a
replica set).
require('mongodb').MongoClient.connect("mongodb://localhost:27017,localhost:27018/mydb",
function(err, db) {
if (db) {
db.on('disconnected', function() {
console.log('disconnected');
}).on('error', function(err) {
console.log('error');
});
}
});
How to build links in code using the ctools_modal_text_button() function?
How to build links in code using the ctools_modal_text_button() function?
On the Modal forms (with ctools) they say:
To build links in code I recommend using the ctools_modal_text_button()
function.
$links[] = ctools_modal_text_button(t('Modal Login'),
'modal_forms/nojs/login', t('Login via modal'));
$links[] = ctools_modal_text_button(t('Modal Login'),
'modal_forms/nojs/login', t('Login via modal'),
'ctools-modal-modal-popup-small');
Where should I enter this code? Witch file and after witch line?
On the Modal forms (with ctools) they say:
To build links in code I recommend using the ctools_modal_text_button()
function.
$links[] = ctools_modal_text_button(t('Modal Login'),
'modal_forms/nojs/login', t('Login via modal'));
$links[] = ctools_modal_text_button(t('Modal Login'),
'modal_forms/nojs/login', t('Login via modal'),
'ctools-modal-modal-popup-small');
Where should I enter this code? Witch file and after witch line?
Android Http url connection Throwing File Not Found Exception at getInputstream
Android Http url connection Throwing File Not Found Exception at
getInputstream
Hi guys i am trying to post some json string to a rest sever but im getting
a java file not found exception at get input stream
getInputstream
Hi guys i am trying to post some json string to a rest sever but im getting
a java file not found exception at get input stream
Tuesday, 20 August 2013
How to lock Windows 7 workstation after inactivity via GPO (no screensaver or blank screen- just lock screen)
How to lock Windows 7 workstation after inactivity via GPO (no screensaver
or blank screen- just lock screen)
Our users have increasingly started leaving their workstations logged in
and unattended (during lunch breaks etc.)
To tackle the security threat this poses, we have enforced a
password-protected screensaver via Group Policy.
The DC server is running SBS 2003, and the workstations are now mostly
Windows 7 (a couple of XP PCs still).
Screensavers popping up can be a little distracting, and screens going
completely blank after 30 minutes can be confusing for some users, so I
would like to have the workstations simply lock after 30 minutes instead.
The monitors will eventually power off (after 60 minutes).
Auto-locking is easy to set manually...
...but I can't see a way to do this in Group Policy.
Does anyone know of a way this can be achieved in this SBS 2003/ Windows 7
environment?
or blank screen- just lock screen)
Our users have increasingly started leaving their workstations logged in
and unattended (during lunch breaks etc.)
To tackle the security threat this poses, we have enforced a
password-protected screensaver via Group Policy.
The DC server is running SBS 2003, and the workstations are now mostly
Windows 7 (a couple of XP PCs still).
Screensavers popping up can be a little distracting, and screens going
completely blank after 30 minutes can be confusing for some users, so I
would like to have the workstations simply lock after 30 minutes instead.
The monitors will eventually power off (after 60 minutes).
Auto-locking is easy to set manually...
...but I can't see a way to do this in Group Policy.
Does anyone know of a way this can be achieved in this SBS 2003/ Windows 7
environment?
Unable to add associations to Active Records model/table, Rails3.2.14
Unable to add associations to Active Records model/table, Rails3.2.14
I am working on a simple job portal which has few tables/resources that I
generated using scaffold in rails and using ActiveRecord as ORM. Tables :
User, Jobs
My User has 2 roles, recruiters and applicant ( I am using rolify, cancan
gems)
These are the steps I performed:
1] Generate tables using scaffold. 2] Run db:migrate, I can see the tables
now 3] I added some belongs_to , has_one, has_many associations in the
mode/.rb file. 4] Run db:migrate:reset , to recreate the db schema that
includes associations 5] I dont see any foreign_key columns in the User,
Jobs table.
What command do I need to run after I add associations to table so that I
can see the foreign key columns in my tables ?
Note:
1] If my associations are incorrect (semantically) thats okay, since I can
change them eventually. However I dont see any errors when I run rake
db:migrate
2] I haven't done any changes to the migrations. Not sure if I need to do
something there ?
Models:
class User < ActiveRecord::Base
rolify
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :role_ids, :as => :admin
attr_accessible :name, :email, :password, :password_confirmation,
:remember_me, :user_id
validates_presence_of :email
end
class Job < ActiveRecord::Base
attr_accessible :company, :desc, :location, :application_id,
:applicant_id
belongs_to :recruiters, :class_name => "User"
has_many :applications
has_many :applicants,:class_name => "User", through: :applications
end
class Application < ActiveRecord::Base
attr_accessible :applicant_email, :applicant_name, :recruiter_id,
:applicant_id, :user_id
belongs_to :jobs
belongs_to :applicants, :class_name => "User"
end
I am working on a simple job portal which has few tables/resources that I
generated using scaffold in rails and using ActiveRecord as ORM. Tables :
User, Jobs
My User has 2 roles, recruiters and applicant ( I am using rolify, cancan
gems)
These are the steps I performed:
1] Generate tables using scaffold. 2] Run db:migrate, I can see the tables
now 3] I added some belongs_to , has_one, has_many associations in the
mode/.rb file. 4] Run db:migrate:reset , to recreate the db schema that
includes associations 5] I dont see any foreign_key columns in the User,
Jobs table.
What command do I need to run after I add associations to table so that I
can see the foreign key columns in my tables ?
Note:
1] If my associations are incorrect (semantically) thats okay, since I can
change them eventually. However I dont see any errors when I run rake
db:migrate
2] I haven't done any changes to the migrations. Not sure if I need to do
something there ?
Models:
class User < ActiveRecord::Base
rolify
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :role_ids, :as => :admin
attr_accessible :name, :email, :password, :password_confirmation,
:remember_me, :user_id
validates_presence_of :email
end
class Job < ActiveRecord::Base
attr_accessible :company, :desc, :location, :application_id,
:applicant_id
belongs_to :recruiters, :class_name => "User"
has_many :applications
has_many :applicants,:class_name => "User", through: :applications
end
class Application < ActiveRecord::Base
attr_accessible :applicant_email, :applicant_name, :recruiter_id,
:applicant_id, :user_id
belongs_to :jobs
belongs_to :applicants, :class_name => "User"
end
Proper method of returning const char* from a function, e.g., overriding std::exception::what()
Proper method of returning const char* from a function, e.g., overriding
std::exception::what()
When extending std::exception, I am wondering the proper way of overriding
what()?
Lets say I have an exception class :
class MyException : public std::exception {
public:
MyException(const string& _type) : m_type(_type) {}
virtual const char* what() const throw() {
string s = "Error::" + _type;
return s.c_str();
}
}
I have used a static analysis tool on the above code, and it is
complaining that the string s will leave the scope and destroy the memory
associated with the string, so it could potentially be a problem if I use
what() in some part of my code.
If there a proper way of returning a const char* from a function without
these issues retaining proper memory management?
std::exception::what()
When extending std::exception, I am wondering the proper way of overriding
what()?
Lets say I have an exception class :
class MyException : public std::exception {
public:
MyException(const string& _type) : m_type(_type) {}
virtual const char* what() const throw() {
string s = "Error::" + _type;
return s.c_str();
}
}
I have used a static analysis tool on the above code, and it is
complaining that the string s will leave the scope and destroy the memory
associated with the string, so it could potentially be a problem if I use
what() in some part of my code.
If there a proper way of returning a const char* from a function without
these issues retaining proper memory management?
jqGrid keeps on displaying "Loading"
jqGrid keeps on displaying "Loading"
I am using a asmx service to return data to display in jqGrid. I can see
the json data is returned in complete callback. This is what json data in
the complete callback look like
{"d":[{"__type":"HHSC.CTF.Business.BatchReceiptModel","BReceiptId".....I
am not sure why it preceded by d: and also the type name for the data.
This is my jqGrid setup look like
$("#list").jqGrid({ url:
"../../WebServices/BatchReceiptsWebService.asmx/BatchReceiptsTable",
datatype: "json", mtype: 'POST', ajaxGridOptions: { contentType:
'application/json; charset=utf-8', success: function (data, status) {
},
complete: function (xhr) {
},
error: function (jqXHR, textStatus, errorThrown) {
}
},
serializeGridData: function (postData) {
return JSON.stringify(postData);
},
jsonReader: {
repeatitems: false,
id: "BReceiptId",
page: function (obj) { return 1; },
total: function (obj) { return 1; },
root: function (obj) { return obj; },
records: function (obj) {
return obj.d.length;
}
},
colNames: ['BReceiptId', 'ReceiptNumber', 'ReceiptAmount'],
colModel: [
{ name: 'BReceiptId', index: 'BReceiptIdnId', width:
100 },
{ name: 'ReceiptNumber', index: 'ReceiptNumber',
width: 150 },
{ name: 'ReceiptAmount', index: 'ReceiptAmount',
align: 'right', width: 100 }
],
rowNum: 10,
loadonce: true,
gridview: true,
rownumbers: true,
rowList: [10, 20, 30],
viewrecords: true
});
I am using a asmx service to return data to display in jqGrid. I can see
the json data is returned in complete callback. This is what json data in
the complete callback look like
{"d":[{"__type":"HHSC.CTF.Business.BatchReceiptModel","BReceiptId".....I
am not sure why it preceded by d: and also the type name for the data.
This is my jqGrid setup look like
$("#list").jqGrid({ url:
"../../WebServices/BatchReceiptsWebService.asmx/BatchReceiptsTable",
datatype: "json", mtype: 'POST', ajaxGridOptions: { contentType:
'application/json; charset=utf-8', success: function (data, status) {
},
complete: function (xhr) {
},
error: function (jqXHR, textStatus, errorThrown) {
}
},
serializeGridData: function (postData) {
return JSON.stringify(postData);
},
jsonReader: {
repeatitems: false,
id: "BReceiptId",
page: function (obj) { return 1; },
total: function (obj) { return 1; },
root: function (obj) { return obj; },
records: function (obj) {
return obj.d.length;
}
},
colNames: ['BReceiptId', 'ReceiptNumber', 'ReceiptAmount'],
colModel: [
{ name: 'BReceiptId', index: 'BReceiptIdnId', width:
100 },
{ name: 'ReceiptNumber', index: 'ReceiptNumber',
width: 150 },
{ name: 'ReceiptAmount', index: 'ReceiptAmount',
align: 'right', width: 100 }
],
rowNum: 10,
loadonce: true,
gridview: true,
rownumbers: true,
rowList: [10, 20, 30],
viewrecords: true
});
Maximum throughput webserver for images
Maximum throughput webserver for images
We need a simple/lightweight web server for small PNG (typically 50KB). We
will have several million.
We have done some testing with GoogleDrive which has an unknown web
server, but it does have SPDY support, which seems to really improve
download of batches of images (about 25 files/sec) currently.
We now need to standup our own server.
Any recommendations. Throughput of simple PNG files is the only goal. We
prefer open source Server Specs: Windows 2008 Server, 24+ GB memory, over
1TB disk, 8 core
WEBDAV support is a must.
I see that Apache 2 has a SPDY module: http://en.wikipedia.org/wiki/SPDY
There are some reviews at:
http://www.webperformance.com/load-testing/blog/2011/11/what-is-the-fastest-webserver/
LiteSpeed claims they are faster than Apache:
http://www.litespeedtech.com/overview.html But we don't need PHP scripts,
just fast downloads of PNG (and also JS, CSS)
It seems that the http://open.litespeedtech.com/mediawiki/ does not work
on Windows.
We need a simple/lightweight web server for small PNG (typically 50KB). We
will have several million.
We have done some testing with GoogleDrive which has an unknown web
server, but it does have SPDY support, which seems to really improve
download of batches of images (about 25 files/sec) currently.
We now need to standup our own server.
Any recommendations. Throughput of simple PNG files is the only goal. We
prefer open source Server Specs: Windows 2008 Server, 24+ GB memory, over
1TB disk, 8 core
WEBDAV support is a must.
I see that Apache 2 has a SPDY module: http://en.wikipedia.org/wiki/SPDY
There are some reviews at:
http://www.webperformance.com/load-testing/blog/2011/11/what-is-the-fastest-webserver/
LiteSpeed claims they are faster than Apache:
http://www.litespeedtech.com/overview.html But we don't need PHP scripts,
just fast downloads of PNG (and also JS, CSS)
It seems that the http://open.litespeedtech.com/mediawiki/ does not work
on Windows.
Develop R$$ population in SimCity4
Develop R$$ population in SimCity4
I want to develop city with only mid-wealth population, little R$ and with
jobs I-M industry and Co§§. Can anyone explain to me what R$$ wants? What
is their demand? I'm trying to find it, but I need help. I only get R$
population high RCI demand, but not R$$.
I want to develop city with only mid-wealth population, little R$ and with
jobs I-M industry and Co§§. Can anyone explain to me what R$$ wants? What
is their demand? I'm trying to find it, but I need help. I only get R$
population high RCI demand, but not R$$.
Maximum Dispersion of a Connected Graph
Maximum Dispersion of a Connected Graph
Let $\left\{\mathbf{p}_1,\dots, \mathbf{p}_k\right\}$ be a set of points
in $n$-dimensional Euclidean space, and let the second moment of these
points be defined as:
$ U=\sum \limits_{i=1}^{k} ||\mathbf{p}_i -\bar{\mathbf{p}}||^2, $
where $\bar{\mathbf{p}}$ is their centroid.
Let two points $i$ and $j$ be connected if $||\mathbf{p}_i -
\mathbf{p}_j||\leq \lambda$.
Then, under the constraint that the points are to form a connected graph,
what is the configuration that maximizes their second moment?
Let $\left\{\mathbf{p}_1,\dots, \mathbf{p}_k\right\}$ be a set of points
in $n$-dimensional Euclidean space, and let the second moment of these
points be defined as:
$ U=\sum \limits_{i=1}^{k} ||\mathbf{p}_i -\bar{\mathbf{p}}||^2, $
where $\bar{\mathbf{p}}$ is their centroid.
Let two points $i$ and $j$ be connected if $||\mathbf{p}_i -
\mathbf{p}_j||\leq \lambda$.
Then, under the constraint that the points are to form a connected graph,
what is the configuration that maximizes their second moment?
Monday, 19 August 2013
Installing NVIDIA Quadro K5000 in Debian 7
Installing NVIDIA Quadro K5000 in Debian 7
I have an HP DL580 server with Debian 7. This machine has an embedded
card, namely ATI ES1000. I installed an NVIDIA Quadro K5000 on the server
and followed the instructions provided in
https://wiki.debian.org/NvidiaGraphicsDrivers to set it up. I changed
/etc/X11/xorg.conf in order to get rid of some well-known bugs (such as
adding BusID option). Now, Gnome still runs in the fall-back mode and when
I run nvidia-settings, it complains that You do not appear to be using the
NVIDIA X driver. Running nvidia-xconfig does not help as well. I don't
know how to activate this card as the primary graphics card and be able to
use its 3d acceleration. Any help is appreciated.
The content of xorg.conf is as follows:
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection
Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "keyboard"
EndSection
Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection
Section "Device"
Identifier "Device1"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "Quadro K5000"
BusID "PCI:11:0:0"
EndSection
Section "Screen"
Identifier "Default Screen"
Device "Device1"
Option "ConnectedMonitor" "DFP"
Option "UseDisplayDevice" "DFP"
SubSection "Display"
Modes "nvidia-auto-select"
EndSubSection
EndSection
The content of /var/log/Xorg.0.log is as follows:
[ 5261.396]
X.Org X Server 1.12.4
Release Date: 2012-08-27
[ 5261.396] X Protocol Version 11, Revision 0
[ 5261.396] Build Operating System: Linux 3.2.0-4-amd64 x86_64 Debian
[ 5261.396] Current Operating System: Linux sahand 3.2.0-4-amd64 #1 SMP
Debian 3.2.46-1 x86_64
[ 5261.396] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.2.0-4-amd64
root=UUID=8e750507-2beb-4808-924c-a27eb4c528d6 ro quiet
[ 5261.396] Build Date: 17 April 2013 10:22:47AM
[ 5261.396] xorg-server 2:1.12.4-6 (Julien Cristau <jcristau@debian.org>)
[ 5261.396] Current version of pixman: 0.26.0
[ 5261.396] Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[ 5261.396] Markers: (--) probed, (**) from config file, (==) default
setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 5261.397] (==) Log file: "/var/log/Xorg.0.log", Time: Mon Aug 19
21:12:26 2013
[ 5261.397] (==) Using config file: "/etc/X11/xorg.conf"
[ 5261.397] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 5261.397] (==) ServerLayout "Default Layout"
[ 5261.397] (**) |-->Screen "Default Screen" (0)
[ 5261.397] (**) | |-->Monitor "<default monitor>"
[ 5261.398] (**) | |-->Device "Device1"
[ 5261.398] (==) No monitor specified for screen "Default Screen".
Using a default monitor configuration.
[ 5261.398] (**) |-->Input Device "Keyboard0"
[ 5261.398] (**) |-->Input Device "Mouse0"
[ 5261.398] (==) Automatically adding devices
[ 5261.398] (==) Automatically enabling devices
[ 5261.398] (==) FontPath set to:
/usr/share/fonts/X11/misc,
/usr/share/fonts/X11/cyrillic,
/usr/share/fonts/X11/100dpi/:unscaled,
/usr/share/fonts/X11/75dpi/:unscaled,
/usr/share/fonts/X11/Type1,
/usr/share/fonts/X11/100dpi,
/usr/share/fonts/X11/75dpi,
/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType,
built-ins
[ 5261.398] (==) ModulePath set to "/usr/lib/xorg/modules"
[ 5261.398] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse'
or 'vmmouse' will be disabled.
[ 5261.398] (WW) Disabling Keyboard0
[ 5261.398] (WW) Disabling Mouse0
[ 5261.398] (II) Loader magic: 0x7fd684c59ae0
[ 5261.398] (II) Module ABI versions:
[ 5261.398] X.Org ANSI C Emulation: 0.4
[ 5261.398] X.Org Video Driver: 12.1
[ 5261.398] X.Org XInput driver : 16.0
[ 5261.398] X.Org Server Extension : 6.0
[ 5261.405] (--) PCI:*(0:1:3:0) 1002:515e:103c:31fb rev 2, Mem @
0xc8000000/134217728, 0xa0710000/65536, I/O @ 0x00002000/256, BIOS @
0x????????/131072
[ 5261.406] (--) PCI: (0:11:0:0) 10de:11ba:103c:0965 rev 161, Mem @
0x90000000/16777216, 0xb0000000/268435456, 0xa2000000/33554432, I/O @
0x00005000/128, BIOS @ 0x????????/524288
[ 5261.406] (II) Open ACPI successful (/var/run/acpid.socket)
[ 5261.406] (II) LoadModule: "extmod"
[ 5261.406] (II) Loading /usr/lib/xorg/modules/extensions/libextmod.so
[ 5261.407] (II) Module extmod: vendor="X.Org Foundation"
[ 5261.407] compiled for 1.12.4, module version = 1.0.0
[ 5261.407] Module class: X.Org Server Extension
[ 5261.407] ABI class: X.Org Server Extension, version 6.0
[ 5261.407] (II) Loading extension SELinux
[ 5261.407] (II) Loading extension MIT-SCREEN-SAVER
[ 5261.407] (II) Loading extension XFree86-VidModeExtension
[ 5261.407] (II) Loading extension XFree86-DGA
[ 5261.407] (II) Loading extension DPMS
[ 5261.407] (II) Loading extension XVideo
[ 5261.407] (II) Loading extension XVideo-MotionCompensation
[ 5261.407] (II) Loading extension X-Resource
[ 5261.407] (II) LoadModule: "dbe"
[ 5261.407] (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so
[ 5261.408] (II) Module dbe: vendor="X.Org Foundation"
[ 5261.408] compiled for 1.12.4, module version = 1.0.0
[ 5261.408] Module class: X.Org Server Extension
[ 5261.408] ABI class: X.Org Server Extension, version 6.0
[ 5261.408] (II) Loading extension DOUBLE-BUFFER
[ 5261.408] (II) LoadModule: "glx"
[ 5261.408] (II) Loading /usr/lib/xorg/modules/linux/libglx.so
[ 5261.429] (II) Module glx: vendor="NVIDIA Corporation"
[ 5261.429] compiled for 4.0.2, module version = 1.0.0
[ 5261.429] Module class: X.Org Server Extension
[ 5261.429] (II) NVIDIA GLX Module 304.88 Wed Mar 27 14:46:57 PDT 2013
[ 5261.429] (II) Loading extension GLX
[ 5261.429] (II) LoadModule: "record"
[ 5261.429] (II) Loading /usr/lib/xorg/modules/extensions/librecord.so
[ 5261.430] (II) Module record: vendor="X.Org Foundation"
[ 5261.430] compiled for 1.12.4, module version = 1.13.0
[ 5261.430] Module class: X.Org Server Extension
[ 5261.430] ABI class: X.Org Server Extension, version 6.0
[ 5261.430] (II) Loading extension RECORD
[ 5261.430] (II) LoadModule: "dri"
[ 5261.430] (II) Loading /usr/lib/xorg/modules/extensions/libdri.so
[ 5261.430] (II) Module dri: vendor="X.Org Foundation"
[ 5261.430] compiled for 1.12.4, module version = 1.0.0
[ 5261.430] ABI class: X.Org Server Extension, version 6.0
[ 5261.430] (II) Loading extension XFree86-DRI
[ 5261.430] (II) LoadModule: "dri2"
[ 5261.431] (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so
[ 5261.431] (II) Module dri2: vendor="X.Org Foundation"
[ 5261.431] compiled for 1.12.4, module version = 1.2.0
[ 5261.431] ABI class: X.Org Server Extension, version 6.0
[ 5261.431] (II) Loading extension DRI2
[ 5261.431] (II) LoadModule: "nvidia"
[ 5261.431] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
[ 5261.432] (II) Module nvidia: vendor="NVIDIA Corporation"
[ 5261.432] compiled for 4.0.2, module version = 1.0.0
[ 5261.432] Module class: X.Org Video Driver
[ 5261.433] (II) NVIDIA dlloader X Driver 304.88 Wed Mar 27 14:28:14
PDT 2013
[ 5261.433] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[ 5261.433] (++) using VT number 9
[ 5261.444] (II) Loading sub module "fb"
[ 5261.444] (II) LoadModule: "fb"
[ 5261.444] (II) Loading /usr/lib/xorg/modules/libfb.so
[ 5261.444] (II) Module fb: vendor="X.Org Foundation"
[ 5261.444] compiled for 1.12.4, module version = 1.0.0
[ 5261.444] ABI class: X.Org ANSI C Emulation, version 0.4
[ 5261.444] (II) Loading sub module "wfb"
[ 5261.444] (II) LoadModule: "wfb"
[ 5261.445] (II) Loading /usr/lib/xorg/modules/libwfb.so
[ 5261.445] (II) Module wfb: vendor="X.Org Foundation"
[ 5261.445] compiled for 1.12.4, module version = 1.0.0
[ 5261.445] ABI class: X.Org ANSI C Emulation, version 0.4
[ 5261.445] (II) Loading sub module "ramdac"
[ 5261.445] (II) LoadModule: "ramdac"
[ 5261.445] (II) Module "ramdac" already built-in
[ 5261.445] (==) NVIDIA(0): Depth 24, (==) framebuffer bpp 32
[ 5261.445] (==) NVIDIA(0): RGB weight 888
[ 5261.445] (==) NVIDIA(0): Default visual is TrueColor
[ 5261.445] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
[ 5261.446] (**) NVIDIA(0): Option "ConnectedMonitor" "DFP"
[ 5261.446] (**) NVIDIA(0): Option "UseDisplayDevice" "DFP"
[ 5261.446] (**) NVIDIA(0): Enabling 2D acceleration
[ 5261.446] (**) NVIDIA(0): ConnectedMonitor string: "DFP"
[ 5262.618] (**) NVIDIA(GPU-0): Using ConnectedMonitor string "DFP-0".
[ 5262.625] (WW) NVIDIA(GPU-0): Unable to read EDID for display device DFP-0
[ 5262.627] (II) NVIDIA(0): NVIDIA GPU Quadro K5000 (GK104GL) at
PCI:11:0:0 (GPU-0)
[ 5262.627] (--) NVIDIA(0): Memory: 4194304 kBytes
[ 5262.627] (--) NVIDIA(0): VideoBIOS: 80.04.50.00.02
[ 5262.627] (II) NVIDIA(0): Detected PCI Express Link width: 16X
[ 5262.627] (--) NVIDIA(0): Interlaced video modes are supported on this GPU
[ 5262.657] (--) NVIDIA(0): Valid display device(s) on Quadro K5000 at
PCI:11:0:0
[ 5262.657] (--) NVIDIA(0): CRT-0
[ 5262.657] (--) NVIDIA(0): DFP-0 (connected)
[ 5262.657] (--) NVIDIA(0): DFP-1
[ 5262.657] (--) NVIDIA(0): DFP-2
[ 5262.657] (--) NVIDIA(0): DFP-3
[ 5262.657] (--) NVIDIA(0): DFP-4
[ 5262.657] (--) NVIDIA(0): DFP-5
[ 5262.657] (--) NVIDIA(0): CRT-0: 400.0 MHz maximum pixel clock
[ 5262.657] (--) NVIDIA(0): DFP-0: 330.0 MHz maximum pixel clock
[ 5262.657] (--) NVIDIA(0): DFP-0: Internal Single Link TMDS
[ 5262.657] (--) NVIDIA(0): DFP-1: 165.0 MHz maximum pixel clock
[ 5262.657] (--) NVIDIA(0): DFP-1: Internal Single Link TMDS
[ 5262.657] (--) NVIDIA(0): DFP-2: 165.0 MHz maximum pixel clock
[ 5262.657] (--) NVIDIA(0): DFP-2: Internal Single Link TMDS
[ 5262.657] (--) NVIDIA(0): DFP-3: 330.0 MHz maximum pixel clock
[ 5262.657] (--) NVIDIA(0): DFP-3: Internal Single Link TMDS
[ 5262.657] (--) NVIDIA(0): DFP-4: 960.0 MHz maximum pixel clock
[ 5262.657] (--) NVIDIA(0): DFP-4: Internal DisplayPort
[ 5262.657] (--) NVIDIA(0): DFP-5: 960.0 MHz maximum pixel clock
[ 5262.658] (--) NVIDIA(0): DFP-5: Internal DisplayPort
[ 5262.658] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the
EDID for display
[ 5262.658] (**) NVIDIA(0): device DFP-0 (Using EDID frequencies has
been enabled on
[ 5262.658] (**) NVIDIA(0): all display devices.)
[ 5262.658] (II) NVIDIA(0): Validated MetaModes:
[ 5262.658] (II) NVIDIA(0): "DFP-0:nvidia-auto-select"
[ 5262.658] (II) NVIDIA(0): Virtual screen size determined to be 800 x 600
[ 5262.688] (WW) NVIDIA(0): Unable to get display device DFP-0's EDID;
cannot compute DPI
[ 5262.688] (WW) NVIDIA(0): from DFP-0's EDID.
[ 5262.688] (==) NVIDIA(0): DPI set to (75, 75); computed from built-in
default
[ 5262.688] (WW) NVIDIA(0): UBB is incompatible with the Composite
extension. Disabling
[ 5262.688] (WW) NVIDIA(0): UBB.
[ 5262.688] (--) Depth 24 pixmap format is 32 bpp
[ 5262.688] (II) NVIDIA: Using 3072.00 MB of virtual memory for indirect
memory
[ 5262.688] (II) NVIDIA: access.
[ 5262.738] (II) NVIDIA(0): Setting mode "DFP-0:nvidia-auto-select"
[ 5262.789] (II) Loading extension NV-GLX
[ 5262.801] (==) NVIDIA(0): Disabling shared memory pixmaps
[ 5262.801] (==) NVIDIA(0): Backing store disabled
[ 5262.801] (==) NVIDIA(0): Silken mouse enabled
[ 5262.802] (==) NVIDIA(0): DPMS enabled
[ 5262.802] (II) Loading extension NV-CONTROL
[ 5262.803] (II) Loading extension XINERAMA
[ 5262.803] (II) Loading sub module "dri2"
[ 5262.803] (II) LoadModule: "dri2"
[ 5262.803] (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so
[ 5262.803] (II) Module dri2: vendor="X.Org Foundation"
[ 5262.803] compiled for 1.12.4, module version = 1.2.0
[ 5262.803] ABI class: X.Org Server Extension, version 6.0
[ 5262.803] (II) NVIDIA(0): [DRI2] Setup complete
[ 5262.803] (II) NVIDIA(0): [DRI2] VDPAU driver: nvidia
[ 5262.803] (--) RandR disabled
[ 5262.803] (II) Initializing built-in extension Generic Event Extension
[ 5262.803] (II) Initializing built-in extension SHAPE
[ 5262.803] (II) Initializing built-in extension MIT-SHM
[ 5262.803] (II) Initializing built-in extension XInputExtension
[ 5262.803] (II) Initializing built-in extension XTEST
[ 5262.803] (II) Initializing built-in extension BIG-REQUESTS
[ 5262.803] (II) Initializing built-in extension SYNC
[ 5262.803] (II) Initializing built-in extension XKEYBOARD
[ 5262.803] (II) Initializing built-in extension XC-MISC
[ 5262.803] (II) Initializing built-in extension SECURITY
[ 5262.803] (II) Initializing built-in extension XINERAMA
[ 5262.803] (II) Initializing built-in extension XFIXES
[ 5262.803] (II) Initializing built-in extension RENDER
[ 5262.803] (II) Initializing built-in extension RANDR
[ 5262.803] (II) Initializing built-in extension COMPOSITE
[ 5262.803] (II) Initializing built-in extension DAMAGE
[ 5262.803] (II) SELinux: Disabled on system
[ 5262.804] (II) Initializing extension GLX
[ 5262.992] (II) config/udev: Adding input device Power Button
(/dev/input/event2)
[ 5262.992] (**) Power Button: Applying InputClass "evdev keyboard catchall"
[ 5262.992] (II) LoadModule: "evdev"
[ 5262.993] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
[ 5262.993] (II) Module evdev: vendor="X.Org Foundation"
[ 5262.993] compiled for 1.12.1, module version = 2.7.0
[ 5262.993] Module class: X.Org XInput Driver
[ 5262.993] ABI class: X.Org XInput driver, version 16.0
[ 5262.993] (II) Using input driver 'evdev' for 'Power Button'
[ 5262.993] (**) Power Button: always reports core events
[ 5262.993] (**) evdev: Power Button: Device: "/dev/input/event2"
[ 5262.993] (--) evdev: Power Button: Vendor 0 Product 0x1
[ 5262.993] (--) evdev: Power Button: Found keys
[ 5262.993] (II) evdev: Power Button: Configuring as keyboard
[ 5262.993] (**) Option "config_info"
"udev:/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input2/event2"
[ 5262.993] (II) XINPUT: Adding extended input device "Power Button"
(type: KEYBOARD, id 6)
[ 5262.993] (**) Option "xkb_rules" "evdev"
[ 5262.993] (**) Option "xkb_model" "pc105"
[ 5262.993] (**) Option "xkb_layout" "us"
[ 5262.994] (II) config/udev: Adding input device HDA NVidia
HDMI/DP,pcm=9 (/dev/input/event4)
[ 5262.994] (II) No input driver specified, ignoring this device.
[ 5262.994] (II) This device may have been added with another device file.
[ 5262.995] (II) config/udev: Adding input device HDA NVidia
HDMI/DP,pcm=8 (/dev/input/event5)
[ 5262.995] (II) No input driver specified, ignoring this device.
[ 5262.995] (II) This device may have been added with another device file.
[ 5262.995] (II) config/udev: Adding input device HDA NVidia
HDMI/DP,pcm=7 (/dev/input/event6)
[ 5262.995] (II) No input driver specified, ignoring this device.
[ 5262.995] (II) This device may have been added with another device file.
[ 5262.996] (II) config/udev: Adding input device HDA NVidia
HDMI/DP,pcm=3 (/dev/input/event7)
[ 5262.996] (II) No input driver specified, ignoring this device.
[ 5262.996] (II) This device may have been added with another device file.
[ 5262.997] (II) config/udev: Adding input device HP Virtual Keyboard
(/dev/input/event0)
[ 5262.997] (**) HP Virtual Keyboard : Applying InputClass "evdev
keyboard catchall"
[ 5262.997] (II) Using input driver 'evdev' for 'HP Virtual Keyboard '
[ 5262.997] (**) HP Virtual Keyboard : always reports core events
[ 5262.997] (**) evdev: HP Virtual Keyboard : Device: "/dev/input/event0"
[ 5262.997] (--) evdev: HP Virtual Keyboard : Vendor 0x3f0 Product 0x7029
[ 5262.997] (--) evdev: HP Virtual Keyboard : Found keys
[ 5262.997] (II) evdev: HP Virtual Keyboard : Configuring as keyboard
[ 5262.997] (**) Option "config_info"
"udev:/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.4/usb6/6-1/6-1:1.0/input/input0/event0"
[ 5262.997] (II) XINPUT: Adding extended input device "HP Virtual
Keyboard " (type: KEYBOARD, id 7)
[ 5262.997] (**) Option "xkb_rules" "evdev"
[ 5262.997] (**) Option "xkb_model" "pc105"
[ 5262.997] (**) Option "xkb_layout" "us"
[ 5262.998] (II) config/udev: Adding input device HP Virtual Keyboard
(/dev/input/event1)
[ 5262.998] (**) HP Virtual Keyboard : Applying InputClass "evdev
pointer catchall"
[ 5262.998] (II) Using input driver 'evdev' for 'HP Virtual Keyboard '
[ 5262.998] (**) HP Virtual Keyboard : always reports core events
[ 5262.998] (**) evdev: HP Virtual Keyboard : Device: "/dev/input/event1"
[ 5262.998] (--) evdev: HP Virtual Keyboard : Vendor 0x3f0 Product 0x7029
[ 5262.998] (--) evdev: HP Virtual Keyboard : Found 3 mouse buttons
[ 5262.998] (--) evdev: HP Virtual Keyboard : Found absolute axes
[ 5262.998] (--) evdev: HP Virtual Keyboard : Found x and y absolute axes
[ 5262.998] (--) evdev: HP Virtual Keyboard : Found absolute touchscreen
[ 5262.998] (II) evdev: HP Virtual Keyboard : Configuring as touchscreen
[ 5262.998] (**) evdev: HP Virtual Keyboard : YAxisMapping: buttons 4 and 5
[ 5262.998] (**) evdev: HP Virtual Keyboard : EmulateWheelButton: 4,
EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[ 5262.998] (**) Option "config_info"
"udev:/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.4/usb6/6-1/6-1:1.1/input/input1/event1"
[ 5262.998] (II) XINPUT: Adding extended input device "HP Virtual
Keyboard " (type: TOUCHSCREEN, id 8)
[ 5262.998] (II) evdev: HP Virtual Keyboard : initialized for absolute
axes.
[ 5262.999] (**) HP Virtual Keyboard : (accel) keeping acceleration
scheme 1
[ 5262.999] (**) HP Virtual Keyboard : (accel) acceleration profile 0
[ 5262.999] (**) HP Virtual Keyboard : (accel) acceleration factor: 2.000
[ 5262.999] (**) HP Virtual Keyboard : (accel) acceleration threshold: 4
[ 5262.999] (II) config/udev: Adding input device HP Virtual Keyboard
(/dev/input/js0)
[ 5262.999] (II) No input driver specified, ignoring this device.
[ 5262.999] (II) This device may have been added with another device file.
[ 5263.000] (II) config/udev: Adding input device HP Virtual Keyboard
(/dev/input/mouse0)
[ 5263.000] (II) No input driver specified, ignoring this device.
[ 5263.000] (II) This device may have been added with another device file.
[ 5263.000] (II) config/udev: Adding input device PC Speaker
(/dev/input/event3)
[ 5263.000] (II) No input driver specified, ignoring this device.
[ 5263.000] (II) This device may have been added with another device file.
[ 5263.011] (**) NVIDIA(GPU-0): Using ConnectedMonitor string "DFP-0".
[ 5263.018] (WW) NVIDIA(GPU-0): Unable to read EDID for display device DFP-0
[ 5263.018] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the
EDID for display
[ 5263.018] (**) NVIDIA(0): device DFP-0 (Using EDID frequencies has
been enabled on
[ 5263.018] (**) NVIDIA(0): all display devices.)
[ 5264.099] (**) NVIDIA(GPU-0): Using ConnectedMonitor string "DFP-0".
[ 5264.107] (WW) NVIDIA(GPU-0): Unable to read EDID for display device DFP-0
[ 5264.107] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the
EDID for display
[ 5264.107] (**) NVIDIA(0): device DFP-0 (Using EDID frequencies has
been enabled on
[ 5264.107] (**) NVIDIA(0): all display devices.)
I have an HP DL580 server with Debian 7. This machine has an embedded
card, namely ATI ES1000. I installed an NVIDIA Quadro K5000 on the server
and followed the instructions provided in
https://wiki.debian.org/NvidiaGraphicsDrivers to set it up. I changed
/etc/X11/xorg.conf in order to get rid of some well-known bugs (such as
adding BusID option). Now, Gnome still runs in the fall-back mode and when
I run nvidia-settings, it complains that You do not appear to be using the
NVIDIA X driver. Running nvidia-xconfig does not help as well. I don't
know how to activate this card as the primary graphics card and be able to
use its 3d acceleration. Any help is appreciated.
The content of xorg.conf is as follows:
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection
Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "keyboard"
EndSection
Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection
Section "Device"
Identifier "Device1"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "Quadro K5000"
BusID "PCI:11:0:0"
EndSection
Section "Screen"
Identifier "Default Screen"
Device "Device1"
Option "ConnectedMonitor" "DFP"
Option "UseDisplayDevice" "DFP"
SubSection "Display"
Modes "nvidia-auto-select"
EndSubSection
EndSection
The content of /var/log/Xorg.0.log is as follows:
[ 5261.396]
X.Org X Server 1.12.4
Release Date: 2012-08-27
[ 5261.396] X Protocol Version 11, Revision 0
[ 5261.396] Build Operating System: Linux 3.2.0-4-amd64 x86_64 Debian
[ 5261.396] Current Operating System: Linux sahand 3.2.0-4-amd64 #1 SMP
Debian 3.2.46-1 x86_64
[ 5261.396] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.2.0-4-amd64
root=UUID=8e750507-2beb-4808-924c-a27eb4c528d6 ro quiet
[ 5261.396] Build Date: 17 April 2013 10:22:47AM
[ 5261.396] xorg-server 2:1.12.4-6 (Julien Cristau <jcristau@debian.org>)
[ 5261.396] Current version of pixman: 0.26.0
[ 5261.396] Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[ 5261.396] Markers: (--) probed, (**) from config file, (==) default
setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 5261.397] (==) Log file: "/var/log/Xorg.0.log", Time: Mon Aug 19
21:12:26 2013
[ 5261.397] (==) Using config file: "/etc/X11/xorg.conf"
[ 5261.397] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 5261.397] (==) ServerLayout "Default Layout"
[ 5261.397] (**) |-->Screen "Default Screen" (0)
[ 5261.397] (**) | |-->Monitor "<default monitor>"
[ 5261.398] (**) | |-->Device "Device1"
[ 5261.398] (==) No monitor specified for screen "Default Screen".
Using a default monitor configuration.
[ 5261.398] (**) |-->Input Device "Keyboard0"
[ 5261.398] (**) |-->Input Device "Mouse0"
[ 5261.398] (==) Automatically adding devices
[ 5261.398] (==) Automatically enabling devices
[ 5261.398] (==) FontPath set to:
/usr/share/fonts/X11/misc,
/usr/share/fonts/X11/cyrillic,
/usr/share/fonts/X11/100dpi/:unscaled,
/usr/share/fonts/X11/75dpi/:unscaled,
/usr/share/fonts/X11/Type1,
/usr/share/fonts/X11/100dpi,
/usr/share/fonts/X11/75dpi,
/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType,
built-ins
[ 5261.398] (==) ModulePath set to "/usr/lib/xorg/modules"
[ 5261.398] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse'
or 'vmmouse' will be disabled.
[ 5261.398] (WW) Disabling Keyboard0
[ 5261.398] (WW) Disabling Mouse0
[ 5261.398] (II) Loader magic: 0x7fd684c59ae0
[ 5261.398] (II) Module ABI versions:
[ 5261.398] X.Org ANSI C Emulation: 0.4
[ 5261.398] X.Org Video Driver: 12.1
[ 5261.398] X.Org XInput driver : 16.0
[ 5261.398] X.Org Server Extension : 6.0
[ 5261.405] (--) PCI:*(0:1:3:0) 1002:515e:103c:31fb rev 2, Mem @
0xc8000000/134217728, 0xa0710000/65536, I/O @ 0x00002000/256, BIOS @
0x????????/131072
[ 5261.406] (--) PCI: (0:11:0:0) 10de:11ba:103c:0965 rev 161, Mem @
0x90000000/16777216, 0xb0000000/268435456, 0xa2000000/33554432, I/O @
0x00005000/128, BIOS @ 0x????????/524288
[ 5261.406] (II) Open ACPI successful (/var/run/acpid.socket)
[ 5261.406] (II) LoadModule: "extmod"
[ 5261.406] (II) Loading /usr/lib/xorg/modules/extensions/libextmod.so
[ 5261.407] (II) Module extmod: vendor="X.Org Foundation"
[ 5261.407] compiled for 1.12.4, module version = 1.0.0
[ 5261.407] Module class: X.Org Server Extension
[ 5261.407] ABI class: X.Org Server Extension, version 6.0
[ 5261.407] (II) Loading extension SELinux
[ 5261.407] (II) Loading extension MIT-SCREEN-SAVER
[ 5261.407] (II) Loading extension XFree86-VidModeExtension
[ 5261.407] (II) Loading extension XFree86-DGA
[ 5261.407] (II) Loading extension DPMS
[ 5261.407] (II) Loading extension XVideo
[ 5261.407] (II) Loading extension XVideo-MotionCompensation
[ 5261.407] (II) Loading extension X-Resource
[ 5261.407] (II) LoadModule: "dbe"
[ 5261.407] (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so
[ 5261.408] (II) Module dbe: vendor="X.Org Foundation"
[ 5261.408] compiled for 1.12.4, module version = 1.0.0
[ 5261.408] Module class: X.Org Server Extension
[ 5261.408] ABI class: X.Org Server Extension, version 6.0
[ 5261.408] (II) Loading extension DOUBLE-BUFFER
[ 5261.408] (II) LoadModule: "glx"
[ 5261.408] (II) Loading /usr/lib/xorg/modules/linux/libglx.so
[ 5261.429] (II) Module glx: vendor="NVIDIA Corporation"
[ 5261.429] compiled for 4.0.2, module version = 1.0.0
[ 5261.429] Module class: X.Org Server Extension
[ 5261.429] (II) NVIDIA GLX Module 304.88 Wed Mar 27 14:46:57 PDT 2013
[ 5261.429] (II) Loading extension GLX
[ 5261.429] (II) LoadModule: "record"
[ 5261.429] (II) Loading /usr/lib/xorg/modules/extensions/librecord.so
[ 5261.430] (II) Module record: vendor="X.Org Foundation"
[ 5261.430] compiled for 1.12.4, module version = 1.13.0
[ 5261.430] Module class: X.Org Server Extension
[ 5261.430] ABI class: X.Org Server Extension, version 6.0
[ 5261.430] (II) Loading extension RECORD
[ 5261.430] (II) LoadModule: "dri"
[ 5261.430] (II) Loading /usr/lib/xorg/modules/extensions/libdri.so
[ 5261.430] (II) Module dri: vendor="X.Org Foundation"
[ 5261.430] compiled for 1.12.4, module version = 1.0.0
[ 5261.430] ABI class: X.Org Server Extension, version 6.0
[ 5261.430] (II) Loading extension XFree86-DRI
[ 5261.430] (II) LoadModule: "dri2"
[ 5261.431] (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so
[ 5261.431] (II) Module dri2: vendor="X.Org Foundation"
[ 5261.431] compiled for 1.12.4, module version = 1.2.0
[ 5261.431] ABI class: X.Org Server Extension, version 6.0
[ 5261.431] (II) Loading extension DRI2
[ 5261.431] (II) LoadModule: "nvidia"
[ 5261.431] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
[ 5261.432] (II) Module nvidia: vendor="NVIDIA Corporation"
[ 5261.432] compiled for 4.0.2, module version = 1.0.0
[ 5261.432] Module class: X.Org Video Driver
[ 5261.433] (II) NVIDIA dlloader X Driver 304.88 Wed Mar 27 14:28:14
PDT 2013
[ 5261.433] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[ 5261.433] (++) using VT number 9
[ 5261.444] (II) Loading sub module "fb"
[ 5261.444] (II) LoadModule: "fb"
[ 5261.444] (II) Loading /usr/lib/xorg/modules/libfb.so
[ 5261.444] (II) Module fb: vendor="X.Org Foundation"
[ 5261.444] compiled for 1.12.4, module version = 1.0.0
[ 5261.444] ABI class: X.Org ANSI C Emulation, version 0.4
[ 5261.444] (II) Loading sub module "wfb"
[ 5261.444] (II) LoadModule: "wfb"
[ 5261.445] (II) Loading /usr/lib/xorg/modules/libwfb.so
[ 5261.445] (II) Module wfb: vendor="X.Org Foundation"
[ 5261.445] compiled for 1.12.4, module version = 1.0.0
[ 5261.445] ABI class: X.Org ANSI C Emulation, version 0.4
[ 5261.445] (II) Loading sub module "ramdac"
[ 5261.445] (II) LoadModule: "ramdac"
[ 5261.445] (II) Module "ramdac" already built-in
[ 5261.445] (==) NVIDIA(0): Depth 24, (==) framebuffer bpp 32
[ 5261.445] (==) NVIDIA(0): RGB weight 888
[ 5261.445] (==) NVIDIA(0): Default visual is TrueColor
[ 5261.445] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
[ 5261.446] (**) NVIDIA(0): Option "ConnectedMonitor" "DFP"
[ 5261.446] (**) NVIDIA(0): Option "UseDisplayDevice" "DFP"
[ 5261.446] (**) NVIDIA(0): Enabling 2D acceleration
[ 5261.446] (**) NVIDIA(0): ConnectedMonitor string: "DFP"
[ 5262.618] (**) NVIDIA(GPU-0): Using ConnectedMonitor string "DFP-0".
[ 5262.625] (WW) NVIDIA(GPU-0): Unable to read EDID for display device DFP-0
[ 5262.627] (II) NVIDIA(0): NVIDIA GPU Quadro K5000 (GK104GL) at
PCI:11:0:0 (GPU-0)
[ 5262.627] (--) NVIDIA(0): Memory: 4194304 kBytes
[ 5262.627] (--) NVIDIA(0): VideoBIOS: 80.04.50.00.02
[ 5262.627] (II) NVIDIA(0): Detected PCI Express Link width: 16X
[ 5262.627] (--) NVIDIA(0): Interlaced video modes are supported on this GPU
[ 5262.657] (--) NVIDIA(0): Valid display device(s) on Quadro K5000 at
PCI:11:0:0
[ 5262.657] (--) NVIDIA(0): CRT-0
[ 5262.657] (--) NVIDIA(0): DFP-0 (connected)
[ 5262.657] (--) NVIDIA(0): DFP-1
[ 5262.657] (--) NVIDIA(0): DFP-2
[ 5262.657] (--) NVIDIA(0): DFP-3
[ 5262.657] (--) NVIDIA(0): DFP-4
[ 5262.657] (--) NVIDIA(0): DFP-5
[ 5262.657] (--) NVIDIA(0): CRT-0: 400.0 MHz maximum pixel clock
[ 5262.657] (--) NVIDIA(0): DFP-0: 330.0 MHz maximum pixel clock
[ 5262.657] (--) NVIDIA(0): DFP-0: Internal Single Link TMDS
[ 5262.657] (--) NVIDIA(0): DFP-1: 165.0 MHz maximum pixel clock
[ 5262.657] (--) NVIDIA(0): DFP-1: Internal Single Link TMDS
[ 5262.657] (--) NVIDIA(0): DFP-2: 165.0 MHz maximum pixel clock
[ 5262.657] (--) NVIDIA(0): DFP-2: Internal Single Link TMDS
[ 5262.657] (--) NVIDIA(0): DFP-3: 330.0 MHz maximum pixel clock
[ 5262.657] (--) NVIDIA(0): DFP-3: Internal Single Link TMDS
[ 5262.657] (--) NVIDIA(0): DFP-4: 960.0 MHz maximum pixel clock
[ 5262.657] (--) NVIDIA(0): DFP-4: Internal DisplayPort
[ 5262.657] (--) NVIDIA(0): DFP-5: 960.0 MHz maximum pixel clock
[ 5262.658] (--) NVIDIA(0): DFP-5: Internal DisplayPort
[ 5262.658] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the
EDID for display
[ 5262.658] (**) NVIDIA(0): device DFP-0 (Using EDID frequencies has
been enabled on
[ 5262.658] (**) NVIDIA(0): all display devices.)
[ 5262.658] (II) NVIDIA(0): Validated MetaModes:
[ 5262.658] (II) NVIDIA(0): "DFP-0:nvidia-auto-select"
[ 5262.658] (II) NVIDIA(0): Virtual screen size determined to be 800 x 600
[ 5262.688] (WW) NVIDIA(0): Unable to get display device DFP-0's EDID;
cannot compute DPI
[ 5262.688] (WW) NVIDIA(0): from DFP-0's EDID.
[ 5262.688] (==) NVIDIA(0): DPI set to (75, 75); computed from built-in
default
[ 5262.688] (WW) NVIDIA(0): UBB is incompatible with the Composite
extension. Disabling
[ 5262.688] (WW) NVIDIA(0): UBB.
[ 5262.688] (--) Depth 24 pixmap format is 32 bpp
[ 5262.688] (II) NVIDIA: Using 3072.00 MB of virtual memory for indirect
memory
[ 5262.688] (II) NVIDIA: access.
[ 5262.738] (II) NVIDIA(0): Setting mode "DFP-0:nvidia-auto-select"
[ 5262.789] (II) Loading extension NV-GLX
[ 5262.801] (==) NVIDIA(0): Disabling shared memory pixmaps
[ 5262.801] (==) NVIDIA(0): Backing store disabled
[ 5262.801] (==) NVIDIA(0): Silken mouse enabled
[ 5262.802] (==) NVIDIA(0): DPMS enabled
[ 5262.802] (II) Loading extension NV-CONTROL
[ 5262.803] (II) Loading extension XINERAMA
[ 5262.803] (II) Loading sub module "dri2"
[ 5262.803] (II) LoadModule: "dri2"
[ 5262.803] (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so
[ 5262.803] (II) Module dri2: vendor="X.Org Foundation"
[ 5262.803] compiled for 1.12.4, module version = 1.2.0
[ 5262.803] ABI class: X.Org Server Extension, version 6.0
[ 5262.803] (II) NVIDIA(0): [DRI2] Setup complete
[ 5262.803] (II) NVIDIA(0): [DRI2] VDPAU driver: nvidia
[ 5262.803] (--) RandR disabled
[ 5262.803] (II) Initializing built-in extension Generic Event Extension
[ 5262.803] (II) Initializing built-in extension SHAPE
[ 5262.803] (II) Initializing built-in extension MIT-SHM
[ 5262.803] (II) Initializing built-in extension XInputExtension
[ 5262.803] (II) Initializing built-in extension XTEST
[ 5262.803] (II) Initializing built-in extension BIG-REQUESTS
[ 5262.803] (II) Initializing built-in extension SYNC
[ 5262.803] (II) Initializing built-in extension XKEYBOARD
[ 5262.803] (II) Initializing built-in extension XC-MISC
[ 5262.803] (II) Initializing built-in extension SECURITY
[ 5262.803] (II) Initializing built-in extension XINERAMA
[ 5262.803] (II) Initializing built-in extension XFIXES
[ 5262.803] (II) Initializing built-in extension RENDER
[ 5262.803] (II) Initializing built-in extension RANDR
[ 5262.803] (II) Initializing built-in extension COMPOSITE
[ 5262.803] (II) Initializing built-in extension DAMAGE
[ 5262.803] (II) SELinux: Disabled on system
[ 5262.804] (II) Initializing extension GLX
[ 5262.992] (II) config/udev: Adding input device Power Button
(/dev/input/event2)
[ 5262.992] (**) Power Button: Applying InputClass "evdev keyboard catchall"
[ 5262.992] (II) LoadModule: "evdev"
[ 5262.993] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
[ 5262.993] (II) Module evdev: vendor="X.Org Foundation"
[ 5262.993] compiled for 1.12.1, module version = 2.7.0
[ 5262.993] Module class: X.Org XInput Driver
[ 5262.993] ABI class: X.Org XInput driver, version 16.0
[ 5262.993] (II) Using input driver 'evdev' for 'Power Button'
[ 5262.993] (**) Power Button: always reports core events
[ 5262.993] (**) evdev: Power Button: Device: "/dev/input/event2"
[ 5262.993] (--) evdev: Power Button: Vendor 0 Product 0x1
[ 5262.993] (--) evdev: Power Button: Found keys
[ 5262.993] (II) evdev: Power Button: Configuring as keyboard
[ 5262.993] (**) Option "config_info"
"udev:/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input2/event2"
[ 5262.993] (II) XINPUT: Adding extended input device "Power Button"
(type: KEYBOARD, id 6)
[ 5262.993] (**) Option "xkb_rules" "evdev"
[ 5262.993] (**) Option "xkb_model" "pc105"
[ 5262.993] (**) Option "xkb_layout" "us"
[ 5262.994] (II) config/udev: Adding input device HDA NVidia
HDMI/DP,pcm=9 (/dev/input/event4)
[ 5262.994] (II) No input driver specified, ignoring this device.
[ 5262.994] (II) This device may have been added with another device file.
[ 5262.995] (II) config/udev: Adding input device HDA NVidia
HDMI/DP,pcm=8 (/dev/input/event5)
[ 5262.995] (II) No input driver specified, ignoring this device.
[ 5262.995] (II) This device may have been added with another device file.
[ 5262.995] (II) config/udev: Adding input device HDA NVidia
HDMI/DP,pcm=7 (/dev/input/event6)
[ 5262.995] (II) No input driver specified, ignoring this device.
[ 5262.995] (II) This device may have been added with another device file.
[ 5262.996] (II) config/udev: Adding input device HDA NVidia
HDMI/DP,pcm=3 (/dev/input/event7)
[ 5262.996] (II) No input driver specified, ignoring this device.
[ 5262.996] (II) This device may have been added with another device file.
[ 5262.997] (II) config/udev: Adding input device HP Virtual Keyboard
(/dev/input/event0)
[ 5262.997] (**) HP Virtual Keyboard : Applying InputClass "evdev
keyboard catchall"
[ 5262.997] (II) Using input driver 'evdev' for 'HP Virtual Keyboard '
[ 5262.997] (**) HP Virtual Keyboard : always reports core events
[ 5262.997] (**) evdev: HP Virtual Keyboard : Device: "/dev/input/event0"
[ 5262.997] (--) evdev: HP Virtual Keyboard : Vendor 0x3f0 Product 0x7029
[ 5262.997] (--) evdev: HP Virtual Keyboard : Found keys
[ 5262.997] (II) evdev: HP Virtual Keyboard : Configuring as keyboard
[ 5262.997] (**) Option "config_info"
"udev:/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.4/usb6/6-1/6-1:1.0/input/input0/event0"
[ 5262.997] (II) XINPUT: Adding extended input device "HP Virtual
Keyboard " (type: KEYBOARD, id 7)
[ 5262.997] (**) Option "xkb_rules" "evdev"
[ 5262.997] (**) Option "xkb_model" "pc105"
[ 5262.997] (**) Option "xkb_layout" "us"
[ 5262.998] (II) config/udev: Adding input device HP Virtual Keyboard
(/dev/input/event1)
[ 5262.998] (**) HP Virtual Keyboard : Applying InputClass "evdev
pointer catchall"
[ 5262.998] (II) Using input driver 'evdev' for 'HP Virtual Keyboard '
[ 5262.998] (**) HP Virtual Keyboard : always reports core events
[ 5262.998] (**) evdev: HP Virtual Keyboard : Device: "/dev/input/event1"
[ 5262.998] (--) evdev: HP Virtual Keyboard : Vendor 0x3f0 Product 0x7029
[ 5262.998] (--) evdev: HP Virtual Keyboard : Found 3 mouse buttons
[ 5262.998] (--) evdev: HP Virtual Keyboard : Found absolute axes
[ 5262.998] (--) evdev: HP Virtual Keyboard : Found x and y absolute axes
[ 5262.998] (--) evdev: HP Virtual Keyboard : Found absolute touchscreen
[ 5262.998] (II) evdev: HP Virtual Keyboard : Configuring as touchscreen
[ 5262.998] (**) evdev: HP Virtual Keyboard : YAxisMapping: buttons 4 and 5
[ 5262.998] (**) evdev: HP Virtual Keyboard : EmulateWheelButton: 4,
EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[ 5262.998] (**) Option "config_info"
"udev:/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.4/usb6/6-1/6-1:1.1/input/input1/event1"
[ 5262.998] (II) XINPUT: Adding extended input device "HP Virtual
Keyboard " (type: TOUCHSCREEN, id 8)
[ 5262.998] (II) evdev: HP Virtual Keyboard : initialized for absolute
axes.
[ 5262.999] (**) HP Virtual Keyboard : (accel) keeping acceleration
scheme 1
[ 5262.999] (**) HP Virtual Keyboard : (accel) acceleration profile 0
[ 5262.999] (**) HP Virtual Keyboard : (accel) acceleration factor: 2.000
[ 5262.999] (**) HP Virtual Keyboard : (accel) acceleration threshold: 4
[ 5262.999] (II) config/udev: Adding input device HP Virtual Keyboard
(/dev/input/js0)
[ 5262.999] (II) No input driver specified, ignoring this device.
[ 5262.999] (II) This device may have been added with another device file.
[ 5263.000] (II) config/udev: Adding input device HP Virtual Keyboard
(/dev/input/mouse0)
[ 5263.000] (II) No input driver specified, ignoring this device.
[ 5263.000] (II) This device may have been added with another device file.
[ 5263.000] (II) config/udev: Adding input device PC Speaker
(/dev/input/event3)
[ 5263.000] (II) No input driver specified, ignoring this device.
[ 5263.000] (II) This device may have been added with another device file.
[ 5263.011] (**) NVIDIA(GPU-0): Using ConnectedMonitor string "DFP-0".
[ 5263.018] (WW) NVIDIA(GPU-0): Unable to read EDID for display device DFP-0
[ 5263.018] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the
EDID for display
[ 5263.018] (**) NVIDIA(0): device DFP-0 (Using EDID frequencies has
been enabled on
[ 5263.018] (**) NVIDIA(0): all display devices.)
[ 5264.099] (**) NVIDIA(GPU-0): Using ConnectedMonitor string "DFP-0".
[ 5264.107] (WW) NVIDIA(GPU-0): Unable to read EDID for display device DFP-0
[ 5264.107] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the
EDID for display
[ 5264.107] (**) NVIDIA(0): device DFP-0 (Using EDID frequencies has
been enabled on
[ 5264.107] (**) NVIDIA(0): all display devices.)