Android - after loading URL with webview can i change background color
I have a webview and im loading an external HTML form a site. I try to
change the background color using javascript function:
function changeBGC(color){
document.bgColor = color;
}
and that does not work. but if i load locally then im able to change the
background color. Is there some kind of security inhibiting me from
changing a web page i load into the webview externally ?
Saturday, 31 August 2013
Opening Image directly into program
Opening Image directly into program
I made a basic picture viewer program in C# windows from , following a
tutorial. The program works fine but I want to open it like default
windows photo viewer. I tried to open an image with the program directly
but that opened the program and the image box was empty.
The image box works fine when images are browsed to open inside the
program but how to make it work externally?
Extra : And is there a way to make it full screen?
Sorry for bad english.
I made a basic picture viewer program in C# windows from , following a
tutorial. The program works fine but I want to open it like default
windows photo viewer. I tried to open an image with the program directly
but that opened the program and the image box was empty.
The image box works fine when images are browsed to open inside the
program but how to make it work externally?
Extra : And is there a way to make it full screen?
Sorry for bad english.
Open map location from Apple maps in my mapping app
Open map location from Apple maps in my mapping app
I'm developing an iOS mapping app. I would like to open a location from
the built-in maps app into my app. Ideally, my app would show up in the
Maps location sharing sheet along with Mail, Twitter, and Facebook. Is
this possible?
The best I've come up with is configuring my app as a routing app so that
Maps can send a routing request to my app, and using the destination as
the point being shared. There are a few problems with that, though. First,
my app doesn't do routing, so that's misleading to the user. Second, in my
opinion, there are too many steps for the user to get to the routing
options screen. Lastly, Apple might not approve an app that advertises
itself to the system as being a routing provider but doesn't actually do
any routing.
I've searched around quite a bit, but I haven't seen this question asked,
and I haven't found anything in Apple's documentation. Any suggestions?
I'm developing an iOS mapping app. I would like to open a location from
the built-in maps app into my app. Ideally, my app would show up in the
Maps location sharing sheet along with Mail, Twitter, and Facebook. Is
this possible?
The best I've come up with is configuring my app as a routing app so that
Maps can send a routing request to my app, and using the destination as
the point being shared. There are a few problems with that, though. First,
my app doesn't do routing, so that's misleading to the user. Second, in my
opinion, there are too many steps for the user to get to the routing
options screen. Lastly, Apple might not approve an app that advertises
itself to the system as being a routing provider but doesn't actually do
any routing.
I've searched around quite a bit, but I haven't seen this question asked,
and I haven't found anything in Apple's documentation. Any suggestions?
HTML sandbox CSS not working?
HTML sandbox CSS not working?
I was making an HTML sandbox at
this place: http://jsfiddle.net/Jtanm/
and for some reason the CSS entering textarea does not work. Please tell
me why this is.
I think it is a jQuery problem.
I was making an HTML sandbox at
this place: http://jsfiddle.net/Jtanm/
and for some reason the CSS entering textarea does not work. Please tell
me why this is.
I think it is a jQuery problem.
wxPython Image brightness control and changing between wximage, bitmap and PIL
wxPython Image brightness control and changing between wximage, bitmap and
PIL
I'm programming a gui and is looking for a method to control the
brightness of my image using a slider. i've tried using ConvertToGreyscale
but it is not giving what i want since images are in RGB and
ConvertToGreyscale is in YUV.
i know that PIL have a lot of capabilities for images processing but i
will have to convert between wximage, bitmap and PILimage. tried looking
at http://wiki.wxpython.org/WorkingWithImages but solutions there doesn't
seem to be working.
assistance is greatly appreciated.
PIL
I'm programming a gui and is looking for a method to control the
brightness of my image using a slider. i've tried using ConvertToGreyscale
but it is not giving what i want since images are in RGB and
ConvertToGreyscale is in YUV.
i know that PIL have a lot of capabilities for images processing but i
will have to convert between wximage, bitmap and PILimage. tried looking
at http://wiki.wxpython.org/WorkingWithImages but solutions there doesn't
seem to be working.
assistance is greatly appreciated.
How to convert date for the first timezone to the second?
How to convert date for the first timezone to the second?
There is the following info:
date ("2013-08-30 07:05:25")
timezone ("Europe/Moscow")
My app gets this info from some server, and I need to convert this
date/time to current user's timezone. I know that I should use DateFormat
and TimeZone APIs, but I don't understand how. Please, give me a piece of
advice or some code. Thanks.
There is the following info:
date ("2013-08-30 07:05:25")
timezone ("Europe/Moscow")
My app gets this info from some server, and I need to convert this
date/time to current user's timezone. I know that I should use DateFormat
and TimeZone APIs, but I don't understand how. Please, give me a piece of
advice or some code. Thanks.
i want to now about mapreduce in mongodb codeigniter
i want to now about mapreduce in mongodb codeigniter
here am basically performing group by operation
table:sale_announcement_history fields:history_timestamp,logged by,
sale_annoucement_id --- want to know max timestamp and distinct logged by
of a particular sale_id
function test_map_reduce(){
$map = new MongoCode('
function(){
var total = 0;
var maxx = 0;
var unique = 0;
for (sum in this.sale_announcement_id) {
$total += this.sale_announcement_id[sum];
}
for (max in this.history_timestamp) {
maxx = this.history_timestamp[max];
}
for (distinct in this.logged_by) {
unique = this.logged_by[distinct];
}
emit(this.sale_announcement_id,{total:total,max:maxx,unique:unique});
}
');
$reduce = new MongoCode('
function(key, values){
var result = {total: 0, max: 0, unique: 0};
values.forEach(function(v) {
result.total = v.total;
result.max = v.max;
result.unique = v.unique;
});
return result;
}
');
$result = $this->mongo_db->command(array(
'mapreduce'=>"sale_announcement_history", // <= 'mtb'
'road' 'minivelo'
'map'=>$map,
'reduce'=>$reduce,
//'query'=>array(),
'out'=> 'test_res1'));
echo'<pre>';
print_r($result);
}
here am basically performing group by operation
table:sale_announcement_history fields:history_timestamp,logged by,
sale_annoucement_id --- want to know max timestamp and distinct logged by
of a particular sale_id
function test_map_reduce(){
$map = new MongoCode('
function(){
var total = 0;
var maxx = 0;
var unique = 0;
for (sum in this.sale_announcement_id) {
$total += this.sale_announcement_id[sum];
}
for (max in this.history_timestamp) {
maxx = this.history_timestamp[max];
}
for (distinct in this.logged_by) {
unique = this.logged_by[distinct];
}
emit(this.sale_announcement_id,{total:total,max:maxx,unique:unique});
}
');
$reduce = new MongoCode('
function(key, values){
var result = {total: 0, max: 0, unique: 0};
values.forEach(function(v) {
result.total = v.total;
result.max = v.max;
result.unique = v.unique;
});
return result;
}
');
$result = $this->mongo_db->command(array(
'mapreduce'=>"sale_announcement_history", // <= 'mtb'
'road' 'minivelo'
'map'=>$map,
'reduce'=>$reduce,
//'query'=>array(),
'out'=> 'test_res1'));
echo'<pre>';
print_r($result);
}
Use of public destructor when the constructor is private. (C++)
Use of public destructor when the constructor is private. (C++)
I have seen code where the constructor has been declared as private while
the destructor is public. What is the use of such a declaration? Is the
destructor required to be public so that during inheritance the calls can
be possible or is it a bug in the code?
The question might seem to be a little less with information but what I
really want to know is that having a public desctructor when the
constructor is required to be public abides by the C++ rules?
I have seen code where the constructor has been declared as private while
the destructor is public. What is the use of such a declaration? Is the
destructor required to be public so that during inheritance the calls can
be possible or is it a bug in the code?
The question might seem to be a little less with information but what I
really want to know is that having a public desctructor when the
constructor is required to be public abides by the C++ rules?
Friday, 30 August 2013
How to store textbox value in database? I am using SQL express with wpf
How to store textbox value in database? I am using SQL express with wpf
i am trying to insert textbox value into database with sqlconnection but i
cant insert it. after successful execution of query table was still null.
working with sqlexpress 2008 in wpf.
my code. private void button1_Click(object sender, RoutedEventArgs e) {
SqlConnection con = new SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\DB1.mdf;Integrated
Security=True;User Instance=True");
try
{
con.Open();
SqlCommand cmd = new SqlCommand("insert into Table1
values('"+textBox1.Text+"');",con);
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
con.Close();
}
}
i am trying to insert textbox value into database with sqlconnection but i
cant insert it. after successful execution of query table was still null.
working with sqlexpress 2008 in wpf.
my code. private void button1_Click(object sender, RoutedEventArgs e) {
SqlConnection con = new SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\DB1.mdf;Integrated
Security=True;User Instance=True");
try
{
con.Open();
SqlCommand cmd = new SqlCommand("insert into Table1
values('"+textBox1.Text+"');",con);
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
con.Close();
}
}
Thursday, 29 August 2013
Linux - Join multiple CSV files into one
Linux - Join multiple CSV files into one
I'm trying to join together multiple results stored in CSV files, with the
first column as the index.
The problem is that I have a various number of files, and the index
results can vary from file to file, with some having less results.
In Linux, what would be the easiest way to script the process to join all
the files in one, with blank fields for empty results? I have experienced
Linux join, paste and column with no luck. Mybe I should try with another
tool, or maybe Python or Perl?
The data files look like this:
file1:
header1 header2 header3
result_A 10 11 12
result_B 13 14 15
result_C 16 17 18
result_D 19 20 21
result_E 22 23 24
result_F 25 26 27
file2:
header1 header2 header3
result_B 40 41 42
result_F 43 44 45
file3:
header1 header2 header3
result_C 60 61 62
result_D 63 64 65
result_F 66 67 68
And hopefully the results should look like this:
file1 file1 file1 file2 file2 file2 file3
file3 file3
header1 header2 header3 header1 header2 header3
header1 header2 header3
result_A 10 11 12
result_B 13 14 15 40 41 42
result_C 16 17 18 60
61 62
result_D 19 20 21 63
64 65
result_E 22 23 24
result_F 25 26 27 43 44 45 66
67 68
I'm trying to join together multiple results stored in CSV files, with the
first column as the index.
The problem is that I have a various number of files, and the index
results can vary from file to file, with some having less results.
In Linux, what would be the easiest way to script the process to join all
the files in one, with blank fields for empty results? I have experienced
Linux join, paste and column with no luck. Mybe I should try with another
tool, or maybe Python or Perl?
The data files look like this:
file1:
header1 header2 header3
result_A 10 11 12
result_B 13 14 15
result_C 16 17 18
result_D 19 20 21
result_E 22 23 24
result_F 25 26 27
file2:
header1 header2 header3
result_B 40 41 42
result_F 43 44 45
file3:
header1 header2 header3
result_C 60 61 62
result_D 63 64 65
result_F 66 67 68
And hopefully the results should look like this:
file1 file1 file1 file2 file2 file2 file3
file3 file3
header1 header2 header3 header1 header2 header3
header1 header2 header3
result_A 10 11 12
result_B 13 14 15 40 41 42
result_C 16 17 18 60
61 62
result_D 19 20 21 63
64 65
result_E 22 23 24
result_F 25 26 27 43 44 45 66
67 68
Data structure python
Data structure python
I must save some data in python and I do not how to save it. The best
think would be a data frame where elements are lists.
For example:
id nickname other information
[32846846,["Mike", "Mikeal",...],[8,9,5,2,4],...]
[32846847,["Jack", "Jason",...],[5,3,2,4,6],....]
For each Id we can have different nicknames and different values.
How should I save my data?
Thanks
I must save some data in python and I do not how to save it. The best
think would be a data frame where elements are lists.
For example:
id nickname other information
[32846846,["Mike", "Mikeal",...],[8,9,5,2,4],...]
[32846847,["Jack", "Jason",...],[5,3,2,4,6],....]
For each Id we can have different nicknames and different values.
How should I save my data?
Thanks
Wednesday, 28 August 2013
Set Name of report for export in C#
Set Name of report for export in C#
I'm coming close to pulling all my hair out on this! Seems like it should
be really easy to set the name which appears in the export dialog of the
reporting tool in C# during runtime but I can't figure out how to do this.
I would be eternally grateful for any help on this matter.
I'm coming close to pulling all my hair out on this! Seems like it should
be really easy to set the name which appears in the export dialog of the
reporting tool in C# during runtime but I can't figure out how to do this.
I would be eternally grateful for any help on this matter.
MVC Ajax Post Requirements
MVC Ajax Post Requirements
Does the ActionResult Method in the Controller require the attribute
[HttpPost] to successfully respond to an ajax post from JQuery?
$.ajax({
url: "~/../../User/AssignPermission",
type: "POST",
data: $.postify({ "p_permId": optionSelectedPerm.value, "p_UserId":
iUserId }),
cache: false,
success: function () {
alert("Success");
},
error: function () {
alert("FAIL");
}
});
Controller::
[HttpPost]
public ActionResult AssignPermission(int p_permId, int p_Userid)
{
blah blah blah dance with the provided Id's
persist new permission for user to Disk
return RedirectToAction("UserPermissions", "User", new {
uzrEditId = p_Userid });
}
I was successful getting back into the controller with a GET ( including
the data values as parameters) but this isnt allowing me to update the
View so I want to try a redirect but this will need a POST. Of course it
was a different ActionResult in the controller which danced with View
Model lists.. That should be pointless since UserPermissions", "User" does
that all in the beginning
function SwapPermission(optionSelectedPerm) {
$.ajax({
url: '~/../../User/AssignPermission',
data: $.postify({ "p_permId": optionSelectedPerm.value
}),
type: 'GET',
datatype: "json",
contentType: "application/json; charset=utf-8",
success: function () {
},
fail: function () {
alert("There was a problem saving the Permission
assignment");
}
});
}
Does the ActionResult Method in the Controller require the attribute
[HttpPost] to successfully respond to an ajax post from JQuery?
$.ajax({
url: "~/../../User/AssignPermission",
type: "POST",
data: $.postify({ "p_permId": optionSelectedPerm.value, "p_UserId":
iUserId }),
cache: false,
success: function () {
alert("Success");
},
error: function () {
alert("FAIL");
}
});
Controller::
[HttpPost]
public ActionResult AssignPermission(int p_permId, int p_Userid)
{
blah blah blah dance with the provided Id's
persist new permission for user to Disk
return RedirectToAction("UserPermissions", "User", new {
uzrEditId = p_Userid });
}
I was successful getting back into the controller with a GET ( including
the data values as parameters) but this isnt allowing me to update the
View so I want to try a redirect but this will need a POST. Of course it
was a different ActionResult in the controller which danced with View
Model lists.. That should be pointless since UserPermissions", "User" does
that all in the beginning
function SwapPermission(optionSelectedPerm) {
$.ajax({
url: '~/../../User/AssignPermission',
data: $.postify({ "p_permId": optionSelectedPerm.value
}),
type: 'GET',
datatype: "json",
contentType: "application/json; charset=utf-8",
success: function () {
},
fail: function () {
alert("There was a problem saving the Permission
assignment");
}
});
}
Makefile Grammar
Makefile Grammar
Is there anywhere a precise makefile grammar definition? Or at least some
common subset since it guess that there are some flavors. Such a grammar
that would could be used for writing a parser.
GNU Make manual doesn't seem to be that precise. It would require some
guessing and trial-and-error to write a parser for makefile based on that
document.
I also found a similar question on ANTLR mail list. But it remained
unanswered which kind of suggests the answer...
Is there anywhere a precise makefile grammar definition? Or at least some
common subset since it guess that there are some flavors. Such a grammar
that would could be used for writing a parser.
GNU Make manual doesn't seem to be that precise. It would require some
guessing and trial-and-error to write a parser for makefile based on that
document.
I also found a similar question on ANTLR mail list. But it remained
unanswered which kind of suggests the answer...
Tuesday, 27 August 2013
Create multiple dataframes using subset function
Create multiple dataframes using subset function
Suppose i have a dataframe that has variables a1 a2 a3...each of which
takes values between 1-10....I need to create 3 separate dataframes for
each of a1>2, a2>2, a3>2.. i have 300 such variables, so i dont want to do
this manullay.. I am a R novice and hence a little weak with the loops i
guess..Could you please help me out?. is there a way to put the 300
variable list in amacro and call each vaalue of the the macro list?
I need something like below for each of the 300 variables.. (Also my
variables are not a1 a2 a3, so i need to change the name each time for
creating the dataframe)
for (i in 1:3){ a_&i <- subset(df,a&i>2) }
Any help would be appreciated..
Thaks!
Suppose i have a dataframe that has variables a1 a2 a3...each of which
takes values between 1-10....I need to create 3 separate dataframes for
each of a1>2, a2>2, a3>2.. i have 300 such variables, so i dont want to do
this manullay.. I am a R novice and hence a little weak with the loops i
guess..Could you please help me out?. is there a way to put the 300
variable list in amacro and call each vaalue of the the macro list?
I need something like below for each of the 300 variables.. (Also my
variables are not a1 a2 a3, so i need to change the name each time for
creating the dataframe)
for (i in 1:3){ a_&i <- subset(df,a&i>2) }
Any help would be appreciated..
Thaks!
How to delete all cookie when visitor visit my website?
How to delete all cookie when visitor visit my website?
I want to ask a question: How to delete all cookie when visitor visit my
website I searched a lot of question like this my question but I can't
find a satisfactory answers.
Please help me ! Sorry for my poor English !
I want to ask a question: How to delete all cookie when visitor visit my
website I searched a lot of question like this my question but I can't
find a satisfactory answers.
Please help me ! Sorry for my poor English !
How to count all characters in a cell of current row in Excel?
How to count all characters in a cell of current row in Excel?
I am trying to use this function =LEN() to count the characters of 1000+
cells, but I can't find a way of just copy-paste it and make it efficient.
If I write the cell id manually =LEN(A1) it works pretty fine, but I want
to write something like the following, so I can copy-paste it a thousand
times: (Now, bare with me, I've never used excel before and I know next to
nothing of its syntax)
=LEN(A*current_row*)
I just want to get the current row, I don't care for the current column.
Thanks very much.
Oh, and just in case you know a different way to count the characters of
all the different cells on a row and having the results not summed in a
big number, please, I'm all ears and eyes.
I am trying to use this function =LEN() to count the characters of 1000+
cells, but I can't find a way of just copy-paste it and make it efficient.
If I write the cell id manually =LEN(A1) it works pretty fine, but I want
to write something like the following, so I can copy-paste it a thousand
times: (Now, bare with me, I've never used excel before and I know next to
nothing of its syntax)
=LEN(A*current_row*)
I just want to get the current row, I don't care for the current column.
Thanks very much.
Oh, and just in case you know a different way to count the characters of
all the different cells on a row and having the results not summed in a
big number, please, I'm all ears and eyes.
CSV file header
CSV file header
What would be the csv file header, (to import into WordPress), to show the
category and subcategory of each post, and how would be the content, for
that header?
I´m using the plugin "CSV Importer".
Thanks.
What would be the csv file header, (to import into WordPress), to show the
category and subcategory of each post, and how would be the content, for
that header?
I´m using the plugin "CSV Importer".
Thanks.
Youtube: Post video to a single account in app behalf and not user behalf using Javascript?
Youtube: Post video to a single account in app behalf and not user behalf
using Javascript?
I'd like to know how to upload videos to a youtube account without having
to ask permissions to users.
1) I want to create a Youtube Account 2) Any user in my web app will be
able to upload content there 3) In my youtube account, I may publish or
approve the videos
I've found some examples, but they're meant to upload in someones behalf
and I'd like to do it differently, like I explained. I don't want to host
this files in my own servers and I remember doing something like this a
few years ago, but not sure if I was using Youtube.
I'd like to use Javascript, as I'm working with AngularJS
Thanks for looking!
*Any code examples would be appreciated
using Javascript?
I'd like to know how to upload videos to a youtube account without having
to ask permissions to users.
1) I want to create a Youtube Account 2) Any user in my web app will be
able to upload content there 3) In my youtube account, I may publish or
approve the videos
I've found some examples, but they're meant to upload in someones behalf
and I'd like to do it differently, like I explained. I don't want to host
this files in my own servers and I remember doing something like this a
few years ago, but not sure if I was using Youtube.
I'd like to use Javascript, as I'm working with AngularJS
Thanks for looking!
*Any code examples would be appreciated
Guidance with refactoring issue
Guidance with refactoring issue
I have a couple of methods, 10 to be exact. All of them have the same
return type and accept the same params like so
public string GenerateDataForABC(List modelList, Student student)
Except for some customization they all pretty much do the same thing,
i.e., return a string.
For example the method GenerateDataForDEF will have a unique code like so:
StringBuilder sb = new StringBuilder();
sb.Append("STUDENT_NUMBER");
sb.Append("\tCALLBACK_NUMBER");
sb.Append("\tSPECIALINSTRUCTIONS");
...
So that one creates a heading for a tab separated file. And then there
will be a for loop that will have code like so:
foreach (Model model in modelList)
{
string sstudentNumber = "789";
sb.Append("\t");
sb.Append("\t");//SPECIALINSTRUCTIONS
sb.Append("\t" + model.ExamNumber);
...
}
The foreach is common in all the methods the only difference being the
properties used from the Model object. So one method may use all the
properties, the other might use only 5.
Currently, as mentioned in the begining, there are seperate methods and
the properites are used as per those methods requirement.
As I see it there are two problems to solve here:
The custom sections in each method. How to handle that?
The foreach. Is there an alternate?
I tried putting the required properties of the model in an xml and then to
build the model for each method assigning only the required properties.
That seems to work but solves only one part of the puzzle.
Any clue or direction is appreciated.
Regards.
I have a couple of methods, 10 to be exact. All of them have the same
return type and accept the same params like so
public string GenerateDataForABC(List modelList, Student student)
Except for some customization they all pretty much do the same thing,
i.e., return a string.
For example the method GenerateDataForDEF will have a unique code like so:
StringBuilder sb = new StringBuilder();
sb.Append("STUDENT_NUMBER");
sb.Append("\tCALLBACK_NUMBER");
sb.Append("\tSPECIALINSTRUCTIONS");
...
So that one creates a heading for a tab separated file. And then there
will be a for loop that will have code like so:
foreach (Model model in modelList)
{
string sstudentNumber = "789";
sb.Append("\t");
sb.Append("\t");//SPECIALINSTRUCTIONS
sb.Append("\t" + model.ExamNumber);
...
}
The foreach is common in all the methods the only difference being the
properties used from the Model object. So one method may use all the
properties, the other might use only 5.
Currently, as mentioned in the begining, there are seperate methods and
the properites are used as per those methods requirement.
As I see it there are two problems to solve here:
The custom sections in each method. How to handle that?
The foreach. Is there an alternate?
I tried putting the required properties of the model in an xml and then to
build the model for each method assigning only the required properties.
That seems to work but solves only one part of the puzzle.
Any clue or direction is appreciated.
Regards.
How to open an existing .mom file, or is there any way to see the structure of an existing .mom file
How to open an existing .mom file, or is there any way to see the
structure of an existing .mom file
I've downloaded a copy of iOS source code and there is a .mom file in the
bundle. I just know it is a "product" of NSManagedObjectModel. I wonder is
there any way that I can explore the entities in the file, or is there any
code snippet to parse its structure. Thank you!
structure of an existing .mom file
I've downloaded a copy of iOS source code and there is a .mom file in the
bundle. I just know it is a "product" of NSManagedObjectModel. I wonder is
there any way that I can explore the entities in the file, or is there any
code snippet to parse its structure. Thank you!
cant convert String to integer
cant convert String to integer
I am a beginner. I know this is basic. In my project i am using java and
mysql workbench. I am reading a data from user by using select box which
is coming from database by using ajax The code for select box is mentioned
below
<%
String a =request.getParameter("course");
if(a!=null)
{
ResultSet rs=s.selectsub(a);
String Query="select * from subject where course_id='"+a+"'";
%>
<select name="subject" id="subject">
<option>Select Subject</option>
<%
while(rs.next())
{
%>
<option value="<% out.println(rs.getString("subject_id")); %>">
<% out.println(rs.getString("subject")); %></option>
<% } %>
</select>
<%
}
%>
and these subject id is passed to another page using post method and
trying this code
String subject=request.getParameter("subject");
int subjectid=Integer.parseInt(subject);
But the line Integer conversion is not working. Error is showing. The
error is
org.apache.jasper.JasperException: An exception occurred processing JSP
page /saveuser.jsp at line 29
26: String email=request.getParameter("email");
27: String designation=request.getParameter("designation");
28: String subject=request.getParameter("subject");
29: int subjectid=Integer.parseInt(subject);
30: String institute=request.getParameter("institute");
31: String inemail=request.getParameter("inemail");
32: String uname=request.getParameter("uname");
Please somebody help me.
I am a beginner. I know this is basic. In my project i am using java and
mysql workbench. I am reading a data from user by using select box which
is coming from database by using ajax The code for select box is mentioned
below
<%
String a =request.getParameter("course");
if(a!=null)
{
ResultSet rs=s.selectsub(a);
String Query="select * from subject where course_id='"+a+"'";
%>
<select name="subject" id="subject">
<option>Select Subject</option>
<%
while(rs.next())
{
%>
<option value="<% out.println(rs.getString("subject_id")); %>">
<% out.println(rs.getString("subject")); %></option>
<% } %>
</select>
<%
}
%>
and these subject id is passed to another page using post method and
trying this code
String subject=request.getParameter("subject");
int subjectid=Integer.parseInt(subject);
But the line Integer conversion is not working. Error is showing. The
error is
org.apache.jasper.JasperException: An exception occurred processing JSP
page /saveuser.jsp at line 29
26: String email=request.getParameter("email");
27: String designation=request.getParameter("designation");
28: String subject=request.getParameter("subject");
29: int subjectid=Integer.parseInt(subject);
30: String institute=request.getParameter("institute");
31: String inemail=request.getParameter("inemail");
32: String uname=request.getParameter("uname");
Please somebody help me.
Monday, 26 August 2013
What happen really when a low rumble come?
What happen really when a low rumble come?
For this text:
There came a low rumble, which distorted the cabin around her, and cast an
oily sheen on the walls.
Could you tell me that what happened really here as the above text says?In
this way?---
There came a low rumble,then distorted the cabin?(can't not post images
for low reputations here)----
http://www.flickr.com/photos/sigkyrre/3772790699/sizes/m/in/photostream/
(let's suppose that's the cabin of the ship on the picture...)
and then?---
http://www.tripadvisor.com/LocationPhotoDirectLink-g60982-d104386-i25298922-USS_Arizona_Memorial-Honolulu_Oahu_Hawaii.html#25298918
(let's suppose that's the walls on the picture. And an oily sheen on the
walls like this on the picture?)
Can it really happen like this? A sound as a low rumble can be so powerful
to distort the cabin slightly?
Thank you in advance!
The context is :
"I can see nothing." There came a low rumble, which distorted the cabin
around her, and cast an oily sheen on the walls. "Watch."
Excerpted from Aliette de Bodard's novel "The Two Sisters in Exile"
partly(maybe you needn't read these words) :
"We're here," The Tortoise in the Lake said, cutting across Dong Huong's
gloomy thoughts.
"I can see nothing."
There came a low rumble, which distorted the cabin around her, and cast an
oily sheen on the walls. "Watch."
Outside, everything was dark. There was only the shadow of The Two Sisters
in Exile, the dead ship that they'd been pulling since Longevity Station.
More partly excerpted from Aliette de Bodard's novel "The Two Sisters in
Exile" (maybe you needn't read these words) :
For the Northerners, however, everything would be different.
"We're here," The Tortoise in the Lake said, cutting across Dong Huong's
gloomy thoughts.
"I can see nothing."
There came a low rumble, which distorted the cabin around her, and cast an
oily sheen on the walls. "Watch."
Outside, everything was dark. There was only the shadow of The Two Sisters
in Exile, the dead ship that they'd been pulling since Longevity Station.
It hung in space, forlorn and pathetic, like the corpse of an old woman;
although Dong Huong knew that it was huge, and could have housed her
entire lineage without a care.
"I see nothing," Dong Huong said, again. The ground rumbled beneath her,
even as her ears popped with pressure –more laughter from The Tortoise in
the Lake, even as the darkness of space focused and narrowed – became the
shadow of wings, the curve on vast surfaces – the hulls of two huge ships
flanking them; thin, sharp, like a stretch of endless walls – making The
Tortoise in the Lake seem small and insignificant, just as much as Dong
Huong herself was small and insignificant in comparison to her own ship.
For this text:
There came a low rumble, which distorted the cabin around her, and cast an
oily sheen on the walls.
Could you tell me that what happened really here as the above text says?In
this way?---
There came a low rumble,then distorted the cabin?(can't not post images
for low reputations here)----
http://www.flickr.com/photos/sigkyrre/3772790699/sizes/m/in/photostream/
(let's suppose that's the cabin of the ship on the picture...)
and then?---
http://www.tripadvisor.com/LocationPhotoDirectLink-g60982-d104386-i25298922-USS_Arizona_Memorial-Honolulu_Oahu_Hawaii.html#25298918
(let's suppose that's the walls on the picture. And an oily sheen on the
walls like this on the picture?)
Can it really happen like this? A sound as a low rumble can be so powerful
to distort the cabin slightly?
Thank you in advance!
The context is :
"I can see nothing." There came a low rumble, which distorted the cabin
around her, and cast an oily sheen on the walls. "Watch."
Excerpted from Aliette de Bodard's novel "The Two Sisters in Exile"
partly(maybe you needn't read these words) :
"We're here," The Tortoise in the Lake said, cutting across Dong Huong's
gloomy thoughts.
"I can see nothing."
There came a low rumble, which distorted the cabin around her, and cast an
oily sheen on the walls. "Watch."
Outside, everything was dark. There was only the shadow of The Two Sisters
in Exile, the dead ship that they'd been pulling since Longevity Station.
More partly excerpted from Aliette de Bodard's novel "The Two Sisters in
Exile" (maybe you needn't read these words) :
For the Northerners, however, everything would be different.
"We're here," The Tortoise in the Lake said, cutting across Dong Huong's
gloomy thoughts.
"I can see nothing."
There came a low rumble, which distorted the cabin around her, and cast an
oily sheen on the walls. "Watch."
Outside, everything was dark. There was only the shadow of The Two Sisters
in Exile, the dead ship that they'd been pulling since Longevity Station.
It hung in space, forlorn and pathetic, like the corpse of an old woman;
although Dong Huong knew that it was huge, and could have housed her
entire lineage without a care.
"I see nothing," Dong Huong said, again. The ground rumbled beneath her,
even as her ears popped with pressure –more laughter from The Tortoise in
the Lake, even as the darkness of space focused and narrowed – became the
shadow of wings, the curve on vast surfaces – the hulls of two huge ships
flanking them; thin, sharp, like a stretch of endless walls – making The
Tortoise in the Lake seem small and insignificant, just as much as Dong
Huong herself was small and insignificant in comparison to her own ship.
Need to create an ellipse in a rectangle
Need to create an ellipse in a rectangle
I have Previous point and Current point of mouse location. Using these, I
need to create an ellipse in a rectangle in C#. Can someone provide me
with sample code?
I have Previous point and Current point of mouse location. Using these, I
need to create an ellipse in a rectangle in C#. Can someone provide me
with sample code?
Meteor.call inside an Collection.observeChanges
Meteor.call inside an Collection.observeChanges
I have a collection (called items) and am trying to watch for a change on
one of the items in the collection via Collection.observeChanges. Once a
change is encountered I want to call a method on the server side with the
ID of my object.
I can't figure out for the life of me why this code isn't working.
Here is the minimal example
Client
Template.test.items = function() {
return Items.find();
}
Template.test.events({
'click a.create.btn' : function () {
Items.insert({count: 0});
}
});
Template.item.events({
'click a.change.btn' : function() {
Items.update(this._id, {$inc: {count: 1}})
}
})
Meteor.startup(function() {
Items.find().observeChanges({
changed: function(id, fields) {
Meteor.call("testMethod", "CHANGED!");
}
});
});
Server
Meteor.startup(function () {
Meteor.publish('items', function() { return Items.find() });
});
Meteor.methods({
testMethod: function(message){
console.log(message);
}
})
Both
this.Items = new Meteor.Collection("items");
html
<body>
{{> test }}
</body>
<template name="test">
<a class="create btn">Create Item</a>
<ul>
</ul>
</template>
<template name="item">
<li>
<h2>Item</h2>
<span>Count is: {{ count }}</span>
<a id="{{_id}}" class="change btn">Increment</a>
</li>
</template>
I have a collection (called items) and am trying to watch for a change on
one of the items in the collection via Collection.observeChanges. Once a
change is encountered I want to call a method on the server side with the
ID of my object.
I can't figure out for the life of me why this code isn't working.
Here is the minimal example
Client
Template.test.items = function() {
return Items.find();
}
Template.test.events({
'click a.create.btn' : function () {
Items.insert({count: 0});
}
});
Template.item.events({
'click a.change.btn' : function() {
Items.update(this._id, {$inc: {count: 1}})
}
})
Meteor.startup(function() {
Items.find().observeChanges({
changed: function(id, fields) {
Meteor.call("testMethod", "CHANGED!");
}
});
});
Server
Meteor.startup(function () {
Meteor.publish('items', function() { return Items.find() });
});
Meteor.methods({
testMethod: function(message){
console.log(message);
}
})
Both
this.Items = new Meteor.Collection("items");
html
<body>
{{> test }}
</body>
<template name="test">
<a class="create btn">Create Item</a>
<ul>
</ul>
</template>
<template name="item">
<li>
<h2>Item</h2>
<span>Count is: {{ count }}</span>
<a id="{{_id}}" class="change btn">Increment</a>
</li>
</template>
Drop shadow on every side of a borderless form?
Drop shadow on every side of a borderless form?
I've got a Form that has FormBorderStyle set to None. I've overridden
ClientParams and added 0x20000 to the ClassStyle. This gives me a form
with drop shadow on the right and bottom edges.
If you look at a form with FormBorderStyle set to Fixed3D then it has a
drop shadow on every side, is it possible to do this with FormBorderStyle
set to None?
I've got a Form that has FormBorderStyle set to None. I've overridden
ClientParams and added 0x20000 to the ClassStyle. This gives me a form
with drop shadow on the right and bottom edges.
If you look at a form with FormBorderStyle set to Fixed3D then it has a
drop shadow on every side, is it possible to do this with FormBorderStyle
set to None?
java boolean ^ operator
java boolean ^ operator
Can someone please explain this operator.
boolean value1 = true;
boolean value2 = false;
System.out.println(!(value1 ^ !value2));
I know this evaluates to true. But what exactly is a ^ and how does it work?
Regards.
Can someone please explain this operator.
boolean value1 = true;
boolean value2 = false;
System.out.println(!(value1 ^ !value2));
I know this evaluates to true. But what exactly is a ^ and how does it work?
Regards.
Remote Desktop Connection
Remote Desktop Connection
I'm attempting to connect using Windows Remote Desktop Connection.
Can I make Remote Desktop Connection from other machines to Ubuntu 12.04
workstation?
I'm attempting to connect using Windows Remote Desktop Connection.
Can I make Remote Desktop Connection from other machines to Ubuntu 12.04
workstation?
spawning threads in a unit test
spawning threads in a unit test
There is a lot of information on how to unit test threaded code but not on
spawning threads inside a unit test method to test synchronization
mechanisms.
[TestMethod]
public void TestDiscountThreading() {
Thread[] threads = new Thread[50];
for (int i = 0; i < threads.Length; i++) {
threads[i] = new Thread(PriceThread);
threads[i].Start();
}
for (int i = 0; i < threads.Length; i++)
threads[i].Join();
}
I want to stresstest if synchronization in the code inside PriceThread is
implemented correctly but every single time the method runs I get the
error "The agent process was stopped while the test was running". Is it
even possible to spawn threads inside unit tests or what can be wrong
here?
Im using Visual Studio 2010 with the shipped unit testing framework
There is a lot of information on how to unit test threaded code but not on
spawning threads inside a unit test method to test synchronization
mechanisms.
[TestMethod]
public void TestDiscountThreading() {
Thread[] threads = new Thread[50];
for (int i = 0; i < threads.Length; i++) {
threads[i] = new Thread(PriceThread);
threads[i].Start();
}
for (int i = 0; i < threads.Length; i++)
threads[i].Join();
}
I want to stresstest if synchronization in the code inside PriceThread is
implemented correctly but every single time the method runs I get the
error "The agent process was stopped while the test was running". Is it
even possible to spawn threads inside unit tests or what can be wrong
here?
Im using Visual Studio 2010 with the shipped unit testing framework
Mail server on 2 ISPs cannot receive outside mail
Mail server on 2 ISPs cannot receive outside mail
I have been trying to fix this problem for a week now. My network has 2 ISP:
1: fixed IP -> Billion router -> mail and web servers
2: dynamic IP -> Linksys -> normal web browsing
They all used to work flawlessly until I reset the routers a week ago
(following an advice by ISP to fix a problem). Until now I can make
everything work except receiving mails from outside domains.
Billion - DHCP (192.168.2.1) is turned off. Virtual servers in NAT page
set to corresponding server local IPs.
Linksys - DHCP (192.168.2.2) is set to relay to 192.168.2.101 (I don't
know why. It was set by former admin who quits 2 months ago) Single Port
Forwarding was set like before.
Here is the DNS setting in DNS-DIY:
(blank) - A - (global IP)
* - A - (global IP)
www - A - (global IP)
(blank) - MX - mail
mail - MX - (global IP)
Telnetting the local IP and mail.xxxx.com for 110 and 25 works, but
xxxx.com doesn't.
Another thing I can tell is two routers are connected in some way. I don't
know about details of the mail server. I am just a programmer and
completely new to this network stuff. Even the network admin who quits 2
months ago cannot figure this out.
This issue is critical to the company I am working, so I need this fixed
ASAP. I will provide any more information I can.
I have been trying to fix this problem for a week now. My network has 2 ISP:
1: fixed IP -> Billion router -> mail and web servers
2: dynamic IP -> Linksys -> normal web browsing
They all used to work flawlessly until I reset the routers a week ago
(following an advice by ISP to fix a problem). Until now I can make
everything work except receiving mails from outside domains.
Billion - DHCP (192.168.2.1) is turned off. Virtual servers in NAT page
set to corresponding server local IPs.
Linksys - DHCP (192.168.2.2) is set to relay to 192.168.2.101 (I don't
know why. It was set by former admin who quits 2 months ago) Single Port
Forwarding was set like before.
Here is the DNS setting in DNS-DIY:
(blank) - A - (global IP)
* - A - (global IP)
www - A - (global IP)
(blank) - MX - mail
mail - MX - (global IP)
Telnetting the local IP and mail.xxxx.com for 110 and 25 works, but
xxxx.com doesn't.
Another thing I can tell is two routers are connected in some way. I don't
know about details of the mail server. I am just a programmer and
completely new to this network stuff. Even the network admin who quits 2
months ago cannot figure this out.
This issue is critical to the company I am working, so I need this fixed
ASAP. I will provide any more information I can.
content animation+html+css+Jquery+javascript
content animation+html+css+Jquery+javascript
The html page is fixed page.
1.There is a container,which has two sections in it.
2.First section is fixed and second section is scroll type.
3.I have many animations to be shown on left in I section and related
content to be placed on right section.
4.when mouse wheel is scrolled(vertical) i want content on right to
animate to related content (say i have five content,on each
scroll(vertical) it needs to go next content) same time i need to change
animation on left as well to relate the content on right.
Any suggestion how to do that in easiest way possible.compatibility
IE(9,10),Firefox,chrome on both windows and mac system.
The html page is fixed page.
1.There is a container,which has two sections in it.
2.First section is fixed and second section is scroll type.
3.I have many animations to be shown on left in I section and related
content to be placed on right section.
4.when mouse wheel is scrolled(vertical) i want content on right to
animate to related content (say i have five content,on each
scroll(vertical) it needs to go next content) same time i need to change
animation on left as well to relate the content on right.
Any suggestion how to do that in easiest way possible.compatibility
IE(9,10),Firefox,chrome on both windows and mac system.
Sunday, 25 August 2013
TOLVEN installation: Test Database and LDAP Connections After ConfigPhase1
TOLVEN installation: Test Database and LDAP Connections After ConfigPhase1
I am trying to install tolven, and following the manual
http://wiki.tolven.org/index.php/Installation_Guide
My linux system info is as follows:-
root@localhost:/> cat /etc/issue
CentOS release 6.4 (Final)
root@localhost:/> arch
x86_64
Everything was going fine as per the manual untill the
step 7.7 "Test Database and LDAP Connections After ConfigPhase1"
root@localhost:/> service postgresql status
postmaster (pid 26942) is running...
root@localhost:/>
root@localhost:/> ps aux|grep slapd
root 21160 0.0 0.2 231572 14652 ? Ssl 21:47 0:00 slapd -f slapd.conf -h
ldaps://
root 21496 0.0 0.0 103236 840 pts/1 S+ 23:23 0:00 grep --color=yes slapd
root@localhost:/>
root@localhost:/> cd /usr/local/tolven-RC1/bin
root@localhost:/> ./tpf.sh -plugin org.tolven.postgresqlmgr -testAdminDB
Please enter config directory: /usr/local/tolven-config
0 [main] INFO root - Start log4j - Configuration:
file:/usr/local/tolven-RC1/bin/tolven-log4j.xml, logFileName:
/usr/local/tolven-RC1/log/tolven.log
23:21:26,024 INFO [TPFBoot] TPF Version: 0.0.10
23:21:26,024 INFO [TPFBoot] Loaded configDir /usr/local/tolven-config
23:21:26,034 INFO [TPFBoot] Generated boot.properties:
/tmp/tpf_4158526156312314572_boot.properties
23:21:26,044 INFO [TolvenApplicationInitializer] logging system initialized
23:21:26,044 INFO [TolvenApplicationInitializer] application root is
/usr/local/tolven-RC1/bin
23:21:26,090 INFO [PluginRegistryImpl] configured, stopOnError=true,
isValidating=false
23:21:26,391 INFO [PluginRegistryImpl] plug-in and fragment descriptors
registered - 89
23:21:26,533 INFO [TolvenApplicationInitializer] integrity check done:
errors - 0, warnings - 0
23:21:26,533 INFO [TolvenApplicationInitializer] application plug-in is
org.tolven.command
23:21:26,564 WARN [TolvenApplication] Remote library unavailable:
tolvenRemoteClient.jar because Could not retrieve library:
tolvenRemoteClient.jar
23:21:26,566 WARN [TolvenApplication] Remote library unavailable:
tolvenRemoteClient.jar because Could not retrieve library:
tolvenRemoteClient.jar
23:21:26,660 INFO [AdminAssembler] Prompt via System.in with: Enter your
password:
Enter your password:
java.lang.RuntimeException: Could not load secret key from
/usr/local/tolven-config/credentials/admin/admin-encryptedSecretKey
at
org.tolven.security.password.PasswordHolder.loadSecretKey(PasswordHolder.java:411)
at
org.tolven.security.password.PasswordHolder.loadPasswordStore(PasswordHolder.java:302)
at
org.tolven.assembler.admin.AdminAssembler.setupAdminPasswordStoreCredentials(AdminAssembler.java:425)
at org.tolven.assembler.admin.AdminAssembler.execute(AdminAssembler.java:153)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.tolven.command.TolvenApplication.execute(TolvenApplication.java:163)
at org.tolven.command.TolvenApplication.execute(TolvenApplication.java:153)
at
org.tolven.command.TolvenApplication.startApplication(TolvenApplication.java:91)
at org.java.plugin.boot.Boot.boot(Boot.java:346)
at org.java.plugin.boot.Boot.main(Boot.java:243)
at org.tolven.plugin.boot.TPFBoot.main(TPFBoot.java:112)
Caused by: java.lang.RuntimeException: Could not load keystore from
/usr/local/tolven-config/credentials/admin/tolvendev-admin.jks
at
org.tolven.security.password.PasswordHolder.getKeyStore(PasswordHolder.java:124)
at
org.tolven.security.password.PasswordHolder.loadSecretKey(PasswordHolder.java:405)
... 13 more
Application start failed.
java.lang.RuntimeException: Could not execute: org.tolven.assembler.admin
at org.tolven.command.TolvenApplication.execute(TolvenApplication.java:168)
at org.tolven.command.TolvenApplication.execute(TolvenApplication.java:153)
at
org.tolven.command.TolvenApplication.startApplication(TolvenApplication.java:91)
at org.java.plugin.boot.Boot.boot(Boot.java:346)
at org.java.plugin.boot.Boot.main(Boot.java:243)
at org.tolven.plugin.boot.TPFBoot.main(TPFBoot.java:112)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.tolven.command.TolvenApplication.execute(TolvenApplication.java:163)
... 5 more
Caused by: java.lang.RuntimeException: Could not load encrypted SecretKey
/usr/local/tolven-config/credentials/admin/admin-encryptedSecretKey
Could not load secret key from
/usr/local/tolven-config/credentials/admin/admin-encryptedSecretKey
at
org.tolven.security.password.PasswordHolder.loadPasswordStore(PasswordHolder.java:305)
at
org.tolven.assembler.admin.AdminAssembler.setupAdminPasswordStoreCredentials(AdminAssembler.java:425)
at org.tolven.assembler.admin.AdminAssembler.execute(AdminAssembler.java:153)
... 10 more
root@localhost:/> cat /usr/local/tolven-RC1/log/tolven.log
2013-08-25 23:21:26,024 INFO [org.tolven.plugin.boot.TPFBoot] TPF Version:
0.0.10
2013-08-25 23:21:26,024 INFO [org.tolven.plugin.boot.TPFBoot] Loaded
configDir /usr/local/tolven-config
2013-08-25 23:21:26,034 INFO [org.tolven.plugin.boot.TPFBoot] Generated
boot.properties: /tmp/tpf_4158526156312314572_boot.properties
2013-08-25 23:21:26,044 INFO
[org.tolven.plugin.boot.TolvenApplicationInitializer] logging system
initialized
2013-08-25 23:21:26,044 INFO
[org.tolven.plugin.boot.TolvenApplicationInitializer] application root is
/usr/local/tolven-RC1/bin
2013-08-25 23:21:26,090 INFO
[org.tolven.plugin.registry.xml.PluginRegistryImpl] configured,
stopOnError=true, isValidating=false
2013-08-25 23:21:26,391 INFO
[org.tolven.plugin.registry.xml.PluginRegistryImpl] plug-in and fragment
descriptors registered - 89
2013-08-25 23:21:26,533 INFO
[org.tolven.plugin.boot.TolvenApplicationInitializer] integrity check
done: errors - 0, warnings - 0
2013-08-25 23:21:26,533 INFO
[org.tolven.plugin.boot.TolvenApplicationInitializer] application plug-in
is org.tolven.command
2013-08-25 23:21:26,564 WARN [org.tolven.command.TolvenApplication] Remote
library unavailable: tolvenRemoteClient.jar because Could not retrieve
library: tolvenRemoteClient.jar
2013-08-25 23:21:26,566 WARN [org.tolven.command.TolvenApplication] Remote
library unavailable: tolvenRemoteClient.jar because Could not retrieve
library: tolvenRemoteClient.jar
2013-08-25 23:21:26,660 INFO [org.tolven.assembler.admin.AdminAssembler]
Prompt via System.in with: Enter your password: (I tried 'tolven' here)
I am unable to find any reason for the error and solution to troubleshoot
this.
Thanks in advance for your kind suggestion.
I want to request the moderators to add a tag "tolven" for this question.
I am trying to install tolven, and following the manual
http://wiki.tolven.org/index.php/Installation_Guide
My linux system info is as follows:-
root@localhost:/> cat /etc/issue
CentOS release 6.4 (Final)
root@localhost:/> arch
x86_64
Everything was going fine as per the manual untill the
step 7.7 "Test Database and LDAP Connections After ConfigPhase1"
root@localhost:/> service postgresql status
postmaster (pid 26942) is running...
root@localhost:/>
root@localhost:/> ps aux|grep slapd
root 21160 0.0 0.2 231572 14652 ? Ssl 21:47 0:00 slapd -f slapd.conf -h
ldaps://
root 21496 0.0 0.0 103236 840 pts/1 S+ 23:23 0:00 grep --color=yes slapd
root@localhost:/>
root@localhost:/> cd /usr/local/tolven-RC1/bin
root@localhost:/> ./tpf.sh -plugin org.tolven.postgresqlmgr -testAdminDB
Please enter config directory: /usr/local/tolven-config
0 [main] INFO root - Start log4j - Configuration:
file:/usr/local/tolven-RC1/bin/tolven-log4j.xml, logFileName:
/usr/local/tolven-RC1/log/tolven.log
23:21:26,024 INFO [TPFBoot] TPF Version: 0.0.10
23:21:26,024 INFO [TPFBoot] Loaded configDir /usr/local/tolven-config
23:21:26,034 INFO [TPFBoot] Generated boot.properties:
/tmp/tpf_4158526156312314572_boot.properties
23:21:26,044 INFO [TolvenApplicationInitializer] logging system initialized
23:21:26,044 INFO [TolvenApplicationInitializer] application root is
/usr/local/tolven-RC1/bin
23:21:26,090 INFO [PluginRegistryImpl] configured, stopOnError=true,
isValidating=false
23:21:26,391 INFO [PluginRegistryImpl] plug-in and fragment descriptors
registered - 89
23:21:26,533 INFO [TolvenApplicationInitializer] integrity check done:
errors - 0, warnings - 0
23:21:26,533 INFO [TolvenApplicationInitializer] application plug-in is
org.tolven.command
23:21:26,564 WARN [TolvenApplication] Remote library unavailable:
tolvenRemoteClient.jar because Could not retrieve library:
tolvenRemoteClient.jar
23:21:26,566 WARN [TolvenApplication] Remote library unavailable:
tolvenRemoteClient.jar because Could not retrieve library:
tolvenRemoteClient.jar
23:21:26,660 INFO [AdminAssembler] Prompt via System.in with: Enter your
password:
Enter your password:
java.lang.RuntimeException: Could not load secret key from
/usr/local/tolven-config/credentials/admin/admin-encryptedSecretKey
at
org.tolven.security.password.PasswordHolder.loadSecretKey(PasswordHolder.java:411)
at
org.tolven.security.password.PasswordHolder.loadPasswordStore(PasswordHolder.java:302)
at
org.tolven.assembler.admin.AdminAssembler.setupAdminPasswordStoreCredentials(AdminAssembler.java:425)
at org.tolven.assembler.admin.AdminAssembler.execute(AdminAssembler.java:153)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.tolven.command.TolvenApplication.execute(TolvenApplication.java:163)
at org.tolven.command.TolvenApplication.execute(TolvenApplication.java:153)
at
org.tolven.command.TolvenApplication.startApplication(TolvenApplication.java:91)
at org.java.plugin.boot.Boot.boot(Boot.java:346)
at org.java.plugin.boot.Boot.main(Boot.java:243)
at org.tolven.plugin.boot.TPFBoot.main(TPFBoot.java:112)
Caused by: java.lang.RuntimeException: Could not load keystore from
/usr/local/tolven-config/credentials/admin/tolvendev-admin.jks
at
org.tolven.security.password.PasswordHolder.getKeyStore(PasswordHolder.java:124)
at
org.tolven.security.password.PasswordHolder.loadSecretKey(PasswordHolder.java:405)
... 13 more
Application start failed.
java.lang.RuntimeException: Could not execute: org.tolven.assembler.admin
at org.tolven.command.TolvenApplication.execute(TolvenApplication.java:168)
at org.tolven.command.TolvenApplication.execute(TolvenApplication.java:153)
at
org.tolven.command.TolvenApplication.startApplication(TolvenApplication.java:91)
at org.java.plugin.boot.Boot.boot(Boot.java:346)
at org.java.plugin.boot.Boot.main(Boot.java:243)
at org.tolven.plugin.boot.TPFBoot.main(TPFBoot.java:112)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.tolven.command.TolvenApplication.execute(TolvenApplication.java:163)
... 5 more
Caused by: java.lang.RuntimeException: Could not load encrypted SecretKey
/usr/local/tolven-config/credentials/admin/admin-encryptedSecretKey
Could not load secret key from
/usr/local/tolven-config/credentials/admin/admin-encryptedSecretKey
at
org.tolven.security.password.PasswordHolder.loadPasswordStore(PasswordHolder.java:305)
at
org.tolven.assembler.admin.AdminAssembler.setupAdminPasswordStoreCredentials(AdminAssembler.java:425)
at org.tolven.assembler.admin.AdminAssembler.execute(AdminAssembler.java:153)
... 10 more
root@localhost:/> cat /usr/local/tolven-RC1/log/tolven.log
2013-08-25 23:21:26,024 INFO [org.tolven.plugin.boot.TPFBoot] TPF Version:
0.0.10
2013-08-25 23:21:26,024 INFO [org.tolven.plugin.boot.TPFBoot] Loaded
configDir /usr/local/tolven-config
2013-08-25 23:21:26,034 INFO [org.tolven.plugin.boot.TPFBoot] Generated
boot.properties: /tmp/tpf_4158526156312314572_boot.properties
2013-08-25 23:21:26,044 INFO
[org.tolven.plugin.boot.TolvenApplicationInitializer] logging system
initialized
2013-08-25 23:21:26,044 INFO
[org.tolven.plugin.boot.TolvenApplicationInitializer] application root is
/usr/local/tolven-RC1/bin
2013-08-25 23:21:26,090 INFO
[org.tolven.plugin.registry.xml.PluginRegistryImpl] configured,
stopOnError=true, isValidating=false
2013-08-25 23:21:26,391 INFO
[org.tolven.plugin.registry.xml.PluginRegistryImpl] plug-in and fragment
descriptors registered - 89
2013-08-25 23:21:26,533 INFO
[org.tolven.plugin.boot.TolvenApplicationInitializer] integrity check
done: errors - 0, warnings - 0
2013-08-25 23:21:26,533 INFO
[org.tolven.plugin.boot.TolvenApplicationInitializer] application plug-in
is org.tolven.command
2013-08-25 23:21:26,564 WARN [org.tolven.command.TolvenApplication] Remote
library unavailable: tolvenRemoteClient.jar because Could not retrieve
library: tolvenRemoteClient.jar
2013-08-25 23:21:26,566 WARN [org.tolven.command.TolvenApplication] Remote
library unavailable: tolvenRemoteClient.jar because Could not retrieve
library: tolvenRemoteClient.jar
2013-08-25 23:21:26,660 INFO [org.tolven.assembler.admin.AdminAssembler]
Prompt via System.in with: Enter your password: (I tried 'tolven' here)
I am unable to find any reason for the error and solution to troubleshoot
this.
Thanks in advance for your kind suggestion.
I want to request the moderators to add a tag "tolven" for this question.
Extjs : Grid column width in percentage
Extjs : Grid column width in percentage
Looks I am not the only one who has run into this situation. I need to set
the widths of the columns in a grid panel in percentages so that on any
size (due to resizing) each column has the predefined percentage width. I
am not able to achieve this by setting width : 'XY%' on each column. Also
noticed that the same question is being asked in the below threads.
http://www.sencha.com/forum/showthread.php?138485
http://www.sencha.com/forum/showthread.php?92930
This didnot help either : How to set width in Ext.grid.ColumnModel in
percentage terms?
Note : I donot want to flex the columns, but want to set percentages.
Extjs gurus please shed some light!
Looks I am not the only one who has run into this situation. I need to set
the widths of the columns in a grid panel in percentages so that on any
size (due to resizing) each column has the predefined percentage width. I
am not able to achieve this by setting width : 'XY%' on each column. Also
noticed that the same question is being asked in the below threads.
http://www.sencha.com/forum/showthread.php?138485
http://www.sencha.com/forum/showthread.php?92930
This didnot help either : How to set width in Ext.grid.ColumnModel in
percentage terms?
Note : I donot want to flex the columns, but want to set percentages.
Extjs gurus please shed some light!
Backup restore fails after update
Backup restore fails after update
I wanted to install windows xp beside ubuntu,so i desided to make an
backup using daja vu and overwrite ubuntu and install windows and again
ubuntu (this time beside windows) and restore the backup.All worked fine
untill i wanted to restore the backup.Deja vu said that the restoring was
not succesfull because of an unknown error. can anyone help?
I wanted to install windows xp beside ubuntu,so i desided to make an
backup using daja vu and overwrite ubuntu and install windows and again
ubuntu (this time beside windows) and restore the backup.All worked fine
untill i wanted to restore the backup.Deja vu said that the restoring was
not succesfull because of an unknown error. can anyone help?
Explicit initialization with constructors
Explicit initialization with constructors
How initialization a class object that has constructors and virtual functions
class DScalerFilterGreedyH
{
public:
DScalerFilterGreedyH() {}
virtual ~DScalerFilterGreedyH() {}
#define IS_SSE
#define SSE_TYPE SSE
#define FUNCT_NAME filterDScaler_SSE
#include "greedyh.asm"
#undef SSE_TYPE
#undef IS_SSE
#undef FUNCT_NAME
#define IS_3DNOW
#define FUNCT_NAME filterDScaler_3DNOW
#define SSE_TYPE 3DNOW
#include "greedyh.asm"
#undef SSE_TYPE
#undef IS_3DNOW
#undef FUNCT_NAME
#define IS_MMX
#define SSE_TYPE MMX
#define FUNCT_NAME filterDScaler_MMX
#include "greedyh.asm"
#undef SSE_TYPE
#undef IS_MMX
#undef FUNCT_NAME
unsigned int GreedyMaxComb;
unsigned int GreedyMotionThreshold;
unsigned int GreedyMotionSense;
};
Here member variable 'DScalerFilterGreedyH::GreedyMotionSense' is not
initialized in the constructor
Best regards
How initialization a class object that has constructors and virtual functions
class DScalerFilterGreedyH
{
public:
DScalerFilterGreedyH() {}
virtual ~DScalerFilterGreedyH() {}
#define IS_SSE
#define SSE_TYPE SSE
#define FUNCT_NAME filterDScaler_SSE
#include "greedyh.asm"
#undef SSE_TYPE
#undef IS_SSE
#undef FUNCT_NAME
#define IS_3DNOW
#define FUNCT_NAME filterDScaler_3DNOW
#define SSE_TYPE 3DNOW
#include "greedyh.asm"
#undef SSE_TYPE
#undef IS_3DNOW
#undef FUNCT_NAME
#define IS_MMX
#define SSE_TYPE MMX
#define FUNCT_NAME filterDScaler_MMX
#include "greedyh.asm"
#undef SSE_TYPE
#undef IS_MMX
#undef FUNCT_NAME
unsigned int GreedyMaxComb;
unsigned int GreedyMotionThreshold;
unsigned int GreedyMotionSense;
};
Here member variable 'DScalerFilterGreedyH::GreedyMotionSense' is not
initialized in the constructor
Best regards
JSON, AJAX and MVC
JSON, AJAX and MVC
I'm trying to implement JSON and AJAX to MVC design pattern through simple
login page, but i'm having an error
Here's my view:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Login Test Page</title>
<script src="../js/jquery-1.10.1.min.js" ></script>
<script src="../js/data_handler.js" ></script>
</head>
<body>
<form action="LoginController" method="post" id="loginForm">
<!-- Login body -->
<table>
<tr>
<td><label for="userName">Username:</label></td>
<td><input type="text" name="userName" id="userName" /></td>
</tr>
<tr>
<td><label for="password">Password:</label></td>
<td><input type="password" name="password" id="password"
/></td>
</tr>
<tr>
<td><input type="submit" /></td>
</tr>
</table>
<hr />
<p id="displayName" />
</form>
</body>
</html>
Here's my controller:
protected void doPost( HttpServletRequest request, HttpServletResponse
response ) throws ServletException,
IOException
{
Map<String, Object> map = new HashMap<String, Object>(); //
variable that will hold data to be parsed to JSON
UserDAO userDAO = new UserDAO(); // instantiate database
String userName = request.getParameter( "userName" ); // get
userName String from the Login.jsp
String password = request.getParameter( "password" ); // get
password String from the Login.jsp
boolean isValid = userDAO.authenticate( userName, password );
map.put( "isValid", isValid );
if( isValid ) // validate userName and password
{
UserModel userModel = userDAO.getUserDetails( userName ); //
get userModel that correspond to userName parameter
request.getSession().setAttribute( "userName", userName ); //
set SESSION REQUEST to be forward to MainPage.jsp
request.setAttribute( "userDetails", userModel ); // set
REQUEST to be forward to MainPage.jsp
RequestDispatcher rd = request.getRequestDispatcher(
"MainPage.jsp" );
rd.forward( request, response ); // forward request to
MainPage.jsp
return;
}
else
{
map.put( "userName", userName );
write( response, map );
}
}
/**
* @param response
* @param map contains data to parse to JSON
* @throws IOException
*/
private void write( HttpServletResponse response, Map<String, Object>
map ) throws IOException
{
response.setContentType( "application/json" );
response.setCharacterEncoding( "UTF-8" );
response.getWriter().write( new Gson().toJson( map ) );
}
Here's the AJAX:
$(document).ready(function(){
$('#loginForm').submit(function(){
$.ajax({
url: 'LoginController',
type: 'POST',
dataType: 'json',
data: $('loginForm').serialize(),
success: function(data){
alert("hello");
}
});
return false;
});
});
What i'm trying to do is a login page that if the user didn't enter a
proper USERNAME and PASSWORD an alert will appear. What am i doing wrong?
I'm just new to AJAX and JSON. For JSON i'm usingGSON`
I'm trying to implement JSON and AJAX to MVC design pattern through simple
login page, but i'm having an error
Here's my view:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Login Test Page</title>
<script src="../js/jquery-1.10.1.min.js" ></script>
<script src="../js/data_handler.js" ></script>
</head>
<body>
<form action="LoginController" method="post" id="loginForm">
<!-- Login body -->
<table>
<tr>
<td><label for="userName">Username:</label></td>
<td><input type="text" name="userName" id="userName" /></td>
</tr>
<tr>
<td><label for="password">Password:</label></td>
<td><input type="password" name="password" id="password"
/></td>
</tr>
<tr>
<td><input type="submit" /></td>
</tr>
</table>
<hr />
<p id="displayName" />
</form>
</body>
</html>
Here's my controller:
protected void doPost( HttpServletRequest request, HttpServletResponse
response ) throws ServletException,
IOException
{
Map<String, Object> map = new HashMap<String, Object>(); //
variable that will hold data to be parsed to JSON
UserDAO userDAO = new UserDAO(); // instantiate database
String userName = request.getParameter( "userName" ); // get
userName String from the Login.jsp
String password = request.getParameter( "password" ); // get
password String from the Login.jsp
boolean isValid = userDAO.authenticate( userName, password );
map.put( "isValid", isValid );
if( isValid ) // validate userName and password
{
UserModel userModel = userDAO.getUserDetails( userName ); //
get userModel that correspond to userName parameter
request.getSession().setAttribute( "userName", userName ); //
set SESSION REQUEST to be forward to MainPage.jsp
request.setAttribute( "userDetails", userModel ); // set
REQUEST to be forward to MainPage.jsp
RequestDispatcher rd = request.getRequestDispatcher(
"MainPage.jsp" );
rd.forward( request, response ); // forward request to
MainPage.jsp
return;
}
else
{
map.put( "userName", userName );
write( response, map );
}
}
/**
* @param response
* @param map contains data to parse to JSON
* @throws IOException
*/
private void write( HttpServletResponse response, Map<String, Object>
map ) throws IOException
{
response.setContentType( "application/json" );
response.setCharacterEncoding( "UTF-8" );
response.getWriter().write( new Gson().toJson( map ) );
}
Here's the AJAX:
$(document).ready(function(){
$('#loginForm').submit(function(){
$.ajax({
url: 'LoginController',
type: 'POST',
dataType: 'json',
data: $('loginForm').serialize(),
success: function(data){
alert("hello");
}
});
return false;
});
});
What i'm trying to do is a login page that if the user didn't enter a
proper USERNAME and PASSWORD an alert will appear. What am i doing wrong?
I'm just new to AJAX and JSON. For JSON i'm usingGSON`
Saturday, 24 August 2013
Multiple if/else statements in js function for unique input disabling
Multiple if/else statements in js function for unique input disabling
I'm bringing this up because I'm still learning javascript. I'm almost
positive that this is not the correct way to write this function, but it
works. It's ugly as hell, but it works. Just from a look at the script,
can you see an obvious oversight that would have made the code a lot
neater and more semantic?
$('#model').on('change', function(){
var yxs = $('#model').find('option:selected').attr('data-yxs');
var ys = $('#model').find('option:selected').attr('data-ys');
var ym = $('#model').find('option:selected').attr('data-ym');
var yl = $('#model').find('option:selected').attr('data-yl');
var yxl = $('#model').find('option:selected').attr('data-yxl');
var xs = $('#model').find('option:selected').attr('data-xs');
var s = $('#model').find('option:selected').attr('data-s');
var m = $('#model').find('option:selected').attr('data-m');
var l = $('#model').find('option:selected').attr('data-l');
var xl = $('#model').find('option:selected').attr('data-xl');
var xxl = $('#model').find('option:selected').attr('data-xxl');
var xxxl = $('#model').find('option:selected').attr('data-xxxl');
var xxxxl = $('#model').find('option:selected').attr('data-xxxxl');
if (yxs != '') {
$('#yxs').prop('disabled', false);
}
else {
$('#yxs').prop('disabled', true);
}
if (ys != '') {
$('#ys').prop('disabled', false);
}
else {
$('#ys').prop('disabled', true);
}
if (ys != '') {
$('#ym').prop('disabled', false);
}
else {
$('#ym').prop('disabled', true);
}
if (ys != '') {
$('#yl').prop('disabled', false);
}
else {
$('#yl').prop('disabled', true);
}
if (ys != '') {
$('#yxl').prop('disabled', false);
}
else {
$('#yxl').prop('disabled', true);
}
if (ys != '') {
$('#xs').prop('disabled', false);
}
else {
$('#xs').prop('disabled', true);
}
if (ys != '') {
$('#s').prop('disabled', false);
}
else {
$('#s').prop('disabled', true);
}
if (ys != '') {
$('#m').prop('disabled', false);
}
else {
$('#m').prop('disabled', true);
}
if (ys != '') {
$('#l').prop('disabled', false);
}
else {
$('#l').prop('disabled', true);
}
if (ys != '') {
$('#xl').prop('disabled', false);
}
else {
$('#xl').prop('disabled', true);
}
if (ys != '') {
$('#xxl').prop('disabled', false);
}
else {
$('#xxl').prop('disabled', true);
}
if (ys != '') {
$('#xxxl').prop('disabled', false);
}
else {
$('#xxxl').prop('disabled', true);
}
if (ys != '') {
$('#xxxxl').prop('disabled', false);
}
else {
$('#xxxxl').prop('disabled', true);
}
});
I'm bringing this up because I'm still learning javascript. I'm almost
positive that this is not the correct way to write this function, but it
works. It's ugly as hell, but it works. Just from a look at the script,
can you see an obvious oversight that would have made the code a lot
neater and more semantic?
$('#model').on('change', function(){
var yxs = $('#model').find('option:selected').attr('data-yxs');
var ys = $('#model').find('option:selected').attr('data-ys');
var ym = $('#model').find('option:selected').attr('data-ym');
var yl = $('#model').find('option:selected').attr('data-yl');
var yxl = $('#model').find('option:selected').attr('data-yxl');
var xs = $('#model').find('option:selected').attr('data-xs');
var s = $('#model').find('option:selected').attr('data-s');
var m = $('#model').find('option:selected').attr('data-m');
var l = $('#model').find('option:selected').attr('data-l');
var xl = $('#model').find('option:selected').attr('data-xl');
var xxl = $('#model').find('option:selected').attr('data-xxl');
var xxxl = $('#model').find('option:selected').attr('data-xxxl');
var xxxxl = $('#model').find('option:selected').attr('data-xxxxl');
if (yxs != '') {
$('#yxs').prop('disabled', false);
}
else {
$('#yxs').prop('disabled', true);
}
if (ys != '') {
$('#ys').prop('disabled', false);
}
else {
$('#ys').prop('disabled', true);
}
if (ys != '') {
$('#ym').prop('disabled', false);
}
else {
$('#ym').prop('disabled', true);
}
if (ys != '') {
$('#yl').prop('disabled', false);
}
else {
$('#yl').prop('disabled', true);
}
if (ys != '') {
$('#yxl').prop('disabled', false);
}
else {
$('#yxl').prop('disabled', true);
}
if (ys != '') {
$('#xs').prop('disabled', false);
}
else {
$('#xs').prop('disabled', true);
}
if (ys != '') {
$('#s').prop('disabled', false);
}
else {
$('#s').prop('disabled', true);
}
if (ys != '') {
$('#m').prop('disabled', false);
}
else {
$('#m').prop('disabled', true);
}
if (ys != '') {
$('#l').prop('disabled', false);
}
else {
$('#l').prop('disabled', true);
}
if (ys != '') {
$('#xl').prop('disabled', false);
}
else {
$('#xl').prop('disabled', true);
}
if (ys != '') {
$('#xxl').prop('disabled', false);
}
else {
$('#xxl').prop('disabled', true);
}
if (ys != '') {
$('#xxxl').prop('disabled', false);
}
else {
$('#xxxl').prop('disabled', true);
}
if (ys != '') {
$('#xxxxl').prop('disabled', false);
}
else {
$('#xxxxl').prop('disabled', true);
}
});
Smooth grid lines and implicit surfaces
Smooth grid lines and implicit surfaces
Take for instance the computer rendering of this implicit surface:
http://xahlee.info/surface/cayley_cubic/cayley_cubic.html
The image shows a grid on the surface. How do I calculate the connection
points of this grid? I want to create a 3D mesh representation of it in
other software (a video game actually).
Thanks!
Take for instance the computer rendering of this implicit surface:
http://xahlee.info/surface/cayley_cubic/cayley_cubic.html
The image shows a grid on the surface. How do I calculate the connection
points of this grid? I want to create a 3D mesh representation of it in
other software (a video game actually).
Thanks!
enumerate tag using the alphabet instead of numbers
enumerate tag using the alphabet instead of numbers
The default behaviour for the \begin{enumerate}tag is to sequentially list
the items given by \item over the numbers {1, 2, 3, 4, ...}.
Is it possible to change this to the alphabet {a, b, c, d, ...}
How about Roman Numerals {i, ii, iii, iv, v, vi, ... }
How is this done?
Note that I use emacs 24.3. Thanks for all the help.
The default behaviour for the \begin{enumerate}tag is to sequentially list
the items given by \item over the numbers {1, 2, 3, 4, ...}.
Is it possible to change this to the alphabet {a, b, c, d, ...}
How about Roman Numerals {i, ii, iii, iv, v, vi, ... }
How is this done?
Note that I use emacs 24.3. Thanks for all the help.
Realtek RTL8188CE wifi driver on 12.04LTS
Realtek RTL8188CE wifi driver on 12.04LTS
I've set up a fresh 12.04 (64bit, Kernel 3.8.0.29) and have issues with my
wifi card which isn't showing any networks / let alone connecting to any.
I followed this blogpost to compile the latest driver from Realtek
(download from realtek)
(make install)
(modprobe rtl8192ce)
(add to /etc/modules)
Immediately after I finished the steps above I saw wifi networks (via the
ubuntu network manager). When I then tried to connect it timed out and
after a subsequent reboot I couldn't even see any networks anymore.
Tried a lot of things since then, but I guess I fail to see the core of
the problem.
This is how the system looks like:
lspci -v -s 02:00.0
02:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8188CE
802.11b/g/n WiFi Adapter (rev 01)
Subsystem: Realtek Semiconductor Co., Ltd. Device 8175
Flags: bus master, fast devsel, latency 0, IRQ 16
I/O ports at e000 [size=256]
Memory at f7b00000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Virtual Channel
Capabilities: [160] Device Serial Number 01-91-81-fe-ff-4c-e0-00
Kernel driver in use: rtl8192ce
Kernel modules: rtl8192ce
spacer
ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr 64:5a:04:31:09:bf
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
spacer
lsmod
Module Size Used by
joydev 17613 0
bnep 18258 2
rfcomm 47864 0
bluetooth 247024 10 bnep,rfcomm
parport_pc 28284 0
ppdev 17113 0
snd_hda_codec_hdmi 37434 1
snd_hda_codec_realtek 79916 1
coretemp 13596 0
kvm_intel 137899 0
kvm 455932 1 kvm_intel
ghash_clmulni_intel 13259 0
cryptd 20501 1 ghash_clmulni_intel
hid_logitech_dj 18767 0
arc4 12573 2
microcode 23017 0
rtl8192ce 141806 0
rtlwifi 123323 1 rtl8192ce
usbhid 47346 1 hid_logitech_dj
hid 105549 2 hid_logitech_dj,usbhid
mac80211 630977 2 rtl8192ce,rtlwifi
cfg80211 525244 2 rtlwifi,mac80211
snd_hda_intel 44339 3
snd_hda_codec 141716 3
snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel
lpc_ich 17144 0
snd_hwdep 13668 1 snd_hda_codec
snd_pcm 102477 3
snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
snd_seq_midi 13324 0
snd_rawmidi 30417 1 snd_seq_midi
snd_seq_midi_event 14899 1 snd_seq_midi
snd_seq 61930 2 snd_seq_midi,snd_seq_midi_event
snd_timer 29989 2 snd_pcm,snd_seq
snd_seq_device 14497 3 snd_seq_midi,snd_rawmidi,snd_seq
i915 620421 3
drm_kms_helper 49597 1 i915
drm 287564 4 i915,drm_kms_helper
snd 69533 16
snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
i2c_algo_bit 13564 1 i915
mac_hid 13253 0
mei 41820 0
video 19652 1 i915
soundcore 12680 1 snd
snd_page_alloc 18798 2 snd_hda_intel,snd_pcm
lp 17799 0
parport 46562 3 parport_pc,ppdev,lp
usb_storage 61749 0
ahci 25879 3
libahci 31606 1 ahci
r8169 68716 0
spacer
cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
lp
rtc
rtl8192ce.ko
I don't see anything that actually points me in any direction. I should
also say that i'm not exactly a Linux guru and dealing with kernel modules
is fairly new to me. After hours of fruitless try & error I'd really
appreciate if anyone more knowledgeable than me would provide some
insights on what to do next.
I've set up a fresh 12.04 (64bit, Kernel 3.8.0.29) and have issues with my
wifi card which isn't showing any networks / let alone connecting to any.
I followed this blogpost to compile the latest driver from Realtek
(download from realtek)
(make install)
(modprobe rtl8192ce)
(add to /etc/modules)
Immediately after I finished the steps above I saw wifi networks (via the
ubuntu network manager). When I then tried to connect it timed out and
after a subsequent reboot I couldn't even see any networks anymore.
Tried a lot of things since then, but I guess I fail to see the core of
the problem.
This is how the system looks like:
lspci -v -s 02:00.0
02:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8188CE
802.11b/g/n WiFi Adapter (rev 01)
Subsystem: Realtek Semiconductor Co., Ltd. Device 8175
Flags: bus master, fast devsel, latency 0, IRQ 16
I/O ports at e000 [size=256]
Memory at f7b00000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Virtual Channel
Capabilities: [160] Device Serial Number 01-91-81-fe-ff-4c-e0-00
Kernel driver in use: rtl8192ce
Kernel modules: rtl8192ce
spacer
ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr 64:5a:04:31:09:bf
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
spacer
lsmod
Module Size Used by
joydev 17613 0
bnep 18258 2
rfcomm 47864 0
bluetooth 247024 10 bnep,rfcomm
parport_pc 28284 0
ppdev 17113 0
snd_hda_codec_hdmi 37434 1
snd_hda_codec_realtek 79916 1
coretemp 13596 0
kvm_intel 137899 0
kvm 455932 1 kvm_intel
ghash_clmulni_intel 13259 0
cryptd 20501 1 ghash_clmulni_intel
hid_logitech_dj 18767 0
arc4 12573 2
microcode 23017 0
rtl8192ce 141806 0
rtlwifi 123323 1 rtl8192ce
usbhid 47346 1 hid_logitech_dj
hid 105549 2 hid_logitech_dj,usbhid
mac80211 630977 2 rtl8192ce,rtlwifi
cfg80211 525244 2 rtlwifi,mac80211
snd_hda_intel 44339 3
snd_hda_codec 141716 3
snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel
lpc_ich 17144 0
snd_hwdep 13668 1 snd_hda_codec
snd_pcm 102477 3
snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
snd_seq_midi 13324 0
snd_rawmidi 30417 1 snd_seq_midi
snd_seq_midi_event 14899 1 snd_seq_midi
snd_seq 61930 2 snd_seq_midi,snd_seq_midi_event
snd_timer 29989 2 snd_pcm,snd_seq
snd_seq_device 14497 3 snd_seq_midi,snd_rawmidi,snd_seq
i915 620421 3
drm_kms_helper 49597 1 i915
drm 287564 4 i915,drm_kms_helper
snd 69533 16
snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
i2c_algo_bit 13564 1 i915
mac_hid 13253 0
mei 41820 0
video 19652 1 i915
soundcore 12680 1 snd
snd_page_alloc 18798 2 snd_hda_intel,snd_pcm
lp 17799 0
parport 46562 3 parport_pc,ppdev,lp
usb_storage 61749 0
ahci 25879 3
libahci 31606 1 ahci
r8169 68716 0
spacer
cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
lp
rtc
rtl8192ce.ko
I don't see anything that actually points me in any direction. I should
also say that i'm not exactly a Linux guru and dealing with kernel modules
is fairly new to me. After hours of fruitless try & error I'd really
appreciate if anyone more knowledgeable than me would provide some
insights on what to do next.
Cannot create named pipe
Cannot create named pipe
i am trying to communicate beween c++ module and c# module using namedpipe
in my code
_pipe = CreateFile(
pipeName.c_str(),
GENERIC_READ, // only need read access
FILE_SHARE_READ ,
NULL,
CREATE_ALWAYS ,
FILE_ATTRIBUTE_NORMAL,
NULL
);
if(_pipe == INVALID_HANDLE_VALUE)
{
DWORD err = GetLastError();
int i = 5;
}
i am always getting error 2 when i try to create the pipe using
listener = new PipeListener("\\\\.\\pipe\\mynamedpipe");
i am trying to communicate beween c++ module and c# module using namedpipe
in my code
_pipe = CreateFile(
pipeName.c_str(),
GENERIC_READ, // only need read access
FILE_SHARE_READ ,
NULL,
CREATE_ALWAYS ,
FILE_ATTRIBUTE_NORMAL,
NULL
);
if(_pipe == INVALID_HANDLE_VALUE)
{
DWORD err = GetLastError();
int i = 5;
}
i am always getting error 2 when i try to create the pipe using
listener = new PipeListener("\\\\.\\pipe\\mynamedpipe");
Computer bluescreens when compiling Visual C++ 2010 project
Computer bluescreens when compiling Visual C++ 2010 project
Occasionally, roughly once every few hours (although it can be less or
more frequent), my computer will bluescreen or sometimes just shut down
with only a black screen when I compile my visual C++ project. It does not
always happen when I compile the project, and has happened with other
projects in the past.
I am using windows 7. When it actually forms a blue screen rather than
just shutting down with a black screen, it is too quick to read before the
computer shuts down. Are there any likely causes and is there anything I
should do prior to the next blue screen to find the cause of the issue?
Occasionally, roughly once every few hours (although it can be less or
more frequent), my computer will bluescreen or sometimes just shut down
with only a black screen when I compile my visual C++ project. It does not
always happen when I compile the project, and has happened with other
projects in the past.
I am using windows 7. When it actually forms a blue screen rather than
just shutting down with a black screen, it is too quick to read before the
computer shuts down. Are there any likely causes and is there anything I
should do prior to the next blue screen to find the cause of the issue?
C++: reference to unordered_map entry for deletion
C++: reference to unordered_map entry for deletion
I want to write a Cache with O(1) insert, O(1) retrieve which sets an
upper limit on the number of entries. The least recently accessed entry
shall be discarded before an insertion when the upper limit was already
reached.
My idea was to implement this based on an unordered map. To set an upper
limit on the number of cache entries, the entries will be intrusively
doubly linked inside the unordered map (the most recently linked at the
end of the list).
template<typename V>
struct CacheEntry {
V val;
CacheEntry<V> *prev
CacheEntry<V> *next;
HandleType h; // to be explained
}
template<typename K, typename V, ...>
struct Cache {
unordered_map<K, CacheEntry<V>, ...> umap_;
CacheEntry *first;
CacheEntry *last;
public:
interface similar to implement unordered_map + cache management
}
When I insert a new item into a full cache, the least recently used item
(referenced by the first pointer) shall be discarded from the cache. This
means I need to get a handle to the item which can be used to delete the
item from the map (HandleType above).
It seems to me that there a basically two things HandleType could be:
The original key, but this is potentially a waste of space or computing
cycles.
An iterator, but those are invalidated when the table is rehashed.
Possible amendment 1: Is it possible to obtain a cheaper representation of
the key (a reference to the Key stored in the implementation of the
unordered_map. Or a tuple (key reference, key hash))?
Possible amendment 2: Does the standard guarantee that there won't be
rehashes if I manually limit the size of the unordered_map to a fixed
number N, do a reserve(N) and a max_load_factor(1.0)?
Any other suggestions for implementing a cache?
I want to write a Cache with O(1) insert, O(1) retrieve which sets an
upper limit on the number of entries. The least recently accessed entry
shall be discarded before an insertion when the upper limit was already
reached.
My idea was to implement this based on an unordered map. To set an upper
limit on the number of cache entries, the entries will be intrusively
doubly linked inside the unordered map (the most recently linked at the
end of the list).
template<typename V>
struct CacheEntry {
V val;
CacheEntry<V> *prev
CacheEntry<V> *next;
HandleType h; // to be explained
}
template<typename K, typename V, ...>
struct Cache {
unordered_map<K, CacheEntry<V>, ...> umap_;
CacheEntry *first;
CacheEntry *last;
public:
interface similar to implement unordered_map + cache management
}
When I insert a new item into a full cache, the least recently used item
(referenced by the first pointer) shall be discarded from the cache. This
means I need to get a handle to the item which can be used to delete the
item from the map (HandleType above).
It seems to me that there a basically two things HandleType could be:
The original key, but this is potentially a waste of space or computing
cycles.
An iterator, but those are invalidated when the table is rehashed.
Possible amendment 1: Is it possible to obtain a cheaper representation of
the key (a reference to the Key stored in the implementation of the
unordered_map. Or a tuple (key reference, key hash))?
Possible amendment 2: Does the standard guarantee that there won't be
rehashes if I manually limit the size of the unordered_map to a fixed
number N, do a reserve(N) and a max_load_factor(1.0)?
Any other suggestions for implementing a cache?
jsf navigation to another method
jsf navigation to another method
I am developing an application using jsf 2.0 and i have the following
situation:
I have 2 managed beans.
On the first managed bean i have a method that process some data and then
store the result in session.After the data was stored in session i need to
invoke a method on the second bean that will display the information from
session.
The problem is that if i return a string from the first bean method that
correspond to the seconds bean method view the data is not processed, and
of course not displayed.
What i need is some navigation rule that from the first bean would
redirect me to the second bean method, and the second bean method would
return a string with the corresponding view name.
I am developing an application using jsf 2.0 and i have the following
situation:
I have 2 managed beans.
On the first managed bean i have a method that process some data and then
store the result in session.After the data was stored in session i need to
invoke a method on the second bean that will display the information from
session.
The problem is that if i return a string from the first bean method that
correspond to the seconds bean method view the data is not processed, and
of course not displayed.
What i need is some navigation rule that from the first bean would
redirect me to the second bean method, and the second bean method would
return a string with the corresponding view name.
Friday, 23 August 2013
Transform from ios6 to ios7
Transform from ios6 to ios7
I have an universal app where I successfully upgraded the iPhone component
to ios7. The ipad component however is not running anymore. I get the
following error:
Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[UISplitViewController tabBar]: unrecognized selector sent to
instance 0x8d9eef0'
I have no idea what happened. it did not touch the ipad side of things
whatsoever.
I am running: 11A4449d build and 5A11365y build for x-code on a mac machine.
After this code the error happens:
(void) awakeFromNib { [super awakeFromNib];
// whenever I come out of a storyboard, I make myself the delegate of any
splitview I am in self.splitViewController.delegate = self; }
I have an universal app where I successfully upgraded the iPhone component
to ios7. The ipad component however is not running anymore. I get the
following error:
Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[UISplitViewController tabBar]: unrecognized selector sent to
instance 0x8d9eef0'
I have no idea what happened. it did not touch the ipad side of things
whatsoever.
I am running: 11A4449d build and 5A11365y build for x-code on a mac machine.
After this code the error happens:
(void) awakeFromNib { [super awakeFromNib];
// whenever I come out of a storyboard, I make myself the delegate of any
splitview I am in self.splitViewController.delegate = self; }
How is Adobe Update Notifier auto launched on Mac OS X?
How is Adobe Update Notifier auto launched on Mac OS X?
It seems the Adobe Update Notifier sometime autolaunches on startup,
however I cannot find where it's launched from. I've checked in Lingon as
well as my login startup items but it's not there.
Any idea where else it could be? The full process is:
/Applications/Utilities/Adobe Application Manager/UWA/AAM Updates
Notifier.app/Contents/MacOS/AAM Updates Notifier -psn_0_127007
It seems the Adobe Update Notifier sometime autolaunches on startup,
however I cannot find where it's launched from. I've checked in Lingon as
well as my login startup items but it's not there.
Any idea where else it could be? The full process is:
/Applications/Utilities/Adobe Application Manager/UWA/AAM Updates
Notifier.app/Contents/MacOS/AAM Updates Notifier -psn_0_127007
ojdbc6 driver's Fetch size limit for Oracle 11.2g database
ojdbc6 driver's Fetch size limit for Oracle 11.2g database
Looking for parameter "max fetch size" we can use for OJDBC6 driver for
Oracle 11.2g database. I could not get from Oracle's driver's doc. Thank
you in advance
Looking for parameter "max fetch size" we can use for OJDBC6 driver for
Oracle 11.2g database. I could not get from Oracle's driver's doc. Thank
you in advance
Best structure for application and ioc container on laravel 4
Best structure for application and ioc container on laravel 4
Hi guys i have some question about what is better. If make a abstract
class named CompanyRepository wich have methods related with database as
duplicate company and stuff like this, then extend this class on
EloquentCompanyRepository or conversely EloquentCompanyRepository is a
abstract class with have all methods from eloquent orm and extended on
CompanyRepository?.
For the ioc container i got this:
$this->app->bind('Optima\Repositories\Company\CompanyRepositoryInterface',
'Optima\Repositories\Company\EloquentCompanyRepository');
Rather this:
$this->app->bind('Optima\Repositories\Company\CompanyRepositoryInterface',
'Optima\Repositories\Company\CompanyRepository');
I think that is more extendable and structured wether CompanyRepository
extend form EloquentCompanyRepository but i really don't know if true.
I hope make me understand and thanks for the help.
Hi guys i have some question about what is better. If make a abstract
class named CompanyRepository wich have methods related with database as
duplicate company and stuff like this, then extend this class on
EloquentCompanyRepository or conversely EloquentCompanyRepository is a
abstract class with have all methods from eloquent orm and extended on
CompanyRepository?.
For the ioc container i got this:
$this->app->bind('Optima\Repositories\Company\CompanyRepositoryInterface',
'Optima\Repositories\Company\EloquentCompanyRepository');
Rather this:
$this->app->bind('Optima\Repositories\Company\CompanyRepositoryInterface',
'Optima\Repositories\Company\CompanyRepository');
I think that is more extendable and structured wether CompanyRepository
extend form EloquentCompanyRepository but i really don't know if true.
I hope make me understand and thanks for the help.
Bash find last entry before timestamp
Bash find last entry before timestamp
I have a .csv file that is formatted thus;
myfile.csv
**Date,Timestamp,Data1,Data2,Data3,Data4,Data5,Data6**
20130730,22:08:51.244,APPLES,Spain,67p,blah,blah
20130730,22:08:51.244,PEARS,Spain,32p,blah,blah
20130730,22:08:51.708,APPLES,France102p,blah,blah
20130730,22:09:62.108,APPLES,Spain,67p,blah,blah
20130730,22:08:51.244,APPLES,Spain,67p,blah,blah
I wish to feed in a timestamp which most likely will NOT match up
perfectly to the millisecond with those in the file, and find the
preceding line that matches a particular grep search.
so e.g. something like;
cat myfile.csv | grep 'SPAIN' | grep 'APPLES' | grep -B1 "22:09"
should return
20130730,22:08:51.244,APPLES,Spain,67p,blah,blah
But thus far I can only get it to work with exact timestamps in the grep.
Is there a way to get it to treat these as a time series? (I am guessing
that's what the issue is here - it's trying pure pattern matching and not
unreasonably failing to find one)
I have a .csv file that is formatted thus;
myfile.csv
**Date,Timestamp,Data1,Data2,Data3,Data4,Data5,Data6**
20130730,22:08:51.244,APPLES,Spain,67p,blah,blah
20130730,22:08:51.244,PEARS,Spain,32p,blah,blah
20130730,22:08:51.708,APPLES,France102p,blah,blah
20130730,22:09:62.108,APPLES,Spain,67p,blah,blah
20130730,22:08:51.244,APPLES,Spain,67p,blah,blah
I wish to feed in a timestamp which most likely will NOT match up
perfectly to the millisecond with those in the file, and find the
preceding line that matches a particular grep search.
so e.g. something like;
cat myfile.csv | grep 'SPAIN' | grep 'APPLES' | grep -B1 "22:09"
should return
20130730,22:08:51.244,APPLES,Spain,67p,blah,blah
But thus far I can only get it to work with exact timestamps in the grep.
Is there a way to get it to treat these as a time series? (I am guessing
that's what the issue is here - it's trying pure pattern matching and not
unreasonably failing to find one)
JPA: persisting entity with composite primary key
JPA: persisting entity with composite primary key
I have two tables in database, A and B. Table B has an id composed of two
fields. One of them is a foreign key to A. Id of A is automatically
generated on insert by a sequence.
A:
ID (PK)
(*other fields*)
B:
SOME_FIELD (PK)
A_ID (PK, FK to A)
I have mapped the two tables in JPA (Hibernate) following JPA
specification, in this way:
@Entity
@Table(name = "A")
public class A {
@Id
@SequenceGenerator(name = "A_SEQ", sequenceName = "A_SEQ")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "A_SEQ")
@Column(name = "ID")
private Long id;
(...)
}
@Entity
@Table(name = "B")
public class B {
@EmbeddedId
@AttributeOverride(name = "someField", column = @Column(name =
SOME_FIELD))
private BPK pk;
@MapsId("aId")
@ManyToOne
@JoinColumn(name = "A_ID")
private A a;
(...)
}
@Embeddable
public class BPK {
private Long aId;
private String someField;
@Override
public boolean equals(Object o) {
(...)
}
@Override
public boolean hashCode() {
(...)
}
(...)
}
The problem is that when I try to save an B object calling
entityManager.persist(b), where b.a is set to an A object, which exists
already in database, I get an exception:
javax.persistence.PersistenceException:
org.hibernate.PersistentObjectException: detached entity passed to
persist: package.name.A
I don't know why this happens. I'm trying to save object of class B, not
A. Is my entity class wrong? Or maybe I shouldn't use persist here?
I have two tables in database, A and B. Table B has an id composed of two
fields. One of them is a foreign key to A. Id of A is automatically
generated on insert by a sequence.
A:
ID (PK)
(*other fields*)
B:
SOME_FIELD (PK)
A_ID (PK, FK to A)
I have mapped the two tables in JPA (Hibernate) following JPA
specification, in this way:
@Entity
@Table(name = "A")
public class A {
@Id
@SequenceGenerator(name = "A_SEQ", sequenceName = "A_SEQ")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "A_SEQ")
@Column(name = "ID")
private Long id;
(...)
}
@Entity
@Table(name = "B")
public class B {
@EmbeddedId
@AttributeOverride(name = "someField", column = @Column(name =
SOME_FIELD))
private BPK pk;
@MapsId("aId")
@ManyToOne
@JoinColumn(name = "A_ID")
private A a;
(...)
}
@Embeddable
public class BPK {
private Long aId;
private String someField;
@Override
public boolean equals(Object o) {
(...)
}
@Override
public boolean hashCode() {
(...)
}
(...)
}
The problem is that when I try to save an B object calling
entityManager.persist(b), where b.a is set to an A object, which exists
already in database, I get an exception:
javax.persistence.PersistenceException:
org.hibernate.PersistentObjectException: detached entity passed to
persist: package.name.A
I don't know why this happens. I'm trying to save object of class B, not
A. Is my entity class wrong? Or maybe I shouldn't use persist here?
Thursday, 22 August 2013
Wifi access mechanism IOS
Wifi access mechanism IOS
Could someone explain to me how exactly an iPhone detects a Wifi hotspot?
I mean i want to know the exact working of it. How does it know of all the
networks that are present in the location? How often does it check for the
networks ?
Could someone explain to me how exactly an iPhone detects a Wifi hotspot?
I mean i want to know the exact working of it. How does it know of all the
networks that are present in the location? How often does it check for the
networks ?
I need some help in Android
I need some help in Android
Can someone kindly give me a solution to this and explain how he/she came
to that particular solution? Thanks so much
1) Upon rotation of the GUI from portrait to landscape or the opposite
disappears all local variables.Skriv content of the class, where it is
marked with To-Do, so that variable isGameFinished taken care of by
rotation and collected again when the app is rotated
Class
public class StatteActivity extends Activity{
private boolean isGameFinished;
private Button buttonFinishedGame;
protected void onCreate (Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_state);
//Get previous state for isGameFinished if it exists
//TO-DO
//Find button
buttonFinishGame = (Button) findViewByID(R.id.buttonFinishGame);
buttonFinishGame.setOnClickListener(new OnClickListener(){
public void onClick(View v){
isGameFinished = true;
}
});
if(isGameFinished){
finish();
}
}
protected void onSaveInstanceState(Bundle outState){
//To-Do
super.onSaveInstanceState(outState);
}
}
Can someone kindly give me a solution to this and explain how he/she came
to that particular solution? Thanks so much
1) Upon rotation of the GUI from portrait to landscape or the opposite
disappears all local variables.Skriv content of the class, where it is
marked with To-Do, so that variable isGameFinished taken care of by
rotation and collected again when the app is rotated
Class
public class StatteActivity extends Activity{
private boolean isGameFinished;
private Button buttonFinishedGame;
protected void onCreate (Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_state);
//Get previous state for isGameFinished if it exists
//TO-DO
//Find button
buttonFinishGame = (Button) findViewByID(R.id.buttonFinishGame);
buttonFinishGame.setOnClickListener(new OnClickListener(){
public void onClick(View v){
isGameFinished = true;
}
});
if(isGameFinished){
finish();
}
}
protected void onSaveInstanceState(Bundle outState){
//To-Do
super.onSaveInstanceState(outState);
}
}
Unable to load json file in html using d3.js
Unable to load json file in html using d3.js
I want to load data from a json file in an HTML file and use D3 to
visualize it. I am able to view the data in the browser if the file is
loaded on its own. The file is also received correctly verified by the 200
status. But the contents of the file are interpreted as null.
Here are the contents of the json file -
[{"totdistance": [["1987", "20926761"], ["1988", "81974990"], ["1989",
"93470285"], ["1990", "116938068"], ["1991", "128179520"], ["1992",
"123889922"], ["1993", "113169123"], ["1994", "119145135"], ["1995",
"132070386"], ["1996", "145689003"], ["1997", "158173093"], ["1998",
"164900616"], ["1999", "180094162"], ["2000", "191005263"], ["2001",
"186583998"], ["2002", "185726579"], ["2003", "189239126"], ["2004",
"203622782"], ["2005", "200373825"]],
"routes": [["1987", "45399"], ["1988", "180871"], ["1989", "195588"],
["1990", "216314"], ["1991", "219896"], ["1992", "199066"], ["1993",
"176756"], ["1994", "177851"], ["1995", "194508"], ["1996", "203001"],
["1997", "206304"], ["1998", "203071"], ["1999", "209496"], ["2000",
"219160"], ["2001", "209979"], ["2002", "196111"], ["2003", "189519"],
["2004", "195939"], ["2005", "197853"]], "code": "HP", "name": "America
West Airlines Inc. (Merged with US Airways 9/05. Stopped reporting
10/07.)", "avgdelay": [["1987", "16"], ["1988", "8"], ["1989", "11"],
["1990", "12"], ["1991", "12"], ["1992", "7"], ["1993", "11"], ["1994",
"15"], ["1995", "17"], ["1996", "23"], ["1997", "17"], ["1998", "29"],
["1999", "25"], ["2000", "28"], ["2001", "18"], ["2002", "9"], ["2003",
"13"], ["2004", "25"], ["2005", "18"]]}]
Here is the code that tries to load the file and read its contents -
d3.json("flights.json", function(flights) {
But I get error on the console that flights is null.
I have tried running this code on a webserver using IE, Firefox and
Chrome. But no solution.
I am using this as a starting point -
https://github.com/mbostock/bost.ocks.org/blob/gh-pages/mike/nations/index.html
Here is the error - Uncaught TypeError: Cannot call method 'map' of null
The json is valid as per http://jsonlint.com/
Thanks for any help to fix this issue.
I want to load data from a json file in an HTML file and use D3 to
visualize it. I am able to view the data in the browser if the file is
loaded on its own. The file is also received correctly verified by the 200
status. But the contents of the file are interpreted as null.
Here are the contents of the json file -
[{"totdistance": [["1987", "20926761"], ["1988", "81974990"], ["1989",
"93470285"], ["1990", "116938068"], ["1991", "128179520"], ["1992",
"123889922"], ["1993", "113169123"], ["1994", "119145135"], ["1995",
"132070386"], ["1996", "145689003"], ["1997", "158173093"], ["1998",
"164900616"], ["1999", "180094162"], ["2000", "191005263"], ["2001",
"186583998"], ["2002", "185726579"], ["2003", "189239126"], ["2004",
"203622782"], ["2005", "200373825"]],
"routes": [["1987", "45399"], ["1988", "180871"], ["1989", "195588"],
["1990", "216314"], ["1991", "219896"], ["1992", "199066"], ["1993",
"176756"], ["1994", "177851"], ["1995", "194508"], ["1996", "203001"],
["1997", "206304"], ["1998", "203071"], ["1999", "209496"], ["2000",
"219160"], ["2001", "209979"], ["2002", "196111"], ["2003", "189519"],
["2004", "195939"], ["2005", "197853"]], "code": "HP", "name": "America
West Airlines Inc. (Merged with US Airways 9/05. Stopped reporting
10/07.)", "avgdelay": [["1987", "16"], ["1988", "8"], ["1989", "11"],
["1990", "12"], ["1991", "12"], ["1992", "7"], ["1993", "11"], ["1994",
"15"], ["1995", "17"], ["1996", "23"], ["1997", "17"], ["1998", "29"],
["1999", "25"], ["2000", "28"], ["2001", "18"], ["2002", "9"], ["2003",
"13"], ["2004", "25"], ["2005", "18"]]}]
Here is the code that tries to load the file and read its contents -
d3.json("flights.json", function(flights) {
But I get error on the console that flights is null.
I have tried running this code on a webserver using IE, Firefox and
Chrome. But no solution.
I am using this as a starting point -
https://github.com/mbostock/bost.ocks.org/blob/gh-pages/mike/nations/index.html
Here is the error - Uncaught TypeError: Cannot call method 'map' of null
The json is valid as per http://jsonlint.com/
Thanks for any help to fix this issue.
Python multiprocessing using a List of Queues
Python multiprocessing using a List of Queues
I try to create a list of queues using Python 2.7 multiprocessing package.
Each sub-process owns an individual queue and has two tasks: getting
elements from its own queue and putting elements to other sub-processes'
queues. So, each sub-process has to know which queue belongs to it, that's
why I use a list of queues.
I made code as follows:
mgr = multiprocessing.Manager()
sharedQueueList = mgr.list()
for i in xrange(num_processes):
sharedQueueList .append(mgr.Queue())
But, I got the following error message:
raise convert_to_error(kind, result)
RemoteError:
Unserializable message: ('#RETURN', < Queue.Queue instance at 0x02AD3170 >)
Any ideas? Thanks!
I try to create a list of queues using Python 2.7 multiprocessing package.
Each sub-process owns an individual queue and has two tasks: getting
elements from its own queue and putting elements to other sub-processes'
queues. So, each sub-process has to know which queue belongs to it, that's
why I use a list of queues.
I made code as follows:
mgr = multiprocessing.Manager()
sharedQueueList = mgr.list()
for i in xrange(num_processes):
sharedQueueList .append(mgr.Queue())
But, I got the following error message:
raise convert_to_error(kind, result)
RemoteError:
Unserializable message: ('#RETURN', < Queue.Queue instance at 0x02AD3170 >)
Any ideas? Thanks!
Does async in 4.5 imply a new thread is spun up just by entering the function?
Does async in 4.5 imply a new thread is spun up just by entering the
function?
Or do I have to use Task.Run within the method to make sure each function
exists on its own thread? I'm trying to see if there's any wisdom in this
practice I see in the code I'm working on.
public async Task<string> GetAStringAfterSyncProcessing(string processThis) {
return await Task.Run(async () => {
var processThis2 = processThis + ",";
var processThis3 = processThis2 + ",";
var nowImDone = processThis3 + ",";
return nowImDone;
});
}
I have a feeling that this is unintended design, since it makes it
impossible to walk through each line while debugging. So I'm wondering if
I'd be right in explaining to others that async automatically implies the
creating of a new thread so that the function is only called when await or
.GetAwaiter().GetResult() is used. Thanks
function?
Or do I have to use Task.Run within the method to make sure each function
exists on its own thread? I'm trying to see if there's any wisdom in this
practice I see in the code I'm working on.
public async Task<string> GetAStringAfterSyncProcessing(string processThis) {
return await Task.Run(async () => {
var processThis2 = processThis + ",";
var processThis3 = processThis2 + ",";
var nowImDone = processThis3 + ",";
return nowImDone;
});
}
I have a feeling that this is unintended design, since it makes it
impossible to walk through each line while debugging. So I'm wondering if
I'd be right in explaining to others that async automatically implies the
creating of a new thread so that the function is only called when await or
.GetAwaiter().GetResult() is used. Thanks
Cannot delete view-private file
Cannot delete view-private file
In a dynamic ClearCase view on Windows 7, I've got a file with size 0 and
name myproject.prj.$$$. I cannot open, delete, rename or modify that file.
I'd prefer to delete the file, but when trying to delete it:
Windows Explorer shows the error message "Invalid MS-DOS function".
cmd.exe's del: "Incorrect function".
ClearCase Explorer simply does nothing.
I've created a file with the same name at a different location, and was
able to edit and delete that file without any issues - so I guess the file
name is not the issue. The file first showed up after the computer had
crashed. I'd prefer not to delete and recreate the view.
What can I do to delete this file?
In a dynamic ClearCase view on Windows 7, I've got a file with size 0 and
name myproject.prj.$$$. I cannot open, delete, rename or modify that file.
I'd prefer to delete the file, but when trying to delete it:
Windows Explorer shows the error message "Invalid MS-DOS function".
cmd.exe's del: "Incorrect function".
ClearCase Explorer simply does nothing.
I've created a file with the same name at a different location, and was
able to edit and delete that file without any issues - so I guess the file
name is not the issue. The file first showed up after the computer had
crashed. I'd prefer not to delete and recreate the view.
What can I do to delete this file?
Wednesday, 21 August 2013
create project using XTRF REST API
create project using XTRF REST API
I am unable to find how I can create a project using XTFR REST API. Please
help me where I can find the best solution for createProject XTRF REST API
functionality.
I am unable to find how I can create a project using XTFR REST API. Please
help me where I can find the best solution for createProject XTRF REST API
functionality.
Force Firefox to strictly follow cache-control
Force Firefox to strictly follow cache-control
I am setting this in my HTTP headers:
Cache-Control: public, max-age=3600
Date: Thu, 22 Aug 2013 02:44:50 GMT
Etag: 7223b29b5aab45749c8ce1b166
Expires: Thu, 22 Aug 2013 03:44:50 GMT
When the asset expires (html, js, or css), I want FireFox to make a
request to the server (preferably using If-None-Match). The issue is that
FireFox sometimes uses a cached copy even if it has expired (like when I
press the 'back' or 'forward' button).
How can I force Firefox to ALWAYS make a request for the expired asset?
Note: I could turn off all caching, but I don't want to do this. I want to
cache for an hour or maybe a day for performance (user experience), but
then I want to be able to push updates to Firefox.
I am setting this in my HTTP headers:
Cache-Control: public, max-age=3600
Date: Thu, 22 Aug 2013 02:44:50 GMT
Etag: 7223b29b5aab45749c8ce1b166
Expires: Thu, 22 Aug 2013 03:44:50 GMT
When the asset expires (html, js, or css), I want FireFox to make a
request to the server (preferably using If-None-Match). The issue is that
FireFox sometimes uses a cached copy even if it has expired (like when I
press the 'back' or 'forward' button).
How can I force Firefox to ALWAYS make a request for the expired asset?
Note: I could turn off all caching, but I don't want to do this. I want to
cache for an hour or maybe a day for performance (user experience), but
then I want to be able to push updates to Firefox.
Parse Cloud Code - Simple Query Doesn't Return Results
Parse Cloud Code - Simple Query Doesn't Return Results
I'm a new user and novice coder trying to learn the basics of Cloud Code
(please bear with me). I've been following online tutorials and I'm trying
to replicate basic functionality to increment my knowledge and
understanding.
I created a very simple class ("Students") with 2 objects: Screenshot
I just want to be able to run simple queries on the data to understand how
queries work. However, using almost exactly the same code found in several
online tutorials, I can't seem to get any results. I don't get errors, but
I'm not able to get results when I create simple matches like query on
"Name", "Alex":
Parse.Cloud.define("test", function(request, response) {
var Student = Parse.Object.extend("Student");
var query = new Parse.Query(Student);
query.equalTo("Grade",95);
query.find({
success: function(results){
console.log("received " + results.length + " result(s)");
},
error: function(error) {
//error
console.log("error: " + error);
}
});
response.success("done");
});
After running this code, the only thing I see in my cloud log after the
usual deploy and run text is this:
Input: {}
Result: done
This should be easy for most of you to troubleshoot. Just trying to learn
this the hard way. Thanks!
I'm a new user and novice coder trying to learn the basics of Cloud Code
(please bear with me). I've been following online tutorials and I'm trying
to replicate basic functionality to increment my knowledge and
understanding.
I created a very simple class ("Students") with 2 objects: Screenshot
I just want to be able to run simple queries on the data to understand how
queries work. However, using almost exactly the same code found in several
online tutorials, I can't seem to get any results. I don't get errors, but
I'm not able to get results when I create simple matches like query on
"Name", "Alex":
Parse.Cloud.define("test", function(request, response) {
var Student = Parse.Object.extend("Student");
var query = new Parse.Query(Student);
query.equalTo("Grade",95);
query.find({
success: function(results){
console.log("received " + results.length + " result(s)");
},
error: function(error) {
//error
console.log("error: " + error);
}
});
response.success("done");
});
After running this code, the only thing I see in my cloud log after the
usual deploy and run text is this:
Input: {}
Result: done
This should be easy for most of you to troubleshoot. Just trying to learn
this the hard way. Thanks!
browsermob-proxy throws a jetty 403 error when starting a simple proxy server
browsermob-proxy throws a jetty 403 error when starting a simple proxy server
In a simple test to set up a proxy I am getting a 403 Error after browsing
to my localhost and port which states "Forbidden for Proxy" and
"RequestURI=/"
<dependency>
<groupId>net.lightbody.bmp</groupId>
<artifactId>browsermob-proxy</artifactId>
<version>LATEST_VERSION (ex: 2.0-beta-8)</version>
<scope>test</scope>
</dependency>
and my test code is:
ProxyServer server = new ProxyServer(9090);
server.start();
What is causing the 403 when attempting to interact with the server?
In a simple test to set up a proxy I am getting a 403 Error after browsing
to my localhost and port which states "Forbidden for Proxy" and
"RequestURI=/"
<dependency>
<groupId>net.lightbody.bmp</groupId>
<artifactId>browsermob-proxy</artifactId>
<version>LATEST_VERSION (ex: 2.0-beta-8)</version>
<scope>test</scope>
</dependency>
and my test code is:
ProxyServer server = new ProxyServer(9090);
server.start();
What is causing the 403 when attempting to interact with the server?
AWS Elastic Beanstalk "composer install" fails to find packages
AWS Elastic Beanstalk "composer install" fails to find packages
I'm using git to deploy a Laravel app to Elastic Beanstalk, however the
app always fails to deploy. I checked the logs and here are the errors I
get:
Problem 1
- The requested package laravel/framework could not be found in any
version, there may be a typo in the package name.
Problem 2
- The requested package laravelbook/ardent could not be found in any
version, there may be a typo in the package name.
Problem 3
- The requested package machuga/authority-l4 could not be found in any
version, there may be a typo in the package name.
Problem 4
- The requested package way/generators could not be found in any version,
there may be a typo in the package name.
Problem 5
- The requested package jonob/restful could not be found in any version,
there may be a typo in the package name.
Problem 6
- The requested package intervention/image could not be found in any
version, there may be a typo in the package name.
Problem 7
- cartalyst/api 1.0.x-dev requires illuminate/container 4.0.* -> no
matching package found.
- cartalyst/api v1.0.0 requires illuminate/container 4.0.* -> no matching
package found.
- Installation request for cartalyst/api 1.0.* -> satisfiable by
cartalyst/api v1.0.0, cartalyst/api 1.0.x-dev.
and here is my composer.json file:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"require": {
"laravel/framework": "4.0.*",
"laravelbook/ardent": "dev-master",
"cartalyst/sentry": "2.0.*",
"cartalyst/api": "1.0.*",
"machuga/authority-l4" : "dev-master",
"way/generators": "dev-master",
"jonob/restful": "dev-master",
"intervention/image": "dev-master"
},
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
},
"repositories": [
{
"type": "composer",
"url": "http://packages.cartalyst.com"
}
],
"minimum-stability": "dev"
}
It seems to find the cartalyst packages alright, so maybe I need to
specify a repository for the others? If so, what would that repository be?
I'm using git to deploy a Laravel app to Elastic Beanstalk, however the
app always fails to deploy. I checked the logs and here are the errors I
get:
Problem 1
- The requested package laravel/framework could not be found in any
version, there may be a typo in the package name.
Problem 2
- The requested package laravelbook/ardent could not be found in any
version, there may be a typo in the package name.
Problem 3
- The requested package machuga/authority-l4 could not be found in any
version, there may be a typo in the package name.
Problem 4
- The requested package way/generators could not be found in any version,
there may be a typo in the package name.
Problem 5
- The requested package jonob/restful could not be found in any version,
there may be a typo in the package name.
Problem 6
- The requested package intervention/image could not be found in any
version, there may be a typo in the package name.
Problem 7
- cartalyst/api 1.0.x-dev requires illuminate/container 4.0.* -> no
matching package found.
- cartalyst/api v1.0.0 requires illuminate/container 4.0.* -> no matching
package found.
- Installation request for cartalyst/api 1.0.* -> satisfiable by
cartalyst/api v1.0.0, cartalyst/api 1.0.x-dev.
and here is my composer.json file:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"require": {
"laravel/framework": "4.0.*",
"laravelbook/ardent": "dev-master",
"cartalyst/sentry": "2.0.*",
"cartalyst/api": "1.0.*",
"machuga/authority-l4" : "dev-master",
"way/generators": "dev-master",
"jonob/restful": "dev-master",
"intervention/image": "dev-master"
},
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
},
"repositories": [
{
"type": "composer",
"url": "http://packages.cartalyst.com"
}
],
"minimum-stability": "dev"
}
It seems to find the cartalyst packages alright, so maybe I need to
specify a repository for the others? If so, what would that repository be?
Formotion Promotion RubyMotion
Formotion Promotion RubyMotion
stuck on this one.
I've just been playing around with RubyMotion and now ProMotion. I'm just
making a todo style app, just to learn a few things. I'm having trouble
with saving my data into a file. Ignore saving the data for now, im just
trying to find the correct function that gets called once the submit
button is pressed.
I've gone through the github pages of both Formmotion and ProMotion, but
the only thing i can find of any use to me is this one on ProMotions page,
https://github.com/clearsightstudio/ProMotion/wiki/Guide:-Formotion-or-other-custom-UIViewControllers
But even then it doesn't tell me (or i'm missing something) on which
helper is called when the submit button is pressed.
Any help would be great, cheers guys.
stuck on this one.
I've just been playing around with RubyMotion and now ProMotion. I'm just
making a todo style app, just to learn a few things. I'm having trouble
with saving my data into a file. Ignore saving the data for now, im just
trying to find the correct function that gets called once the submit
button is pressed.
I've gone through the github pages of both Formmotion and ProMotion, but
the only thing i can find of any use to me is this one on ProMotions page,
https://github.com/clearsightstudio/ProMotion/wiki/Guide:-Formotion-or-other-custom-UIViewControllers
But even then it doesn't tell me (or i'm missing something) on which
helper is called when the submit button is pressed.
Any help would be great, cheers guys.
Mail account access in iphone
Mail account access in iphone
I am trying to build a iPhone application which can access a mail account
user will give their email address and password if it match then he can
access his mail account.How do i do that?
I am trying to build a iPhone application which can access a mail account
user will give their email address and password if it match then he can
access his mail account.How do i do that?
Tuesday, 20 August 2013
Highstock - Single line series-Dynamically create marker based on a trigger
Highstock - Single line series-Dynamically create marker based on a trigger
I am using Highstock - Single line series for plotting
data.http://www.highcharts.com/stock/demo/basic-line. I want to know how
to create marker on certain points based on a trigger.If a sudden increase
happens in y axis,i want create a marker on that point(ie sudden increase
happend from 460 to 470,i want to create a marker on 470).I want to do it
in client level.How can i do this.Can anyone help on this.
I am using Highstock - Single line series for plotting
data.http://www.highcharts.com/stock/demo/basic-line. I want to know how
to create marker on certain points based on a trigger.If a sudden increase
happens in y axis,i want create a marker on that point(ie sudden increase
happend from 460 to 470,i want to create a marker on 470).I want to do it
in client level.How can i do this.Can anyone help on this.
Simple Google Spreadsheet For Each Loop?
Simple Google Spreadsheet For Each Loop?
It's been a long time since I've coded. I've never looked into scripts for
google spreadsheets before. I just want to make a simple effect to edit
the spreadsheet. If I understand correctly, this is doable so long as you
run it manually?
The syntax is throwing me off too much. My basic goal is to set each cell
in a fixed column range to equal itself plus the value in the adjacent
column, and then set that second value to 0.
My instinct would be to do something such as
CellRange[i][j] selected = C9:D13;
for(i=0,i<selectedrange.length,i++){
SpreadsheetApp.getActiveRange().setValue(selected[i][j]+selected[i][j+1];
SpreadsheetApp.getRange(selected[i][j+1]).setValue(0);
}
That's probably terribly wrong but I feel I ought to at least throw my
best guess out before asking for help.
It's been a long time since I've coded. I've never looked into scripts for
google spreadsheets before. I just want to make a simple effect to edit
the spreadsheet. If I understand correctly, this is doable so long as you
run it manually?
The syntax is throwing me off too much. My basic goal is to set each cell
in a fixed column range to equal itself plus the value in the adjacent
column, and then set that second value to 0.
My instinct would be to do something such as
CellRange[i][j] selected = C9:D13;
for(i=0,i<selectedrange.length,i++){
SpreadsheetApp.getActiveRange().setValue(selected[i][j]+selected[i][j+1];
SpreadsheetApp.getRange(selected[i][j+1]).setValue(0);
}
That's probably terribly wrong but I feel I ought to at least throw my
best guess out before asking for help.
using a var and a string to find a folder
using a var and a string to find a folder
to say some space and repetition I'm trying to use a var n to store a
common location for a folder but also want to later combine a image name.
example.
var n="/me/work/air/image/";
var get_images = ["'+n+'" "1.jpg"",n+ "2.jpg" ]
I'm simply just trying to include var n with the string "1.jpg" so the
result would be
"/me/work/air/image/1.jpg","/me/work/air/image/2.jpg"
to say some space and repetition I'm trying to use a var n to store a
common location for a folder but also want to later combine a image name.
example.
var n="/me/work/air/image/";
var get_images = ["'+n+'" "1.jpg"",n+ "2.jpg" ]
I'm simply just trying to include var n with the string "1.jpg" so the
result would be
"/me/work/air/image/1.jpg","/me/work/air/image/2.jpg"
Scrapy - Run with python or shell
Scrapy - Run with python or shell
I was just wondering if anyone could tell me the potential issues or
advantages of running scrapy using the CLI or with python. I'm
predominantly using python at the moment but currently I'm using it to run
the "scrapy crawl" command, but considering using the twisted reactor code
to start it.
It seems like there are well documented ways of running via both methods
but I didn't know if either one was in any way preferable. For example,
does one way give more control, does one way manage memory useage better,
or anything else I should be aware of.
Any help or advice would be much appreciated.
I was just wondering if anyone could tell me the potential issues or
advantages of running scrapy using the CLI or with python. I'm
predominantly using python at the moment but currently I'm using it to run
the "scrapy crawl" command, but considering using the twisted reactor code
to start it.
It seems like there are well documented ways of running via both methods
but I didn't know if either one was in any way preferable. For example,
does one way give more control, does one way manage memory useage better,
or anything else I should be aware of.
Any help or advice would be much appreciated.
Making my client-server program allow real users
Making my client-server program allow real users
I've done my best to Google, search here, everything, but I'm not having
luck. Long story short, I spent some time learning about socket
programming (specifically in Java). Everything I have programmed has had a
client application and a server application, i.e.:
Client.java --> User types in a message and it gets sent to the server
Server.java --> Returns an all-capitalized version to the user
or
Client.java --> Enters numerical integer guesses
Server.java --> Responds whether or not user has guessed the number correctly
When I run server then client, and use the client, it works fine. But I'm
wondering, how could I put this online? I.e. Random people can just access
my guessing game from wherever in the country. What I actually want to do
is set up a chat client which friends could all connect to, but it's the
same idea. Would I need to buy a home server and put the server.java
program on there or something? And then distribute the client.java file
(or .exe equivalent)?
Your help is greatly appreciated!
I've done my best to Google, search here, everything, but I'm not having
luck. Long story short, I spent some time learning about socket
programming (specifically in Java). Everything I have programmed has had a
client application and a server application, i.e.:
Client.java --> User types in a message and it gets sent to the server
Server.java --> Returns an all-capitalized version to the user
or
Client.java --> Enters numerical integer guesses
Server.java --> Responds whether or not user has guessed the number correctly
When I run server then client, and use the client, it works fine. But I'm
wondering, how could I put this online? I.e. Random people can just access
my guessing game from wherever in the country. What I actually want to do
is set up a chat client which friends could all connect to, but it's the
same idea. Would I need to buy a home server and put the server.java
program on there or something? And then distribute the client.java file
(or .exe equivalent)?
Your help is greatly appreciated!
JLayeredPane with a LayoutManager
JLayeredPane with a LayoutManager
The situation: drawing a stack of playing cards, like in the Solitaire
game. Nicely stacked.
To achieve this, I'm using a JLayeredPane in combination with a custom
implementation of the LayoutManager interface. The reason for using a
custom LayoutManager is that the stack orientation varies, sometimes the
playing cards cover each other completely, sometimes partially, and this
logic seems to be a good job for a LayoutManager, because this basically
boils down to setting the location of the cards.
So, the LayoutManager is responsible for setting the X- and Y-coordinates
of all components in my stack. The JLayeredPane on the other hand is
responsible for their Z-coordinates (via its layers).
Adding a component to a JLayeredPane goes like this:
JLayeredPane pane = new JLayeredPane();
pane.setLayout(new StackLayout(...));
pane.add(new CardView(...), new Integer(j));
where new Integer(j) is the layer of the card. This must be an Integer due
to the contract of JLayeredPane.
The problem here is, that my StackLayout cannot have any other constraint
object than an Integer, due to the reason stated above. The LayoutManager
interface requires you to implement the following method:
addLayoutComponent(Component comp, Object constraints);
and the passed Object will here always be an Integer.
In my particular situation, I am lucky, as my XY-coordinates can be
calculated based on the Z-coordinates. For example, the card in layer k
has to be located at Y-coordinate k * offset. So in my situation, the
constraints object being an Integer is not a problem.
I was wondering what you should be doing when there is no correlation
between the Z-coordinates and the XY-coordinates? How can you solve this
then? For example, how would I use a GridBagLayout in combination with a
JLayeredPane, where the first requires a GridBagConstraints object and the
second an Integer object? Of course, a GBL will layout in such a way that
components do not overlap, but it's just the idea.
The situation: drawing a stack of playing cards, like in the Solitaire
game. Nicely stacked.
To achieve this, I'm using a JLayeredPane in combination with a custom
implementation of the LayoutManager interface. The reason for using a
custom LayoutManager is that the stack orientation varies, sometimes the
playing cards cover each other completely, sometimes partially, and this
logic seems to be a good job for a LayoutManager, because this basically
boils down to setting the location of the cards.
So, the LayoutManager is responsible for setting the X- and Y-coordinates
of all components in my stack. The JLayeredPane on the other hand is
responsible for their Z-coordinates (via its layers).
Adding a component to a JLayeredPane goes like this:
JLayeredPane pane = new JLayeredPane();
pane.setLayout(new StackLayout(...));
pane.add(new CardView(...), new Integer(j));
where new Integer(j) is the layer of the card. This must be an Integer due
to the contract of JLayeredPane.
The problem here is, that my StackLayout cannot have any other constraint
object than an Integer, due to the reason stated above. The LayoutManager
interface requires you to implement the following method:
addLayoutComponent(Component comp, Object constraints);
and the passed Object will here always be an Integer.
In my particular situation, I am lucky, as my XY-coordinates can be
calculated based on the Z-coordinates. For example, the card in layer k
has to be located at Y-coordinate k * offset. So in my situation, the
constraints object being an Integer is not a problem.
I was wondering what you should be doing when there is no correlation
between the Z-coordinates and the XY-coordinates? How can you solve this
then? For example, how would I use a GridBagLayout in combination with a
JLayeredPane, where the first requires a GridBagConstraints object and the
second an Integer object? Of course, a GBL will layout in such a way that
components do not overlap, but it's just the idea.
Tagging or marking a video / audio using HTML5
Tagging or marking a video / audio using HTML5
Is there a way to tag or mark a video / audio at a particular location
using HTML5 during playback? It could be by right clicking on the seek bar
while it's being played or something else.
I have something like YouTube's "copy video URL at current time" feature
in mind. Is it possible?
Is there a way to tag or mark a video / audio at a particular location
using HTML5 during playback? It could be by right clicking on the seek bar
while it's being played or something else.
I have something like YouTube's "copy video URL at current time" feature
in mind. Is it possible?
Monday, 19 August 2013
Hide Birt Report Cross Tab cell
Hide Birt Report Cross Tab cell
I am very new to Birt Tool,
I need to show/hide Summary field of the Cross Tab on the basis of some
parameters which we can pass manually. I used the Properties-->Visibility
--> show/hide element but it only hide the data of the cell and blank cell
are still showing and my need to disable the cell on the basis of some
parameter.
I also tried by applying scripting on OnPrepare event but failed.
Kindly give me some suggestions...
Thanks in Advance.....
I am very new to Birt Tool,
I need to show/hide Summary field of the Cross Tab on the basis of some
parameters which we can pass manually. I used the Properties-->Visibility
--> show/hide element but it only hide the data of the cell and blank cell
are still showing and my need to disable the cell on the basis of some
parameter.
I also tried by applying scripting on OnPrepare event but failed.
Kindly give me some suggestions...
Thanks in Advance.....
Create a macro that is executed when a cel value chages (not by the user)
Create a macro that is executed when a cel value chages (not by the user)
Ok I have a worksheet "Goal 0" that with some ranges, make some
calculations like...
(in A1) =SUM(G2:G68)*I17
Then if I add/modify any of the values in 62-G68, the cell is auto
calculated (numbers that are mainly negative and some possitive). The
objetive is: According to the sum of the range, find the value of I17
where the result is equal or more than 0. (incrementing it 1 by 1,
decimals not needed)
Manually I can add change i17 untill it reaches the goal. How ever I want
to make it automatically, so if a value in the range of G2 to G68 changes
it recalculate the value of I17, but if already is higger or equal than 0
then do nothing.
Hope I explain it well
Regards
Ok I have a worksheet "Goal 0" that with some ranges, make some
calculations like...
(in A1) =SUM(G2:G68)*I17
Then if I add/modify any of the values in 62-G68, the cell is auto
calculated (numbers that are mainly negative and some possitive). The
objetive is: According to the sum of the range, find the value of I17
where the result is equal or more than 0. (incrementing it 1 by 1,
decimals not needed)
Manually I can add change i17 untill it reaches the goal. How ever I want
to make it automatically, so if a value in the range of G2 to G68 changes
it recalculate the value of I17, but if already is higger or equal than 0
then do nothing.
Hope I explain it well
Regards
How to start my Windows Service at RunTime or at OnAfterInstall
How to start my Windows Service at RunTime or at OnAfterInstall
History
I am building a Windows Service as part of my Platform Application to
handle updates and server functions, so it can be installed in machines
different than where the Client Application is installed. It uses UDP to
send and receive broadcast messages, and TCP to to handle more sensitive
and most important messages.
Objective
I want that my Application could be easily installed by the end user, just
by copying the executable files in the computers and when executing them.
The main application should verify if the user is an administrator, create
the configuration files, and then install the Windows Service and run it,
so when non administrative users log in, they won't receive any error from
my Application regarding administrative rights. The goal is to make most
configurations without the need a present technician, since database will
be remote.
Problem
My Service is being installed normally with the command MyService.exe
/install but it is not starting automatically. The only way to start it is
to go on Control Panel > Admin Tools > Services and do it manually. I
tryed to call net start MyService through my application but I receive
invalid service name at the shell. I tryied the executable name, the
display name and the object name of the service, but none of them worked.
This is the object of my TService:
object ServiceMainController: TServiceMainController
OldCreateOrder = False
OnCreate = ServiceCreate
DisplayName = 'PlatformUpdateService'
Interactive = True
AfterInstall = ServiceAfterInstall
AfterUninstall = ServiceAfterUninstall
OnShutdown = ServiceShutdown
OnStart = ServiceStart
OnStop = ServiceStop
Height = 210
Width = 320
Question
What should I do to start my service by the code and not by the user
hands? It would be the best if I could do it inside my client application,
or when by itself after the OnServiceAfterInstall call.
History
I am building a Windows Service as part of my Platform Application to
handle updates and server functions, so it can be installed in machines
different than where the Client Application is installed. It uses UDP to
send and receive broadcast messages, and TCP to to handle more sensitive
and most important messages.
Objective
I want that my Application could be easily installed by the end user, just
by copying the executable files in the computers and when executing them.
The main application should verify if the user is an administrator, create
the configuration files, and then install the Windows Service and run it,
so when non administrative users log in, they won't receive any error from
my Application regarding administrative rights. The goal is to make most
configurations without the need a present technician, since database will
be remote.
Problem
My Service is being installed normally with the command MyService.exe
/install but it is not starting automatically. The only way to start it is
to go on Control Panel > Admin Tools > Services and do it manually. I
tryed to call net start MyService through my application but I receive
invalid service name at the shell. I tryied the executable name, the
display name and the object name of the service, but none of them worked.
This is the object of my TService:
object ServiceMainController: TServiceMainController
OldCreateOrder = False
OnCreate = ServiceCreate
DisplayName = 'PlatformUpdateService'
Interactive = True
AfterInstall = ServiceAfterInstall
AfterUninstall = ServiceAfterUninstall
OnShutdown = ServiceShutdown
OnStart = ServiceStart
OnStop = ServiceStop
Height = 210
Width = 320
Question
What should I do to start my service by the code and not by the user
hands? It would be the best if I could do it inside my client application,
or when by itself after the OnServiceAfterInstall call.
Texclipse biber run parameters
Texclipse biber run parameters
I'm trying to run biblatex in texclipse however I keep getting the error
and my citation is just [ID ] with no bibliography at the end of the
document.
LaTeX Warning: Empty bibliography on input line 37.
Please (re)run Biber on the file: document.tex
My main tex file looks like:
\documentclass{ut-thesis}
\usepackage[backend=biber]{biblatex}
\addbibresource{thesis.bib}
\degree{Test Degree}
\department{Deparment}
\gradyear{Year}
\author{Author}
\title{UT-Thesis Class File Example}
\setcounter{tocdepth}{2}
\flushbottom
%%%%%%%%%%%% MAIN DOCUMENT %%%%%%%%%%%%
\begin{document}
\begin{preliminary}
\maketitle
\begin{abstract}
\end{abstract}
\tableofcontents
\end{preliminary}
\chapter{Introduction}
\section{Why?}
This is a section \cite{ID}
\addcontentsline{toc}{chapter}{Bibliography}
\printbibliography
\end{document}
My bib file looks like:
@Article{ID,
author = {Author},
title = {Title},
journal = {journal},
year = {2013}
}
@Article{ID2,
author = {Authors},
title = {Title 2},
journal = {Journal 2},
year = {2013}
}
I am trying to run biber as a manual build program with
Location: C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\biber.exe
Working Directory: ${workspace_loc:/Thesis/tmp}
Arguments: thesis
I get the following console output:
INFO - This is Biber 1.7
INFO - Logfile is 'thesis.blg'
INFO - Reading 'thesis.bcf'
INFO - Found 1 citekeys in bib section 0
INFO - Processing section 0
INFO - Looking for bibtex format file 'thesis.bib' for section 0
INFO - Found BibTeX data source 'C:/Program Files (x86)/MiKTeX
2.9/bibtex/bib/unswcover/thesis.bib'
WARN - I didn't find a database entry for 'ID' (section 0)
INFO - Overriding locale 'English_United States.1252' default tailoring
'variable = shifted' with 'variable = non-ignorable'
INFO - Sorting 'entry' list 'nty' keys
INFO - No sort tailoring available for locale 'English_United States.1252'
INFO - Writing 'thesis.bbl' with encoding 'ascii'
INFO - Output to thesis.bbl
INFO - WARNINGS: 1
This program works in TexMaker when i set it up to run pdflatex > biber >
pdflatex > pdflatex but i want to get it working in texlipse.
I'm trying to run biblatex in texclipse however I keep getting the error
and my citation is just [ID ] with no bibliography at the end of the
document.
LaTeX Warning: Empty bibliography on input line 37.
Please (re)run Biber on the file: document.tex
My main tex file looks like:
\documentclass{ut-thesis}
\usepackage[backend=biber]{biblatex}
\addbibresource{thesis.bib}
\degree{Test Degree}
\department{Deparment}
\gradyear{Year}
\author{Author}
\title{UT-Thesis Class File Example}
\setcounter{tocdepth}{2}
\flushbottom
%%%%%%%%%%%% MAIN DOCUMENT %%%%%%%%%%%%
\begin{document}
\begin{preliminary}
\maketitle
\begin{abstract}
\end{abstract}
\tableofcontents
\end{preliminary}
\chapter{Introduction}
\section{Why?}
This is a section \cite{ID}
\addcontentsline{toc}{chapter}{Bibliography}
\printbibliography
\end{document}
My bib file looks like:
@Article{ID,
author = {Author},
title = {Title},
journal = {journal},
year = {2013}
}
@Article{ID2,
author = {Authors},
title = {Title 2},
journal = {Journal 2},
year = {2013}
}
I am trying to run biber as a manual build program with
Location: C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\biber.exe
Working Directory: ${workspace_loc:/Thesis/tmp}
Arguments: thesis
I get the following console output:
INFO - This is Biber 1.7
INFO - Logfile is 'thesis.blg'
INFO - Reading 'thesis.bcf'
INFO - Found 1 citekeys in bib section 0
INFO - Processing section 0
INFO - Looking for bibtex format file 'thesis.bib' for section 0
INFO - Found BibTeX data source 'C:/Program Files (x86)/MiKTeX
2.9/bibtex/bib/unswcover/thesis.bib'
WARN - I didn't find a database entry for 'ID' (section 0)
INFO - Overriding locale 'English_United States.1252' default tailoring
'variable = shifted' with 'variable = non-ignorable'
INFO - Sorting 'entry' list 'nty' keys
INFO - No sort tailoring available for locale 'English_United States.1252'
INFO - Writing 'thesis.bbl' with encoding 'ascii'
INFO - Output to thesis.bbl
INFO - WARNINGS: 1
This program works in TexMaker when i set it up to run pdflatex > biber >
pdflatex > pdflatex but i want to get it working in texlipse.
Show a window on load in MVVM-Light
Show a window on load in MVVM-Light
I'm currently developing an application in WPF using MVVM Light Toolkit. I
have a couple windows as shells that load user controls based on a
selection at startup. These windows are MainWindow and Settings.
MainWindow, as it normally would, loads on startup. Before this windows is
shown, I'd like to show the settings window so that a configuration may be
loaded and certain settings may be entered. Now, this is relatively easy,
usually I'd just instantiate it and call ShowDialog(), but there's a few
caveats I've encountered along the way:
If I try to load Settings in the MainViewModel constructor I run into
issues with infinite recursion
I can't load Settings from MainWindow because there's several other
actions that need to take place that can't be contained in MainWindow's
code-behind. For reference, here's the relay command I have everything in
(I'll get to my reasoning behind a relay command in a second):
public bool ShowSettings()
{
Messenger.Default.Register<XDocument>(this, (xdoc) => {
CopySettings(xdoc); });
Settings settings = new Settings();
settings.ShowDialog();
LoadMainControl();
return true;
}
I can't, don't want to, load the window via (for example) a RelayCommand
and a button placed somewhere on the MainWindow form as I'd like Settings
to show before MainWindow.
I can't make Settings the main window (I.E. switch the XAML and UI Logic
out for MainWindow and Settings) as Settings needs to be reusable as
Window in case further options need to be set.
Taking all this into account, the only proper way I've found to load the
window is via binding the Loaded event in the MainWindow XAML like so:
<Window Loaded="{Binding OnWindowLoad}">
And in the MainViewModel:
The RelayCommand:
public RelayCommand OnWindowLoad
{
get;
private set;
}
Then:
OnWindowLoad = new RelayCommand(() => ShowSettings());
Then:
public bool ShowSettings()
{
Messenger.Default.Register<XDocument>(this, (xdoc) => {
CopySettings(xdoc); });
Settings settings = new Settings();
settings.ShowDialog();
LoadMainControl();
return true;
}
But, of course, Loaded can't be bound to a RelayCommand so I have to do
something like this:
<Window>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<i:InvokeCommandAction Command="{Binding OnWindowLoad}"
CommandParameter="{Binding OnWindowLoadParam}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Window>
Which solves the bulk of my prolems, but fails to hid MainWindow when
Settings is loaded. Are there any other ways I can load Settings without
encountering this and the other multitude of problems I've had? I've been
searching for a more efficient way, and as of yet I've not found one.
I'm currently developing an application in WPF using MVVM Light Toolkit. I
have a couple windows as shells that load user controls based on a
selection at startup. These windows are MainWindow and Settings.
MainWindow, as it normally would, loads on startup. Before this windows is
shown, I'd like to show the settings window so that a configuration may be
loaded and certain settings may be entered. Now, this is relatively easy,
usually I'd just instantiate it and call ShowDialog(), but there's a few
caveats I've encountered along the way:
If I try to load Settings in the MainViewModel constructor I run into
issues with infinite recursion
I can't load Settings from MainWindow because there's several other
actions that need to take place that can't be contained in MainWindow's
code-behind. For reference, here's the relay command I have everything in
(I'll get to my reasoning behind a relay command in a second):
public bool ShowSettings()
{
Messenger.Default.Register<XDocument>(this, (xdoc) => {
CopySettings(xdoc); });
Settings settings = new Settings();
settings.ShowDialog();
LoadMainControl();
return true;
}
I can't, don't want to, load the window via (for example) a RelayCommand
and a button placed somewhere on the MainWindow form as I'd like Settings
to show before MainWindow.
I can't make Settings the main window (I.E. switch the XAML and UI Logic
out for MainWindow and Settings) as Settings needs to be reusable as
Window in case further options need to be set.
Taking all this into account, the only proper way I've found to load the
window is via binding the Loaded event in the MainWindow XAML like so:
<Window Loaded="{Binding OnWindowLoad}">
And in the MainViewModel:
The RelayCommand:
public RelayCommand OnWindowLoad
{
get;
private set;
}
Then:
OnWindowLoad = new RelayCommand(() => ShowSettings());
Then:
public bool ShowSettings()
{
Messenger.Default.Register<XDocument>(this, (xdoc) => {
CopySettings(xdoc); });
Settings settings = new Settings();
settings.ShowDialog();
LoadMainControl();
return true;
}
But, of course, Loaded can't be bound to a RelayCommand so I have to do
something like this:
<Window>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<i:InvokeCommandAction Command="{Binding OnWindowLoad}"
CommandParameter="{Binding OnWindowLoadParam}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Window>
Which solves the bulk of my prolems, but fails to hid MainWindow when
Settings is loaded. Are there any other ways I can load Settings without
encountering this and the other multitude of problems I've had? I've been
searching for a more efficient way, and as of yet I've not found one.
Sunday, 18 August 2013
Twitter authorize in asp.net mvc not work using Tweetsharp
Twitter authorize in asp.net mvc not work using Tweetsharp
public ActionResult Authorize()
{
// Step 1 - Retrieve an OAuth Request Token
TwitterService service = new
TwitterService(Globals.CONSUMER_KEY, Globals.CONSUMER_SECRET);
// This is the registered callback URL
OAuthRequestToken requestToken =
service.GetRequestToken("http://localhost:52707/AuthorizeCallback");
// Step 2 - Redirect to the OAuth Authorization URL
Uri uri =
service.GetAuthorizationUri(requestToken,"http://localhost:52707/AuthorizeCallback");
return new RedirectResult(uri.ToString(), false /*permanent*/);
}
I am using this code to get accesstoken of user which is logged-in in
asp.net mvc 4 app. I don't get it worked.
The code is documented at https://github.com/danielcrenna/tweetsharp.
When I try this code I got seen this
Whoa there! The request token for this page is invalid. It may have
already been used, or expired because it is too old. Please go back to the
site or application that sent you here and try again; it was probably just
a mistake
I have check that my consumer_key and consumer_secret are same as on
dev.twitter.com Somebody please guide me how to fix this.
public ActionResult Authorize()
{
// Step 1 - Retrieve an OAuth Request Token
TwitterService service = new
TwitterService(Globals.CONSUMER_KEY, Globals.CONSUMER_SECRET);
// This is the registered callback URL
OAuthRequestToken requestToken =
service.GetRequestToken("http://localhost:52707/AuthorizeCallback");
// Step 2 - Redirect to the OAuth Authorization URL
Uri uri =
service.GetAuthorizationUri(requestToken,"http://localhost:52707/AuthorizeCallback");
return new RedirectResult(uri.ToString(), false /*permanent*/);
}
I am using this code to get accesstoken of user which is logged-in in
asp.net mvc 4 app. I don't get it worked.
The code is documented at https://github.com/danielcrenna/tweetsharp.
When I try this code I got seen this
Whoa there! The request token for this page is invalid. It may have
already been used, or expired because it is too old. Please go back to the
site or application that sent you here and try again; it was probably just
a mistake
I have check that my consumer_key and consumer_secret are same as on
dev.twitter.com Somebody please guide me how to fix this.
Finite set of congruences
Finite set of congruences
Is it true that for every $c$ there is a finite set of congruences
$a_i(mod\,\,n_i) , c = n_1<n_2<n_3<...........<n_k \,\,\, (1)\\ $
So that every integer satisfies at least one of the congruence (1)
Is it true that for every $c$ there is a finite set of congruences
$a_i(mod\,\,n_i) , c = n_1<n_2<n_3<...........<n_k \,\,\, (1)\\ $
So that every integer satisfies at least one of the congruence (1)
PHP replace quotes inside of quotes, but not quotes escaped
PHP replace quotes inside of quotes, but not quotes escaped
I'm looking for code in PHP to replace quotes (") inside quotes ("),
unless those quotes (") are escaped () e.g (\") in a string. The inside
quotes being replaced with "\\"".
So I would like the string "\"text"text"\"" to turn into
"\"text\\"text\\"\"".
Thank you to all who can help.
I'm looking for code in PHP to replace quotes (") inside quotes ("),
unless those quotes (") are escaped () e.g (\") in a string. The inside
quotes being replaced with "\\"".
So I would like the string "\"text"text"\"" to turn into
"\"text\\"text\\"\"".
Thank you to all who can help.
PHP-Composer, locally installed, remote installation need?
PHP-Composer, locally installed, remote installation need?
This is a very simple question and I think that there will be someone who
will mark me down for this, but I developed in PHP / CakePHP on my local
Ubuntu system, and then install / ftp my code to my hosting company.
With CakePHP which is only PHP code, there is nothing to install, you have
to set-up DB connections e.c.t but that is simple stuff but I have just
come across PHP Composer, looks very easy to use and install locally.
My question is does it need to be re-installed on my hosting server, e.g
once the code / php archive file is loaded into my project and its all
working do I need to re-install it via SSH / curl, if so this might not be
usable has I would not have access to my server to install it as root but
it is only downloading code archive PHP file for use then would this work?
Sorry again for the newbe question but I can not seem to find a simple
answer to my question.
Many Thanks
Glenn.
This is a very simple question and I think that there will be someone who
will mark me down for this, but I developed in PHP / CakePHP on my local
Ubuntu system, and then install / ftp my code to my hosting company.
With CakePHP which is only PHP code, there is nothing to install, you have
to set-up DB connections e.c.t but that is simple stuff but I have just
come across PHP Composer, looks very easy to use and install locally.
My question is does it need to be re-installed on my hosting server, e.g
once the code / php archive file is loaded into my project and its all
working do I need to re-install it via SSH / curl, if so this might not be
usable has I would not have access to my server to install it as root but
it is only downloading code archive PHP file for use then would this work?
Sorry again for the newbe question but I can not seem to find a simple
answer to my question.
Many Thanks
Glenn.
Using FactoryGirl with RSoec
Using FactoryGirl with RSoec
I have written a spec using Factorygirl for a method index in a controller
of my Rails application. But when I am running it with guard it is giving
following errors:
1) TestController should get index Failure/Error: assert_response :success
MiniTest::Assertion: Expected response to be a <:success>, but was <302>
1 example, 1 failure
I have no idea about the reason behind the error and how to fix that.
I have written a spec using Factorygirl for a method index in a controller
of my Rails application. But when I am running it with guard it is giving
following errors:
1) TestController should get index Failure/Error: assert_response :success
MiniTest::Assertion: Expected response to be a <:success>, but was <302>
1 example, 1 failure
I have no idea about the reason behind the error and how to fix that.
desy Crystal Palace vs Tottenham Live 18th 2013
desy Crystal Palace vs Tottenham Live 18th 2013
Watch Crystal Palace vs Tottenham Live Streaming Link
Even when he's not even playing, Gareth Bale is still dominating the
headlines.
With speculation over a transfer to Real Madrid continuing to run rampant,
the Guardian's David Hytner reported Bale will miss the first three
matches of the season as a result of him having missed most of the
preseason due to injury.
That means the winger will miss the opener against Crystal Palace, a
Europa League fixture against Dinamo Tbilisi and the critical North London
Derby.
Even without Bale, Tottenham should be able to get by just fine. They've
had a great summer and recently confirmed the purchase of Etienne Capoue
(h/t Tottenham's Instagram account).
When: Sunday, August 18, at 8:30 a.m. ET (13:30 BST)
Where: Selhurst Park, London, England
Watch: NBC Sports Network
Live Stream: NBC Sports Live Extra
Watch Crystal Palace vs Tottenham Live Streaming Link
Watch Crystal Palace vs Tottenham Live Streaming Link
Even when he's not even playing, Gareth Bale is still dominating the
headlines.
With speculation over a transfer to Real Madrid continuing to run rampant,
the Guardian's David Hytner reported Bale will miss the first three
matches of the season as a result of him having missed most of the
preseason due to injury.
That means the winger will miss the opener against Crystal Palace, a
Europa League fixture against Dinamo Tbilisi and the critical North London
Derby.
Even without Bale, Tottenham should be able to get by just fine. They've
had a great summer and recently confirmed the purchase of Etienne Capoue
(h/t Tottenham's Instagram account).
When: Sunday, August 18, at 8:30 a.m. ET (13:30 BST)
Where: Selhurst Park, London, England
Watch: NBC Sports Network
Live Stream: NBC Sports Live Extra
Watch Crystal Palace vs Tottenham Live Streaming Link
I am trying to install package fetch
I am trying to install package fetch
dam@ubuntu:~$ sudo apt-get update W: Failed ....
adam@ubuntu:~$ sudo apt-get install fetch Reading package lists... Done
Building dependency tree
Reading state information... Done E: Unable to locate package fetch
dam@ubuntu:~$ sudo apt-get update W: Failed ....
adam@ubuntu:~$ sudo apt-get install fetch Reading package lists... Done
Building dependency tree
Reading state information... Done E: Unable to locate package fetch
Saturday, 17 August 2013
Drop Down Menu Similar to xenForo?
Drop Down Menu Similar to xenForo?
How can I create a dropdown menu similar to xenforo, which will
automatically close after 2 seconds? I've tried searching but
unfortunately couldn't find any proper solution.
But I don't know how to and what code to put to achieve like; 1. The drop
down menu open after 2 seconds if the mouse cursor hovers over the main
menu link for 2 seconds. 2. The drop down closes if the mouse cursor is
away from the drop down for 2 seconds.
Thanks!
Here is Jsfiddle;
How can I create a dropdown menu similar to xenforo, which will
automatically close after 2 seconds? I've tried searching but
unfortunately couldn't find any proper solution.
But I don't know how to and what code to put to achieve like; 1. The drop
down menu open after 2 seconds if the mouse cursor hovers over the main
menu link for 2 seconds. 2. The drop down closes if the mouse cursor is
away from the drop down for 2 seconds.
Thanks!
Here is Jsfiddle;
Subscribe to:
Comments (Atom)