PostId
int64 13
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 3
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -33
210k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
5.77k
| Title
stringlengths 10
250
| BodyMarkdown
stringlengths 12
30k
| Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 47
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6,503,144 | 06/28/2011 07:37:13 | 644,013 | 03/04/2011 02:24:27 | 179 | 1 | Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=168821248)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4)))) error | Yesterday i was using oracle 9.1 with ojdbc 14 jdbc driver with following code for adding employee, it was working fine but now i am using oracle 10.1.0.2.0 with ojdbc14 but now it is giving following error
Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=168821248)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4)))) error
Following is code for adding employee
public static Connection getConnection() throws Exception {
String driver = "oracle.jdbc.driver.OracleDriver";
String url = "jdbc:oracle:thin:@localhost:1521:globldb3";
String username = "scott";
String password = "tiger";
Class.forName(driver);
Connection conn = DriverManager.getConnection(url, username, password);
return conn;
}
public String addEmployee(){
Connection conn = null;
PreparedStatement pstmt = null;
boolean committed = false;
try {
conn = getConnection();
conn.setAutoCommit(false);
String query = "INSERT INTO
employee(e_id,e_name,e_f_name,e_desg,e_address,e_phone_no,"+
"e_salary,e_house_rent,e_conv_allow,e_email,d_name,e_hire_month,e_hire_year)"+
"VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)";
pstmt = conn.prepareStatement(query);
pstmt = conn.prepareStatement(query); // create a statement
pstmt.setInt(1,this.eid);
pstmt.setString(2,this.ename);
pstmt.setString(3,this.efname);
pstmt.setString(4,this.edesg);
pstmt.setString(5,this.eaddress);
pstmt.setLong(6,this.ephoneno);
pstmt.setInt(7,this.esalary);
pstmt.setInt(8,this.houserent);
pstmt.setInt(9,this.convallow);
pstmt.setString(10,this.eemail);
pstmt.setString(11,this.edname);
pstmt.setInt(12,this.ehmon);
pstmt.setInt(13,this.ehy);
pstmt.executeUpdate(); // execute insert statement
conn.commit();
conn.setAutoCommit(true);
committed = true;
return "add-employee-msg.xhtml";
} catch (Exception e) {
e.printStackTrace();
return "add-employee-ex.xhtml";
} finally {
try{
if (!committed) conn.rollback();
if (pstmt != null) pstmt.close();
if (conn != null) conn.close();
}catch(Exception e){
e.printStackTrace();
}
}
} //addEmployee
Any idea please? | java | jdbc | java-ee | null | null | null | open | Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=168821248)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4)))) error
===
Yesterday i was using oracle 9.1 with ojdbc 14 jdbc driver with following code for adding employee, it was working fine but now i am using oracle 10.1.0.2.0 with ojdbc14 but now it is giving following error
Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=168821248)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4)))) error
Following is code for adding employee
public static Connection getConnection() throws Exception {
String driver = "oracle.jdbc.driver.OracleDriver";
String url = "jdbc:oracle:thin:@localhost:1521:globldb3";
String username = "scott";
String password = "tiger";
Class.forName(driver);
Connection conn = DriverManager.getConnection(url, username, password);
return conn;
}
public String addEmployee(){
Connection conn = null;
PreparedStatement pstmt = null;
boolean committed = false;
try {
conn = getConnection();
conn.setAutoCommit(false);
String query = "INSERT INTO
employee(e_id,e_name,e_f_name,e_desg,e_address,e_phone_no,"+
"e_salary,e_house_rent,e_conv_allow,e_email,d_name,e_hire_month,e_hire_year)"+
"VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)";
pstmt = conn.prepareStatement(query);
pstmt = conn.prepareStatement(query); // create a statement
pstmt.setInt(1,this.eid);
pstmt.setString(2,this.ename);
pstmt.setString(3,this.efname);
pstmt.setString(4,this.edesg);
pstmt.setString(5,this.eaddress);
pstmt.setLong(6,this.ephoneno);
pstmt.setInt(7,this.esalary);
pstmt.setInt(8,this.houserent);
pstmt.setInt(9,this.convallow);
pstmt.setString(10,this.eemail);
pstmt.setString(11,this.edname);
pstmt.setInt(12,this.ehmon);
pstmt.setInt(13,this.ehy);
pstmt.executeUpdate(); // execute insert statement
conn.commit();
conn.setAutoCommit(true);
committed = true;
return "add-employee-msg.xhtml";
} catch (Exception e) {
e.printStackTrace();
return "add-employee-ex.xhtml";
} finally {
try{
if (!committed) conn.rollback();
if (pstmt != null) pstmt.close();
if (conn != null) conn.close();
}catch(Exception e){
e.printStackTrace();
}
}
} //addEmployee
Any idea please? | 0 |
8,060,720 | 11/09/2011 05:24:38 | 923,636 | 09/01/2011 14:30:07 | 77 | 0 | Mongoid: persistence in 1 to many relation within embedded document | I have a problem with relationships persisting in an embedded document. Here is the example
require 'mongoid'
require 'mongo'
class User
include Mongoid::Document
field :name
key :name
embeds_one :garage
end
class Garage
include Mongoid::Document
field :name
has_many :tools, autosave: true
has_many :cars, autosave: true
end
class Tool
include Mongoid::Document
belongs_to :garage, inverse_of: :tools
end
class Car
include Mongoid::Document
field :name
belongs_to :garage, inverse_of: :cars
end
When I run the following:
Mongoid.configure do |config|
config.master = Mongo::Connection.new.db("mydb")
end
connection = Mongo::Connection.new
connection.drop_database("mydb")
database = connection.db("mydb")
user = User.create!(name: "John")
user.build_garage
user.garage.cars << Car.create!(name: "Bessy")
user.save!
puts "user #{user}, #{user.name}"
user.garage.cars.each do |car|
puts "car is #{car}"
end
same_user = User.first(conditions: {name: user.name})
puts "same_user #{same_user}, #{same_user.name}"
same_user.garage.cars.each do |car|
puts "car found is #{car}"
end
the output is:
user #<User:0x00000003619d30>, John
car is #<Car:0x00000003573ca0>
same_user #<User:0x000000034ff760>, John
so the second time the user's car array is not outputted. How do i get the array of cars to persist?
Thanks | ruby-on-rails | mongodb | persistence | mongoid | relationships | null | open | Mongoid: persistence in 1 to many relation within embedded document
===
I have a problem with relationships persisting in an embedded document. Here is the example
require 'mongoid'
require 'mongo'
class User
include Mongoid::Document
field :name
key :name
embeds_one :garage
end
class Garage
include Mongoid::Document
field :name
has_many :tools, autosave: true
has_many :cars, autosave: true
end
class Tool
include Mongoid::Document
belongs_to :garage, inverse_of: :tools
end
class Car
include Mongoid::Document
field :name
belongs_to :garage, inverse_of: :cars
end
When I run the following:
Mongoid.configure do |config|
config.master = Mongo::Connection.new.db("mydb")
end
connection = Mongo::Connection.new
connection.drop_database("mydb")
database = connection.db("mydb")
user = User.create!(name: "John")
user.build_garage
user.garage.cars << Car.create!(name: "Bessy")
user.save!
puts "user #{user}, #{user.name}"
user.garage.cars.each do |car|
puts "car is #{car}"
end
same_user = User.first(conditions: {name: user.name})
puts "same_user #{same_user}, #{same_user.name}"
same_user.garage.cars.each do |car|
puts "car found is #{car}"
end
the output is:
user #<User:0x00000003619d30>, John
car is #<Car:0x00000003573ca0>
same_user #<User:0x000000034ff760>, John
so the second time the user's car array is not outputted. How do i get the array of cars to persist?
Thanks | 0 |
7,229,670 | 08/29/2011 11:50:14 | 325,241 | 04/25/2010 04:06:57 | 2,436 | 113 | How to make an element out of it's parent's range? | My HTML:
<div id="main">
<div id="inner_div"></div>
</div>
CSS:
#main{
width: 300px;
height: 300px;
border: 1px solid black;
margin: 10px auto;
position: relative;
}
#inner_div{
width: 200px;
height: 200px;
border: 1px solid red;
}
As you can see, now `#main` will center in the page, I can't change the style of #main. I can change the style of `#inner_div`, I want to make it at the left of the page, so I change the CSS to:
#inner_div{
width: 200px;
height: 200px;
border: 1px solid red;
z-index: 2012;
position: absolute;
left: 10px;
top: 10px;
}
But #inner_div is still in `#main` 's range:
![enter image description here][1]
My question is, how could I change the CSS of #inner_div but not #main to make #inner_div break the bound of #main ? Fiddle: http://jsfiddle.net/9EYP6/1/
[1]: http://i.stack.imgur.com/lauFH.png | html | css | layout | position | null | null | open | How to make an element out of it's parent's range?
===
My HTML:
<div id="main">
<div id="inner_div"></div>
</div>
CSS:
#main{
width: 300px;
height: 300px;
border: 1px solid black;
margin: 10px auto;
position: relative;
}
#inner_div{
width: 200px;
height: 200px;
border: 1px solid red;
}
As you can see, now `#main` will center in the page, I can't change the style of #main. I can change the style of `#inner_div`, I want to make it at the left of the page, so I change the CSS to:
#inner_div{
width: 200px;
height: 200px;
border: 1px solid red;
z-index: 2012;
position: absolute;
left: 10px;
top: 10px;
}
But #inner_div is still in `#main` 's range:
![enter image description here][1]
My question is, how could I change the CSS of #inner_div but not #main to make #inner_div break the bound of #main ? Fiddle: http://jsfiddle.net/9EYP6/1/
[1]: http://i.stack.imgur.com/lauFH.png | 0 |
2,890,837 | 05/23/2010 06:24:24 | 348,149 | 05/23/2010 06:24:24 | 1 | 0 | Flexigrid Jquery | I dont know how to use flexigrid jquery in my website,please answer me sir | php5 | null | null | null | null | 09/30/2011 21:41:25 | not a real question | Flexigrid Jquery
===
I dont know how to use flexigrid jquery in my website,please answer me sir | 1 |
2,785,848 | 05/07/2010 02:41:14 | 193,513 | 10/21/2009 01:53:55 | 79 | 3 | Can someone recommend a resource/site/book to improve problem solving skills | I am a reasonably expreience developer (.NET, c#, asp.NET etc) but I'd like to hone my problem solving skills. I find that when I come up against a complex problem I sometimes implement a solution that I feel could have been better had I analysed the problem in a different way.
Ideally what I am looking for is a resource of some type that has 'practice problems and solutions' as I think my skills will only get better by practicing this more and adopting better practices.
I hope my question is not to vague and I wont get pissed at people anwering with opinions etc..
thanks | problem-solving | .net | c# | analysis | null | 09/17/2011 22:43:28 | not constructive | Can someone recommend a resource/site/book to improve problem solving skills
===
I am a reasonably expreience developer (.NET, c#, asp.NET etc) but I'd like to hone my problem solving skills. I find that when I come up against a complex problem I sometimes implement a solution that I feel could have been better had I analysed the problem in a different way.
Ideally what I am looking for is a resource of some type that has 'practice problems and solutions' as I think my skills will only get better by practicing this more and adopting better practices.
I hope my question is not to vague and I wont get pissed at people anwering with opinions etc..
thanks | 4 |
5,279,043 | 03/11/2011 22:27:15 | 435,645 | 08/31/2010 07:01:49 | 742 | 0 | What are problems with shallow copy ? | This is an interview question I saw from here:
http://www.careercup.com/question?id=1707701
Want to know more about this .thanks | c++ | interview-questions | shallow-copy | null | null | 03/12/2011 01:14:17 | not a real question | What are problems with shallow copy ?
===
This is an interview question I saw from here:
http://www.careercup.com/question?id=1707701
Want to know more about this .thanks | 1 |
11,596,548 | 07/21/2012 23:10:36 | 1,543,314 | 07/21/2012 23:00:03 | 1 | 0 | turn off keyboard shortcuts stackoverflow | how can I turn off stackoverflow's keyboard shortcuts.. It's almost impossible to enter any text without some stuff popping up. I don't need any fancy formatting, period..! | stackoverflow | null | null | null | null | 07/21/2012 23:15:47 | off topic | turn off keyboard shortcuts stackoverflow
===
how can I turn off stackoverflow's keyboard shortcuts.. It's almost impossible to enter any text without some stuff popping up. I don't need any fancy formatting, period..! | 2 |
11,493,691 | 07/15/2012 16:38:13 | 1,527,148 | 07/15/2012 16:29:29 | 1 | 0 | How to write the following program? | Problem: Euler's number, e, can be estimated using the following formula:
e = 1 + 1/1! + 1/2! + 1/3! + 1/4! + 1/5! + 1/6! + ...
Ask the user to enter a maximum desired difference between the estimate above and the value of Euler's number from
math.h. Be sure to validate that the desired difference is greater than zero.
Example Execution #1:
Enter desired difference: 0.005
Requested maximum difference: 0.0050000000
Term Estimate Math.h Difference
---- ------------ ------------ ------------
1 1.0000000000 2.7182818285 1.7182818285
2 2.0000000000 2.7182818285 0.7182818285
3 2.5000000000 2.7182818285 0.2182818285
4 2.6666666667 2.7182818285 0.0516151618
5 2.7083333333 2.7182818285 0.0099484951
6 2.7166666667 2.7182818285 0.0016151618
| unix | null | null | null | null | 07/15/2012 16:42:40 | too localized | How to write the following program?
===
Problem: Euler's number, e, can be estimated using the following formula:
e = 1 + 1/1! + 1/2! + 1/3! + 1/4! + 1/5! + 1/6! + ...
Ask the user to enter a maximum desired difference between the estimate above and the value of Euler's number from
math.h. Be sure to validate that the desired difference is greater than zero.
Example Execution #1:
Enter desired difference: 0.005
Requested maximum difference: 0.0050000000
Term Estimate Math.h Difference
---- ------------ ------------ ------------
1 1.0000000000 2.7182818285 1.7182818285
2 2.0000000000 2.7182818285 0.7182818285
3 2.5000000000 2.7182818285 0.2182818285
4 2.6666666667 2.7182818285 0.0516151618
5 2.7083333333 2.7182818285 0.0099484951
6 2.7166666667 2.7182818285 0.0016151618
| 3 |
541,912 | 02/12/2009 15:51:33 | 2,443 | 08/22/2008 10:53:30 | 5,667 | 211 | Interface naming in Java | Most OO languages prefix their interface names with a capital I, why does Java not do this? What was the rationale for not following this convention?
To demonstrate what I mean, if I wanted to have a User interface and a User implementation I'd have two choices in Java:
>1. Class = User, Interface = UserInterface
2. Class = UserImpl, Interface = User
Where in most languages:
>Class = User, Interface = IUser
Now, you might argue that you could always pick a most descriptive name for the user implementation and the problem goes away, but Java's pushing a POJO approach to things and most IOC containers use DynamicProxies extensively. These two things together mean that you'll have lots of interfaces with a single POJO implementation.
So, I guess my question boils down to: **"Is it worth following the broader Interface naming convention especially in light of where Java Frameworks seem to be heading?"** | java | naming-conventions | null | null | null | 04/19/2012 20:06:03 | not constructive | Interface naming in Java
===
Most OO languages prefix their interface names with a capital I, why does Java not do this? What was the rationale for not following this convention?
To demonstrate what I mean, if I wanted to have a User interface and a User implementation I'd have two choices in Java:
>1. Class = User, Interface = UserInterface
2. Class = UserImpl, Interface = User
Where in most languages:
>Class = User, Interface = IUser
Now, you might argue that you could always pick a most descriptive name for the user implementation and the problem goes away, but Java's pushing a POJO approach to things and most IOC containers use DynamicProxies extensively. These two things together mean that you'll have lots of interfaces with a single POJO implementation.
So, I guess my question boils down to: **"Is it worth following the broader Interface naming convention especially in light of where Java Frameworks seem to be heading?"** | 4 |
6,230,395 | 06/03/2011 17:14:32 | 592,459 | 01/27/2011 15:35:07 | 103 | 3 | How to prevent triggering of other events when closing a JPopupMenu by clicking outside it? | There are some properties of the right-click context menu I would like to replicate with a JPopupMenu:
1. When menu is open and you click elsewhere, menu closes.
2. When menu is open and you click elsewhere, nothing else happens.
I've got the first part down just fine. But when I click elsewhere, other events can occur. For instance, lets say I have button, A, which performs some action, B. Currently, if the JPopupMenu is open, and I click A, the JPopupMenu closes and B is performed. I would prefer that JPopupMenu close and B NOT be performed. Is this possible?
Thanks | java | swing | menu | null | null | null | open | How to prevent triggering of other events when closing a JPopupMenu by clicking outside it?
===
There are some properties of the right-click context menu I would like to replicate with a JPopupMenu:
1. When menu is open and you click elsewhere, menu closes.
2. When menu is open and you click elsewhere, nothing else happens.
I've got the first part down just fine. But when I click elsewhere, other events can occur. For instance, lets say I have button, A, which performs some action, B. Currently, if the JPopupMenu is open, and I click A, the JPopupMenu closes and B is performed. I would prefer that JPopupMenu close and B NOT be performed. Is this possible?
Thanks | 0 |
9,903,555 | 03/28/2012 08:16:28 | 204,769 | 11/06/2009 11:55:25 | 2,110 | 122 | How to use jcurses from groovy | just tried to use jcurses from within groovy, but I always get the following exception:
Caused by: java.lang.NullPointerException at
jcurses.system.Toolkit.getLibraryPath(Toolkit.java:97) at
jcurses.system.Toolkit.<clinit>(Toolkit.java:37)
Toolkit.java:37 :
String url = ClassLoader.getSystemClassLoader()\
.getResource("jcurses/system/Toolkit.class").toString();
Google told me that it could have to do with spaces within the classpath (windows), but moving the library and even using the classes instead of the .jar file was not successful.
but it seem to be possible - pleac for groovy references jcurses: http://pleac.sourceforge.net/pleac_groovy/userinterfaces.html
Another way to clear the screen from within a groovy shell script would also solve my problem :-)
| groovy | windows-shell | null | null | null | null | open | How to use jcurses from groovy
===
just tried to use jcurses from within groovy, but I always get the following exception:
Caused by: java.lang.NullPointerException at
jcurses.system.Toolkit.getLibraryPath(Toolkit.java:97) at
jcurses.system.Toolkit.<clinit>(Toolkit.java:37)
Toolkit.java:37 :
String url = ClassLoader.getSystemClassLoader()\
.getResource("jcurses/system/Toolkit.class").toString();
Google told me that it could have to do with spaces within the classpath (windows), but moving the library and even using the classes instead of the .jar file was not successful.
but it seem to be possible - pleac for groovy references jcurses: http://pleac.sourceforge.net/pleac_groovy/userinterfaces.html
Another way to clear the screen from within a groovy shell script would also solve my problem :-)
| 0 |
4,808,019 | 01/26/2011 17:51:41 | 557,657 | 12/29/2010 22:05:03 | 3 | 0 | Boolean logic question | "true"? "Yes" : "No" , I am using ruby language
This is taking by deafult "yes" even I select "no" | boolean-expression | null | null | null | null | 01/26/2011 23:11:53 | not a real question | Boolean logic question
===
"true"? "Yes" : "No" , I am using ruby language
This is taking by deafult "yes" even I select "no" | 1 |
10,796,032 | 05/29/2012 09:00:14 | 605,280 | 02/06/2011 13:15:20 | 61 | 0 | Are both IP address and default gateway needed on a switch to enable communication between different vlans? | It's a problem excerpted from Cisco's CCNA test:
![enter image description here][1]
[1]: http://i.stack.imgur.com/CQF2y.png
I would like to know if both IP address and default gateway are needed on Switch1 in order for different vlans connected to this switch to communicate with each other?
Thank you in advance.
(IT'S NO HOMEWORK!) | networking | routing | computer-science | null | null | 05/29/2012 10:09:50 | off topic | Are both IP address and default gateway needed on a switch to enable communication between different vlans?
===
It's a problem excerpted from Cisco's CCNA test:
![enter image description here][1]
[1]: http://i.stack.imgur.com/CQF2y.png
I would like to know if both IP address and default gateway are needed on Switch1 in order for different vlans connected to this switch to communicate with each other?
Thank you in advance.
(IT'S NO HOMEWORK!) | 2 |
5,770,097 | 04/24/2011 10:43:55 | 377,381 | 06/27/2010 12:16:21 | 154 | 3 | any other site(s) like this one? | this site is extremely cool ( http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=strncpy ) but a bit unformatted, it shows many (and this means a lot) of C functions with params , example etc. the prototype example of the function is very bad anyway. do you know other sites as complete or more than this one? i recall there's one site with a dice icon that has many C functions.
thanks | c | null | null | null | null | 04/24/2011 11:10:11 | not a real question | any other site(s) like this one?
===
this site is extremely cool ( http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=strncpy ) but a bit unformatted, it shows many (and this means a lot) of C functions with params , example etc. the prototype example of the function is very bad anyway. do you know other sites as complete or more than this one? i recall there's one site with a dice icon that has many C functions.
thanks | 1 |
11,288,031 | 07/02/2012 05:07:05 | 1,084,965 | 12/07/2011 05:37:47 | 565 | 12 | how to display one imageview(visible & invisible)for three time in android? | I want to show an image view for three like on/off,if any one have idea how to diaplay an imageview for three time.I am using below code for these
totalTimeCountInMilliseconds = 180 * 1000;
timeBlinkInMilliseconds = 60 * 1000;
private boolean blink=true;
countDownTimer = new CountDownTimer(totalTimeCountInMilliseconds,500) {
@Override
public void onTick(long leftTimeInMilliseconds) {
if ( leftTimeInMilliseconds < timeBlinkInMilliseconds ) {
if (blink) {
handImg.setVisibility(View.VISIBLE);
} else {
handImg.setVisibility(View.INVISIBLE);
}
blink = !blink;
}
}
@Override
public void onFinish() {
handImg.setVisibility(View.INVISIBLE);
}
}.start();
if any one have please help,Thank in advance. | android | timer | imageview | null | null | null | open | how to display one imageview(visible & invisible)for three time in android?
===
I want to show an image view for three like on/off,if any one have idea how to diaplay an imageview for three time.I am using below code for these
totalTimeCountInMilliseconds = 180 * 1000;
timeBlinkInMilliseconds = 60 * 1000;
private boolean blink=true;
countDownTimer = new CountDownTimer(totalTimeCountInMilliseconds,500) {
@Override
public void onTick(long leftTimeInMilliseconds) {
if ( leftTimeInMilliseconds < timeBlinkInMilliseconds ) {
if (blink) {
handImg.setVisibility(View.VISIBLE);
} else {
handImg.setVisibility(View.INVISIBLE);
}
blink = !blink;
}
}
@Override
public void onFinish() {
handImg.setVisibility(View.INVISIBLE);
}
}.start();
if any one have please help,Thank in advance. | 0 |
4,891,130 | 02/03/2011 20:09:39 | 435,951 | 05/05/2010 03:08:39 | 688 | 4 | Is it worth to buy jQuery 1.4 books? | Is it worth to buy jQuery 1.4 books now that 1.5 is out? | jquery | jquery-ui | null | null | null | 09/22/2011 00:51:14 | not constructive | Is it worth to buy jQuery 1.4 books?
===
Is it worth to buy jQuery 1.4 books now that 1.5 is out? | 4 |
10,156,358 | 04/14/2012 18:53:23 | 468,130 | 10/06/2010 15:15:56 | 614 | 4 | Subclassing EDIT control | I'm subclassing an edit control, and I'm looking for a message I could intercept that would allow me to capitalize the first letter in the box.<br>
`WM_KEYDOWN` and `WM_CHAR` don't seem to have anything that identifies the characters case.
I currently have this working semi-good by processing the `EN_UPDATE` message in the parent window, but since I'm already subclassing the edit control, I'd prefer to do it in the subclassed proc.
Any help is appreciated and thanks in advance. | c++ | winapi | null | null | null | null | open | Subclassing EDIT control
===
I'm subclassing an edit control, and I'm looking for a message I could intercept that would allow me to capitalize the first letter in the box.<br>
`WM_KEYDOWN` and `WM_CHAR` don't seem to have anything that identifies the characters case.
I currently have this working semi-good by processing the `EN_UPDATE` message in the parent window, but since I'm already subclassing the edit control, I'd prefer to do it in the subclassed proc.
Any help is appreciated and thanks in advance. | 0 |
5,805,998 | 04/27/2011 14:47:07 | 174,349 | 09/16/2009 13:43:11 | 1,201 | 84 | strange jsf issue | I have a facelet component for displaying rss content:
**rssFeedReader.xhtml**
<h:outputText
binding="#{rssReaderBean.text}"
value="#{url}">
<f:attribute
name="url"
value="#{url}" />
</h:outputText>
<ui:repeat
value="#{rssReaderBean.rss}"
var="rss">
<ice:panelGroup>
<ice:outputLabel
value="#{rss['publishDate']} - "
rendered="#{not empty rss['publishDate']}">
</ice:outputLabel>
<a
href="#{rss['link']}"
target="_blank">#{rss['title']}</a>
</ice:panelGroup>
<ice:panelGroup>
<ice:outputLabel>#{rss['description']}</ice:outputLabel>
</ice:panelGroup>
<hr />
</ui:repeat>
and I include it where I need it like:
<myLib:rssFeedReader url="http://rss.news.yahoo.com/rss/topstories"></myLib:rssFeedReader >
If I include it with different urls, multiple times on my page, I do not understand why it displays multiple times the same LATEST url rss feed insted of taking each url separately.
To be able to read the specified url in my bean I bind it to the h:outputText from my facelet. Code from **RssReaderBean** bean:
private HtmlOutputText text;
public HtmlOutputText getText() {
return text;
}
public void setText(final HtmlOutputText text) {
this.text = text;
}
and the method which takes the url and returns the list:
public List<Rss> getRss() {
try {
final URL u = new URL((String) text.getAttributes().get("url"));
///read the rss feed and prepare the result, this code works good so its not required here
}
Can you see the problem...?
Thanks.
| java | jsf | null | null | null | null | open | strange jsf issue
===
I have a facelet component for displaying rss content:
**rssFeedReader.xhtml**
<h:outputText
binding="#{rssReaderBean.text}"
value="#{url}">
<f:attribute
name="url"
value="#{url}" />
</h:outputText>
<ui:repeat
value="#{rssReaderBean.rss}"
var="rss">
<ice:panelGroup>
<ice:outputLabel
value="#{rss['publishDate']} - "
rendered="#{not empty rss['publishDate']}">
</ice:outputLabel>
<a
href="#{rss['link']}"
target="_blank">#{rss['title']}</a>
</ice:panelGroup>
<ice:panelGroup>
<ice:outputLabel>#{rss['description']}</ice:outputLabel>
</ice:panelGroup>
<hr />
</ui:repeat>
and I include it where I need it like:
<myLib:rssFeedReader url="http://rss.news.yahoo.com/rss/topstories"></myLib:rssFeedReader >
If I include it with different urls, multiple times on my page, I do not understand why it displays multiple times the same LATEST url rss feed insted of taking each url separately.
To be able to read the specified url in my bean I bind it to the h:outputText from my facelet. Code from **RssReaderBean** bean:
private HtmlOutputText text;
public HtmlOutputText getText() {
return text;
}
public void setText(final HtmlOutputText text) {
this.text = text;
}
and the method which takes the url and returns the list:
public List<Rss> getRss() {
try {
final URL u = new URL((String) text.getAttributes().get("url"));
///read the rss feed and prepare the result, this code works good so its not required here
}
Can you see the problem...?
Thanks.
| 0 |
6,391,265 | 06/17/2011 20:12:34 | 57,907 | 01/22/2009 14:15:45 | 502 | 45 | How do I get maven to download the platform.jar from the JNA project. | I have the following POM entry
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>3.3.0</version>
</dependency>
When I build my project it downloads the following files:
- jna-3.3.0.jar
- jna-3.3.0.jar.sha1
- jna-3.3.0.pom
- jna-3.3.0.jar.sha1
If you visit the repository at http://download.java.net/maven/2/net/java/dev/jna/jna/3.3.0/ you can see there are numerous other files. Why isn't Maven downloading those other files?
If you open the jna-3.3.0.pom you see
<plugins>
<!-- fake out maven and install the binary artifact -->
<plugin>
<groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
<artifactId>maven-antrun-extended-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<!--<ant dir="." target="dist" />-->
<attachArtifact file="dist/jna.jar" />
<attachArtifact file="dist/platform.jar" classifier="platform" type="jar" />
<attachArtifact file="dist/src-mvn.zip" classifier="sources" type="jar"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
I suspect the issue has something to do with the comment in the pom "fake out maven and install the binary artifact". | maven-2 | jna | null | null | null | null | open | How do I get maven to download the platform.jar from the JNA project.
===
I have the following POM entry
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>3.3.0</version>
</dependency>
When I build my project it downloads the following files:
- jna-3.3.0.jar
- jna-3.3.0.jar.sha1
- jna-3.3.0.pom
- jna-3.3.0.jar.sha1
If you visit the repository at http://download.java.net/maven/2/net/java/dev/jna/jna/3.3.0/ you can see there are numerous other files. Why isn't Maven downloading those other files?
If you open the jna-3.3.0.pom you see
<plugins>
<!-- fake out maven and install the binary artifact -->
<plugin>
<groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
<artifactId>maven-antrun-extended-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<!--<ant dir="." target="dist" />-->
<attachArtifact file="dist/jna.jar" />
<attachArtifact file="dist/platform.jar" classifier="platform" type="jar" />
<attachArtifact file="dist/src-mvn.zip" classifier="sources" type="jar"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
I suspect the issue has something to do with the comment in the pom "fake out maven and install the binary artifact". | 0 |
8,663,982 | 12/29/2011 04:24:22 | 1,087,280 | 12/08/2011 07:58:52 | 26 | 1 | Error occur after hosting- "Object reference not set to an instance" | I am new to .net. I am using Asp.net 3.5 framework C# and SQLSERVER 2005
![This error is not occur when I run it in local machine. but after hosting it I got this error. What will be the reason?][1]
[1]: http://i.stack.imgur.com/TixIe.png | c# | asp.net | sql-server-2005 | null | null | 12/29/2011 05:23:52 | too localized | Error occur after hosting- "Object reference not set to an instance"
===
I am new to .net. I am using Asp.net 3.5 framework C# and SQLSERVER 2005
![This error is not occur when I run it in local machine. but after hosting it I got this error. What will be the reason?][1]
[1]: http://i.stack.imgur.com/TixIe.png | 3 |
6,495,713 | 06/27/2011 16:09:09 | 817,739 | 06/27/2011 16:09:09 | 1 | 0 | SEO tehniques for Social Bookmarking sites | I have a kind of requirement where I need to do SEO for a social bookmarking site. Generally social bookmarking sites are used to get traffic to our website. But my client is building a new social bookmarking website. For which how can I increase traffic through some SEO techniques? | search | seo | engine | tagging | null | 06/28/2011 16:10:49 | off topic | SEO tehniques for Social Bookmarking sites
===
I have a kind of requirement where I need to do SEO for a social bookmarking site. Generally social bookmarking sites are used to get traffic to our website. But my client is building a new social bookmarking website. For which how can I increase traffic through some SEO techniques? | 2 |
5,968,784 | 05/11/2011 18:21:48 | 665,341 | 03/18/2011 01:18:30 | 20 | 0 | how can i solve this error on wamp? | i have just installed wamp for windows everything worked fine how ever when i try to connect to mysql db i receive this error:
Fatal error: Call to undefined function mysql_connect() in C:\wamp\www\pets\app\lib\adodb\drivers\adodb-mysql.inc.php on line 337.
PS: i have the mysql extension enabled in my php.ini
Thanks | mysql | php5 | wamp | null | null | 10/17/2011 21:01:13 | too localized | how can i solve this error on wamp?
===
i have just installed wamp for windows everything worked fine how ever when i try to connect to mysql db i receive this error:
Fatal error: Call to undefined function mysql_connect() in C:\wamp\www\pets\app\lib\adodb\drivers\adodb-mysql.inc.php on line 337.
PS: i have the mysql extension enabled in my php.ini
Thanks | 3 |
5,439,722 | 03/26/2011 01:20:47 | 513,302 | 11/19/2010 09:29:56 | 116 | 17 | Inexpensive VPS | I am just going to switch webhosting to VPS and I want to know about inexpensive VPS. I am currently using arvixe shared hosting but as it is shared so have many restrictions. So looking for VPS now. I have seen these two inexpensive hosting
http://www.webkeepers.com/vps/vps_basic.html
http://365ezone.com/vps_hosting.html
but want to know that will they be reliable and how are these such inexpensive? What can be problem in them ? or if you know better then please share that.
thanks | vps | web-hosting | null | null | null | 03/26/2011 01:47:19 | off topic | Inexpensive VPS
===
I am just going to switch webhosting to VPS and I want to know about inexpensive VPS. I am currently using arvixe shared hosting but as it is shared so have many restrictions. So looking for VPS now. I have seen these two inexpensive hosting
http://www.webkeepers.com/vps/vps_basic.html
http://365ezone.com/vps_hosting.html
but want to know that will they be reliable and how are these such inexpensive? What can be problem in them ? or if you know better then please share that.
thanks | 2 |
7,750,986 | 10/13/2011 07:50:00 | 603,633 | 02/04/2011 18:45:12 | 1,246 | 80 | Oracle BLOB field or Physical File - Which is more preferable? | Consider following options.
- **I have database with a `BLOB` field**
- **A database with a `varchar` field with link to physical files on the server**
I need to store `PDF` files (approx. 500 daily)
Which should I go for.
Should I have a data base with `BLOB` field or a data base with a field having links to each and every physical file on a server.And Why?
Also consider the process of uploading , retrieving these files also happens daily.
Does either of one take more space than other...? if yes then why? | oracle | file | blob | null | null | 10/16/2011 17:01:39 | not constructive | Oracle BLOB field or Physical File - Which is more preferable?
===
Consider following options.
- **I have database with a `BLOB` field**
- **A database with a `varchar` field with link to physical files on the server**
I need to store `PDF` files (approx. 500 daily)
Which should I go for.
Should I have a data base with `BLOB` field or a data base with a field having links to each and every physical file on a server.And Why?
Also consider the process of uploading , retrieving these files also happens daily.
Does either of one take more space than other...? if yes then why? | 4 |
5,143,100 | 02/28/2011 14:15:17 | 637,806 | 02/28/2011 14:15:17 | 1 | 0 | Add Watermark on Facebook profile image with an APP | Could you please help me with the app that you have made to add a watermark to the people that give authorization to it. I have been searching for that app and i have not found anything neither info about the code to get it. Could yo help me please with this or tell me important information to success in my intention.
Thanks and best regards | image | facebook | application | profile | watermark | null | open | Add Watermark on Facebook profile image with an APP
===
Could you please help me with the app that you have made to add a watermark to the people that give authorization to it. I have been searching for that app and i have not found anything neither info about the code to get it. Could yo help me please with this or tell me important information to success in my intention.
Thanks and best regards | 0 |
5,044,071 | 02/18/2011 16:48:13 | 422,121 | 08/16/2010 20:02:44 | 223 | 3 | yui3's version of jquery's .width() | How do you calculate the width (in pixels) of an element in yui3? I have tried `.getComputedStyle("width")` and `.get('offsetWidth')` and neither return the correct results, possibly because the div doesn't have a CSS width set on it. | yui | yui3 | null | null | null | 02/18/2011 20:12:03 | too localized | yui3's version of jquery's .width()
===
How do you calculate the width (in pixels) of an element in yui3? I have tried `.getComputedStyle("width")` and `.get('offsetWidth')` and neither return the correct results, possibly because the div doesn't have a CSS width set on it. | 3 |
11,440,078 | 07/11/2012 19:33:57 | 825,421 | 07/01/2011 19:22:39 | 103 | 3 | Web app for learning (My)SQL with Gamification | I manage a department where MySQL skills will soon be a requirement and we need to train our existing staff. Providing books and even paying for MySQL classes at the local college are an option; but even better, I would like to create some healthy competition within the department and inspire employees to pursue the needed skill set on their own.
Ideally, we would offer a gamified online app that teaches (My)SQL. Leaderboards would be a big selling point.
I spent some time Googling, but came back empty-handed. Does anyone know of an existing site (paid is fine) that would fit the bill? In lieu of that, can anyone recommend gamification platforms that we could build upon? | mysql | sql | competitions | null | null | 07/13/2012 15:39:30 | not constructive | Web app for learning (My)SQL with Gamification
===
I manage a department where MySQL skills will soon be a requirement and we need to train our existing staff. Providing books and even paying for MySQL classes at the local college are an option; but even better, I would like to create some healthy competition within the department and inspire employees to pursue the needed skill set on their own.
Ideally, we would offer a gamified online app that teaches (My)SQL. Leaderboards would be a big selling point.
I spent some time Googling, but came back empty-handed. Does anyone know of an existing site (paid is fine) that would fit the bill? In lieu of that, can anyone recommend gamification platforms that we could build upon? | 4 |
3,632,767 | 09/03/2010 02:50:35 | 179,972 | 09/28/2009 01:09:53 | 4,781 | 267 | XML Schema validation ignored when fragment-level conformance is enabled? | From my sojourn with XML and Schema validation, it seems that when [fragment-level conformance][1] is enabled for an XML reader, the XML source stops being validated against any included Schemas.
However I cannot verify this from the MSDN documentation. Also if I assume this is true, I cannot find a workaround.
I would like to know how to validate a fragment against schemas. In my case I'm validating against the [XHTML 1 Strict Schema][2]; the fact deprecated HTML tags like <center> are not being flagged as invalid is part of the reason I believe fragment conformance ignores schema. Also as soon as I enabled document conformance the validity errors in the same scenario are flagged.
[For a code sample of the type of validation scenario I'm using see this][3].
[1]: http://msdn.microsoft.com/en-us/library/6bts1x50.aspx
[2]: http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd
[3]: http://asp.dotnetheaven.com/howto/doc/Xml/ValidationReadingXML.aspx | .net | xml-schema | xml-validation | null | null | null | open | XML Schema validation ignored when fragment-level conformance is enabled?
===
From my sojourn with XML and Schema validation, it seems that when [fragment-level conformance][1] is enabled for an XML reader, the XML source stops being validated against any included Schemas.
However I cannot verify this from the MSDN documentation. Also if I assume this is true, I cannot find a workaround.
I would like to know how to validate a fragment against schemas. In my case I'm validating against the [XHTML 1 Strict Schema][2]; the fact deprecated HTML tags like <center> are not being flagged as invalid is part of the reason I believe fragment conformance ignores schema. Also as soon as I enabled document conformance the validity errors in the same scenario are flagged.
[For a code sample of the type of validation scenario I'm using see this][3].
[1]: http://msdn.microsoft.com/en-us/library/6bts1x50.aspx
[2]: http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd
[3]: http://asp.dotnetheaven.com/howto/doc/Xml/ValidationReadingXML.aspx | 0 |
7,811,773 | 10/18/2011 18:12:03 | 692,347 | 04/05/2011 06:55:28 | 38 | 3 | CSS: Will I face problems, if I construct CSS from jQuery? | If I detect browser window size on load, and then create the CSS from jQuery after that, will
I then have problems with compatibility or memory use ? Are there any reference for using this as general pattern when designing webapps ?
Thanks,
Jakob | jquery | css | design-patterns | compatibility | null | 10/18/2011 18:31:08 | not a real question | CSS: Will I face problems, if I construct CSS from jQuery?
===
If I detect browser window size on load, and then create the CSS from jQuery after that, will
I then have problems with compatibility or memory use ? Are there any reference for using this as general pattern when designing webapps ?
Thanks,
Jakob | 1 |
5,012,819 | 02/16/2011 05:28:19 | 615,988 | 02/14/2011 09:43:08 | 1 | 0 | compare login time and logout time | if (Convert.ToDateTime(GrdEmployeeAttendance.CurrentRow.Cells["LoginTime"].Value) < Convert.ToDateTime(GrdEmployeeAttendance.CurrentRow.Cells["LogoutTime"].Value))
{
if (GrdEmployeeAttendance.Columns[e.ColumnIndex].Name == "LoginTime")
{
GrdEmployeeAttendance.EndEdit();
if (Convert.ToDateTime(GrdEmployeeAttendance.CurrentRow.Cells[e.ColumnIndex].Value) < Convert.ToDateTime("01:00 PM"))
{
GrdEmployeeAttendance.CurrentRow.Cells["CheckFN"].Value = true;
}
else
{
GrdEmployeeAttendance.CurrentRow.Cells["ChkAN"].Value = true;
}
}
} | c# | .net | null | null | null | 02/16/2011 10:07:09 | not a real question | compare login time and logout time
===
if (Convert.ToDateTime(GrdEmployeeAttendance.CurrentRow.Cells["LoginTime"].Value) < Convert.ToDateTime(GrdEmployeeAttendance.CurrentRow.Cells["LogoutTime"].Value))
{
if (GrdEmployeeAttendance.Columns[e.ColumnIndex].Name == "LoginTime")
{
GrdEmployeeAttendance.EndEdit();
if (Convert.ToDateTime(GrdEmployeeAttendance.CurrentRow.Cells[e.ColumnIndex].Value) < Convert.ToDateTime("01:00 PM"))
{
GrdEmployeeAttendance.CurrentRow.Cells["CheckFN"].Value = true;
}
else
{
GrdEmployeeAttendance.CurrentRow.Cells["ChkAN"].Value = true;
}
}
} | 1 |
11,429,608 | 07/11/2012 09:30:00 | 1,223,428 | 02/21/2012 13:08:01 | 1 | 0 | wpf combobox prevent text changed | is there any way to prevent wpf combobox from changing its text after selection changed? I have a custom control that derives from combobox and I want to be able to set the text manually after selection changed, additionally I cannot prevent the base.OnSelectionChanged from being invoked (this does the trick but it has to stay there as a part of requirements) | wpf | combobox | selectionchanged | null | null | null | open | wpf combobox prevent text changed
===
is there any way to prevent wpf combobox from changing its text after selection changed? I have a custom control that derives from combobox and I want to be able to set the text manually after selection changed, additionally I cannot prevent the base.OnSelectionChanged from being invoked (this does the trick but it has to stay there as a part of requirements) | 0 |
5,933,865 | 05/09/2011 07:29:15 | 663,724 | 03/17/2011 05:17:05 | 68 | 1 | How to apply background-color to a button | I have a Button as shown below
<input type="button" value="Close" onclick="callMe();" style="top :100px; position:relative; left :710px; width :100px; height :25px; font-size: 15px" />
I have tried using
background-color:00BFFF , its currently not working
But unfortunately i haven't been able to apply back ground color to my button
| css | null | null | null | null | 05/21/2012 16:16:11 | not a real question | How to apply background-color to a button
===
I have a Button as shown below
<input type="button" value="Close" onclick="callMe();" style="top :100px; position:relative; left :710px; width :100px; height :25px; font-size: 15px" />
I have tried using
background-color:00BFFF , its currently not working
But unfortunately i haven't been able to apply back ground color to my button
| 1 |
9,652,812 | 03/11/2012 05:56:15 | 1,254,044 | 03/07/2012 07:17:27 | 6 | 0 | How would use a get() method to access an element in an arrayList? | This is my code I have so far but I don't know how to access an element in the Array myList?
And is the inex of an array list start at 0 or 1?
I have just found out about array lists and i need a few pointers and some help
ArrayList<String> myList = new ArrayList<String>();
myList.add("hello");
myList.add("5");
myList.add("3");
myList.add("8");
int totalElements = myList.size();
System.out.println(totalElements);
private String[] myList;
public String getList() {
return this.myList[0]; | java | null | null | null | null | 03/11/2012 06:36:39 | too localized | How would use a get() method to access an element in an arrayList?
===
This is my code I have so far but I don't know how to access an element in the Array myList?
And is the inex of an array list start at 0 or 1?
I have just found out about array lists and i need a few pointers and some help
ArrayList<String> myList = new ArrayList<String>();
myList.add("hello");
myList.add("5");
myList.add("3");
myList.add("8");
int totalElements = myList.size();
System.out.println(totalElements);
private String[] myList;
public String getList() {
return this.myList[0]; | 3 |
1,156,715 | 07/21/2009 00:29:23 | 100,851 | 05/04/2009 12:37:28 | 132 | 24 | Map XML Nodes to Datatable Fields | I am new to C# so I apologize if this is a simple task. What I would like to do open an XML file whose root node is a table name and the children of the root node are field names and values. I would then like to map the fields to the root node's table in a SQL Server database and update or insert as needed. Does anyone know if there is a more elegant way to do this than looping through the node tree and building out the SQL string? It seems like there should be a way to bind the fields as if the XML document were a form, only it would only exist in memory. Again, sorry if this question has an obvious answer. Thanks in advance for any help. | c# | sql-server-2008 | null | null | null | null | open | Map XML Nodes to Datatable Fields
===
I am new to C# so I apologize if this is a simple task. What I would like to do open an XML file whose root node is a table name and the children of the root node are field names and values. I would then like to map the fields to the root node's table in a SQL Server database and update or insert as needed. Does anyone know if there is a more elegant way to do this than looping through the node tree and building out the SQL string? It seems like there should be a way to bind the fields as if the XML document were a form, only it would only exist in memory. Again, sorry if this question has an obvious answer. Thanks in advance for any help. | 0 |
9,798,712 | 03/21/2012 04:43:43 | 779,023 | 06/01/2011 08:47:28 | 55 | 1 | Ubuntu 11.04 does not detect my tata photon + | I am trying to connect to the Internet via my photon+ from the past day and have tried various suggestions on the Internet and have tried to zero in to the main cause of the problem which is that my device is not detected.
I have tried the following ways:
1) After connecting the device, I tried to create a mobile broadband connection via System > Preferences > Network Connections and selected tata photon plus. But there was no connection.
2) I did `sudo apt-get install usb-modeswitch-data `
and `sudo apt-get install usb-modeswitch`
But the prompt said that they are at their newest version.
3) I tried to edit the file `sudo gedit /etc/usb_modeswitch.d/12d1:1446`, but this file did not exist.
4) my `lsusb` output is
`nikhil@nikhil:~$ lsusb
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 003: ID 22f4:0021
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 04f2:b159 Chicony Electronics Co., Ltd
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
`
Any Ideas ?? | ubuntu | ubuntu-11.04 | null | null | null | 03/22/2012 11:47:07 | off topic | Ubuntu 11.04 does not detect my tata photon +
===
I am trying to connect to the Internet via my photon+ from the past day and have tried various suggestions on the Internet and have tried to zero in to the main cause of the problem which is that my device is not detected.
I have tried the following ways:
1) After connecting the device, I tried to create a mobile broadband connection via System > Preferences > Network Connections and selected tata photon plus. But there was no connection.
2) I did `sudo apt-get install usb-modeswitch-data `
and `sudo apt-get install usb-modeswitch`
But the prompt said that they are at their newest version.
3) I tried to edit the file `sudo gedit /etc/usb_modeswitch.d/12d1:1446`, but this file did not exist.
4) my `lsusb` output is
`nikhil@nikhil:~$ lsusb
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 003: ID 22f4:0021
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 04f2:b159 Chicony Electronics Co., Ltd
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
`
Any Ideas ?? | 2 |
1,715,821 | 11/11/2009 15:13:27 | 186,608 | 10/08/2009 18:13:35 | 8 | 1 | why does Blend suck at compiling? | about 10% of the time when I go to compile code that should compile, blend fails. I know the code should compile because w/o changing a thing it will compile in VS just fine. The really weird thing is that about 50% or more of the time, after compiling in VS and I come back to blend, it compiles. >_<
So, why does blend suck at compiling? and is there a way to make it as reliable as VS?
~N | expression-blend | visual-studio | compiler | null | null | 07/12/2011 17:00:41 | not a real question | why does Blend suck at compiling?
===
about 10% of the time when I go to compile code that should compile, blend fails. I know the code should compile because w/o changing a thing it will compile in VS just fine. The really weird thing is that about 50% or more of the time, after compiling in VS and I come back to blend, it compiles. >_<
So, why does blend suck at compiling? and is there a way to make it as reliable as VS?
~N | 1 |
523,038 | 02/07/2009 03:03:30 | 27,751 | 10/14/2008 07:26:36 | 32 | 0 | php - auto select drop down menu based on parameters in browser link | if in the browser i have parameters like
http://localhost/specials.php?year=2009&make=honda&model=civic
and the dropdown looks something like this
<select name="year">
<?php
$query = mysql_query("select distinct year from tbl_content where year = '$year'");
while($row = mysql_fetch_assoc($query)) {
echo "<option value=\"{$row['year']}\">{$row['year']}</option>";
}
?>
</select>
==========================<br><br>
now what im trying to do is show select when the dropdown options value is equal to the parameter year in the browser url.
i tried this
<select name="year">
<?php
$query = mysql_query("select * from tbl_year
while($row = mysql_fetch_assoc($query)) {
#=============================
if(isset($_GET['year'])) {
$year = (int)$_GET['year'];
if($year == $row['year'] { $selected = "selected"; }
else { $selected = "";
}
echo "<option value=\"{$row['year']}\" {$selected}>{$row['year']}</option>";
}
?>
</select>
| php | drop | down | null | null | null | open | php - auto select drop down menu based on parameters in browser link
===
if in the browser i have parameters like
http://localhost/specials.php?year=2009&make=honda&model=civic
and the dropdown looks something like this
<select name="year">
<?php
$query = mysql_query("select distinct year from tbl_content where year = '$year'");
while($row = mysql_fetch_assoc($query)) {
echo "<option value=\"{$row['year']}\">{$row['year']}</option>";
}
?>
</select>
==========================<br><br>
now what im trying to do is show select when the dropdown options value is equal to the parameter year in the browser url.
i tried this
<select name="year">
<?php
$query = mysql_query("select * from tbl_year
while($row = mysql_fetch_assoc($query)) {
#=============================
if(isset($_GET['year'])) {
$year = (int)$_GET['year'];
if($year == $row['year'] { $selected = "selected"; }
else { $selected = "";
}
echo "<option value=\"{$row['year']}\" {$selected}>{$row['year']}</option>";
}
?>
</select>
| 0 |
3,100,569 | 06/23/2010 09:52:23 | 183,871 | 10/04/2009 07:36:36 | 189 | 8 | Manipulation of URLEncoded String | I have to pass a string (input) in GET parameter of a URL, but there is a limit on maximum length of URL being 357.
The string is to be encoded using "Shift-JIS".
For a keyword "blah 123 blahblah 321", i need to strip off last word(s) such that the string would be meaningful and the resulting URL length should be within the limit of 357.
But after converting into Shift-JIS encoding, I can no longer split string meaningfully.
Converting back-n-forth would be suboptimal.
Can someone help here please.
Thanks
Nayn | java | urlencode | null | null | null | null | open | Manipulation of URLEncoded String
===
I have to pass a string (input) in GET parameter of a URL, but there is a limit on maximum length of URL being 357.
The string is to be encoded using "Shift-JIS".
For a keyword "blah 123 blahblah 321", i need to strip off last word(s) such that the string would be meaningful and the resulting URL length should be within the limit of 357.
But after converting into Shift-JIS encoding, I can no longer split string meaningfully.
Converting back-n-forth would be suboptimal.
Can someone help here please.
Thanks
Nayn | 0 |
2,860,328 | 05/18/2010 19:15:16 | 75,598 | 03/09/2009 12:24:38 | 266 | 14 | Managing trace files on Sql Server 2005 | I need to manage the trace files for a database on Sql Server 2005 Express Edition. The C2 audit logging is turned on for the database, and the files that it's creating are eating up a lot of space.
Can this be done from within Sql Server, or do I need to write a service to monitor these files and take the appropriate actions?
I found the [master].[sys].[trace] table with the trace file properties. Does anyone know the meaning of the fields in this table? | sql-server-2005 | audit | logging | null | null | null | open | Managing trace files on Sql Server 2005
===
I need to manage the trace files for a database on Sql Server 2005 Express Edition. The C2 audit logging is turned on for the database, and the files that it's creating are eating up a lot of space.
Can this be done from within Sql Server, or do I need to write a service to monitor these files and take the appropriate actions?
I found the [master].[sys].[trace] table with the trace file properties. Does anyone know the meaning of the fields in this table? | 0 |
4,118,432 | 11/07/2010 15:46:58 | 499,916 | 11/07/2010 15:46:58 | 1 | 0 | Refresh Page, Follow Link, Fill Email Address, Submit | There is a contest over at facebook.com/lowes. I am looking for help making some javascript for GreaseMonkey that will refresh the page looking for an update, follow new "http://bit.ly" links and fill and submit an email address into the resulting page. | javascript | null | null | null | null | 11/07/2010 19:48:28 | not a real question | Refresh Page, Follow Link, Fill Email Address, Submit
===
There is a contest over at facebook.com/lowes. I am looking for help making some javascript for GreaseMonkey that will refresh the page looking for an update, follow new "http://bit.ly" links and fill and submit an email address into the resulting page. | 1 |
7,021,141 | 08/11/2011 05:18:48 | 825,780 | 07/02/2011 05:13:00 | 61 | 13 | How to retrieve author of a office file in python? | Title explains the problem, there are doc and docs files that which I want to retrieive their author information so that I can restructure my files.
`os.stat` returns only size and datetime, real-file related information. | python | file | office | author | null | null | open | How to retrieve author of a office file in python?
===
Title explains the problem, there are doc and docs files that which I want to retrieive their author information so that I can restructure my files.
`os.stat` returns only size and datetime, real-file related information. | 0 |
9,511,505 | 03/01/2012 06:15:56 | 1,198,988 | 02/09/2012 06:43:08 | 1 | 0 | How to submit data by a button click in a database using jdbc? | I am working on a project in java(swing components).i have created a form which consists of a button and a text box.And after entering the value in the textbox and clicking the submit button ,i want the value to be entered in the database . | java | null | null | null | null | 03/01/2012 06:49:20 | not a real question | How to submit data by a button click in a database using jdbc?
===
I am working on a project in java(swing components).i have created a form which consists of a button and a text box.And after entering the value in the textbox and clicking the submit button ,i want the value to be entered in the database . | 1 |
10,349,715 | 04/27/2012 11:23:45 | 1,099,129 | 12/15/2011 04:20:45 | 16 | 2 | i want to learn node.js, anyone suggest me a better book, or link for node.js? | All though i have come across links like this http://www.nodebeginner.org/
As a complete beginner, i couldn't understand few concepts in it,
and to be clear, i know only a little bit of javascript. | javascript | node.js | null | null | null | 04/28/2012 03:14:09 | not constructive | i want to learn node.js, anyone suggest me a better book, or link for node.js?
===
All though i have come across links like this http://www.nodebeginner.org/
As a complete beginner, i couldn't understand few concepts in it,
and to be clear, i know only a little bit of javascript. | 4 |
8,715,543 | 01/03/2012 16:45:12 | 1,079,008 | 12/03/2011 13:31:01 | 19 | 0 | Why I have a (error does not implement interface member) silverlight | PagesCollection.ViewModel.PagePictureCommands.cs
namespace PagesCollection.ViewModel
{
public partial class PagePicturesViewModel : IPropertieCommands
{
private ICommand deleteAlbum;
public ICommand _CreateAlbum
{
get
{
if (createAlbum == null)
createAlbum = new Model.DelegateCommand(CreateAlbum, CanAdd);
return createAlbum;
}
}
}
}
PagesCollection.ViewModel.PagePicturesViewModel.cs
namespace PagesCollection.ViewModel
{
public partial class PagePicturesViewModel : IPictureMethods
{
public void CreateAlbum(object param)
{...}
}
}
I have one 2 interfaces and one class which divided on 2.Each one half of class has implemented some of those interfaces.But I have a very strange error.
('PagesCollection.ViewModel.PagePicturesViewModel' does not implement interface member 'PagesCollection.Model.IPropertieCommands._CreateAlbum.set')
Can u help me please? | c# | wpf | silverlight | interface | partial | null | open | Why I have a (error does not implement interface member) silverlight
===
PagesCollection.ViewModel.PagePictureCommands.cs
namespace PagesCollection.ViewModel
{
public partial class PagePicturesViewModel : IPropertieCommands
{
private ICommand deleteAlbum;
public ICommand _CreateAlbum
{
get
{
if (createAlbum == null)
createAlbum = new Model.DelegateCommand(CreateAlbum, CanAdd);
return createAlbum;
}
}
}
}
PagesCollection.ViewModel.PagePicturesViewModel.cs
namespace PagesCollection.ViewModel
{
public partial class PagePicturesViewModel : IPictureMethods
{
public void CreateAlbum(object param)
{...}
}
}
I have one 2 interfaces and one class which divided on 2.Each one half of class has implemented some of those interfaces.But I have a very strange error.
('PagesCollection.ViewModel.PagePicturesViewModel' does not implement interface member 'PagesCollection.Model.IPropertieCommands._CreateAlbum.set')
Can u help me please? | 0 |
7,563,509 | 09/27/2011 02:11:45 | 239,242 | 12/27/2009 18:11:44 | 560 | 8 | How can I selecting multiple columns, only one of which is distinct? (ORACLE SQL) | I want to be able to do this:
INSERT INTO TABLE_1(<LIST OF ROWS>)
SELECT <LIST OF ROWS> FROM (SELECT DISTINCT <OTHER ROWS> FROM TABLE_2);
How can I do this? I receive an error when I try to do it now.
Note that `<LIST OF ROWS>` is the same in both cases I use it, and also not that the fields in `<OTHER ROWS>` could, but do not necessarily exist in <LIST_OF ROWS>.
| sql | oracle | null | null | null | null | open | How can I selecting multiple columns, only one of which is distinct? (ORACLE SQL)
===
I want to be able to do this:
INSERT INTO TABLE_1(<LIST OF ROWS>)
SELECT <LIST OF ROWS> FROM (SELECT DISTINCT <OTHER ROWS> FROM TABLE_2);
How can I do this? I receive an error when I try to do it now.
Note that `<LIST OF ROWS>` is the same in both cases I use it, and also not that the fields in `<OTHER ROWS>` could, but do not necessarily exist in <LIST_OF ROWS>.
| 0 |
6,229,361 | 06/03/2011 15:44:03 | 64,334 | 02/09/2009 21:08:32 | 4,080 | 83 | Why can't you call methods with c# object initializer syntax? | Why can't you call methods with c# object initializer syntax?
It seems to me that the property setters are called in the order that they are set in the syntax, so why not allow calls to methods as well? If there is a good reason, I'm missing it. | c# | .net | null | null | null | 06/03/2011 17:12:52 | not constructive | Why can't you call methods with c# object initializer syntax?
===
Why can't you call methods with c# object initializer syntax?
It seems to me that the property setters are called in the order that they are set in the syntax, so why not allow calls to methods as well? If there is a good reason, I'm missing it. | 4 |
7,437,799 | 09/15/2011 21:44:22 | 285,594 | 03/03/2010 18:19:03 | 633 | 34 | How can i make my RS232 cable setup so that from Java, i can turn on and off the 12voltage lights? | I have a 12volt light + Battery.
![enter image description here][1]
When i connect + and - the light turns on. Now how can connect that + and - wire to my RS232 cable which is connected to my Java application. And from Java button press, i want to turn the light on instead of doing it by my hands.
Please advise how i can do this real world setup?
![enter image description here][2]
[1]: http://i.stack.imgur.com/CMDe9.jpg
[2]: http://i.stack.imgur.com/5phhD.jpg | java | linux | hardware | robot | electronics | 09/15/2011 22:34:41 | off topic | How can i make my RS232 cable setup so that from Java, i can turn on and off the 12voltage lights?
===
I have a 12volt light + Battery.
![enter image description here][1]
When i connect + and - the light turns on. Now how can connect that + and - wire to my RS232 cable which is connected to my Java application. And from Java button press, i want to turn the light on instead of doing it by my hands.
Please advise how i can do this real world setup?
![enter image description here][2]
[1]: http://i.stack.imgur.com/CMDe9.jpg
[2]: http://i.stack.imgur.com/5phhD.jpg | 2 |
8,589,677 | 12/21/2011 12:15:02 | 568,442 | 01/09/2011 00:12:44 | 141 | 10 | Information System in Java Using Agent | I got task in my college to create smart information system using java as it language and using Agent.
The problem is that I really don`t know what Agent is. I tried too google it and I ended up with confussion. And I don`t know how to implement it on information system.
Can anyone point me to get started or maybe explain to me :D
Thank you.. | java | artificial-intelligence | system | information | agent | 12/21/2011 12:35:39 | not a real question | Information System in Java Using Agent
===
I got task in my college to create smart information system using java as it language and using Agent.
The problem is that I really don`t know what Agent is. I tried too google it and I ended up with confussion. And I don`t know how to implement it on information system.
Can anyone point me to get started or maybe explain to me :D
Thank you.. | 1 |
8,648,421 | 12/27/2011 19:24:21 | 191,459 | 10/16/2009 21:12:48 | 1,964 | 86 | List of Strings to char[] in Java | I have a list of Strings in Java, I would to create an array of Chars instead. Is there a quick and dirty way to do this? | java | string | char | null | null | null | open | List of Strings to char[] in Java
===
I have a list of Strings in Java, I would to create an array of Chars instead. Is there a quick and dirty way to do this? | 0 |
6,248,719 | 06/06/2011 06:59:20 | 698,734 | 04/08/2011 13:32:42 | 107 | 0 | how to get open contacts by calling method instead of button click | As per my requirement,
i need to get email id's from contacts.
And i need to write a code for this in a separate class in a method.To get call this integrate classes into my project simply call that method.
This is what i need.
for this my code in ownServices is like this.
-(NSString *)getSelectedNumberFromContatcs {
ABPeoplePickerNavigationController *peoplePickerController = [[ABPeoplePickerNavigationController alloc] init];
peoplePickerController.peoplePickerDelegate = self;
[self presentModalViewController:peoplePickerController animated:NO];
[peoplePickerController release];
return aNSString;
}
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person {
// NSString *name = (NSString *)ABRecordCopyValue(person, kABPersonPhoneProperty);
return YES;
}
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person
property:(ABPropertyID)property
identifier:(ABMultiValueIdentifier)identifier {
if (property == kABPersonPhoneProperty) {
ABMultiValueRef emails = ABRecordCopyValue(person, property);
CFStringRef phonenumberselected = ABMultiValueCopyValueAtIndex(emails, identifier);
// CFStringRef emailLabelSelected = ABMultiValueCopyLabelAtIndex(emails, identifier);
// CFStringRef emailLabelSelectedLocalized = ABAddressBookCopyLocalizedLabel(ABMultiValueCopyLabelAtIndex(emails, identifier));
aNSString = (NSString *)phonenumberselected;
// Return to the main view controller.
[ self dismissModalViewControllerAnimated:YES ];
return NO;
}
return YES ;
}
- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker
{
[ self dismissModalViewControllerAnimated:YES ];
}
i am calling this in myclassviewcontroller like this.
- (void)viewDidLoad {
[super viewDidLoad];
ownServices *obj = [[ownServices alloc]init];
[obj getSelectedNumberFromContatcs];
}
But contatcs viewcontraoller is not opened.
But i try same code in view controller in a button action like this
-(IBAction)openContacts {
ABPeoplePickerNavigationController *peoplePickerController = [[ABPeoplePickerNavigationController alloc] init];
peoplePickerController.peoplePickerDelegate = self;
[self presentModalViewController:peoplePickerController animated:NO];
[peoplePickerController release];
}
Then contacts viewconrtroller opened.
i did n't why view controller is not opened by calling it in a method.
is it possible to do like this.
can any one please help me.
Thank u in advance.
| iphone | null | null | null | null | null | open | how to get open contacts by calling method instead of button click
===
As per my requirement,
i need to get email id's from contacts.
And i need to write a code for this in a separate class in a method.To get call this integrate classes into my project simply call that method.
This is what i need.
for this my code in ownServices is like this.
-(NSString *)getSelectedNumberFromContatcs {
ABPeoplePickerNavigationController *peoplePickerController = [[ABPeoplePickerNavigationController alloc] init];
peoplePickerController.peoplePickerDelegate = self;
[self presentModalViewController:peoplePickerController animated:NO];
[peoplePickerController release];
return aNSString;
}
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person {
// NSString *name = (NSString *)ABRecordCopyValue(person, kABPersonPhoneProperty);
return YES;
}
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person
property:(ABPropertyID)property
identifier:(ABMultiValueIdentifier)identifier {
if (property == kABPersonPhoneProperty) {
ABMultiValueRef emails = ABRecordCopyValue(person, property);
CFStringRef phonenumberselected = ABMultiValueCopyValueAtIndex(emails, identifier);
// CFStringRef emailLabelSelected = ABMultiValueCopyLabelAtIndex(emails, identifier);
// CFStringRef emailLabelSelectedLocalized = ABAddressBookCopyLocalizedLabel(ABMultiValueCopyLabelAtIndex(emails, identifier));
aNSString = (NSString *)phonenumberselected;
// Return to the main view controller.
[ self dismissModalViewControllerAnimated:YES ];
return NO;
}
return YES ;
}
- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker
{
[ self dismissModalViewControllerAnimated:YES ];
}
i am calling this in myclassviewcontroller like this.
- (void)viewDidLoad {
[super viewDidLoad];
ownServices *obj = [[ownServices alloc]init];
[obj getSelectedNumberFromContatcs];
}
But contatcs viewcontraoller is not opened.
But i try same code in view controller in a button action like this
-(IBAction)openContacts {
ABPeoplePickerNavigationController *peoplePickerController = [[ABPeoplePickerNavigationController alloc] init];
peoplePickerController.peoplePickerDelegate = self;
[self presentModalViewController:peoplePickerController animated:NO];
[peoplePickerController release];
}
Then contacts viewconrtroller opened.
i did n't why view controller is not opened by calling it in a method.
is it possible to do like this.
can any one please help me.
Thank u in advance.
| 0 |
9,450,347 | 02/26/2012 03:40:37 | 1,233,344 | 02/26/2012 03:38:26 | 1 | 0 | Loop through PHP array | Can some help me get this data out of this array so I get
$year $month $ count
Array ( [0] => MonthlySearchVolume Object ( [year] => 2012 [month] => 1 [count] => 368000 ) [1] => MonthlySearchVolume Object ( [year] => 2011 [month] => 12 [count] => 246000 ) [2] => MonthlySearchVolume Object ( [year] => 2011 [month] => 11 [count] => 246000 ) [3] => MonthlySearchVolume Object ( [year] => 2011 [month] => 10 [count] => 165000 ) [4] => MonthlySearchVolume Object ( [year] => 2011 [month] => 9 [count] => 165000 ) [5] => MonthlySearchVolume Object ( [year] => 2011 [month] => 8 [count] => 301000 ) [6] => MonthlySearchVolume Object ( [year] => 2011 [month] => 7 [count] => 301000 ) [7] => MonthlySearchVolume Object ( [year] => 2011 [month] => 6 [count] => 135000 ) [8] => MonthlySearchVolume Object ( [year] => 2011 [month] => 5 [count] => 201000 ) [9] => MonthlySearchVolume Object ( [year] => 2011 [month] => 4 [count] => 246000 ) [10] => MonthlySearchVolume Object ( [year] => 2011 [month] => 3 [count] => 74000 ) [11] => MonthlySearchVolume Object ( [year] => 2011 [month] => 2 [count] => 40500 ) ) | php | arrays | null | null | null | 02/26/2012 03:59:35 | not a real question | Loop through PHP array
===
Can some help me get this data out of this array so I get
$year $month $ count
Array ( [0] => MonthlySearchVolume Object ( [year] => 2012 [month] => 1 [count] => 368000 ) [1] => MonthlySearchVolume Object ( [year] => 2011 [month] => 12 [count] => 246000 ) [2] => MonthlySearchVolume Object ( [year] => 2011 [month] => 11 [count] => 246000 ) [3] => MonthlySearchVolume Object ( [year] => 2011 [month] => 10 [count] => 165000 ) [4] => MonthlySearchVolume Object ( [year] => 2011 [month] => 9 [count] => 165000 ) [5] => MonthlySearchVolume Object ( [year] => 2011 [month] => 8 [count] => 301000 ) [6] => MonthlySearchVolume Object ( [year] => 2011 [month] => 7 [count] => 301000 ) [7] => MonthlySearchVolume Object ( [year] => 2011 [month] => 6 [count] => 135000 ) [8] => MonthlySearchVolume Object ( [year] => 2011 [month] => 5 [count] => 201000 ) [9] => MonthlySearchVolume Object ( [year] => 2011 [month] => 4 [count] => 246000 ) [10] => MonthlySearchVolume Object ( [year] => 2011 [month] => 3 [count] => 74000 ) [11] => MonthlySearchVolume Object ( [year] => 2011 [month] => 2 [count] => 40500 ) ) | 1 |
8,374,360 | 12/04/2011 09:17:48 | 415,020 | 08/09/2010 11:36:47 | 168 | 11 | Munin-node won't start Cent OS 5.7 | i just installed munin-node on my new cent os 5.4 64bit machine via yum.
Installation went fine, i've setup munin and munin-nodes on many machines in the past, but this time i cannot get it to start.
When I try to restart it with the following command this happens:
[root@Server2 munin]# service munin-node restart
Stopping Munin Node agents: kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
[FAILED]
Starting Munin Node: Use of uninitialized value in pattern match (m//) at /usr/lib/perl5/vendor_perl/5.8.8/Net/Server/Daemonize.pm line 61.
Couldn't find pid in existing pid_file at /usr/lib/perl5/vendor_perl/5.8.8/Net/Server/Daemonize.pm line 61.
[ OK ]
It says [OK] in the end in green, but I don't see it running anywhere.
Also this is the output of munin-node.log
[root@Server2 munin]# tail -n 100 munin-node.log
2011/12/04-03:10:44 Couldn't find pid in existing pid_file at /usr/lib/perl5/vendor_perl/5.8.8/Net/Server/Daemonize.pm line 61.
at line 276 in file /usr/lib/perl5/vendor_perl/5.8.8/Net/Server.pm
2011/12/04-03:10:44 Server closing!
2011/12/04-03:10:54 Couldn't find pid in existing pid_file at /usr/lib/perl5/vendor_perl/5.8.8/Net/Server/Daemonize.pm line 61.
at line 276 in file /usr/lib/perl5/vendor_perl/5.8.8/Net/Server.pm
2011/12/04-03:10:54 Server closing!
Ive looked up line 61 in Daemonize.pm and it is:
my $current_pid = $_current_pid =~ /^(\d{1,10})/ ? $1 : die "Couldn't find pid in existing pid_file";
I've tried to rename the pid file in /etc/munin/munin-node.conf but that also didnt change anything.
Any idea what I can try? | centos | munin | null | null | null | 12/05/2011 06:27:14 | off topic | Munin-node won't start Cent OS 5.7
===
i just installed munin-node on my new cent os 5.4 64bit machine via yum.
Installation went fine, i've setup munin and munin-nodes on many machines in the past, but this time i cannot get it to start.
When I try to restart it with the following command this happens:
[root@Server2 munin]# service munin-node restart
Stopping Munin Node agents: kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
[FAILED]
Starting Munin Node: Use of uninitialized value in pattern match (m//) at /usr/lib/perl5/vendor_perl/5.8.8/Net/Server/Daemonize.pm line 61.
Couldn't find pid in existing pid_file at /usr/lib/perl5/vendor_perl/5.8.8/Net/Server/Daemonize.pm line 61.
[ OK ]
It says [OK] in the end in green, but I don't see it running anywhere.
Also this is the output of munin-node.log
[root@Server2 munin]# tail -n 100 munin-node.log
2011/12/04-03:10:44 Couldn't find pid in existing pid_file at /usr/lib/perl5/vendor_perl/5.8.8/Net/Server/Daemonize.pm line 61.
at line 276 in file /usr/lib/perl5/vendor_perl/5.8.8/Net/Server.pm
2011/12/04-03:10:44 Server closing!
2011/12/04-03:10:54 Couldn't find pid in existing pid_file at /usr/lib/perl5/vendor_perl/5.8.8/Net/Server/Daemonize.pm line 61.
at line 276 in file /usr/lib/perl5/vendor_perl/5.8.8/Net/Server.pm
2011/12/04-03:10:54 Server closing!
Ive looked up line 61 in Daemonize.pm and it is:
my $current_pid = $_current_pid =~ /^(\d{1,10})/ ? $1 : die "Couldn't find pid in existing pid_file";
I've tried to rename the pid file in /etc/munin/munin-node.conf but that also didnt change anything.
Any idea what I can try? | 2 |
4,184,816 | 11/15/2010 13:28:45 | 183,201 | 10/02/2009 15:47:56 | 28 | 0 | NHibernate: cannot append items to map element | I have map element in my mapping -
<component name="Resources">
<map name="Inner" table="SomeTable" lazy="false" fetch="join" access="field.lowercase-underscore">
<key column="Id"/>
<index column="IndexId" type="String"/>
<composite-element class="SomeResource">
<property name="Name"/>
</composite-element>
</map>
</component>
I want to append items in the SomeTable in the following way -
var ent = new Entity();
ent.Resources.Add("key1", new SomeResource());
var saved = Session.SaveOrUpdate(ent);
Session.Session.Flush();
Session.Session.Clear();
var newEntity = new Entity {Id = saved.Id};
ent.Resources.Add("key2", new SomeResource());
Session.SaveOrUpdate(newEntity); // here nHib generates DELETE FROM SomeTable WHERE Id = saved.Id
Session.Session.Flush();
Session.Session.Clear();
I want to have elements "key1" & "key2" in the SomeTable after the run, how can this be done?.. Currently nHib deletes all elements with the specified id from the SomeTable before second save.
| nhibernate | map | mapping | null | null | null | open | NHibernate: cannot append items to map element
===
I have map element in my mapping -
<component name="Resources">
<map name="Inner" table="SomeTable" lazy="false" fetch="join" access="field.lowercase-underscore">
<key column="Id"/>
<index column="IndexId" type="String"/>
<composite-element class="SomeResource">
<property name="Name"/>
</composite-element>
</map>
</component>
I want to append items in the SomeTable in the following way -
var ent = new Entity();
ent.Resources.Add("key1", new SomeResource());
var saved = Session.SaveOrUpdate(ent);
Session.Session.Flush();
Session.Session.Clear();
var newEntity = new Entity {Id = saved.Id};
ent.Resources.Add("key2", new SomeResource());
Session.SaveOrUpdate(newEntity); // here nHib generates DELETE FROM SomeTable WHERE Id = saved.Id
Session.Session.Flush();
Session.Session.Clear();
I want to have elements "key1" & "key2" in the SomeTable after the run, how can this be done?.. Currently nHib deletes all elements with the specified id from the SomeTable before second save.
| 0 |
10,016,813 | 04/04/2012 18:06:09 | 962,469 | 09/24/2011 09:30:36 | 73 | 0 | alternative for Jquery scrollto | I'm searching a way to have a horizontal scroller on hyperlinks and I have been taking a look on the scrollto plugin but as it seems is really outdated. Is it possible to achive the same results just with simple jquery? | jquery | null | null | null | null | 04/05/2012 05:54:18 | not a real question | alternative for Jquery scrollto
===
I'm searching a way to have a horizontal scroller on hyperlinks and I have been taking a look on the scrollto plugin but as it seems is really outdated. Is it possible to achive the same results just with simple jquery? | 1 |
3,104,172 | 06/23/2010 17:49:03 | 374,503 | 06/23/2010 17:49:02 | 1 | 0 | trace an address using ip address | how to trace the information of an individual using ip adress and email id can any one help me... i tried for a example using my friends ip address , and i was able to get only this information alone....
Location of the IP address 59.162.171.249:
Visakhapatnam in India.
but how to trace his address perfectly
plz help me
| networking | network-programming | network-protocols | null | null | 06/23/2010 18:01:26 | not a real question | trace an address using ip address
===
how to trace the information of an individual using ip adress and email id can any one help me... i tried for a example using my friends ip address , and i was able to get only this information alone....
Location of the IP address 59.162.171.249:
Visakhapatnam in India.
but how to trace his address perfectly
plz help me
| 1 |
7,815,028 | 10/18/2011 23:38:19 | 706,628 | 04/13/2011 18:32:20 | 673 | 38 | Why does my Gmail address appear as my handle in Android Market reviews? | I am really frustrated that my Gmail address appears as my handle in Android Market reviews. As a result I really can't review apps because I don't want to get spammed.
How do I change my handle? I cannot find this setting anywhere. :(
Thanks in advance,
Barry | android | gmail | android-market | null | null | 10/19/2011 18:41:26 | off topic | Why does my Gmail address appear as my handle in Android Market reviews?
===
I am really frustrated that my Gmail address appears as my handle in Android Market reviews. As a result I really can't review apps because I don't want to get spammed.
How do I change my handle? I cannot find this setting anywhere. :(
Thanks in advance,
Barry | 2 |
10,174,711 | 04/16/2012 13:06:18 | 123,671 | 06/16/2009 12:41:22 | 1,417 | 36 | HTML5 history: how can I see the URL that was popped (ie, the page we were on when we hit the back button) | I am using the [HTML5 history API][1]
I notice that if:
- if I am on a page called /first
- I use pushState to /second
- And then hit the back button
The event handler for window.onpopstate() returns the state for /first, as documented.
In order to transition from /second to /first, **I would like to see the URL that was popped - ie, /second in this case**. What's the best way of doing that?
[1]: https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history | javascript | html5 | browser-history | null | null | null | open | HTML5 history: how can I see the URL that was popped (ie, the page we were on when we hit the back button)
===
I am using the [HTML5 history API][1]
I notice that if:
- if I am on a page called /first
- I use pushState to /second
- And then hit the back button
The event handler for window.onpopstate() returns the state for /first, as documented.
In order to transition from /second to /first, **I would like to see the URL that was popped - ie, /second in this case**. What's the best way of doing that?
[1]: https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history | 0 |
10,454,110 | 05/04/2012 18:19:19 | 1,336,879 | 04/16/2012 17:13:35 | 1 | 0 | What is the difference between Linux and Unix? | Can some one please explain the major difference between Linux and Unix?
Thanks & Regards,
Shiva. | linux | unix | null | null | null | 05/04/2012 18:33:57 | not a real question | What is the difference between Linux and Unix?
===
Can some one please explain the major difference between Linux and Unix?
Thanks & Regards,
Shiva. | 1 |
3,498,618 | 08/17/2010 01:11:41 | 133,374 | 07/05/2009 15:29:28 | 1,274 | 44 | Sun JVMs memory allocator compared to others | How does Sun JVMs memory allocator compares to glibcs malloc or jemalloc? | jvm | malloc | glibc | null | null | 08/17/2010 02:28:20 | not constructive | Sun JVMs memory allocator compared to others
===
How does Sun JVMs memory allocator compares to glibcs malloc or jemalloc? | 4 |
7,626,798 | 10/02/2011 14:01:25 | 560,287 | 01/02/2011 11:32:58 | 377 | 27 | XML save all children to variable | I am using jQuery AJAX to get a XML file with:
$.ajax({
type: "GET",
url: phoneXmlPath,
dataType: "xml",
contentType: "text/xml; charset=utf-8",
success: function(xml){
$(xml).find("phone[phone_id="+phone_id+"]").each(function(index, value){
var tis = $(this);
tis.children().each(function(){
alert($(this).nodeName);
});
});
},
error:function(xhr,type){
if(type == null){
var errorMsg = "There was an error loading the phone.xml file!<br/>Please make sure the path to the xml file <strong>'"+phoneXmlPath+"'</strong> is correct.";
}else if(type == "parsererror"){
var errorMsg = "There is an error in the file <strong>'"+phoneXmlPath+"'</strong>.";
}else{
var errorMsg = "An error has been detected.";
}
popup.removeClass("loading").html("<p><strong>Error:</strong> "+errorMsg+"</p><p><strong>Type of error:</strong> "+type+".</p>");
}
});
In this part: `alert($(this).nodeName);` how could I save everything to a variables that I can later access. E.g further down the code I would like to be able to do: "phone.title" and access all of the phone children elements.
XML file
<phones>
<phone>
<title>Phone title</title>
etc.... | jquery | xml | null | null | null | null | open | XML save all children to variable
===
I am using jQuery AJAX to get a XML file with:
$.ajax({
type: "GET",
url: phoneXmlPath,
dataType: "xml",
contentType: "text/xml; charset=utf-8",
success: function(xml){
$(xml).find("phone[phone_id="+phone_id+"]").each(function(index, value){
var tis = $(this);
tis.children().each(function(){
alert($(this).nodeName);
});
});
},
error:function(xhr,type){
if(type == null){
var errorMsg = "There was an error loading the phone.xml file!<br/>Please make sure the path to the xml file <strong>'"+phoneXmlPath+"'</strong> is correct.";
}else if(type == "parsererror"){
var errorMsg = "There is an error in the file <strong>'"+phoneXmlPath+"'</strong>.";
}else{
var errorMsg = "An error has been detected.";
}
popup.removeClass("loading").html("<p><strong>Error:</strong> "+errorMsg+"</p><p><strong>Type of error:</strong> "+type+".</p>");
}
});
In this part: `alert($(this).nodeName);` how could I save everything to a variables that I can later access. E.g further down the code I would like to be able to do: "phone.title" and access all of the phone children elements.
XML file
<phones>
<phone>
<title>Phone title</title>
etc.... | 0 |
10,893,788 | 06/05/2012 08:13:54 | 1,310,055 | 04/03/2012 09:37:02 | 1 | 0 | Car Dealer WordPress Plugin | I wonder if there is a plugin for wordpress that allow the user to search, select and filter a new and used cars and their prices or something like that...
Please advise...
Thanks in advance. | wordpress | plugins | null | null | null | 06/05/2012 21:47:16 | not constructive | Car Dealer WordPress Plugin
===
I wonder if there is a plugin for wordpress that allow the user to search, select and filter a new and used cars and their prices or something like that...
Please advise...
Thanks in advance. | 4 |
6,938,676 | 08/04/2011 09:01:10 | 878,207 | 08/04/2011 09:01:10 | 1 | 0 | Tools for web design | I am developing a website, but it seems that I am wasting my time writing CSS/HTML from scratch. Are there any tools that can do that for me? drag and drop style or any programs with a GUI that will make my life easier? My main concen now is to dal with the back-end part of the website, which it will be Django/MySQL. | html | css | django | null | null | 08/05/2011 04:11:05 | not constructive | Tools for web design
===
I am developing a website, but it seems that I am wasting my time writing CSS/HTML from scratch. Are there any tools that can do that for me? drag and drop style or any programs with a GUI that will make my life easier? My main concen now is to dal with the back-end part of the website, which it will be Django/MySQL. | 4 |
7,265,984 | 09/01/2011 03:58:01 | 670,521 | 03/22/2011 03:28:55 | 740 | 26 | How to customize window menu (linux ubuntu) | I'm looking for a way to add a "kill this window" item in the window menu:
![Window Menu][1]
Is it possible, under gnome/ubuntu?
Thanks!
[1]: http://i.stack.imgur.com/7xLEN.png | linux | ubuntu | menu | customization | gnome | 11/22/2011 16:54:01 | off topic | How to customize window menu (linux ubuntu)
===
I'm looking for a way to add a "kill this window" item in the window menu:
![Window Menu][1]
Is it possible, under gnome/ubuntu?
Thanks!
[1]: http://i.stack.imgur.com/7xLEN.png | 2 |
7,058,733 | 08/14/2011 18:16:11 | 724,344 | 04/25/2011 20:43:37 | 11 | 5 | C++/CLI: Get Stock Price | I'm currently working on a C++ project to get the price of my stocks, and display it in cells on my computer screen (so it looks nice). However, my Googling is NOT working for any of this. I also searched for libraries, but to no avail. Can anyone please tell me how I can do this? I don't know how to use the Google and Yahoo APIs, but they're not that updated anyways. I need something so I can put in my code, like:
`this->label1->Text = stockPrice;`
So, thanks! | winforms | visual-c++ | c++-cli | stock | null | 08/14/2011 20:12:25 | not a real question | C++/CLI: Get Stock Price
===
I'm currently working on a C++ project to get the price of my stocks, and display it in cells on my computer screen (so it looks nice). However, my Googling is NOT working for any of this. I also searched for libraries, but to no avail. Can anyone please tell me how I can do this? I don't know how to use the Google and Yahoo APIs, but they're not that updated anyways. I need something so I can put in my code, like:
`this->label1->Text = stockPrice;`
So, thanks! | 1 |
9,623,804 | 03/08/2012 19:44:29 | 1,229,311 | 02/23/2012 20:33:37 | 1 | 0 | Dynamically appending the user input to <script src= " "> from a textbox in Java Script | Im new to Java Script, i tried searching for a solution to my problem online, but wasnt successful.
I need to append the user's input from a textbox, after onclick of a button to 'src' attribute of <script> element in the same file. How can i do this?
<script id="url " type="text/javascript" src="http://gdata.youtube.com/feeds/api/videos?q=**<USER INPUT>**&alt=json-in-script&callback=showMyVideos2&max-results=30&format=5">
</script>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Search" OnClick= ? />
Thanks and very grateful for your help
Suman Moorthy | javascript | javascript-events | youtube-api | null | null | 03/09/2012 01:48:46 | not a real question | Dynamically appending the user input to <script src= " "> from a textbox in Java Script
===
Im new to Java Script, i tried searching for a solution to my problem online, but wasnt successful.
I need to append the user's input from a textbox, after onclick of a button to 'src' attribute of <script> element in the same file. How can i do this?
<script id="url " type="text/javascript" src="http://gdata.youtube.com/feeds/api/videos?q=**<USER INPUT>**&alt=json-in-script&callback=showMyVideos2&max-results=30&format=5">
</script>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Search" OnClick= ? />
Thanks and very grateful for your help
Suman Moorthy | 1 |
1,241,352 | 08/06/2009 20:49:20 | 143,718 | 07/23/2009 13:18:58 | 11 | 2 | rails group by multiple columns | i have budgets table with emptype_id and calendar_id actual_head, estimated_head
when i do Budgets.sum(:actual_head ,:group=>"emptype_id,calendar_id") i do not get the result grouped by the above two columns but only by the emptype_id
however when i check the log the sql query is right
"SELECT sum(`budgets`.actual_head) AS sum_actual_head, emptype_id,calendar_id AS emptype_id_calendar_id FROM `budgets` GROUP BY emptype_id,calendar_id"
has 103 rows
i wanted to iterate through each emptype_id and calendar_id to get a sum of actual_head
and do some calculations on it
can someone please help
Thx
| ruby-on-rails | activerecord | sql | null | null | null | open | rails group by multiple columns
===
i have budgets table with emptype_id and calendar_id actual_head, estimated_head
when i do Budgets.sum(:actual_head ,:group=>"emptype_id,calendar_id") i do not get the result grouped by the above two columns but only by the emptype_id
however when i check the log the sql query is right
"SELECT sum(`budgets`.actual_head) AS sum_actual_head, emptype_id,calendar_id AS emptype_id_calendar_id FROM `budgets` GROUP BY emptype_id,calendar_id"
has 103 rows
i wanted to iterate through each emptype_id and calendar_id to get a sum of actual_head
and do some calculations on it
can someone please help
Thx
| 0 |
9,606,906 | 03/07/2012 18:14:37 | 261,002 | 01/28/2010 13:23:08 | 244 | 1 | Saving .bmp file using hBitmap = CreateDIBSection() in C Win32 | I have the following code. I want to use the return of this function to create one .bmp file, can somebody please let me?
Thank you
hBitmap = CreateDIBSection(
hDCBits, // handle of device context
(BITMAPINFO *)&zWinGHeader, // address of structure containing
// bitmap size, format and color data
DIB_RGB_COLORS, // color data type indicator: RGB values
// or palette indices
&pWinGBits, // pointer to variable to receive a pointer
// to the bitmap's bit values
NULL, // optional handle to a file mapping object
0 // offset to the bitmap bit values within
// the file mapping object
); | c | file | winapi | save | bmp | null | open | Saving .bmp file using hBitmap = CreateDIBSection() in C Win32
===
I have the following code. I want to use the return of this function to create one .bmp file, can somebody please let me?
Thank you
hBitmap = CreateDIBSection(
hDCBits, // handle of device context
(BITMAPINFO *)&zWinGHeader, // address of structure containing
// bitmap size, format and color data
DIB_RGB_COLORS, // color data type indicator: RGB values
// or palette indices
&pWinGBits, // pointer to variable to receive a pointer
// to the bitmap's bit values
NULL, // optional handle to a file mapping object
0 // offset to the bitmap bit values within
// the file mapping object
); | 0 |
10,707,990 | 05/22/2012 18:35:49 | 489,041 | 10/27/2010 15:34:54 | 2,870 | 95 | Can not deploy Java Web Service to Glassfish | I am trying to deploy a simple web service to Glassfish. Here is the web service class:
import com.dv.testrunner.extended.Task;
import com.medallion.etl.exception.StepExecutionException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
/**
*
* @author dvargo
*/
@WebService(serviceName = "Execute")
public class Execute
{
/**
* Web service operation
*/
@WebMethod(operationName = "executeTask")
public boolean executeTask(@WebParam(name = "task") Task task)
{
boolean setUp = task.setUp();
boolean execute;
try
{
execute = task.execute();
}
catch (StepExecutionException ex)
{
Logger.getLogger(Execute.class.getName()).log(Level.SEVERE, null, ex);
return false;
}
return setUp && execute;
}
}
Task is a simple interface. Here is the interface:
package com.dv.testrunner.extended;
import com.medallion.etl.exception.StepExecutionException;
/**
*
* @author dvargo
*/
public interface Task
{
public boolean execute() throws StepExecutionException;
public boolean setUp();
}
When I try to deploy my web service via Netbeans, I get the following error:
<pre>
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: Servlet web service endpoint '' failure
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:138)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:294)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:462)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:382)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:459)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:209)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:238)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:680)
</pre>
Does anyone have any ideas on what is happening and how I may fix it? Is it that I can not use Task as a parameter? | java | web-services | netbeans | glassfish | jax-ws | null | open | Can not deploy Java Web Service to Glassfish
===
I am trying to deploy a simple web service to Glassfish. Here is the web service class:
import com.dv.testrunner.extended.Task;
import com.medallion.etl.exception.StepExecutionException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
/**
*
* @author dvargo
*/
@WebService(serviceName = "Execute")
public class Execute
{
/**
* Web service operation
*/
@WebMethod(operationName = "executeTask")
public boolean executeTask(@WebParam(name = "task") Task task)
{
boolean setUp = task.setUp();
boolean execute;
try
{
execute = task.execute();
}
catch (StepExecutionException ex)
{
Logger.getLogger(Execute.class.getName()).log(Level.SEVERE, null, ex);
return false;
}
return setUp && execute;
}
}
Task is a simple interface. Here is the interface:
package com.dv.testrunner.extended;
import com.medallion.etl.exception.StepExecutionException;
/**
*
* @author dvargo
*/
public interface Task
{
public boolean execute() throws StepExecutionException;
public boolean setUp();
}
When I try to deploy my web service via Netbeans, I get the following error:
<pre>
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: Servlet web service endpoint '' failure
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:138)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:294)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:462)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:382)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:459)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:209)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:238)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:680)
</pre>
Does anyone have any ideas on what is happening and how I may fix it? Is it that I can not use Task as a parameter? | 0 |
10,292,659 | 04/24/2012 06:17:32 | 1,352,960 | 04/24/2012 06:15:48 | 1 | 0 | reading in a file separated by bars c++ | I am trying trying to read in a file in C++ where the characters are separated by bars "|",
what is the best way to do that?
Thanks | c++ | file-io | null | null | null | 07/06/2012 22:23:22 | not a real question | reading in a file separated by bars c++
===
I am trying trying to read in a file in C++ where the characters are separated by bars "|",
what is the best way to do that?
Thanks | 1 |
8,467,369 | 12/11/2011 20:53:21 | 1,091,627 | 12/10/2011 20:28:12 | 1 | 0 | Whats wrong with my java program? | I don't know whats wrong with my java program and don't know why it won't compile:
import java.util.Scanner;
/* Design, build and test a program to input the number of workers followed by their name, hours worked, hourly rate of pay, overtime rate of pay, status (married or single) for each. The main program must use separate methods and appropriate parameters. Suggested methods include:
calculate the gross pay (overtime rate is paid for any number of hours above 40);
calculate the amount of tax paid (25% if married and 30% if single);
display all the details as a payslip on the computer screen. */
class morePay
{
public static double calculateGrossPay (double grossPay, double hours)
{
return (grossPay * hours);
}
public static double calculateTaxPaid (double amount, double taxPaid)
{
return (amount * taxPaid);
}
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
int numberOfWorkers, regular, overtime;
double hours, grossPay, hourlyRate, overtimeRateOfPay, finalPay;
double taxPaid = 30;
double onePercent = 0.01;
String name, marriedOrSingle, whichHoursWorked;
finalPay = 0.0;
regular = 0.0;
overtime = 0.0;
System.out.print("Please input the number of workers ");
numberOfWorkers = input.nextInt();
System.out.print("Please input the employee's name ");
name = input.next();
System.out.print("Please input the hours that the employee has worked for ");
hours = input.nextDouble();
System.out.print("Please input the employee's gross pay ");
grossPay = input.nextDouble();
System.out.println("Please input the employee's hourly rate ");
hourlyRate = input.nextDouble();
System.out.print("Please input the employee's overtime rate of pay ");
overtimeRateOfPay = input.nextDouble();
System.out.print("Please input whether the employee is married or single ");
marriedOrSingle = input.next();
if (overtimeRateOfPay >= 40)
{
System.out.println("overtime hours");
overtime++;
else
System.out.println("regular hours");
regular++;
}
grossPay = calculateGrossPay(grossPay, hours);
overtimeRateOfPay = hourlyRate * overtimeRateOfPay;
if (marriedOrSingle.equals("married") || marriedOrSingle.equals("Married"))
{
onePercent = (grossPay/100);
taxPaid = (onePercent * 25);
finalPay = ((overtimeRateOfPay * hourlyRate) - taxPaid);
}
if (marriedOrSingle.equals("single") || marriedOrSingle.equals("Single"))
{
onePercent = (grossPay/100);
taxPaid = (onePercent * 30);
finalPay = ((overtimeRateOfPay * hourlyRate) - taxPaid);
}
System.out.println("the number of workers = " + numberOfWorkers);
System.out.println("employee's name = " + name);
System.out.println("the hours that the employee have worked for = " + hours);
System.out.println("the employee's gross pay = " + grossPay);
System.out.println("the employee's hourly rate = " + hourlyRate);
System.out.println("the employee's over time rate of pay = " + overtimeRateOfPay);
System.out.println("employee's status (whether the employee is married or single) = " + marriedOrSingle);
System.out.println("employee's final pay = \u0153" + finalPay);
}
}
This is the error that it is giving me:
morePay.java:59: error: 'else' without 'if'
else
^
1 error
Please tell what I need to alter?
thanks | java | null | null | null | null | 12/11/2011 21:18:40 | too localized | Whats wrong with my java program?
===
I don't know whats wrong with my java program and don't know why it won't compile:
import java.util.Scanner;
/* Design, build and test a program to input the number of workers followed by their name, hours worked, hourly rate of pay, overtime rate of pay, status (married or single) for each. The main program must use separate methods and appropriate parameters. Suggested methods include:
calculate the gross pay (overtime rate is paid for any number of hours above 40);
calculate the amount of tax paid (25% if married and 30% if single);
display all the details as a payslip on the computer screen. */
class morePay
{
public static double calculateGrossPay (double grossPay, double hours)
{
return (grossPay * hours);
}
public static double calculateTaxPaid (double amount, double taxPaid)
{
return (amount * taxPaid);
}
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
int numberOfWorkers, regular, overtime;
double hours, grossPay, hourlyRate, overtimeRateOfPay, finalPay;
double taxPaid = 30;
double onePercent = 0.01;
String name, marriedOrSingle, whichHoursWorked;
finalPay = 0.0;
regular = 0.0;
overtime = 0.0;
System.out.print("Please input the number of workers ");
numberOfWorkers = input.nextInt();
System.out.print("Please input the employee's name ");
name = input.next();
System.out.print("Please input the hours that the employee has worked for ");
hours = input.nextDouble();
System.out.print("Please input the employee's gross pay ");
grossPay = input.nextDouble();
System.out.println("Please input the employee's hourly rate ");
hourlyRate = input.nextDouble();
System.out.print("Please input the employee's overtime rate of pay ");
overtimeRateOfPay = input.nextDouble();
System.out.print("Please input whether the employee is married or single ");
marriedOrSingle = input.next();
if (overtimeRateOfPay >= 40)
{
System.out.println("overtime hours");
overtime++;
else
System.out.println("regular hours");
regular++;
}
grossPay = calculateGrossPay(grossPay, hours);
overtimeRateOfPay = hourlyRate * overtimeRateOfPay;
if (marriedOrSingle.equals("married") || marriedOrSingle.equals("Married"))
{
onePercent = (grossPay/100);
taxPaid = (onePercent * 25);
finalPay = ((overtimeRateOfPay * hourlyRate) - taxPaid);
}
if (marriedOrSingle.equals("single") || marriedOrSingle.equals("Single"))
{
onePercent = (grossPay/100);
taxPaid = (onePercent * 30);
finalPay = ((overtimeRateOfPay * hourlyRate) - taxPaid);
}
System.out.println("the number of workers = " + numberOfWorkers);
System.out.println("employee's name = " + name);
System.out.println("the hours that the employee have worked for = " + hours);
System.out.println("the employee's gross pay = " + grossPay);
System.out.println("the employee's hourly rate = " + hourlyRate);
System.out.println("the employee's over time rate of pay = " + overtimeRateOfPay);
System.out.println("employee's status (whether the employee is married or single) = " + marriedOrSingle);
System.out.println("employee's final pay = \u0153" + finalPay);
}
}
This is the error that it is giving me:
morePay.java:59: error: 'else' without 'if'
else
^
1 error
Please tell what I need to alter?
thanks | 3 |
6,714,472 | 07/16/2011 00:31:18 | 681,904 | 03/29/2011 10:59:45 | 24 | 0 | cover list to string then back it to list [ Python] | i got problem it's about covering from List to String to edit it
i have file text content these name
Roby
Bucky
johan
then i want to add beside each one `OK:1`
so i do this code
Names='a.txt' # here is the names
O=open(Names,'r') # we open the file content the names
iamList=O.readlines() # read the name it would be List !
imSting=str(iamList) # conver it to string
Edit=imSting.replace(r"\n","Ok:1") # Editng by adding
noname=Edit
noname=noname.split()
for PT in noname:
PT.strip('[')
print PT
and i got this result
`['RobyOk:1',
'BuckyOk:1',
'johan']`
i want to delete these thing `[ , ' `
i tried `strip` and `replace('[','')`
any ideas ? | python | edit | strip | null | null | null | open | cover list to string then back it to list [ Python]
===
i got problem it's about covering from List to String to edit it
i have file text content these name
Roby
Bucky
johan
then i want to add beside each one `OK:1`
so i do this code
Names='a.txt' # here is the names
O=open(Names,'r') # we open the file content the names
iamList=O.readlines() # read the name it would be List !
imSting=str(iamList) # conver it to string
Edit=imSting.replace(r"\n","Ok:1") # Editng by adding
noname=Edit
noname=noname.split()
for PT in noname:
PT.strip('[')
print PT
and i got this result
`['RobyOk:1',
'BuckyOk:1',
'johan']`
i want to delete these thing `[ , ' `
i tried `strip` and `replace('[','')`
any ideas ? | 0 |
8,978,395 | 01/23/2012 20:53:29 | 1,036,513 | 11/08/2011 21:43:31 | 3 | 0 | App downloaded but not showing | I am a developer for a mobile apps company and we have put a .ipa file up on our website for our clients to download and test. One of the testers said that the app downloaded and showed the blue progress bar and "Installing," but it never showed up on her home screen. Her device is included in the provisioning profile and I tested the same type of download and it worked for me. The only thing I've found on the subject thus far is to restart the device and it "magically appears." What else can I do to help remotely, other than send her the .ipa? | iphone | ios | download | iphone-provisioning | null | 01/27/2012 13:49:57 | too localized | App downloaded but not showing
===
I am a developer for a mobile apps company and we have put a .ipa file up on our website for our clients to download and test. One of the testers said that the app downloaded and showed the blue progress bar and "Installing," but it never showed up on her home screen. Her device is included in the provisioning profile and I tested the same type of download and it worked for me. The only thing I've found on the subject thus far is to restart the device and it "magically appears." What else can I do to help remotely, other than send her the .ipa? | 3 |
7,618,752 | 10/01/2011 07:02:11 | 924,353 | 09/01/2011 22:36:53 | 239 | 0 | Not worked true tooltp box in jQuery | Not know why tooltip box(class `.show_tooltip`) there is left when mouse enter on `li a`, i want display each tooltip box top same link that mouse is enter on it and if the width and height was more or less it is same style.(i want links put in right and please do not change my html code) **[DEMO][1]**
I want example this (for `how`): what do i do?
![enter image description here][2]
These codes are example from originally my code, i on originally code in tooltip box use from long html code no a text low.
**CSS:**
.show_tooltip{
background-color: #E5F4FE;
display: none;
padding: 5px 10px;
border: #5A5959 1px solid;
position: absolute;
z-index: 9999;
color: #0C0C0C;
/*margin: 0 0 0 0;
top: 0;
bottom: 0;*/
}
<p>
**HTML:**
<ul>
<li>
<div class="show_tooltip">
put returns between paragraphs
</div>
<a href="#">about</a>
</li>
<li>
<div class="show_tooltip">
for linebreak add 2 spaces at end
</div>
<a href="#">how</a>
</li>
</ul>
<p>
**jQuery:**
$("li a").mouseenter(function(){
$(this).prev().fadeIn();
}).mousemove(function(e) {
$('.tooltip').css('bottom', e.pageY - 10);
$('.tooltip').css('right', e.pageX + 10);
}).mouseout(function(){
$(this).prev().fadeOut();
})
[1]: http://jsfiddle.net/AQh6y/3/
[2]: http://i.stack.imgur.com/5KGQC.gif | javascript | jquery | css | null | null | null | open | Not worked true tooltp box in jQuery
===
Not know why tooltip box(class `.show_tooltip`) there is left when mouse enter on `li a`, i want display each tooltip box top same link that mouse is enter on it and if the width and height was more or less it is same style.(i want links put in right and please do not change my html code) **[DEMO][1]**
I want example this (for `how`): what do i do?
![enter image description here][2]
These codes are example from originally my code, i on originally code in tooltip box use from long html code no a text low.
**CSS:**
.show_tooltip{
background-color: #E5F4FE;
display: none;
padding: 5px 10px;
border: #5A5959 1px solid;
position: absolute;
z-index: 9999;
color: #0C0C0C;
/*margin: 0 0 0 0;
top: 0;
bottom: 0;*/
}
<p>
**HTML:**
<ul>
<li>
<div class="show_tooltip">
put returns between paragraphs
</div>
<a href="#">about</a>
</li>
<li>
<div class="show_tooltip">
for linebreak add 2 spaces at end
</div>
<a href="#">how</a>
</li>
</ul>
<p>
**jQuery:**
$("li a").mouseenter(function(){
$(this).prev().fadeIn();
}).mousemove(function(e) {
$('.tooltip').css('bottom', e.pageY - 10);
$('.tooltip').css('right', e.pageX + 10);
}).mouseout(function(){
$(this).prev().fadeOut();
})
[1]: http://jsfiddle.net/AQh6y/3/
[2]: http://i.stack.imgur.com/5KGQC.gif | 0 |
38,360 | 09/01/2008 20:07:42 | 905 | 08/10/2008 09:37:14 | 3,048 | 200 | Can you recommend an alternative for NCover? | I'm looking for a good .Net code coverage alternative to NCover (insufficient .Net 3.5 coverage and now pay-for) or VSTS (way too expensive).
We currently test with NUnit, but could switch to something with a similar 'layout' for its text fixtures if it were better integrated. | .net | code-coverage | null | null | null | 06/11/2012 08:31:39 | not constructive | Can you recommend an alternative for NCover?
===
I'm looking for a good .Net code coverage alternative to NCover (insufficient .Net 3.5 coverage and now pay-for) or VSTS (way too expensive).
We currently test with NUnit, but could switch to something with a similar 'layout' for its text fixtures if it were better integrated. | 4 |
828,455 | 05/06/2009 07:40:33 | 100,240 | 05/03/2009 12:46:50 | 1 | 1 | rails windows problem | I just installed ruby on rails on windows.
install mysql and created a new project. Then I changed database.yml to use my own mysql server as follow
development:
adapter: mysql
database: mytools
username: test
password: test
when I try to access story controller(http://localhost:3000/stories), error shows
"SQLite3::SQLException: no such table: stories: SELECT * FROM "stories" "
Why am I getting this error? I am not using mysql... | ruby | on | rails | mysql | null | null | open | rails windows problem
===
I just installed ruby on rails on windows.
install mysql and created a new project. Then I changed database.yml to use my own mysql server as follow
development:
adapter: mysql
database: mytools
username: test
password: test
when I try to access story controller(http://localhost:3000/stories), error shows
"SQLite3::SQLException: no such table: stories: SELECT * FROM "stories" "
Why am I getting this error? I am not using mysql... | 0 |
6,801,390 | 07/23/2011 15:28:48 | 335,355 | 05/07/2010 10:49:54 | 647 | 10 | How do I debug "INT_MAX undeclared" | `printf(INT_MAX);`
limits.h is included, for some reason it's not working in this particular project. In my testbed, it just works. I have no idea how to approach this problem other than removing every single file in the entire project until it starts working. This would be an inhuman amount of work. How can I find this bug faster? What are common causes of this? | c | debugging | preprocessor | null | null | 03/29/2012 12:45:40 | too localized | How do I debug "INT_MAX undeclared"
===
`printf(INT_MAX);`
limits.h is included, for some reason it's not working in this particular project. In my testbed, it just works. I have no idea how to approach this problem other than removing every single file in the entire project until it starts working. This would be an inhuman amount of work. How can I find this bug faster? What are common causes of this? | 3 |
11,428,521 | 07/11/2012 08:27:38 | 969,113 | 09/28/2011 12:55:06 | 57 | 0 | Linear Model Overfit due to too many Covariates? | my study design involves a control and 2 test groups plus some covariates.
Each group consists of around 20 observations. In total I look at around a 1000 variables.
I created a linear model using the lm function in R including 2 covariates. After that
I thought I include another covariate because doing a PCA plot earlier showed a slight effect on that covariate. However, after adding this covariate to the model 50% of the significant hits are now different. I was actually assuming that it would pretty much identical as the effect was hardly seen in the PCA.
Could it be that I have overfitted the model? Or is the effect simple just not shown in the PCA plot but is there?
I just compared the two models using anova(lm1, lm2) and the p-val is significant which I think means that the third covariate adds significant information to the model?
lm1 <- lm(var ~ factor_of_interest + cov1 + cov2)
lm2 <- lm(var ~ factor_of_interest + cov1 + cov2 + cov3)
anova(lm1, lm2)
Best
Jacky | r | lm | anova | null | null | 07/11/2012 11:05:30 | off topic | Linear Model Overfit due to too many Covariates?
===
my study design involves a control and 2 test groups plus some covariates.
Each group consists of around 20 observations. In total I look at around a 1000 variables.
I created a linear model using the lm function in R including 2 covariates. After that
I thought I include another covariate because doing a PCA plot earlier showed a slight effect on that covariate. However, after adding this covariate to the model 50% of the significant hits are now different. I was actually assuming that it would pretty much identical as the effect was hardly seen in the PCA.
Could it be that I have overfitted the model? Or is the effect simple just not shown in the PCA plot but is there?
I just compared the two models using anova(lm1, lm2) and the p-val is significant which I think means that the third covariate adds significant information to the model?
lm1 <- lm(var ~ factor_of_interest + cov1 + cov2)
lm2 <- lm(var ~ factor_of_interest + cov1 + cov2 + cov3)
anova(lm1, lm2)
Best
Jacky | 2 |
6,055,583 | 05/19/2011 08:01:30 | 550,889 | 12/22/2010 06:50:34 | 62 | 1 | How do i mask images on hover ? | I have 9 images aligned in 3 rows. Each row has 3 images.The images popup on hover. Except the image which popups the rest of images should be darkened. Since i have yellow background if i try to reduce opacity of the images , the images appear dim yellow . So i can't reduce opacity. Any other solution . Please help
| javascript | jquery | html | css | null | null | open | How do i mask images on hover ?
===
I have 9 images aligned in 3 rows. Each row has 3 images.The images popup on hover. Except the image which popups the rest of images should be darkened. Since i have yellow background if i try to reduce opacity of the images , the images appear dim yellow . So i can't reduce opacity. Any other solution . Please help
| 0 |
9,329,736 | 02/17/2012 14:11:57 | 234,270 | 12/18/2009 01:54:58 | 1,245 | 38 | DjangoAppEngine and Eventual Consistency Problems on the High Replication Datastore | I am using djangoappengine and I think have run into some problems with the way it handles eventual consistency on the high application datastore.
First, entity groups are not even implemented in djangoappengine.
Second, I think that when you do a djangoappengine get(), it is really doing an app engine query in the background, which are only eventually consistent. Therefore, you cannot even assume consistency using keys.
Assuming those two statements are true (and I think they are), how does one build an app of any complexity using djangoappengine on the high replication datastore? Every time you save a value and then try to get the same value, there is no guarantee that it will be the same. | google-app-engine | django-nonrel | djangoappengine | eventual-consistency | null | null | open | DjangoAppEngine and Eventual Consistency Problems on the High Replication Datastore
===
I am using djangoappengine and I think have run into some problems with the way it handles eventual consistency on the high application datastore.
First, entity groups are not even implemented in djangoappengine.
Second, I think that when you do a djangoappengine get(), it is really doing an app engine query in the background, which are only eventually consistent. Therefore, you cannot even assume consistency using keys.
Assuming those two statements are true (and I think they are), how does one build an app of any complexity using djangoappengine on the high replication datastore? Every time you save a value and then try to get the same value, there is no guarantee that it will be the same. | 0 |
8,711,381 | 01/03/2012 11:10:14 | 1,127,642 | 01/03/2012 10:46:19 | 1 | 0 | i cant understand this error, NullPointerException | I am making my first little gui, is a order and costummer IS just for training java. I get this errorcode when i try to add an article to an hashmap through my controller klass.
i understand there is something that is returning Null but why.
line 94 is at controller.addArtikel(nyttArtikelnr, nyttNamn, nyttInpris, nyttUtpris);
<i>
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at NyArtikelWindow.btnSpara_actionPerformed(NyArtikelWindow.java:94)
at NyArtikelWindow$1.actionPerformed(NyArtikelWindow.java:54)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
</i>
the UiController:
public class UiController {
private NyArtikelWindow nyAW;
private NyKundWindow nyKW;
private NyOrderWindow nyOW;
private VisaArtiklarWindow nyVAW;
private VisaOrdrarWindow nyVOW;
private SokKundWindow nyVSW;
private MainWindow nyMW;
private Controller controller;
public UiController(Controller newController) {
nyMW = new MainWindow(controller,this);
try {
nyAW= new NyArtikelWindow (controller, this);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
nyKW= new NyKundWindow (controller, this);
nyOW= new NyOrderWindow(controller, this);
nyVAW= new VisaArtiklarWindow(controller, this);
nyVOW = new VisaOrdrarWindow(controller, this);
nyVSW = new SokKundWindow(controller, this);
}
public void setVisibleOnMain(){
nyMW.setVisibleOn();
}
public void setVisibleOffMain() {
nyMW.setVisibleOff();
}
public void setVisibleOnKund() {
nyKW.setVisibleOn();
}
public void setVisibleOnArtikel() {
nyAW.setVisibleOn();
}
public void setVisibleOnOrder() {
nyOW.setVisibleOn();
}
public void setVisibleOnVisaArtikel() {
nyVAW.setVisibleOn();
}
public void setVisibleOnVisaOrder() {
nyVOW.setVisibleOn();
}
public void setVisibleOnSokKund() {
nyVSW.setVisibleOn();
}
}
Controller:
public class Controller {
private ArtikelReg ar;
private UiController uiController;
private KundReg kr;
private KundOrderReg or;
public Controller() {
uiController = new UiController(this);
ar = new ArtikelReg(this);
kr = new KundReg(this);
or = new KundOrderReg(this);
uiController.setVisibleOnMain();
}
public void addKund (int nyttKundnr, String nyttPersorgnr,
String nyttNamn, String nyttKontaktperson,
String nyttAdress, int nyttPostnr,
String nyttOrt, int nyttTelefonnr,
String nyttEpost) {
Kund nyKund = new Kund(nyttKundnr, nyttPersorgnr, nyttNamn, nyttKontaktperson, nyttAdress, nyttPostnr, nyttOrt, nyttTelefonnr, nyttEpost);
kr.AddKund(nyKund);
}
public Kund updateKund(int nyttKundnr, String nyttPersorgnr,
String nyttNamn, String nyttKontaktperson,
String nyttAdress, int nyttPostnr,
String nyttOrt, int nyttTelefonnr,
String nyttEpost){
Kund kund = new Kund(nyttKundnr, nyttPersorgnr, nyttNamn, nyttKontaktperson, nyttAdress, nyttPostnr, nyttOrt, nyttTelefonnr, nyttEpost);
kr.AddKund(kund);
return kund;
}
public void addArtikel(int nyttArtikelnr, String nyttNamn, double nyttInpris, double nyttUtpris) {
Artikel artikel = new Artikel(nyttArtikelnr, nyttNamn, nyttInpris, nyttUtpris);
ar.addArtikel(artikel);
}
public Artikel updateArtikel(int nyttArtikelnr, String nyttNamn, double nyttInpris, double nyttUtpris) {
Artikel artikel = new Artikel(nyttArtikelnr, nyttNamn, nyttInpris, nyttUtpris);
ar.addArtikel(artikel);
return artikel;
}
}
Make article window:
public class NyArtikelWindow extends JFrame {
private JLabel lblArtikelnummer = new JLabel();
private JTextField txtArtikelnummer = new JTextField();
private JTextField txtArtikelnamn = new JTextField();
private JTextField txtInpris = new JTextField();
private JTextField txtUtpris = new JTextField();
private JTextField txtLeverantor = new JTextField();
private JLabel lblArtikelnamn = new JLabel();
private JLabel lblInpris = new JLabel();
private JLabel lblUtpris = new JLabel();
private JLabel lblLeverantor = new JLabel();
private JButton btnSpara = new JButton();
private JButton btnAvbryt = new JButton();
private Controller controller;
private UiController uicontroller;
public NyArtikelWindow(Controller controller, UiController uiController){
this.controller = controller;
this.uicontroller = uiController;
this.getContentPane().setLayout( null );
this.setSize(new Dimension(432, 285));
this.setTitle("Ny artikel");
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
lblArtikelnummer.setText("Artikelnummer:");
lblArtikelnummer.setBounds(new Rectangle(25, 35, 75, 15));
txtArtikelnummer.setBounds(new Rectangle(105, 30, 110, 20));
lblArtikelnamn.setText("Artikelnamn:");
lblArtikelnamn.setBounds(new Rectangle(30, 80, 65, 15));
txtArtikelnamn.setBounds(new Rectangle(105, 75, 280, 20));
lblInpris.setText("Inpris:");
lblInpris.setBounds(new Rectangle(60, 160, 34, 14));
txtInpris.setBounds(new Rectangle(105, 155, 60, 20));
lblUtpris.setText("Utpris:");
lblUtpris.setBounds(new Rectangle(180, 160, 34, 14));
txtUtpris.setBounds(new Rectangle(220, 155, 60, 20));
lblLeverantor.setText("Leverantör:");
lblLeverantor.setBounds(new Rectangle(30, 115, 60, 15));
txtLeverantor.setBounds(new Rectangle(105, 110, 280, 20));
btnSpara.setText("Spara");
btnSpara.setBounds(new Rectangle(250, 215, 75, 21));
btnSpara.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
btnSpara_actionPerformed(e);
}
});
btnAvbryt.setText("Avbryt");
btnAvbryt.setBounds(new Rectangle(330, 215, 75, 21));
btnAvbryt.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
NyArtikelWindow.this.setVisible( false );
NyArtikelWindow.this.dispose();
}
});
this.getContentPane().add(btnAvbryt, null);
this.getContentPane().add(btnSpara, null);
this.getContentPane().add(txtLeverantor, null);
this.getContentPane().add(lblLeverantor, null);
this.getContentPane().add(txtUtpris, null);
this.getContentPane().add(lblUtpris, null);
this.getContentPane().add(txtInpris, null);
this.getContentPane().add(lblInpris, null);
this.getContentPane().add(txtArtikelnamn, null);
this.getContentPane().add(lblArtikelnamn, null);
this.getContentPane().add(txtArtikelnummer, null);
this.getContentPane().add(lblArtikelnummer, null);
}
public void setVisibleOn() {
setVisible(true);
}
public void btnSpara_actionPerformed(ActionEvent e) {
String Artikelnr = txtArtikelnummer.getText();
String nyttNamn = txtArtikelnamn.getText();
String Inpris = txtInpris.getText();
String Utpris = txtUtpris.getText();
int nyttArtikelnr = Integer.parseInt(Artikelnr);
double nyttInpris = Double.parseDouble(Inpris);
double nyttUtpris = Double.parseDouble(Utpris);
System.out.println(nyttArtikelnr+nyttNamn+nyttInpris+nyttUtpris);
controller.addArtikel(nyttArtikelnr, nyttNamn, nyttInpris, nyttUtpris);
txtArtikelnummer.setText(null);
}
} | java | nullpointerexception | null | null | null | 01/04/2012 13:32:46 | too localized | i cant understand this error, NullPointerException
===
I am making my first little gui, is a order and costummer IS just for training java. I get this errorcode when i try to add an article to an hashmap through my controller klass.
i understand there is something that is returning Null but why.
line 94 is at controller.addArtikel(nyttArtikelnr, nyttNamn, nyttInpris, nyttUtpris);
<i>
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at NyArtikelWindow.btnSpara_actionPerformed(NyArtikelWindow.java:94)
at NyArtikelWindow$1.actionPerformed(NyArtikelWindow.java:54)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
</i>
the UiController:
public class UiController {
private NyArtikelWindow nyAW;
private NyKundWindow nyKW;
private NyOrderWindow nyOW;
private VisaArtiklarWindow nyVAW;
private VisaOrdrarWindow nyVOW;
private SokKundWindow nyVSW;
private MainWindow nyMW;
private Controller controller;
public UiController(Controller newController) {
nyMW = new MainWindow(controller,this);
try {
nyAW= new NyArtikelWindow (controller, this);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
nyKW= new NyKundWindow (controller, this);
nyOW= new NyOrderWindow(controller, this);
nyVAW= new VisaArtiklarWindow(controller, this);
nyVOW = new VisaOrdrarWindow(controller, this);
nyVSW = new SokKundWindow(controller, this);
}
public void setVisibleOnMain(){
nyMW.setVisibleOn();
}
public void setVisibleOffMain() {
nyMW.setVisibleOff();
}
public void setVisibleOnKund() {
nyKW.setVisibleOn();
}
public void setVisibleOnArtikel() {
nyAW.setVisibleOn();
}
public void setVisibleOnOrder() {
nyOW.setVisibleOn();
}
public void setVisibleOnVisaArtikel() {
nyVAW.setVisibleOn();
}
public void setVisibleOnVisaOrder() {
nyVOW.setVisibleOn();
}
public void setVisibleOnSokKund() {
nyVSW.setVisibleOn();
}
}
Controller:
public class Controller {
private ArtikelReg ar;
private UiController uiController;
private KundReg kr;
private KundOrderReg or;
public Controller() {
uiController = new UiController(this);
ar = new ArtikelReg(this);
kr = new KundReg(this);
or = new KundOrderReg(this);
uiController.setVisibleOnMain();
}
public void addKund (int nyttKundnr, String nyttPersorgnr,
String nyttNamn, String nyttKontaktperson,
String nyttAdress, int nyttPostnr,
String nyttOrt, int nyttTelefonnr,
String nyttEpost) {
Kund nyKund = new Kund(nyttKundnr, nyttPersorgnr, nyttNamn, nyttKontaktperson, nyttAdress, nyttPostnr, nyttOrt, nyttTelefonnr, nyttEpost);
kr.AddKund(nyKund);
}
public Kund updateKund(int nyttKundnr, String nyttPersorgnr,
String nyttNamn, String nyttKontaktperson,
String nyttAdress, int nyttPostnr,
String nyttOrt, int nyttTelefonnr,
String nyttEpost){
Kund kund = new Kund(nyttKundnr, nyttPersorgnr, nyttNamn, nyttKontaktperson, nyttAdress, nyttPostnr, nyttOrt, nyttTelefonnr, nyttEpost);
kr.AddKund(kund);
return kund;
}
public void addArtikel(int nyttArtikelnr, String nyttNamn, double nyttInpris, double nyttUtpris) {
Artikel artikel = new Artikel(nyttArtikelnr, nyttNamn, nyttInpris, nyttUtpris);
ar.addArtikel(artikel);
}
public Artikel updateArtikel(int nyttArtikelnr, String nyttNamn, double nyttInpris, double nyttUtpris) {
Artikel artikel = new Artikel(nyttArtikelnr, nyttNamn, nyttInpris, nyttUtpris);
ar.addArtikel(artikel);
return artikel;
}
}
Make article window:
public class NyArtikelWindow extends JFrame {
private JLabel lblArtikelnummer = new JLabel();
private JTextField txtArtikelnummer = new JTextField();
private JTextField txtArtikelnamn = new JTextField();
private JTextField txtInpris = new JTextField();
private JTextField txtUtpris = new JTextField();
private JTextField txtLeverantor = new JTextField();
private JLabel lblArtikelnamn = new JLabel();
private JLabel lblInpris = new JLabel();
private JLabel lblUtpris = new JLabel();
private JLabel lblLeverantor = new JLabel();
private JButton btnSpara = new JButton();
private JButton btnAvbryt = new JButton();
private Controller controller;
private UiController uicontroller;
public NyArtikelWindow(Controller controller, UiController uiController){
this.controller = controller;
this.uicontroller = uiController;
this.getContentPane().setLayout( null );
this.setSize(new Dimension(432, 285));
this.setTitle("Ny artikel");
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
lblArtikelnummer.setText("Artikelnummer:");
lblArtikelnummer.setBounds(new Rectangle(25, 35, 75, 15));
txtArtikelnummer.setBounds(new Rectangle(105, 30, 110, 20));
lblArtikelnamn.setText("Artikelnamn:");
lblArtikelnamn.setBounds(new Rectangle(30, 80, 65, 15));
txtArtikelnamn.setBounds(new Rectangle(105, 75, 280, 20));
lblInpris.setText("Inpris:");
lblInpris.setBounds(new Rectangle(60, 160, 34, 14));
txtInpris.setBounds(new Rectangle(105, 155, 60, 20));
lblUtpris.setText("Utpris:");
lblUtpris.setBounds(new Rectangle(180, 160, 34, 14));
txtUtpris.setBounds(new Rectangle(220, 155, 60, 20));
lblLeverantor.setText("Leverantör:");
lblLeverantor.setBounds(new Rectangle(30, 115, 60, 15));
txtLeverantor.setBounds(new Rectangle(105, 110, 280, 20));
btnSpara.setText("Spara");
btnSpara.setBounds(new Rectangle(250, 215, 75, 21));
btnSpara.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
btnSpara_actionPerformed(e);
}
});
btnAvbryt.setText("Avbryt");
btnAvbryt.setBounds(new Rectangle(330, 215, 75, 21));
btnAvbryt.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
NyArtikelWindow.this.setVisible( false );
NyArtikelWindow.this.dispose();
}
});
this.getContentPane().add(btnAvbryt, null);
this.getContentPane().add(btnSpara, null);
this.getContentPane().add(txtLeverantor, null);
this.getContentPane().add(lblLeverantor, null);
this.getContentPane().add(txtUtpris, null);
this.getContentPane().add(lblUtpris, null);
this.getContentPane().add(txtInpris, null);
this.getContentPane().add(lblInpris, null);
this.getContentPane().add(txtArtikelnamn, null);
this.getContentPane().add(lblArtikelnamn, null);
this.getContentPane().add(txtArtikelnummer, null);
this.getContentPane().add(lblArtikelnummer, null);
}
public void setVisibleOn() {
setVisible(true);
}
public void btnSpara_actionPerformed(ActionEvent e) {
String Artikelnr = txtArtikelnummer.getText();
String nyttNamn = txtArtikelnamn.getText();
String Inpris = txtInpris.getText();
String Utpris = txtUtpris.getText();
int nyttArtikelnr = Integer.parseInt(Artikelnr);
double nyttInpris = Double.parseDouble(Inpris);
double nyttUtpris = Double.parseDouble(Utpris);
System.out.println(nyttArtikelnr+nyttNamn+nyttInpris+nyttUtpris);
controller.addArtikel(nyttArtikelnr, nyttNamn, nyttInpris, nyttUtpris);
txtArtikelnummer.setText(null);
}
} | 3 |
8,668,070 | 12/29/2011 12:48:45 | 1,121,132 | 12/29/2011 12:16:10 | 1 | 0 | custom connect my iphone app to facebook | Is there any option to make a custom login page to facebook from my app?
i know that i cant customize the default login page on the facebook SDK.
my proggramer sais that we can use it by php..
do apple will agree my app if it will have such connect like that?
My iPhone Proggramer said to me that it is possible to set up login window that send the username and password by "get" method and then connect to facebook by php facebook sdk, is it correct?
thanks alot, Ive been looking long time for an answer. | php | iphone | objective-c | facebook | facebook-connect | 12/30/2011 17:57:03 | not a real question | custom connect my iphone app to facebook
===
Is there any option to make a custom login page to facebook from my app?
i know that i cant customize the default login page on the facebook SDK.
my proggramer sais that we can use it by php..
do apple will agree my app if it will have such connect like that?
My iPhone Proggramer said to me that it is possible to set up login window that send the username and password by "get" method and then connect to facebook by php facebook sdk, is it correct?
thanks alot, Ive been looking long time for an answer. | 1 |
8,245,733 | 11/23/2011 16:31:31 | 1,054,005 | 11/18/2011 14:38:05 | 1 | 0 | In mysql what does the regex statement "...REGEXP '\w'" do or return? | In mysql what does the regex statement REGEXP '\w' do/return? Is it at all like the perl \w? | mysql | regex | null | null | null | null | open | In mysql what does the regex statement "...REGEXP '\w'" do or return?
===
In mysql what does the regex statement REGEXP '\w' do/return? Is it at all like the perl \w? | 0 |
115,328 | 09/22/2008 15:01:38 | 15,771 | 09/17/2008 12:36:35 | 47 | 0 | How can I do Databinding in c#? | I have the following class
<pre>
public class Car
{
public Name {get; set;}
}
</pre>
and I want to bind this programmatically to a text box.
How do I do that?
Shooting in the dark:
<pre>
...
Car car = new Car();
TextEdit editBox = new TextEdit();
editBox.DataBinding.Add("Name", car, "Car - Name");
...
</pre>
I get the following error "Cannot bind to the propery 'Name' on the target control.
What am I doing wrong and how should I be doing this? I am finding the databinding concept a bit difficult to grasp coming from web-development. | c# | data-binding | null | null | null | null | open | How can I do Databinding in c#?
===
I have the following class
<pre>
public class Car
{
public Name {get; set;}
}
</pre>
and I want to bind this programmatically to a text box.
How do I do that?
Shooting in the dark:
<pre>
...
Car car = new Car();
TextEdit editBox = new TextEdit();
editBox.DataBinding.Add("Name", car, "Car - Name");
...
</pre>
I get the following error "Cannot bind to the propery 'Name' on the target control.
What am I doing wrong and how should I be doing this? I am finding the databinding concept a bit difficult to grasp coming from web-development. | 0 |
8,240,968 | 11/23/2011 10:56:49 | 476,660 | 10/15/2010 08:26:15 | 403 | 18 | Sharing data between Sinatra condition and request block | I am just wondering if it is possible to have a condition that passes information to the request body once it is complete, I doubt conditions can do it and are the right place even if they could, because it implies they are to do conditional logic, however the authorisation example also redirects so it has a blur of concerns... an example would be something like:
set(:get_model) { |body| { send_to_request_body(Model.new(body)) } }
get '/something', :get_model => request.body.data do
return "model called #{@model.name}"
end
The above is all psudocode so sorry for any syntax/spelling mistakes, but the idea is I can have a condition which fetches the model and puts it into some local variable for the body to use, or do a halt with an error or something.
I am sure before/after would be a better way to do this if it can be done, however from what I have seen I would need to set that up per route, whereas with a condition I would only need to have it as an option on the request.
In ASP MVC you could do this sort of thing with filters, which is what I am ideally after, some way to configure certain routes (at the route definition) to do some work before hand and pass it into the calling block.
| ruby | sinatra | action-filter | null | null | null | open | Sharing data between Sinatra condition and request block
===
I am just wondering if it is possible to have a condition that passes information to the request body once it is complete, I doubt conditions can do it and are the right place even if they could, because it implies they are to do conditional logic, however the authorisation example also redirects so it has a blur of concerns... an example would be something like:
set(:get_model) { |body| { send_to_request_body(Model.new(body)) } }
get '/something', :get_model => request.body.data do
return "model called #{@model.name}"
end
The above is all psudocode so sorry for any syntax/spelling mistakes, but the idea is I can have a condition which fetches the model and puts it into some local variable for the body to use, or do a halt with an error or something.
I am sure before/after would be a better way to do this if it can be done, however from what I have seen I would need to set that up per route, whereas with a condition I would only need to have it as an option on the request.
In ASP MVC you could do this sort of thing with filters, which is what I am ideally after, some way to configure certain routes (at the route definition) to do some work before hand and pass it into the calling block.
| 0 |
5,943,544 | 05/09/2011 23:15:21 | 363,247 | 06/10/2010 08:47:00 | 55 | 10 | Automated Website (Files + Mysql database) backup on Linux ? | Is there a free and simple to use program to do automatic website backup ?
The program should be able to upload website files and mysql database to a remote ftp location where the backup are to be stored so that, in case the machine is broken, one can restore things.
The target system is Linux (I am using Ubunto server)
Thank you in advance. | mysql | linux | website | backup | automatic | 05/10/2011 12:33:41 | off topic | Automated Website (Files + Mysql database) backup on Linux ?
===
Is there a free and simple to use program to do automatic website backup ?
The program should be able to upload website files and mysql database to a remote ftp location where the backup are to be stored so that, in case the machine is broken, one can restore things.
The target system is Linux (I am using Ubunto server)
Thank you in advance. | 2 |
78,172 | 09/16/2008 22:59:37 | 11,688 | 09/16/2008 10:13:56 | 1 | 0 | Using C/Pthreads: do shared variables need to be volatile? | In the C programming language and Pthreads as the threading library; do variables/structures that are shared between threads need to be declared as volatile? Assuming that they might be protected by a lock or not (barriers perhaps).
Does the pthread POSIX standard have any say about this, is this compiler-dependent or neither?
| c | pthreads | multithreading | null | null | null | open | Using C/Pthreads: do shared variables need to be volatile?
===
In the C programming language and Pthreads as the threading library; do variables/structures that are shared between threads need to be declared as volatile? Assuming that they might be protected by a lock or not (barriers perhaps).
Does the pthread POSIX standard have any say about this, is this compiler-dependent or neither?
| 0 |
10,406,341 | 05/02/2012 00:47:27 | 325,419 | 04/25/2010 14:53:03 | 171 | 1 | In what situation, if we add sorted numbers as keys to a hash table, we can expect the hash to be ordered? | Is it true that in PHP, when we insert elements into a new hash table using sorted numbers as the keys, then the resulting hash will also be ordered?
So when we get the keys, they will be ordered, and `$a[0], $a[1], $a[2]` will also follow that original order? (although certainly, the keys will be that order, but the values don't have to be).
Is it true that in PHP, we can count on that? Is there no such behavior in Perl, Python, or Ruby?
| php | python | ruby | perl | hash | 05/02/2012 06:33:39 | not a real question | In what situation, if we add sorted numbers as keys to a hash table, we can expect the hash to be ordered?
===
Is it true that in PHP, when we insert elements into a new hash table using sorted numbers as the keys, then the resulting hash will also be ordered?
So when we get the keys, they will be ordered, and `$a[0], $a[1], $a[2]` will also follow that original order? (although certainly, the keys will be that order, but the values don't have to be).
Is it true that in PHP, we can count on that? Is there no such behavior in Perl, Python, or Ruby?
| 1 |
4,553,639 | 12/29/2010 11:24:28 | 350,294 | 05/25/2010 05:26:42 | 1,932 | 220 | javascript strange behaviour of jQuery .click | <br>I ahve a html file, in which I include .js file. This file contains this code:
$(document).ready(function(){
$("button.save").click(function(){
alert("payment_type_form_");
});
PlanTabs.Open("payments");
$("#payment-types-accordion").lyfAccordion();
});
All good works. But .click() doesn't. If I move this code to html `<script></script>` all good nice.<br>
I want to keep javascript code in file, not in html. How can I do it?<br>
Thank you in advance. Sorry for my english) | javascript | jquery | html | null | null | null | open | javascript strange behaviour of jQuery .click
===
<br>I ahve a html file, in which I include .js file. This file contains this code:
$(document).ready(function(){
$("button.save").click(function(){
alert("payment_type_form_");
});
PlanTabs.Open("payments");
$("#payment-types-accordion").lyfAccordion();
});
All good works. But .click() doesn't. If I move this code to html `<script></script>` all good nice.<br>
I want to keep javascript code in file, not in html. How can I do it?<br>
Thank you in advance. Sorry for my english) | 0 |
8,279,762 | 11/26/2011 16:16:49 | 985,573 | 10/08/2011 16:54:17 | 3 | 0 | I'm confuse appliying OOP in a program | First that all, I have to ask for excuse for the gramatics and english mistakes.
I have to do a program in Java with the following characteristics:
"The system will create a guest list, which will be consulted by the doorman whenever it reaches a person. The porter guests can search by name or surname. When the event ends, you can extract statistical information about assistance the event. "
The identities or objects that I have identified are: User (a class can inherit Administrator and Porter or could create it separately), Events, Guests, a class for connection to the database and the graphics.
Well, the problem is that I really do not know what the use of classes Porter, Manager, Events and Guests will be. For all that I can do it directly with the database. I mean, if I have to insert a new guest, I would do is fill the textfield (name, surname, phone, etc.) in the program and when you click Insert button, for example, the event calls the method to insert into the database data obtained from those textfield, with getText (). The same when has to check a guest arrives and the same for delete or modify guests and events.
So really need to create classes guests, events and users? what for? | oop | class | design | design-patterns | object | 11/26/2011 20:16:47 | not constructive | I'm confuse appliying OOP in a program
===
First that all, I have to ask for excuse for the gramatics and english mistakes.
I have to do a program in Java with the following characteristics:
"The system will create a guest list, which will be consulted by the doorman whenever it reaches a person. The porter guests can search by name or surname. When the event ends, you can extract statistical information about assistance the event. "
The identities or objects that I have identified are: User (a class can inherit Administrator and Porter or could create it separately), Events, Guests, a class for connection to the database and the graphics.
Well, the problem is that I really do not know what the use of classes Porter, Manager, Events and Guests will be. For all that I can do it directly with the database. I mean, if I have to insert a new guest, I would do is fill the textfield (name, surname, phone, etc.) in the program and when you click Insert button, for example, the event calls the method to insert into the database data obtained from those textfield, with getText (). The same when has to check a guest arrives and the same for delete or modify guests and events.
So really need to create classes guests, events and users? what for? | 4 |
7,167,608 | 08/23/2011 21:12:46 | 299,230 | 03/22/2010 17:29:47 | 462 | 7 | Reading javascript from xml | I have a list of strings I want to put in a XML file and include the file into the web pages. So when I do validation on client side using javascript. I can read those strings from the XML and parse it immediately.
Something like this
blabla.cshtml
<includebla> path to xml </includebla>
<script type="javascript">
read xml
parse string
</script>
The point is: I want to keep my strings in a file so the browser won't download the data again and again, but I don't know if I can reference a XML file in .cshtml and read it in javascript. Can anybody give a hint? I really appreciate it.
Thanks | javascript | xml | razor | null | null | null | open | Reading javascript from xml
===
I have a list of strings I want to put in a XML file and include the file into the web pages. So when I do validation on client side using javascript. I can read those strings from the XML and parse it immediately.
Something like this
blabla.cshtml
<includebla> path to xml </includebla>
<script type="javascript">
read xml
parse string
</script>
The point is: I want to keep my strings in a file so the browser won't download the data again and again, but I don't know if I can reference a XML file in .cshtml and read it in javascript. Can anybody give a hint? I really appreciate it.
Thanks | 0 |
5,090,902 | 02/23/2011 12:26:15 | 629,731 | 02/23/2011 07:26:35 | 1 | 1 | ImageIO.write() method and png | Why `ImageIO.write(bufferedimage_dest,"png",new File(filedest));` writes jpg (without transparency colour) file instead png? | java | image-processing | null | null | null | 06/04/2012 09:18:46 | too localized | ImageIO.write() method and png
===
Why `ImageIO.write(bufferedimage_dest,"png",new File(filedest));` writes jpg (without transparency colour) file instead png? | 3 |
7,658,049 | 10/05/2011 07:31:33 | 874,854 | 08/02/2011 14:45:17 | 3 | 0 | dynamic columns dissapears after postback | I have a gridview with some bounfields and 2 templatefield. In these two, i create dynamically usercontrols (dropdownlist, textbox). I let the user change the value of these usercontrols. The problem is when I want to get the values of the controls. After a postback, the values in boundfields are still there but my dynamic controls dissapears. I can create them again but it won't be the values changed by the user ... how can I get these values before their deletion ?
here some of my code :
in the RowDataBound event
Select Case type
Case "BooleanBis"
e.Row.Cells(2).Controls.Clear()
Dim list1 As BooleanBisList = New BooleanBisList(avant, False)
e.Row.Cells(2).Controls.Add(list1)
e.Row.Cells(4).Controls.Clear()
Dim list2 As BooleanBisList = New BooleanBisList(apres, True)
e.Row.Cells(4).Controls.Add(list2)
Case "Boolean"
e.Row.Cells(2).Controls.Clear()
Dim list3 As BooleanList = New BooleanList(avant, False)
e.Row.Cells(2).Controls.Add(list3)
e.Row.Cells(4).Controls.Clear()
Dim list4 As BooleanList = New BooleanList(apres, True)
e.Row.Cells(4).Controls.Add(list4)
End Select
In my button click event, I try to get the user control :
Case "String"
temp.ChampValeurApres =DirectCast(Tableau1.Rows(i).Cells(selectedColumn).Controls(1), TextBox).Text
but i get the error that it doesnt exist.
Could someone give me a hint plz ? | asp.net | gridview | controls | postback | null | null | open | dynamic columns dissapears after postback
===
I have a gridview with some bounfields and 2 templatefield. In these two, i create dynamically usercontrols (dropdownlist, textbox). I let the user change the value of these usercontrols. The problem is when I want to get the values of the controls. After a postback, the values in boundfields are still there but my dynamic controls dissapears. I can create them again but it won't be the values changed by the user ... how can I get these values before their deletion ?
here some of my code :
in the RowDataBound event
Select Case type
Case "BooleanBis"
e.Row.Cells(2).Controls.Clear()
Dim list1 As BooleanBisList = New BooleanBisList(avant, False)
e.Row.Cells(2).Controls.Add(list1)
e.Row.Cells(4).Controls.Clear()
Dim list2 As BooleanBisList = New BooleanBisList(apres, True)
e.Row.Cells(4).Controls.Add(list2)
Case "Boolean"
e.Row.Cells(2).Controls.Clear()
Dim list3 As BooleanList = New BooleanList(avant, False)
e.Row.Cells(2).Controls.Add(list3)
e.Row.Cells(4).Controls.Clear()
Dim list4 As BooleanList = New BooleanList(apres, True)
e.Row.Cells(4).Controls.Add(list4)
End Select
In my button click event, I try to get the user control :
Case "String"
temp.ChampValeurApres =DirectCast(Tableau1.Rows(i).Cells(selectedColumn).Controls(1), TextBox).Text
but i get the error that it doesnt exist.
Could someone give me a hint plz ? | 0 |
11,533,587 | 07/18/2012 02:42:58 | 1,533,434 | 07/18/2012 02:38:35 | 1 | 0 | Join table twice with NHibernate | I have 2 tables:
Account: AccountID, Name
Message: FromAccountID, ToAccountID, Contents
How do i join two tables to get name of the sender and receiver with Nhibernate | nhibernate | join | criteria | null | null | 07/20/2012 19:55:48 | not a real question | Join table twice with NHibernate
===
I have 2 tables:
Account: AccountID, Name
Message: FromAccountID, ToAccountID, Contents
How do i join two tables to get name of the sender and receiver with Nhibernate | 1 |
8,589,344 | 12/21/2011 11:50:46 | 577,873 | 01/16/2011 22:37:17 | 1 | 1 | Store ACL in LDAP | Can't find any docs/howto store ACL user/resource/action to LDAP. We use LDAP for athorization in access to FTP and MAIL server. It would be great to define access rights to many services in LDAP. For example:
user1 has FTP:ftp1 can do list,create,delete
user1 has DNS:test.cz can do edit mx, edit base, edit ttl
user2 has FTP:ftp1 can do list
In many cases applications have no support for these extended attributes (proftpd for limiting operations via LDAP). But idea is, that according these settings, we will generate config file for Proftpd.
I'm new to LDAP, can you point me to some documentation or is it bad idea? And ACL should be stored somewhere else? Thank You, Andrew
| ldap | acl | null | null | null | 12/22/2011 07:06:23 | off topic | Store ACL in LDAP
===
Can't find any docs/howto store ACL user/resource/action to LDAP. We use LDAP for athorization in access to FTP and MAIL server. It would be great to define access rights to many services in LDAP. For example:
user1 has FTP:ftp1 can do list,create,delete
user1 has DNS:test.cz can do edit mx, edit base, edit ttl
user2 has FTP:ftp1 can do list
In many cases applications have no support for these extended attributes (proftpd for limiting operations via LDAP). But idea is, that according these settings, we will generate config file for Proftpd.
I'm new to LDAP, can you point me to some documentation or is it bad idea? And ACL should be stored somewhere else? Thank You, Andrew
| 2 |
6,589,225 | 07/05/2011 21:41:15 | 86,263 | 04/02/2009 15:35:39 | 714 | 10 | How do twisted and multiprocessing.Process create zombies? | In python, using twisted loopingcall, multiprocessing.Process, and multiprocessing.Queue; is it possible to create a zombie process. And, if so, then how?
| python | process | twisted | multiprocessing | zombie-process | null | open | How do twisted and multiprocessing.Process create zombies?
===
In python, using twisted loopingcall, multiprocessing.Process, and multiprocessing.Queue; is it possible to create a zombie process. And, if so, then how?
| 0 |
6,454,151 | 06/23/2011 12:41:36 | 812,186 | 06/23/2011 12:28:29 | 1 | 0 | Receive anonymous users' input by web upload form or email. Any online service for that? | Are you aware of any online service or online "platform" allowing users, not previously registered, to upload pairs of picture+comment to a database?
It would be a collaborative database of picture+comment pairs.
I'm not going wiki or googlegroup, picasa or such because I'd like the user to have the least to do to participate, that is e.g.: take a picture with his phone and email it to an email to an email address. Or go to a web page with an upload form, type in a description, hit OK and that's it.
And the goal is also that it be as hassle-less to put up as possible.
Yeah I know, it can't programme itself to my requirements :) by I'm suspecting there's a tool or tool combination going a decent way through my needs.
Thanks for any info/advice!
SJA
| database | image | anonymous-users | collaborative | null | 06/23/2011 14:22:52 | off topic | Receive anonymous users' input by web upload form or email. Any online service for that?
===
Are you aware of any online service or online "platform" allowing users, not previously registered, to upload pairs of picture+comment to a database?
It would be a collaborative database of picture+comment pairs.
I'm not going wiki or googlegroup, picasa or such because I'd like the user to have the least to do to participate, that is e.g.: take a picture with his phone and email it to an email to an email address. Or go to a web page with an upload form, type in a description, hit OK and that's it.
And the goal is also that it be as hassle-less to put up as possible.
Yeah I know, it can't programme itself to my requirements :) by I'm suspecting there's a tool or tool combination going a decent way through my needs.
Thanks for any info/advice!
SJA
| 2 |
6,987,531 | 08/08/2011 19:32:25 | 884,693 | 08/08/2011 19:32:25 | 1 | 0 | How to I send an HTML string back to the browser? | How do I return an HTML document to a browser and have it display using C#? Do I have to save it on the server and do a response.redirect or what? | c# | html | string-formatting | null | null | 08/09/2011 02:52:37 | not a real question | How to I send an HTML string back to the browser?
===
How do I return an HTML document to a browser and have it display using C#? Do I have to save it on the server and do a response.redirect or what? | 1 |
10,716,536 | 05/23/2012 08:49:16 | 910,029 | 08/24/2011 16:04:43 | 10 | 0 | ASP.net Data GridView | I need to generate Data gridview just like below. All the P Cells should be textboxes and editable. I have no clue how to do it .please let me know how I can do it in C#. Thanks in advance
[enter link description here][1]
[1]: http://i48.tinypic.com/1zg3o5j.png | c# | asp.net | null | null | null | 05/23/2012 15:48:51 | not a real question | ASP.net Data GridView
===
I need to generate Data gridview just like below. All the P Cells should be textboxes and editable. I have no clue how to do it .please let me know how I can do it in C#. Thanks in advance
[enter link description here][1]
[1]: http://i48.tinypic.com/1zg3o5j.png | 1 |
6,953,071 | 08/05/2011 07:47:56 | 78,000 | 03/14/2009 06:49:33 | 367 | 15 | How can I render 3D graphics which looks like the following image? 3d watercolor rendering | I don't need the dinosaur, just the buildings with details on the buildings, but I would like the 3D graphics to take on this sort of style. Real-time.
![enter image description here][1]
[1]: http://i.stack.imgur.com/sXv2w.jpg | graphics | 3d | null | null | null | 08/05/2011 14:00:55 | off topic | How can I render 3D graphics which looks like the following image? 3d watercolor rendering
===
I don't need the dinosaur, just the buildings with details on the buildings, but I would like the 3D graphics to take on this sort of style. Real-time.
![enter image description here][1]
[1]: http://i.stack.imgur.com/sXv2w.jpg | 2 |
3,003,264 | 06/09/2010 05:24:28 | 355,063 | 06/01/2010 04:35:47 | 6 | 2 | Is it Possible to change the Default Margins of Browser through JavaScript??? | I want to change the default margins of Browser through JavaScript because I want to print the displayed document on page but the margins are different on different browser??? plz help me to change default margins of browser. | javascript | null | null | null | null | null | open | Is it Possible to change the Default Margins of Browser through JavaScript???
===
I want to change the default margins of Browser through JavaScript because I want to print the displayed document on page but the margins are different on different browser??? plz help me to change default margins of browser. | 0 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.