PostId
int64 4
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 1
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -55
461k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
21.5k
| Title
stringlengths 3
250
| BodyMarkdown
stringlengths 5
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 32
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,297,877 | 07/02/2012 16:48:53 | 16,476 | 09/17/2008 17:31:43 | 3,533 | 80 | Raphael Hit Detection | I am trying to determine when a newly created path is dragged over another path. I have tried a few things, but nothing works reliably.
onDragOver - I tried using the onDragOver event for the target path, but this seems to never get called.
getElementsByPoint() - This is very unreliable. This returns my target about 1 in 5 times.
I have a [fiddle here][1] that shows the problem.
(I realize that the offset is slightly off, but it still shows the problem.)
To see the issue, drag from the bottom line to the top. Once over the top line, a console message should be printed, but this only happens sometimes.
I would like to know the following:
1) Am I just doing it wrong?
2) Is there a way to get this to work?
3) Are there known bugs in Raphael preventing this from working?
[1]: http://jsfiddle.net/acabler/Uk765/43/ | javascript | html5 | svg | raphael | null | null | open | Raphael Hit Detection
===
I am trying to determine when a newly created path is dragged over another path. I have tried a few things, but nothing works reliably.
onDragOver - I tried using the onDragOver event for the target path, but this seems to never get called.
getElementsByPoint() - This is very unreliable. This returns my target about 1 in 5 times.
I have a [fiddle here][1] that shows the problem.
(I realize that the offset is slightly off, but it still shows the problem.)
To see the issue, drag from the bottom line to the top. Once over the top line, a console message should be printed, but this only happens sometimes.
I would like to know the following:
1) Am I just doing it wrong?
2) Is there a way to get this to work?
3) Are there known bugs in Raphael preventing this from working?
[1]: http://jsfiddle.net/acabler/Uk765/43/ | 0 |
11,594,137 | 07/21/2012 17:01:32 | 974,873 | 10/01/2011 20:56:39 | 60 | 0 | How do I display arrayList contents from resultset in Java JDBC? | So I am making a simple java project to play around with JDBC in glassfish and see how it works. The program just shows you a list of surveys and a list of questions for the survey you select. However i cant seem to display the list of questions for the survey I selected. I keep getting empty values. These are the methods I have created:
**convert the resultset to object model data values**
public JHAKSurvey findSurvey(long id) {
System.out.println("JDBC: FIND SURVEY");
Connection connection = null;
PreparedStatement ps = null;
ResultSet rs = null;
JHAKSurvey survey = null;
try {
connection = openConnection();
String query = "SELECT * FROM APP.SURVEY WHERE ID=?";
ps = connection.prepareStatement(query);
ps.setLong(1, id);
rs = ps.executeQuery();
while (rs.next()) {
survey = createSurveyFromResultSet(rs);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
closeConnection(connection);
}
return survey;
}
**private method to query the list of questions from the QUESTION table for a survey id**
private void findQuestionsBySurvey(JHAKSurvey survey){
System.out.println("JDBC: FIND QUESTIONS BY SURVEY");
Connection connection = null;
PreparedStatement ps = null;
try {
connection = openConnection();
String query = "SELECT * FROM APP.QUESTION WHERE SURVEYID=?";
ps = connection.prepareStatement(query);
ps.setLong(1, survey.getId());
ps.executeQuery(query);
} catch (Exception e) {
e.printStackTrace();
} finally {
closeConnection(connection);
}
}
**private method to convert the find the resultset list to an question object and add it to the survey object**
private void createQuestionFromResultSet(ResultSet rs, JHAKSurvey survey){
ArrayList<JHAKQuestion> qList = new ArrayList<JHAKQuestion>();
JHAKQuestion question = new JHAKQuestion();
JHAKSurvey ss = new JHAKSurvey();
//qList.add(survey.getQuestions());
try {
while (rs.next()) {
//question.setDescription(qList.toString());
question.setId(rs.getLong("ID"));
question.setDescription(rs.getString("DESCRIPTION"));
qList.add(question);
survey.setQuestions(qList);
}
System.out.println("createQuestionFromResultSet : JDBC : successful");
} catch (SQLException e) {
// TODO Auto-generated catch block
System.out.println("createQuestionFromResultSet : JDBC : fail");
e.printStackTrace();
}
}
**private method to convert a resultset to an survey object.**
private JHAKSurvey createSurveyFromResultSet(ResultSet rs){
JHAKSurvey survey = new JHAKSurvey();
Boolean active = false;
String yes;
try {
yes = rs.getString("ACTIVE");
survey.setId(rs.getLong("ID"));
survey.setTitle(rs.getString("TITLE"));
if (yes.equals(Character.toString('Y'))) {
survey.setActive(true);
} else {
survey.setActive(false);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return survey;
}
What am I missing? I also seem to get error:
cannot convert from void to JHAKQuestion
When I try the method: createQuestionFromResultSet();
Thank You | jdbc | null | null | null | null | null | open | How do I display arrayList contents from resultset in Java JDBC?
===
So I am making a simple java project to play around with JDBC in glassfish and see how it works. The program just shows you a list of surveys and a list of questions for the survey you select. However i cant seem to display the list of questions for the survey I selected. I keep getting empty values. These are the methods I have created:
**convert the resultset to object model data values**
public JHAKSurvey findSurvey(long id) {
System.out.println("JDBC: FIND SURVEY");
Connection connection = null;
PreparedStatement ps = null;
ResultSet rs = null;
JHAKSurvey survey = null;
try {
connection = openConnection();
String query = "SELECT * FROM APP.SURVEY WHERE ID=?";
ps = connection.prepareStatement(query);
ps.setLong(1, id);
rs = ps.executeQuery();
while (rs.next()) {
survey = createSurveyFromResultSet(rs);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
closeConnection(connection);
}
return survey;
}
**private method to query the list of questions from the QUESTION table for a survey id**
private void findQuestionsBySurvey(JHAKSurvey survey){
System.out.println("JDBC: FIND QUESTIONS BY SURVEY");
Connection connection = null;
PreparedStatement ps = null;
try {
connection = openConnection();
String query = "SELECT * FROM APP.QUESTION WHERE SURVEYID=?";
ps = connection.prepareStatement(query);
ps.setLong(1, survey.getId());
ps.executeQuery(query);
} catch (Exception e) {
e.printStackTrace();
} finally {
closeConnection(connection);
}
}
**private method to convert the find the resultset list to an question object and add it to the survey object**
private void createQuestionFromResultSet(ResultSet rs, JHAKSurvey survey){
ArrayList<JHAKQuestion> qList = new ArrayList<JHAKQuestion>();
JHAKQuestion question = new JHAKQuestion();
JHAKSurvey ss = new JHAKSurvey();
//qList.add(survey.getQuestions());
try {
while (rs.next()) {
//question.setDescription(qList.toString());
question.setId(rs.getLong("ID"));
question.setDescription(rs.getString("DESCRIPTION"));
qList.add(question);
survey.setQuestions(qList);
}
System.out.println("createQuestionFromResultSet : JDBC : successful");
} catch (SQLException e) {
// TODO Auto-generated catch block
System.out.println("createQuestionFromResultSet : JDBC : fail");
e.printStackTrace();
}
}
**private method to convert a resultset to an survey object.**
private JHAKSurvey createSurveyFromResultSet(ResultSet rs){
JHAKSurvey survey = new JHAKSurvey();
Boolean active = false;
String yes;
try {
yes = rs.getString("ACTIVE");
survey.setId(rs.getLong("ID"));
survey.setTitle(rs.getString("TITLE"));
if (yes.equals(Character.toString('Y'))) {
survey.setActive(true);
} else {
survey.setActive(false);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return survey;
}
What am I missing? I also seem to get error:
cannot convert from void to JHAKQuestion
When I try the method: createQuestionFromResultSet();
Thank You | 0 |
11,594,139 | 07/21/2012 17:01:50 | 1,387,298 | 05/10/2012 13:57:33 | 17 | 0 | Using swingworker to update a JProgressBar during download | Here's the problem, I'm trying to build an app that will download my school emails plus attachments (the idea being to run this on a weekly basis). Due to some projects and powerpoints, this may take a while so I decided to implement a basic GUI with two JProgressBars.
After archive-crawling StackOverflow, I think I'm starting to get the idea behind SwingWorker. Given what I have written already, I'm not sure how to implement it. If you all could help me out, I'd really appreciate it! On a sidenote, I'm using JavaMail to handle the email downloads.
private static JProgressBar totalProgress;
private static JProgressBar folderProgress;
//class variables for the progress bars upper limits and current values
public static void buildJFrame(){
//sample
totalProgress = new JProgressBar(0); //setting to zero because we don't
//know the size of the mailbox yet
}
public static void nuTotal{ //updates the 'total' JProgressBar
totalProgress = new JProgressBar(0, totalLimit); //totalLimit was updated before method call
totalProgress.setValue(0);
totalProgress.setStringPainted(true);
}
//login called from an action listener
public static void login(String u, String p){
//connect to mail server using the (u)ser and (p)assword
//find size of mailbox and update "totalLimit"
nuTotal(); //call to update totalProgress
writeEML(); //call to download messages
}
public static void writeEML(){
for(int i 0; i<sizeOfMailFolder; i++){
//code that handles downloading
totalPlusPlus();
folderPlusPlus(); //these two methods update their respective progress bars
}
}
So two problems actually, the progress bars are initialized with just a zero because the upper limit is unknown at time of GUI creation and they aren't being reinstantiated with proper values. Secondly, the JProgress bars are not being updated like they should at the bottom of the loop controlling downloads. Thanks for taking the time to read this, I appreciate it! | java | multithreading | swing | swingworker | jprogressbar | null | open | Using swingworker to update a JProgressBar during download
===
Here's the problem, I'm trying to build an app that will download my school emails plus attachments (the idea being to run this on a weekly basis). Due to some projects and powerpoints, this may take a while so I decided to implement a basic GUI with two JProgressBars.
After archive-crawling StackOverflow, I think I'm starting to get the idea behind SwingWorker. Given what I have written already, I'm not sure how to implement it. If you all could help me out, I'd really appreciate it! On a sidenote, I'm using JavaMail to handle the email downloads.
private static JProgressBar totalProgress;
private static JProgressBar folderProgress;
//class variables for the progress bars upper limits and current values
public static void buildJFrame(){
//sample
totalProgress = new JProgressBar(0); //setting to zero because we don't
//know the size of the mailbox yet
}
public static void nuTotal{ //updates the 'total' JProgressBar
totalProgress = new JProgressBar(0, totalLimit); //totalLimit was updated before method call
totalProgress.setValue(0);
totalProgress.setStringPainted(true);
}
//login called from an action listener
public static void login(String u, String p){
//connect to mail server using the (u)ser and (p)assword
//find size of mailbox and update "totalLimit"
nuTotal(); //call to update totalProgress
writeEML(); //call to download messages
}
public static void writeEML(){
for(int i 0; i<sizeOfMailFolder; i++){
//code that handles downloading
totalPlusPlus();
folderPlusPlus(); //these two methods update their respective progress bars
}
}
So two problems actually, the progress bars are initialized with just a zero because the upper limit is unknown at time of GUI creation and they aren't being reinstantiated with proper values. Secondly, the JProgress bars are not being updated like they should at the bottom of the loop controlling downloads. Thanks for taking the time to read this, I appreciate it! | 0 |
11,594,140 | 07/21/2012 17:01:51 | 1,183,979 | 02/01/2012 23:57:27 | 240 | 0 | How the static class's static method will know the caller? | Imagine I have a static class and a static method inside that. And it has to be accessed by 10 different child classes. But how the static class will know who has called it :(
It was an interview question....please rephrase it properly and answer me, I am new :( | c# | .net | c#-4.0 | static | static-methods | null | open | How the static class's static method will know the caller?
===
Imagine I have a static class and a static method inside that. And it has to be accessed by 10 different child classes. But how the static class will know who has called it :(
It was an interview question....please rephrase it properly and answer me, I am new :( | 0 |
11,594,142 | 07/21/2012 17:02:11 | 636,525 | 02/27/2011 14:33:48 | 69 | 0 | Updating an inner list using MongoDB | I have an Object
public class Object1{
public List<Object2> {get;set;}
}
public class Object2{
public Name{get;set;}
public Address{get;set;}
}
I have a feature where the user can update just one instance of Object2. So my code for saving Object2 looks like
[HttpPost]
public ActionResult SaveObject2(Object2 obj2)
{
if (obj2.Id == null){
//Add Logic
obj1.Obj2List.Add(obj2)
}
else{
// Update logic
}
}
But obj2.Id is never null.Id is of type ObjectId. How can i check for logic to see if need to insert or update ? I am using asp.net MVC 3 and Mongo DB using the official C# drivers.
Thanks
| c# | mongodb | null | null | null | null | open | Updating an inner list using MongoDB
===
I have an Object
public class Object1{
public List<Object2> {get;set;}
}
public class Object2{
public Name{get;set;}
public Address{get;set;}
}
I have a feature where the user can update just one instance of Object2. So my code for saving Object2 looks like
[HttpPost]
public ActionResult SaveObject2(Object2 obj2)
{
if (obj2.Id == null){
//Add Logic
obj1.Obj2List.Add(obj2)
}
else{
// Update logic
}
}
But obj2.Id is never null.Id is of type ObjectId. How can i check for logic to see if need to insert or update ? I am using asp.net MVC 3 and Mongo DB using the official C# drivers.
Thanks
| 0 |
11,594,143 | 07/21/2012 17:02:13 | 167,451 | 09/02/2009 19:33:03 | 1,021 | 18 | Application not Installed error when referencing Mono.Android.GoogleMaps | I am working on a new update to my app and added google maps support. I added a reference to the Mono.Android.GoogleMaps assembly. All works great, tested good on my Droid X device so I sent the .apk to beta testers. I then tried to install on my Kindle Fire (allowed unknown sources) and it failed to install. I also got a report from a beta tester that they got the same message on their Motorola Photon.
I've later learned Kindle Fire and NOOK don't have the Google Maps integration. I've already built around "location" permissions although not sure if that was required.
I just fired up a AVD for Kindle Fire per the Amazon info and tried deploying a debug build. I got this error message:
![Deploy error to Kindle Fire emulator AVD][1]
How do you suggest I proceed? If this issue IS google maps being referenced, how do you handle this so my app will run on devices without this shared library present? What do I test for in code as to when to allow features such as this?
Thanks.
[1]: http://i.stack.imgur.com/vu558.jpg | android | google-maps | monodroid | kindle-fire | xamarin | null | open | Application not Installed error when referencing Mono.Android.GoogleMaps
===
I am working on a new update to my app and added google maps support. I added a reference to the Mono.Android.GoogleMaps assembly. All works great, tested good on my Droid X device so I sent the .apk to beta testers. I then tried to install on my Kindle Fire (allowed unknown sources) and it failed to install. I also got a report from a beta tester that they got the same message on their Motorola Photon.
I've later learned Kindle Fire and NOOK don't have the Google Maps integration. I've already built around "location" permissions although not sure if that was required.
I just fired up a AVD for Kindle Fire per the Amazon info and tried deploying a debug build. I got this error message:
![Deploy error to Kindle Fire emulator AVD][1]
How do you suggest I proceed? If this issue IS google maps being referenced, how do you handle this so my app will run on devices without this shared library present? What do I test for in code as to when to allow features such as this?
Thanks.
[1]: http://i.stack.imgur.com/vu558.jpg | 0 |
11,594,146 | 07/21/2012 17:02:34 | 828,661 | 07/04/2011 19:50:32 | 30 | 0 | Android app crashing with no internet | I've just started an android app, and moving to the next page, it loads an xml file from a website in the creator. To try and remedy this crashing if it tries to load with no internet connection, I've put in a check on whether there is internet available, however, the code doesn't seem to be firing..
btn1.setOnClickListener(new OnClickListener()
{
public void onClick(View v)
{
SetPage();
}
});
private void SetPage()
{
if (isOnline() == true)
startActivity(new Intent(getApplicationContext(), PageActivity.class));
else{
NoInternet();
}
}
private void NoInternet()
{
Toast toast;
Context context = getApplicationContext();
toast = Toast.makeText(context, "No internet connection", Toast.LENGTH_SHORT);
toast.show();
}
private boolean isOnline()
{
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo[] ni = cm.getAllNetworkInfo();
if (ni != null){
for (int i = 0; i < ni.length; i++){
if (ni[i].getState() == NetworkInfo.State.CONNECTED){
return true;
}
}
}
return false;
}
I've put a breakpoint in when the "isOnline()" method is called, but it doesn't seem to be called..any reason why this is? | java | android | exception | methods | null | 07/24/2012 07:37:29 | too localized | Android app crashing with no internet
===
I've just started an android app, and moving to the next page, it loads an xml file from a website in the creator. To try and remedy this crashing if it tries to load with no internet connection, I've put in a check on whether there is internet available, however, the code doesn't seem to be firing..
btn1.setOnClickListener(new OnClickListener()
{
public void onClick(View v)
{
SetPage();
}
});
private void SetPage()
{
if (isOnline() == true)
startActivity(new Intent(getApplicationContext(), PageActivity.class));
else{
NoInternet();
}
}
private void NoInternet()
{
Toast toast;
Context context = getApplicationContext();
toast = Toast.makeText(context, "No internet connection", Toast.LENGTH_SHORT);
toast.show();
}
private boolean isOnline()
{
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo[] ni = cm.getAllNetworkInfo();
if (ni != null){
for (int i = 0; i < ni.length; i++){
if (ni[i].getState() == NetworkInfo.State.CONNECTED){
return true;
}
}
}
return false;
}
I've put a breakpoint in when the "isOnline()" method is called, but it doesn't seem to be called..any reason why this is? | 3 |
11,594,154 | 07/21/2012 17:03:50 | 1,394,586 | 05/14/2012 20:00:34 | 20 | 0 | Guide,tutorial for Joomla and a bit more information | May I ask is there any tutorial,guide website or videos that can guide me of making a template/theme from scratch using virtuemart 2.0.8 the extension for joomla?
Also do you suggest me to use Joomla with Virtuemart or Zen Cart for making an e-commerce website and I mean of making a template and theme from scratch using the CMS.html,css and jquery.
Also I a planning to add a text file into my database automatically from a ftp server every 8 hours so as to update the product prices of the site automatically.I know ith virtuemart I can do this with CSVI but is there any similar for Zen Cart?
Thank you! | joomla | virtuemart | zen-cart | null | null | null | open | Guide,tutorial for Joomla and a bit more information
===
May I ask is there any tutorial,guide website or videos that can guide me of making a template/theme from scratch using virtuemart 2.0.8 the extension for joomla?
Also do you suggest me to use Joomla with Virtuemart or Zen Cart for making an e-commerce website and I mean of making a template and theme from scratch using the CMS.html,css and jquery.
Also I a planning to add a text file into my database automatically from a ftp server every 8 hours so as to update the product prices of the site automatically.I know ith virtuemart I can do this with CSVI but is there any similar for Zen Cart?
Thank you! | 0 |
11,594,155 | 07/21/2012 17:03:50 | 187,835 | 10/11/2009 00:21:53 | 175 | 4 | Create a bordered DIV on top of an image with JQuery? | I am trying to get an effect where existing thumbnail images have a thick css border on them, INSIDE the existing image. If I just use CSS and apply a border with box-sizing set to border box, it works BUT it reduces the image the size of the border; what I need is the existing image with the wide border over it, same size, as if a layer in photoshop.
Short of creating a new image, I'd like to do it dynamically so it works on all images.
So I am trying jQuery's "wrap" method,but so far no luck, [please see this fiddle](http://jsfiddle.net/smlombardi/TBmcU/)
What am I missing here? | jquery | css3 | border | wrap | null | null | open | Create a bordered DIV on top of an image with JQuery?
===
I am trying to get an effect where existing thumbnail images have a thick css border on them, INSIDE the existing image. If I just use CSS and apply a border with box-sizing set to border box, it works BUT it reduces the image the size of the border; what I need is the existing image with the wide border over it, same size, as if a layer in photoshop.
Short of creating a new image, I'd like to do it dynamically so it works on all images.
So I am trying jQuery's "wrap" method,but so far no luck, [please see this fiddle](http://jsfiddle.net/smlombardi/TBmcU/)
What am I missing here? | 0 |
11,594,156 | 07/21/2012 17:04:44 | 802,949 | 06/17/2011 09:10:53 | 43 | 6 | Rails: Convert end midnight time to MySql time 24:00:00 | i have model which saves opening time for place. There are two attributes, begins and ends. Both attributes are defined as Time.
Begin time should be 00:00 which is start midnight. Problem is with end time. Default time_select haven't 24:00 only 23:59. So i convert 00:00 to 24:00, this is valid, 24:00 noted that is 00:00 of next day.
Ruby on Rails creates for both attributes time objects.
Start and end midnight is correctly converted as:
2000-01-01T00:00:00Z
vs
2000-01-02T00:00:00Z
But second time object i want save as 24:00:00 to database. But Rails doesn't respects if column type is TIME. It just save 00:00:00. What is bad because i don't know if it is starting or ending midnight.
I try to convert it with before_save filter. After change attribute value to string `'24:00:00'` it automatic convert to Time object again and returns 00:00:00.
Is any solution how to save to database 24:00:00 instead 00:00:00?
Thanks | ruby-on-rails | ruby-on-rails-3 | time | null | null | null | open | Rails: Convert end midnight time to MySql time 24:00:00
===
i have model which saves opening time for place. There are two attributes, begins and ends. Both attributes are defined as Time.
Begin time should be 00:00 which is start midnight. Problem is with end time. Default time_select haven't 24:00 only 23:59. So i convert 00:00 to 24:00, this is valid, 24:00 noted that is 00:00 of next day.
Ruby on Rails creates for both attributes time objects.
Start and end midnight is correctly converted as:
2000-01-01T00:00:00Z
vs
2000-01-02T00:00:00Z
But second time object i want save as 24:00:00 to database. But Rails doesn't respects if column type is TIME. It just save 00:00:00. What is bad because i don't know if it is starting or ending midnight.
I try to convert it with before_save filter. After change attribute value to string `'24:00:00'` it automatic convert to Time object again and returns 00:00:00.
Is any solution how to save to database 24:00:00 instead 00:00:00?
Thanks | 0 |
11,594,157 | 07/21/2012 17:04:51 | 1,542,954 | 07/21/2012 16:53:56 | 1 | 0 | MySQL exception - com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException | I get the error -
'Unknown column 'customerno' in 'field list' '.
But, that column exists in my customer table. Then why am I getting this exception ?
Code:
import java.sql.*;
public class Classy {
static String myQuery =
"SELECT customerno, name" +
"FROM customers;";
public static void main(String[]args)
{
String username = "cowboy";
String password = "1234567";
try
{
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/Business", username, password);
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(myQuery);
while(rs.next())
{
System.out.print(rs.getString("customerno"));
}
}catch(SQLException ex){System.out.println(ex);}
}
}
| java | mysql | exception | jdbc | null | null | open | MySQL exception - com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException
===
I get the error -
'Unknown column 'customerno' in 'field list' '.
But, that column exists in my customer table. Then why am I getting this exception ?
Code:
import java.sql.*;
public class Classy {
static String myQuery =
"SELECT customerno, name" +
"FROM customers;";
public static void main(String[]args)
{
String username = "cowboy";
String password = "1234567";
try
{
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/Business", username, password);
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(myQuery);
while(rs.next())
{
System.out.print(rs.getString("customerno"));
}
}catch(SQLException ex){System.out.println(ex);}
}
}
| 0 |
11,571,457 | 07/20/2012 00:58:27 | 1,343,096 | 04/19/2012 05:34:39 | 1,294 | 62 | "Invalid byte 1 of 1-byte UTF-8 sequence" When reading a RSS feed | My code is supra simple :
DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = db.parse("http://blog.rogermontgomery.com/feed/?cat=skaffold");
The problem is that I end with en exception:
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:684)
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:554)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1742)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.arrangeCapacity(XMLEntityScanner.java:1619)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipString(XMLEntityScanner.java:1657)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:193)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:772)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:232)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:180)
at com.skaffold.service.RogerBlogReader.read(RogerBlogReader.java:33)
[...]
I don't get it, the xml header declare the document as UTF-8, the http response is encoded in UTF-8...
Any explanations? | java | xml | null | null | null | null | open | "Invalid byte 1 of 1-byte UTF-8 sequence" When reading a RSS feed
===
My code is supra simple :
DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = db.parse("http://blog.rogermontgomery.com/feed/?cat=skaffold");
The problem is that I end with en exception:
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:684)
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:554)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1742)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.arrangeCapacity(XMLEntityScanner.java:1619)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipString(XMLEntityScanner.java:1657)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:193)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:772)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:232)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:180)
at com.skaffold.service.RogerBlogReader.read(RogerBlogReader.java:33)
[...]
I don't get it, the xml header declare the document as UTF-8, the http response is encoded in UTF-8...
Any explanations? | 0 |
11,571,458 | 07/20/2012 00:58:29 | 1,176,094 | 01/29/2012 05:33:18 | 168 | 3 | Slider not responding EFFICIENTLY to user's drag | <Slider x:Name="sliderBright" HorizontalAlignment="Left" Height="48" Margin="132,632,0,0" VerticalAlignment="Top" Width="1052" Background="#FF727272" FontSize="36" BorderBrush="#FF090505" ValueChanged="SliderValue_Changed" StepFrequency="1" TickPlacement="Inline" TickFrequency="1"/>
Hello Guys! I'm currently working on an application which allows user to adjust the brightness of the application, its a torchlight app. Anyway my slider isnt responding to the drag , i have to tap at specific location of the bar for it to proceed to the location. When dragged, it will only move 1 value(its a bar with 100 value)
I tested in a few days back and its working but after awhile of playing around , it just becomes un-drag-able anyway whats wrong with my code, i didnt do any modification to the slider :O
Thanks! | c# | xaml | windows-8 | microsoft-metro | null | null | open | Slider not responding EFFICIENTLY to user's drag
===
<Slider x:Name="sliderBright" HorizontalAlignment="Left" Height="48" Margin="132,632,0,0" VerticalAlignment="Top" Width="1052" Background="#FF727272" FontSize="36" BorderBrush="#FF090505" ValueChanged="SliderValue_Changed" StepFrequency="1" TickPlacement="Inline" TickFrequency="1"/>
Hello Guys! I'm currently working on an application which allows user to adjust the brightness of the application, its a torchlight app. Anyway my slider isnt responding to the drag , i have to tap at specific location of the bar for it to proceed to the location. When dragged, it will only move 1 value(its a bar with 100 value)
I tested in a few days back and its working but after awhile of playing around , it just becomes un-drag-able anyway whats wrong with my code, i didnt do any modification to the slider :O
Thanks! | 0 |
11,571,305 | 07/20/2012 00:35:55 | 1,535,888 | 07/18/2012 19:14:24 | 1 | 0 | loop for ggplot2 formula in r | Here is an example:
require(ggplot2)
p <- ggplot(mtcars, aes(x = wt, y=mpg)) + geom_point()
yintercept <- c(5, 12, 20, 28, 29, 40)
col <- c("red", "blue", "green", "pink", "yellow", "tan")
# for the first level yintercept, and col
p + geom_hline(aes(yintercept=5), col = "red")
I have more levels of variables as listed above, instead of writing long "+" formula, can I loop the process. Sorry for simple question. | r | loops | ggplot2 | null | null | null | open | loop for ggplot2 formula in r
===
Here is an example:
require(ggplot2)
p <- ggplot(mtcars, aes(x = wt, y=mpg)) + geom_point()
yintercept <- c(5, 12, 20, 28, 29, 40)
col <- c("red", "blue", "green", "pink", "yellow", "tan")
# for the first level yintercept, and col
p + geom_hline(aes(yintercept=5), col = "red")
I have more levels of variables as listed above, instead of writing long "+" formula, can I loop the process. Sorry for simple question. | 0 |
11,571,464 | 07/20/2012 01:00:09 | 1,235,905 | 02/27/2012 15:25:25 | 53 | 0 | Page scraping using ColdFusion | I need to create a new layout dynamically using ColdFusion by scapping the top and bottom of the page and saving as 2 different variables.
The top stops at the top until this.
[<!---googleoff: all--->]
The bottom starts at this
[<!---googleon: all--->]
until the end.
I am thinking that I can use regular expressions to do this. | regex | coldfusion | null | null | null | 07/22/2012 02:46:21 | not constructive | Page scraping using ColdFusion
===
I need to create a new layout dynamically using ColdFusion by scapping the top and bottom of the page and saving as 2 different variables.
The top stops at the top until this.
[<!---googleoff: all--->]
The bottom starts at this
[<!---googleon: all--->]
until the end.
I am thinking that I can use regular expressions to do this. | 4 |
11,571,430 | 07/20/2012 00:55:42 | 1,539,429 | 07/20/2012 00:29:27 | 1 | 0 | jquery if else statement not working | Would appreciate any help to a newbie here. I have a simple if/else if statement that for some reason only gets to the second condition, even if the third is met. I've tried adding else to the end, tried pretty much everything but still nothing. I know it's not working, because I added the alert triggers and no matter what it never gets to the third condition. What am I missing here? I've looked around a lot so I'm sorry if I'm beating a dead horse here but I couldn't find a solution. I should note that I'm trying to get the conditions on the change of a selection drop-down box. Thanks!!!
My code:
$('#table_two select:eq(6)').change(function(e){
var allDiv = $('#table_two,#table_three,#table_four');
var parBoxOne = $('#par_one').val();
var totalOne = 1 - parBoxOne;
var totalTwo = 2 - parBoxOne;
if ($(this).val() == "made_shot"){
$(allDiv).hide();
$('#score_one').val(totalOne);
$('#score_total').val($('.score_input').val());
alert('ACE!!');
}
else if ($(this).val() == 'green', 'trees', 'fairway', 'rough', 'sand' ){
$('#score_one').val(totalOne);
$('#score_total').val($('.score_input').val());
$('#table_two').hide();
$('#butt_two').html('Show stroke');
alert('triggered two');
}
else if ($(this).val() == 'other', 'penalty_water', 'penalty_ob', 'penalty_sand' ){
$('#score_one').val(totalTwo);
$('#score_total').val($('.score_input').val());
$('#table_two').hide();
alert('triggered three');
}
}); | javascript | jquery | conditions | elseif | null | null | open | jquery if else statement not working
===
Would appreciate any help to a newbie here. I have a simple if/else if statement that for some reason only gets to the second condition, even if the third is met. I've tried adding else to the end, tried pretty much everything but still nothing. I know it's not working, because I added the alert triggers and no matter what it never gets to the third condition. What am I missing here? I've looked around a lot so I'm sorry if I'm beating a dead horse here but I couldn't find a solution. I should note that I'm trying to get the conditions on the change of a selection drop-down box. Thanks!!!
My code:
$('#table_two select:eq(6)').change(function(e){
var allDiv = $('#table_two,#table_three,#table_four');
var parBoxOne = $('#par_one').val();
var totalOne = 1 - parBoxOne;
var totalTwo = 2 - parBoxOne;
if ($(this).val() == "made_shot"){
$(allDiv).hide();
$('#score_one').val(totalOne);
$('#score_total').val($('.score_input').val());
alert('ACE!!');
}
else if ($(this).val() == 'green', 'trees', 'fairway', 'rough', 'sand' ){
$('#score_one').val(totalOne);
$('#score_total').val($('.score_input').val());
$('#table_two').hide();
$('#butt_two').html('Show stroke');
alert('triggered two');
}
else if ($(this).val() == 'other', 'penalty_water', 'penalty_ob', 'penalty_sand' ){
$('#score_one').val(totalTwo);
$('#score_total').val($('.score_input').val());
$('#table_two').hide();
alert('triggered three');
}
}); | 0 |
11,571,467 | 07/20/2012 01:00:26 | 848,513 | 07/17/2011 09:01:27 | 50 | 2 | jquery background image stretches across screen | i know there are a number of plugins that can do this, i have tried a few. in the past the ones i have tried always lead to some flickering on Firefox.
The one in the link below seems to work seamlessly, but i cant seem to figure out what they are using.
if anyone can take a look, i'd appreciate it!
link: http://usa.buy2.co.il/assets/themes/Buy2Usa/pages/error.html
thanks! | jquery | jquery-plugins | null | null | null | null | open | jquery background image stretches across screen
===
i know there are a number of plugins that can do this, i have tried a few. in the past the ones i have tried always lead to some flickering on Firefox.
The one in the link below seems to work seamlessly, but i cant seem to figure out what they are using.
if anyone can take a look, i'd appreciate it!
link: http://usa.buy2.co.il/assets/themes/Buy2Usa/pages/error.html
thanks! | 0 |
11,571,471 | 07/20/2012 01:00:38 | 1,437,989 | 06/05/2012 17:39:19 | 80 | 1 | Changing background color in an NSCell cell not using NSTextFieldCell | At the Moment in my table i have four columns. Three are NSTextFieldCells and one is a custom cell using NSCell. I need to change the color of a row. I've changed color of the NSTextFieldCells but now i need to change the NSCell background color, is there a way to do that? I absolutely cannot use a NSTextFieldCell to do this one cell. | objective-c | cocoa | nscell | nstextfieldcell | null | null | open | Changing background color in an NSCell cell not using NSTextFieldCell
===
At the Moment in my table i have four columns. Three are NSTextFieldCells and one is a custom cell using NSCell. I need to change the color of a row. I've changed color of the NSTextFieldCells but now i need to change the NSCell background color, is there a way to do that? I absolutely cannot use a NSTextFieldCell to do this one cell. | 0 |
11,571,474 | 07/20/2012 01:00:53 | 253,686 | 01/19/2010 03:19:08 | 6,635 | 190 | Django's test client with multiple values for data keys | Django's [test client](https://docs.djangoproject.com/en/1.4/topics/testing/#module-django.test.client) lets you perform `POST` requests and specify request data as a `dict`.
However if I want to send data that mimics `<select multiple>` or `<input type="checkbox">` fields, I need to send multiple values for a single key in the data `dict`.
How do I do this? | django | null | null | null | null | null | open | Django's test client with multiple values for data keys
===
Django's [test client](https://docs.djangoproject.com/en/1.4/topics/testing/#module-django.test.client) lets you perform `POST` requests and specify request data as a `dict`.
However if I want to send data that mimics `<select multiple>` or `<input type="checkbox">` fields, I need to send multiple values for a single key in the data `dict`.
How do I do this? | 0 |
11,571,476 | 07/20/2012 01:01:04 | 851,835 | 07/19/2011 11:19:09 | 312 | 0 | Is it safe to use temporary object as default parameter in C++? | For example:
int StrLen(const std::string &s = "default string") {
const std::string &t = "another string"; // BTW, is this line safe?
return s.size();
}
| c++ | null | null | null | null | null | open | Is it safe to use temporary object as default parameter in C++?
===
For example:
int StrLen(const std::string &s = "default string") {
const std::string &t = "another string"; // BTW, is this line safe?
return s.size();
}
| 0 |
11,541,242 | 07/18/2012 12:21:54 | 1,422,840 | 05/29/2012 04:52:59 | 107 | 1 | EditText validation in android | Hi i developed one login form using mysql database connection through soap web services.here i validate my edittext(usernaem,password)box.dis is a basic question.but i can't develop my coding part.help me please.
my coding is:
Button login = (Button) findViewById(R.id.btn_login);
login.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
loginAction();
}
});
}
private void loginAction(){
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
EditText userName = (EditText) findViewById(R.id.tf_userName);
String user_Name = userName.getText().toString();
EditText userPassword = (EditText) findViewById(R.id.tf_password);
String user_Password = userPassword.getText().toString();
//Pass value for userName variable of the web service
PropertyInfo unameProp =new PropertyInfo();
unameProp.setName("userName");//Define the variable name in the web service method
unameProp.setValue(user_Name);//set value for userName variable
unameProp.setType(String.class);//Define the type of the variable
request.addProperty(unameProp);//Pass properties to the variable
//Pass value for Password variable of the web service
PropertyInfo passwordProp =new PropertyInfo();
passwordProp.setName("password");
passwordProp.setValue(user_Password);
passwordProp.setType(String.class);
request.addProperty(passwordProp);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try{
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
String status = response.toString();
TextView result = (TextView) findViewById(R.id.tv_status);
result.setText(response.toString());
if(status.equals("Success!"))
{
// ADD to save and read next time
String strUserName = userName.getText().toString().trim();
String strPassword = userPassword.getText().toString().trim();
if (null == strUserName || strUserName.length() == 0)
{
// showToast("Enter Your Name");
userName.setError( "username is required!" );
} else if (null == strPassword || strPassword.length() == 0)
{
// showToast("Enter Your Password");
userPassword.setError( "password is required!" );
} else
{
if (chkRememberMe.isChecked())
{
SharedPreferences loginPreferences = getSharedPreferences(SPF_NAME, Context.MODE_PRIVATE);
loginPreferences.edit().putString(USERNAME, strUserName).putString(PASSWORD, strPassword).commit();
} else
{
SharedPreferences loginPreferences = getSharedPreferences(SPF_NAME, Context.MODE_PRIVATE);
loginPreferences.edit().clear().commit();
}
Intent intent = new Intent(Login.this,HomePage.class);
intent.putExtra("username",userName.getText().toString());
startActivity(intent);
}
}
else
{
Intent i = new Intent(getApplicationContext(), Login.class);
startActivity(i);
}
}
catch(Exception e){
}
}
}
i wish to need if i clicked button means first it is validate both edittext then only it is move to next activity.please help me. | android | null | null | null | null | null | open | EditText validation in android
===
Hi i developed one login form using mysql database connection through soap web services.here i validate my edittext(usernaem,password)box.dis is a basic question.but i can't develop my coding part.help me please.
my coding is:
Button login = (Button) findViewById(R.id.btn_login);
login.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
loginAction();
}
});
}
private void loginAction(){
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
EditText userName = (EditText) findViewById(R.id.tf_userName);
String user_Name = userName.getText().toString();
EditText userPassword = (EditText) findViewById(R.id.tf_password);
String user_Password = userPassword.getText().toString();
//Pass value for userName variable of the web service
PropertyInfo unameProp =new PropertyInfo();
unameProp.setName("userName");//Define the variable name in the web service method
unameProp.setValue(user_Name);//set value for userName variable
unameProp.setType(String.class);//Define the type of the variable
request.addProperty(unameProp);//Pass properties to the variable
//Pass value for Password variable of the web service
PropertyInfo passwordProp =new PropertyInfo();
passwordProp.setName("password");
passwordProp.setValue(user_Password);
passwordProp.setType(String.class);
request.addProperty(passwordProp);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try{
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
String status = response.toString();
TextView result = (TextView) findViewById(R.id.tv_status);
result.setText(response.toString());
if(status.equals("Success!"))
{
// ADD to save and read next time
String strUserName = userName.getText().toString().trim();
String strPassword = userPassword.getText().toString().trim();
if (null == strUserName || strUserName.length() == 0)
{
// showToast("Enter Your Name");
userName.setError( "username is required!" );
} else if (null == strPassword || strPassword.length() == 0)
{
// showToast("Enter Your Password");
userPassword.setError( "password is required!" );
} else
{
if (chkRememberMe.isChecked())
{
SharedPreferences loginPreferences = getSharedPreferences(SPF_NAME, Context.MODE_PRIVATE);
loginPreferences.edit().putString(USERNAME, strUserName).putString(PASSWORD, strPassword).commit();
} else
{
SharedPreferences loginPreferences = getSharedPreferences(SPF_NAME, Context.MODE_PRIVATE);
loginPreferences.edit().clear().commit();
}
Intent intent = new Intent(Login.this,HomePage.class);
intent.putExtra("username",userName.getText().toString());
startActivity(intent);
}
}
else
{
Intent i = new Intent(getApplicationContext(), Login.class);
startActivity(i);
}
}
catch(Exception e){
}
}
}
i wish to need if i clicked button means first it is validate both edittext then only it is move to next activity.please help me. | 0 |
11,541,244 | 07/18/2012 12:22:02 | 1,289,834 | 03/24/2012 10:41:43 | 12 | 0 | Sharing Violation On path Error C# | Here is my code:
public static TextWriter twLog = null;
private int fileNo = 1;
private string line = null;
TextReader tr = new StreamReader("file_no.txt");
TextWriter tw = new StreamWriter("file_no.txt");
line = tr.ReadLine();
if(line != null){
fileNo = int.Parse(line);
twLog = new StreamWriter("log_" + line + ".txt");
}else{
twLog = new StreamWriter("log_" + fileNo.toString() + ".txt");
}
System.IO.File.WriteAllText("file_no.txt",string.Empty);
tw.WriteLine((fileNo++).ToString());
tr.Close();
tw.Close();
twLog.Close();
What i'm trying to do is just open a file with log_x.txt name and take the "x" from file_no.txt file.If file_no.txt file is empty make log file's name log_1.txt and write "fileNo + 1" to file_no.txt.After a new program starts the new log file name must be log_2.txt.But i'm getting this error and i couldn't understand what am i doing wrong.Thanks for help.
| c# | file-io | textreader | textwriter | null | null | open | Sharing Violation On path Error C#
===
Here is my code:
public static TextWriter twLog = null;
private int fileNo = 1;
private string line = null;
TextReader tr = new StreamReader("file_no.txt");
TextWriter tw = new StreamWriter("file_no.txt");
line = tr.ReadLine();
if(line != null){
fileNo = int.Parse(line);
twLog = new StreamWriter("log_" + line + ".txt");
}else{
twLog = new StreamWriter("log_" + fileNo.toString() + ".txt");
}
System.IO.File.WriteAllText("file_no.txt",string.Empty);
tw.WriteLine((fileNo++).ToString());
tr.Close();
tw.Close();
twLog.Close();
What i'm trying to do is just open a file with log_x.txt name and take the "x" from file_no.txt file.If file_no.txt file is empty make log file's name log_1.txt and write "fileNo + 1" to file_no.txt.After a new program starts the new log file name must be log_2.txt.But i'm getting this error and i couldn't understand what am i doing wrong.Thanks for help.
| 0 |
11,541,255 | 07/18/2012 12:22:58 | 1,174,382 | 01/27/2012 20:55:47 | 18 | 0 | Is it possible to use custom image in OsCommerce tep_draw_button function? | Is it possible to use custom image in OsCommerce tep_draw_button function?
<?php echo tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'triangle-1-e'tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary'); ?> | customization | oscommerce | null | null | null | null | open | Is it possible to use custom image in OsCommerce tep_draw_button function?
===
Is it possible to use custom image in OsCommerce tep_draw_button function?
<?php echo tep_draw_button(IMAGE_BUTTON_CHECKOUT, 'triangle-1-e'tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'primary'); ?> | 0 |
11,541,125 | 07/18/2012 12:14:30 | 1,241,327 | 02/29/2012 21:52:11 | 1 | 1 | Supported Screen manifest android Corona SDK | Google play not 'view' tag supported screen in android manifest made at the Corona SDK build 840. Google 'says' that the application is designed for screens of small-xlarge, although in the build.settings is written to support only small and normal size.
build.settings file:
settings =
{
android =
{
supportsScreens =
{
resizeable = false,
smallScreens = true,
normalScreens = true,
largeScreens = false,
xlargeScreens = false,
}
},
iphone =
{
plist =
{
UIAppFonts =
{
"Mail Ray Stuff.ttf"
},
CFBundleIconFile = "Icon.png",
CFBundleIconFiles = {
"Icon.png",
"[email protected]",
"Icon-72.png",
},
},
},
}
decoded AndroidManifest.xml
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="false"
android:resizeable="false"
android:xlargeScreens="false"
>
</supports-screens>
what am I doing wrong? | corona | coronasdk | null | null | null | null | open | Supported Screen manifest android Corona SDK
===
Google play not 'view' tag supported screen in android manifest made at the Corona SDK build 840. Google 'says' that the application is designed for screens of small-xlarge, although in the build.settings is written to support only small and normal size.
build.settings file:
settings =
{
android =
{
supportsScreens =
{
resizeable = false,
smallScreens = true,
normalScreens = true,
largeScreens = false,
xlargeScreens = false,
}
},
iphone =
{
plist =
{
UIAppFonts =
{
"Mail Ray Stuff.ttf"
},
CFBundleIconFile = "Icon.png",
CFBundleIconFiles = {
"Icon.png",
"[email protected]",
"Icon-72.png",
},
},
},
}
decoded AndroidManifest.xml
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="false"
android:resizeable="false"
android:xlargeScreens="false"
>
</supports-screens>
what am I doing wrong? | 0 |
11,541,262 | 07/18/2012 12:23:22 | 1,514,773 | 07/10/2012 12:28:21 | 10 | 1 | Basic query regarding bindtags in tkinter | In the given example from post "http://stackoverflow.com/questions/3501849/how-to-bind-self-events-in-tkinter-text-widget-after-it-will-binded-by-text-widg", it was mentioned that if default bindtags are used then event value will not be visible inside definiton (there will be lag by one). There was some explanation regarding class binding. I am a beginner, so would like to understand the detailed reason. Can some please explain why it was not working in first case and was working in second case (when order of bindtags is modified).
import Tkinter
def OnKeyPress(event):
value = event.widget.get()
string="value of %s is '%s'" % (event.widget._name, value)
status.configure(text=string)
root = Tkinter.Tk()
entry1 = Tkinter.Entry(root, name="entry1")
entry2 = Tkinter.Entry(root, name="entry2")
entry3 = Tkinter.Entry(root, name="entry3")
entry1.bindtags(('.entry1', 'Entry', '.', 'all'))
entry2.bindtags(('Entry', '.entry1', '.', 'all'))
entry3.bindtags(('.entry1','Entry','post-class-bindings', '.', 'all'))
btlabel1 = Tkinter.Label(text="bindtags: %s" % " ".join(entry1.bindtags()))
btlabel2 = Tkinter.Label(text="bindtags: %s" % " ".join(entry2.bindtags()))
btlabel3 = Tkinter.Label(text="bindtags: %s" % " ".join(entry3.bindtags()))
status = Tkinter.Label(anchor="w")
entry1.grid(row=0,column=0)
btlabel1.grid(row=0,column=1, padx=10, sticky="w")
entry2.grid(row=1,column=0)
btlabel2.grid(row=1,column=1, padx=10, sticky="w")
entry3.grid(row=2,column=0)
btlabel3.grid(row=2,column=1, padx=10)
status.grid(row=3, columnspan=2, sticky="w")
entry1.bind("<KeyPress>", OnKeyPress)
entry2.bind("<KeyPress>", OnKeyPress)
entry3.bind_class("post-class-bindings", "<KeyPress>", OnKeyPress)
root.mainloop()
| python | tkinter | null | null | null | null | open | Basic query regarding bindtags in tkinter
===
In the given example from post "http://stackoverflow.com/questions/3501849/how-to-bind-self-events-in-tkinter-text-widget-after-it-will-binded-by-text-widg", it was mentioned that if default bindtags are used then event value will not be visible inside definiton (there will be lag by one). There was some explanation regarding class binding. I am a beginner, so would like to understand the detailed reason. Can some please explain why it was not working in first case and was working in second case (when order of bindtags is modified).
import Tkinter
def OnKeyPress(event):
value = event.widget.get()
string="value of %s is '%s'" % (event.widget._name, value)
status.configure(text=string)
root = Tkinter.Tk()
entry1 = Tkinter.Entry(root, name="entry1")
entry2 = Tkinter.Entry(root, name="entry2")
entry3 = Tkinter.Entry(root, name="entry3")
entry1.bindtags(('.entry1', 'Entry', '.', 'all'))
entry2.bindtags(('Entry', '.entry1', '.', 'all'))
entry3.bindtags(('.entry1','Entry','post-class-bindings', '.', 'all'))
btlabel1 = Tkinter.Label(text="bindtags: %s" % " ".join(entry1.bindtags()))
btlabel2 = Tkinter.Label(text="bindtags: %s" % " ".join(entry2.bindtags()))
btlabel3 = Tkinter.Label(text="bindtags: %s" % " ".join(entry3.bindtags()))
status = Tkinter.Label(anchor="w")
entry1.grid(row=0,column=0)
btlabel1.grid(row=0,column=1, padx=10, sticky="w")
entry2.grid(row=1,column=0)
btlabel2.grid(row=1,column=1, padx=10, sticky="w")
entry3.grid(row=2,column=0)
btlabel3.grid(row=2,column=1, padx=10)
status.grid(row=3, columnspan=2, sticky="w")
entry1.bind("<KeyPress>", OnKeyPress)
entry2.bind("<KeyPress>", OnKeyPress)
entry3.bind_class("post-class-bindings", "<KeyPress>", OnKeyPress)
root.mainloop()
| 0 |
11,541,264 | 07/18/2012 12:23:27 | 1,528,573 | 07/16/2012 10:14:32 | 1 | 0 | Read large values in Excel sheet | I have large data nearly about 5,00,000 of record.I have to write it to Excel..Is it possible to read such huge amount of data in excel sheet.Are there any better ways to do so | c# | excel | null | null | null | null | open | Read large values in Excel sheet
===
I have large data nearly about 5,00,000 of record.I have to write it to Excel..Is it possible to read such huge amount of data in excel sheet.Are there any better ways to do so | 0 |
11,541,258 | 07/18/2012 12:23:04 | 852,610 | 07/19/2011 18:18:39 | 89 | 0 | link with sql consult joomla | I have this link in my website, that I create with joomla 2.5
<p class="txtC"><a class="bt-big" href="#">Find</a></p>
When I click it, I want to do a sql consult and return the result , but I have no idea, How to to that in joomla.
Any manual or idea!!!
Thanks | joomla | joomla2.5 | null | null | null | null | open | link with sql consult joomla
===
I have this link in my website, that I create with joomla 2.5
<p class="txtC"><a class="bt-big" href="#">Find</a></p>
When I click it, I want to do a sql consult and return the result , but I have no idea, How to to that in joomla.
Any manual or idea!!!
Thanks | 0 |
11,541,269 | 07/18/2012 12:23:42 | 1,534,705 | 07/18/2012 12:02:44 | 1 | 0 | Calling SQL commands for MS Access from Java is very slow the first time and much faster on subsequent runs | I'm connecting to an Access database with a jdbc:odbc bridge.
I then select a large amount of data from the database (~2 million rows).
The first time I run the code after a restart it is very slow, taking over 6 minutes to retrieve the data.
On subsequent runs, it takes only 1.5 mins to do the same thing.
This is the code I'm using to connect to the database:
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=" + databaseLocation + databaseName + ";selectMethod=cursor; READONLY=true; TYPE=FASTLOAD";
con = DriverManager.getConnection(url);
System.out.println("Connected to " + databaseName);
} catch (SQLException e) {
System.out.println("SQL Exception: " + e.toString());
} catch (ClassNotFoundException cE) {
System.out.println("Class Not Found Exception: " + cE.toString());
}
After much Googling I've tried adding parameters such as
selectMethod=cursor
READONLY=true
TYPE=FASTLOAD
As far as I can see, none of these made a difference.
I then select the data like so:
String SQL = "SELECT ADDRESS_MODEL.ADDR_LINE_1, ADDRESS_MODEL.ADDR_LINE_2, LOCALITIES.NAME, ADDRESS_MODEL.SECONDARY_LOCALITY, TLANDS.NAME, ADDRESS_MODEL.POST_TOWN, ADDRESS_MODEL.COUNTY FROM ((ADDRESS_MODEL LEFT JOIN BUILDINGS ON ADDRESS_MODEL.BUILDING_ID = BUILDINGS.BUILDING_ID) LEFT JOIN LOCALITIES ON BUILDINGS.LOCALITY_ID = LOCALITIES.LOCALITY_ID) LEFT JOIN TLANDS ON BUILDINGS.TLAND_ID = TLANDS.TLAND_ID WHERE BUILDINGS.COUNTY_ID = " + county_ID;
PreparedStatement prest = con.prepareStatement(SQL);
ResultSet result = prest.executeQuery();
I tried using a prepared statement but I'm not sure I did it right.
After storing the data I close the ResultSet:
result.close();
Later in the program, I close the connection as follows:
try{
stmt.close();
con.close();
System.out.println("Connection to " + databaseName + " closed");
} catch (SQLException e) {
System.out.println("SQL Exception: " + e.toString());
}
Unfortunately I am committed to using both Java and Access at this point.
Does anyone have any idea why it is slower the first time (or more why it is faster on subsequent runs)?
Also, are there any general things I could do better to make it faster?
Thanks for your time.
| java | sql | performance | connection | null | null | open | Calling SQL commands for MS Access from Java is very slow the first time and much faster on subsequent runs
===
I'm connecting to an Access database with a jdbc:odbc bridge.
I then select a large amount of data from the database (~2 million rows).
The first time I run the code after a restart it is very slow, taking over 6 minutes to retrieve the data.
On subsequent runs, it takes only 1.5 mins to do the same thing.
This is the code I'm using to connect to the database:
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=" + databaseLocation + databaseName + ";selectMethod=cursor; READONLY=true; TYPE=FASTLOAD";
con = DriverManager.getConnection(url);
System.out.println("Connected to " + databaseName);
} catch (SQLException e) {
System.out.println("SQL Exception: " + e.toString());
} catch (ClassNotFoundException cE) {
System.out.println("Class Not Found Exception: " + cE.toString());
}
After much Googling I've tried adding parameters such as
selectMethod=cursor
READONLY=true
TYPE=FASTLOAD
As far as I can see, none of these made a difference.
I then select the data like so:
String SQL = "SELECT ADDRESS_MODEL.ADDR_LINE_1, ADDRESS_MODEL.ADDR_LINE_2, LOCALITIES.NAME, ADDRESS_MODEL.SECONDARY_LOCALITY, TLANDS.NAME, ADDRESS_MODEL.POST_TOWN, ADDRESS_MODEL.COUNTY FROM ((ADDRESS_MODEL LEFT JOIN BUILDINGS ON ADDRESS_MODEL.BUILDING_ID = BUILDINGS.BUILDING_ID) LEFT JOIN LOCALITIES ON BUILDINGS.LOCALITY_ID = LOCALITIES.LOCALITY_ID) LEFT JOIN TLANDS ON BUILDINGS.TLAND_ID = TLANDS.TLAND_ID WHERE BUILDINGS.COUNTY_ID = " + county_ID;
PreparedStatement prest = con.prepareStatement(SQL);
ResultSet result = prest.executeQuery();
I tried using a prepared statement but I'm not sure I did it right.
After storing the data I close the ResultSet:
result.close();
Later in the program, I close the connection as follows:
try{
stmt.close();
con.close();
System.out.println("Connection to " + databaseName + " closed");
} catch (SQLException e) {
System.out.println("SQL Exception: " + e.toString());
}
Unfortunately I am committed to using both Java and Access at this point.
Does anyone have any idea why it is slower the first time (or more why it is faster on subsequent runs)?
Also, are there any general things I could do better to make it faster?
Thanks for your time.
| 0 |
11,692,944 | 07/27/2012 17:43:07 | 1,532,016 | 07/17/2012 13:56:27 | 1 | 0 | how to move an object from one array to another | I understand that this topic has been done before but I wanted to bring it up again for a specific reason, I have a function designed to move an item from one array to another, removing the item from the array it was originally in, but whenever I test it, it doesnt seem to work
-(void) moveOpperand: (NSMutableArray *) moveFrom :(NSMutableArray *) moveTo{
NSString *opperandObject = [moveFrom lastObject];
if (opperandObject) {
[moveTo addObject:moveFrom.lastObject];
[moveFrom removeLastObject];
}
}
| objective-c | nsmutablearray | null | null | null | null | open | how to move an object from one array to another
===
I understand that this topic has been done before but I wanted to bring it up again for a specific reason, I have a function designed to move an item from one array to another, removing the item from the array it was originally in, but whenever I test it, it doesnt seem to work
-(void) moveOpperand: (NSMutableArray *) moveFrom :(NSMutableArray *) moveTo{
NSString *opperandObject = [moveFrom lastObject];
if (opperandObject) {
[moveTo addObject:moveFrom.lastObject];
[moveFrom removeLastObject];
}
}
| 0 |
11,692,946 | 07/27/2012 17:43:15 | 650,519 | 03/08/2011 21:21:51 | 1 | 0 | Safari 6's New Developer Toolbar doesn't show Form Data in XHR/AJAX Requests | Safari recently went to version 6 (Lion/Mtn Lion) and they've changed over from the standard webkit dev tools to one that's much more XCode looking, my problem other than the OCD of not liking things change is that in the resource tab (or anywhere you can track down the DataService.aspx/AJAX calls) I can no longer see the form data that I am passing.
| safari | null | null | null | null | null | open | Safari 6's New Developer Toolbar doesn't show Form Data in XHR/AJAX Requests
===
Safari recently went to version 6 (Lion/Mtn Lion) and they've changed over from the standard webkit dev tools to one that's much more XCode looking, my problem other than the OCD of not liking things change is that in the resource tab (or anywhere you can track down the DataService.aspx/AJAX calls) I can no longer see the form data that I am passing.
| 0 |
11,680,798 | 07/27/2012 02:47:28 | 1,556,481 | 07/27/2012 02:30:11 | 1 | 0 | Connect two tables togather and sum the top three of a specific field on the second table to the first table | Here is the issue. I have looke through these threads for a while now and have yet to find the exact solution.
I have two tables like most question this has to do with joining the two tables. one is basicly a table with a list of runners little over 20,000 records currently the second table is a list of results for those runners it has alittle over 35000 records. The second table is actualy a view that contains all the result info plus age grades and a Rating which are generated by the view. What I need now is to combine the top three ratings per each runner. I tried this First.
SELECT r.id, r.FirstName,r.MiddleName,r.LastName,r.Age,r.Gender,r.City,r.State,
ROUND((SELECT SUM(re.Rating) rating FROM vwResults re WHERE re.runnerid = r.id ORDER BY re.Rating DESC LIMIT 3)/3,2) Rating
FROM Runners r
Unfortunitly that failed What I'm trying to do is sum the top three ratings from the results table and then devide it be 3 to get the avrage. this would be the avrage rating for that user. I have tried several diffrent variations of the code above and I did get one to work partialy but it took 8 seconds to load 30 records and the data was incorrect. Is there any way to do this so that I can create a new Runner view that has the rating built in? I would prefer not to use a procedure if at all possible. | mysql | null | null | null | null | null | open | Connect two tables togather and sum the top three of a specific field on the second table to the first table
===
Here is the issue. I have looke through these threads for a while now and have yet to find the exact solution.
I have two tables like most question this has to do with joining the two tables. one is basicly a table with a list of runners little over 20,000 records currently the second table is a list of results for those runners it has alittle over 35000 records. The second table is actualy a view that contains all the result info plus age grades and a Rating which are generated by the view. What I need now is to combine the top three ratings per each runner. I tried this First.
SELECT r.id, r.FirstName,r.MiddleName,r.LastName,r.Age,r.Gender,r.City,r.State,
ROUND((SELECT SUM(re.Rating) rating FROM vwResults re WHERE re.runnerid = r.id ORDER BY re.Rating DESC LIMIT 3)/3,2) Rating
FROM Runners r
Unfortunitly that failed What I'm trying to do is sum the top three ratings from the results table and then devide it be 3 to get the avrage. this would be the avrage rating for that user. I have tried several diffrent variations of the code above and I did get one to work partialy but it took 8 seconds to load 30 records and the data was incorrect. Is there any way to do this so that I can create a new Runner view that has the rating built in? I would prefer not to use a procedure if at all possible. | 0 |
11,692,950 | 07/27/2012 17:43:19 | 1,402,440 | 05/18/2012 04:01:52 | 1 | 0 | Create images dynamically using input parameters | I'd like to dynamically either create from scratch or update an image using some input parameters to tweak/seed the images. Lets say I have this image - http://cdn.smashingapps.com/wp-content/uploads/2009/07/patterns-mix.jpg - and I want to tweak it by making the flower size bigger or changing the color of the flower. I guess updating an existing image will be harder than creating it from group up.
I am not looking for a final solution but any pointers to the right resources will be greatly appreciated. | image | null | null | null | null | null | open | Create images dynamically using input parameters
===
I'd like to dynamically either create from scratch or update an image using some input parameters to tweak/seed the images. Lets say I have this image - http://cdn.smashingapps.com/wp-content/uploads/2009/07/patterns-mix.jpg - and I want to tweak it by making the flower size bigger or changing the color of the flower. I guess updating an existing image will be harder than creating it from group up.
I am not looking for a final solution but any pointers to the right resources will be greatly appreciated. | 0 |
11,692,952 | 07/27/2012 17:43:23 | 223,633 | 12/03/2009 08:02:48 | 3,359 | 235 | How to download lower version SDK like 1.0.0 and 1.2.0? | We are developing one bada base c++ application . We need to provide application cometibility for Bada 1.0.0, Bada 1.2.0 and Bada 2.0.x. We have successfully build and tested on Bada 2.0.x. Now we are trying to test application on 1.0 and 1.2 and application is not runing on these versions of Bada os. So, I think we need to build appication on respective 1.0 and 1.2 SDKs. We are trying to find out above SDKs to build application but we are not able to find SDK download link from web.
Can any one help on this? It is bit urgent for us.
Thanks for help in advance
Regards,
Chetan | bada | null | null | null | null | null | open | How to download lower version SDK like 1.0.0 and 1.2.0?
===
We are developing one bada base c++ application . We need to provide application cometibility for Bada 1.0.0, Bada 1.2.0 and Bada 2.0.x. We have successfully build and tested on Bada 2.0.x. Now we are trying to test application on 1.0 and 1.2 and application is not runing on these versions of Bada os. So, I think we need to build appication on respective 1.0 and 1.2 SDKs. We are trying to find out above SDKs to build application but we are not able to find SDK download link from web.
Can any one help on this? It is bit urgent for us.
Thanks for help in advance
Regards,
Chetan | 0 |
11,692,954 | 07/27/2012 17:43:28 | 1,558,297 | 07/27/2012 17:00:48 | 1 | 0 | "git does not appear to be a git repository" after remote server changes IP address | The git repository is hosted on the shared drive mounted to Linux Ubuntu. The IP address of the shared drive has changed and the environmental variable (host) has been updated accordingly. However, when push to the shard drive, I got "does not appear to be a git repository' error. Is there any reason for this and how to fix it? Thanks, | git | null | null | null | null | null | open | "git does not appear to be a git repository" after remote server changes IP address
===
The git repository is hosted on the shared drive mounted to Linux Ubuntu. The IP address of the shared drive has changed and the environmental variable (host) has been updated accordingly. However, when push to the shard drive, I got "does not appear to be a git repository' error. Is there any reason for this and how to fix it? Thanks, | 0 |
11,692,959 | 07/27/2012 17:43:53 | 489,669 | 10/28/2010 04:39:05 | 808 | 1 | URL POST not hitting isset($_POST) | I have a simple php test page as follows
<?php
if(isset($_POST['hitme']))
{
echo "hello world";
}
?>
I'm hitting this page as, `http://www.abc.com/page.php?hitme=true` but this is not echo'ing anything. Is something wrong with this?
| php | null | null | null | null | null | open | URL POST not hitting isset($_POST)
===
I have a simple php test page as follows
<?php
if(isset($_POST['hitme']))
{
echo "hello world";
}
?>
I'm hitting this page as, `http://www.abc.com/page.php?hitme=true` but this is not echo'ing anything. Is something wrong with this?
| 0 |
11,692,962 | 07/27/2012 17:43:57 | 1,558,376 | 07/27/2012 17:39:32 | 1 | 0 | How to color an image based on a dynamically changing percentage value in javascript/jquery | I have an image which i want to fill with some color based on a dynamically changing percentage value.
So, if the value is 50% half of the image should be colored.
thanks in advance. | javascript | jquery | svg | html5-canvas | null | null | open | How to color an image based on a dynamically changing percentage value in javascript/jquery
===
I have an image which i want to fill with some color based on a dynamically changing percentage value.
So, if the value is 50% half of the image should be colored.
thanks in advance. | 0 |
11,692,964 | 07/27/2012 17:44:05 | 1,558,352 | 07/27/2012 17:30:08 | 1 | 0 | insert a print on nth line after a pattern | My original requirement is to insert a print at the entry of each function. Since it is very difficult, with regular expression, I find out a partial solution, for the fulfilment of the same, I need to insert printf after my function name. and I assume it should be one line after function name. so where ever my functions definitions (here the pattern is my function name) are come, a print should come on 2nd line after that function name(first line can be the curly brace. that's why I selected second line) | sed | null | null | null | null | null | open | insert a print on nth line after a pattern
===
My original requirement is to insert a print at the entry of each function. Since it is very difficult, with regular expression, I find out a partial solution, for the fulfilment of the same, I need to insert printf after my function name. and I assume it should be one line after function name. so where ever my functions definitions (here the pattern is my function name) are come, a print should come on 2nd line after that function name(first line can be the curly brace. that's why I selected second line) | 0 |
11,692,968 | 07/27/2012 17:44:12 | 1,164,004 | 01/22/2012 22:16:30 | 49 | 3 | How can i cast between void* and boost shared ptr | I've got these lines:
typedef boost::shared_ptr<A> A_SPtr;
void *f(void* var){ ...
and i want to be able to do something like this:
A_SPtr instance = (void*)(var);
how can i do it?
Also, how can i cast the other way around meaning from the shared_ptr to void*?
| c++ | boost | casting | shared-ptr | void-pointers | null | open | How can i cast between void* and boost shared ptr
===
I've got these lines:
typedef boost::shared_ptr<A> A_SPtr;
void *f(void* var){ ...
and i want to be able to do something like this:
A_SPtr instance = (void*)(var);
how can i do it?
Also, how can i cast the other way around meaning from the shared_ptr to void*?
| 0 |
11,423,317 | 07/10/2012 23:08:23 | 1,353,199 | 04/24/2012 08:35:01 | 25 | 0 | Java Applet class file | I am attempting to do my assignment for my Intermediate Java Class. I am supposed to write this small applet and submit the .java, .class, and .html files.
I went to the .html file to see if what I have written so far would show up on the webpage, but it did now. I don't seem to have a .class file. Here is my code. I am using NetBeans.
Can someone please advise me on how to get the .class file into my folder.
/*
* Curtis Sizemore
* IT 259 - Intermediate Java
* Unit 8
* Working with Applets
* I attest that this is a product of my own creation.
*
*/
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;
/**
*
* @author Curtis
*/
public class JDivide extends JApplet implements ActionListener
{
JTextField numer = new JTextField();
JTextField denom = new JTextField();
JLabel num = new JLabel("Numerator: ");
JLabel den = new JLabel("Denominator: ");
JLabel result = new JLabel();
JButton solve = new JButton("Click Me to Solve!");
Container con = getContentPane();
@Override
public void init()
{
con.setLayout(new GridLayout(3,2));
con.add(num);
con.add(numer);
con.add(den);
con.add(denom);
}
@Override
public void actionPerformed(ActionEvent e)
{
throw new UnsupportedOperationException("Not supported yet.");
}
}
| java | homework | class | applet | null | null | open | Java Applet class file
===
I am attempting to do my assignment for my Intermediate Java Class. I am supposed to write this small applet and submit the .java, .class, and .html files.
I went to the .html file to see if what I have written so far would show up on the webpage, but it did now. I don't seem to have a .class file. Here is my code. I am using NetBeans.
Can someone please advise me on how to get the .class file into my folder.
/*
* Curtis Sizemore
* IT 259 - Intermediate Java
* Unit 8
* Working with Applets
* I attest that this is a product of my own creation.
*
*/
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;
/**
*
* @author Curtis
*/
public class JDivide extends JApplet implements ActionListener
{
JTextField numer = new JTextField();
JTextField denom = new JTextField();
JLabel num = new JLabel("Numerator: ");
JLabel den = new JLabel("Denominator: ");
JLabel result = new JLabel();
JButton solve = new JButton("Click Me to Solve!");
Container con = getContentPane();
@Override
public void init()
{
con.setLayout(new GridLayout(3,2));
con.add(num);
con.add(numer);
con.add(den);
con.add(denom);
}
@Override
public void actionPerformed(ActionEvent e)
{
throw new UnsupportedOperationException("Not supported yet.");
}
}
| 0 |
11,423,318 | 07/10/2012 23:08:25 | 1,313,296 | 04/04/2012 15:56:29 | 129 | 4 | I am creating a class that generate sql queries. Am i doing it right? | I am creating a class (Datamap) that will help me simplify my queries in my model class. Basically, this class(Datamap) is use in conjunction with my db class.
Previously for an insert statement in my model i need.
$db->query("INSERT INTO test(id,name) VALUES("id","name")");
Now, with the Datamap class, it will be like
$datamap->create("test","id=id&name=name");
Below is snippet code from the Datamap class that i created.
function create($tablename,$variables){
$id=0;
$tbl = $this->creturnval($variables);
$tblVal = $tbl[0];
$tblData = $tbl[1];
$this->db->execute("INSERT into $tablename($tblVal) VALUES($tblData);");
$id = $this->db->lastInsertedId();
return $id;
}
function creturnval($variables){
$vars = explode("&",$variables);
$count = sizeOf($vars);
$tblVal = "";
$tblData = "";
for($i=0;$i<$count;$i++){
$d = explode("=",$vars[$i]);
$tblVal.= $d[0].",";
$tblData.= "'".$d[1]."'".",";
}
$tblVal = rtrim($tblVal, ',');
$tblData = rtrim($tblData, ',');
$return[0] = $tblVal;
$return[1] = $tblData;
return $return;
}
My concern is actually the performance issue. Previously in my model class, if i just used $db->query(), it seems to be faster because i do not have to go through 2 functions.
Now, in order to do an insert, i will need to parse the variables, split & etc, then process it.
My idea of using this Datamap class is actually to provide more maintainability and standardization. This is to prevent all my model classes from having sql statements over the place which looks untidy.
Do you think this will pose a possible performance issue?
PS: I am using my own framework that i build for my web application
Appreciate all advices | php | sql | data | null | null | null | open | I am creating a class that generate sql queries. Am i doing it right?
===
I am creating a class (Datamap) that will help me simplify my queries in my model class. Basically, this class(Datamap) is use in conjunction with my db class.
Previously for an insert statement in my model i need.
$db->query("INSERT INTO test(id,name) VALUES("id","name")");
Now, with the Datamap class, it will be like
$datamap->create("test","id=id&name=name");
Below is snippet code from the Datamap class that i created.
function create($tablename,$variables){
$id=0;
$tbl = $this->creturnval($variables);
$tblVal = $tbl[0];
$tblData = $tbl[1];
$this->db->execute("INSERT into $tablename($tblVal) VALUES($tblData);");
$id = $this->db->lastInsertedId();
return $id;
}
function creturnval($variables){
$vars = explode("&",$variables);
$count = sizeOf($vars);
$tblVal = "";
$tblData = "";
for($i=0;$i<$count;$i++){
$d = explode("=",$vars[$i]);
$tblVal.= $d[0].",";
$tblData.= "'".$d[1]."'".",";
}
$tblVal = rtrim($tblVal, ',');
$tblData = rtrim($tblData, ',');
$return[0] = $tblVal;
$return[1] = $tblData;
return $return;
}
My concern is actually the performance issue. Previously in my model class, if i just used $db->query(), it seems to be faster because i do not have to go through 2 functions.
Now, in order to do an insert, i will need to parse the variables, split & etc, then process it.
My idea of using this Datamap class is actually to provide more maintainability and standardization. This is to prevent all my model classes from having sql statements over the place which looks untidy.
Do you think this will pose a possible performance issue?
PS: I am using my own framework that i build for my web application
Appreciate all advices | 0 |
11,423,116 | 07/10/2012 22:45:17 | 1,413,598 | 05/23/2012 20:51:44 | 89 | 2 | How to horizontally align a button in a panel with dynamic size | [**Here**][1] is my jsFiddle simple case as a starter for you.
I want the `create` button stay in the center of the west pane as my drag the resize bar.
Thanks,
[1]: http://jsfiddle.net/jxTUw/7/ | javascript | jquery | css | null | null | null | open | How to horizontally align a button in a panel with dynamic size
===
[**Here**][1] is my jsFiddle simple case as a starter for you.
I want the `create` button stay in the center of the west pane as my drag the resize bar.
Thanks,
[1]: http://jsfiddle.net/jxTUw/7/ | 0 |
11,423,319 | 07/10/2012 23:08:38 | 656,149 | 03/11/2011 23:36:28 | 6 | 1 | Installing pg gem through terminal works but does not work through cap deploy | I am running Mac OS X Lion Server on another Mac mini. I installed PostgreSQL through Homebrew. When running
$ sudo gem install pg
the gem install works fine, but when (from my laptop) I run:
$ cap deploy
it fails and I get the following messages:
## Output from $ cap deploy:
[out :: Pace.local] checking for pg_config... yes
[out :: Pace.local] Using config values from /usr/bin/pg_config
[out :: Pace.local] checking for libpq-fe.h... yes
[out :: Pace.local] checking for libpq/libpq-fs.h... yes
[out :: Pace.local] checking for pg_config_manual.h... yes
[out :: Pace.local] checking for PQconnectdb() in -lpq... no
[out :: Pace.local] checking for PQconnectdb() in -llibpq... no
[out :: Pace.local] checking for PQconnectdb() in -lms/libpq... no
[out :: Pace.local] Can't find the PostgreSQL client library (libpq)
[out :: Pace.local] *** extconf.rb failed ***
[out :: Pace.local] Could not create Makefile due to some reason, probably lack of
[out :: Pace.local] necessary libraries and/or headers. Check the mkmf.log file for more
[out :: Pace.local] details. You may need configuration options.
and I get the error messages shown in:
## mkmf.log:
find_executable: checking for pg_config... -------------------- yes
--------------------
find_header: checking for libpq-fe.h... -------------------- yes
"gcc -E -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/postgresql/9.1.4/include -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include <libpq-fe.h>
/* end */
--------------------
find_header: checking for libpq/libpq-fs.h... -------------------- yes
"gcc -E -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/postgresql/9.1.4/include -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include <libpq/libpq-fs.h>
/* end */
--------------------
find_header: checking for pg_config_manual.h... -------------------- yes
"gcc -E -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/postgresql/9.1.4/include -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include <pg_config_manual.h>
/* end */
--------------------
have_library: checking for PQconnectdb() in -lpq... -------------------- no
"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/postgresql/9.1.4/include -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -L/usr/local/Cellar/postgresql/9.1.4/lib -lruby -lpq -lpthread -ldl -lobjc "
ld: warning: ignoring file /usr/local/Cellar/postgresql/9.1.4/lib/libpq.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
"_PQconnectdb", referenced from:
_t in cccMktph.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T//ccbuecN1.out (No such file or directory)
checked program was:
/* begin */
1: #include <libpq-fe.h>
2:
3: /*top*/
4: int main() { return 0; }
5: int t() { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return 0; }
/* end */
"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/postgresql/9.1.4/include -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -L/usr/local/Cellar/postgresql/9.1.4/lib -lruby -lpq -lpthread -ldl -lobjc "
conftest.c: In function 't':
conftest.c:5: error: too few arguments to function 'PQconnectdb'
conftest.c: In function 't':
conftest.c:5: error: too few arguments to function 'PQconnectdb'
lipo: can't figure out the architecture type of: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T//cckhI2ka.out
checked program was:
/* begin */
1: #include <libpq-fe.h>
2:
3: /*top*/
4: int main() { return 0; }
5: int t() { PQconnectdb(); return 0; }
/* end */
--------------------
have_library: checking for PQconnectdb() in -llibpq... -------------------- no
"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/postgresql/9.1.4/include -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -L/usr/local/Cellar/postgresql/9.1.4/lib -lruby -llibpq -lpthread -ldl -lobjc "
ld: library not found for -llibpq
collect2: ld returned 1 exit status
ld: library not found for -llibpq
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T//cctsaEf7.out (No such file or directory)
checked program was:
/* begin */
1: #include <libpq-fe.h>
2:
3: /*top*/
4: int main() { return 0; }
5: int t() { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return 0; }
/* end */
"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/postgresql/9.1.4/include -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -L/usr/local/Cellar/postgresql/9.1.4/lib -lruby -llibpq -lpthread -ldl -lobjc "
conftest.c: In function 't':
conftest.c:5: error: too few arguments to function 'PQconnectdb'
conftest.c: In function 't':
conftest.c:5: error: too few arguments to function 'PQconnectdb'
lipo: can't figure out the architecture type of: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T//cc3OxLEw.out
checked program was:
/* begin */
1: #include <libpq-fe.h>
2:
3: /*top*/
4: int main() { return 0; }
5: int t() { PQconnectdb(); return 0; }
/* end */
--------------------
have_library: checking for PQconnectdb() in -lms/libpq... -------------------- no
"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/postgresql/9.1.4/include -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -L/usr/local/Cellar/postgresql/9.1.4/lib -lruby -lms/libpq -lpthread - ldl -lobjc "
ld: library not found for -lms/libpq
collect2: ld returned 1 exit status
ld: library not found for -lms/libpq
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T//ccAWgBGN.out (No such file or directory)
checked program was:
/* begin */
1: #include <libpq-fe.h>
2:
3: /*top*/
4: int main() { return 0; }
5: int t() { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return 0; }
/* end */
"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/postgresql/9.1.4/include -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -L/usr/local/Cellar/postgresql/9.1.4/lib -lruby -lms/libpq -lpthread - ldl -lobjc "
conftest.c: In function 't':
conftest.c:5: error: too few arguments to function 'PQconnectdb'
conftest.c: In function 't':
conftest.c:5: error: too few arguments to function 'PQconnectdb'
lipo: can't figure out the architecture type of: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T//ccbZi3QN.out
checked program was:
/* begin */
1: #include <libpq-fe.h>
2:
3: /*top*/
4: int main() { return 0; }
5: int t() { PQconnectdb(); return 0; }
/* end */
-------------------- | ruby-on-rails | postgresql | osx-lion | capistrano | null | null | open | Installing pg gem through terminal works but does not work through cap deploy
===
I am running Mac OS X Lion Server on another Mac mini. I installed PostgreSQL through Homebrew. When running
$ sudo gem install pg
the gem install works fine, but when (from my laptop) I run:
$ cap deploy
it fails and I get the following messages:
## Output from $ cap deploy:
[out :: Pace.local] checking for pg_config... yes
[out :: Pace.local] Using config values from /usr/bin/pg_config
[out :: Pace.local] checking for libpq-fe.h... yes
[out :: Pace.local] checking for libpq/libpq-fs.h... yes
[out :: Pace.local] checking for pg_config_manual.h... yes
[out :: Pace.local] checking for PQconnectdb() in -lpq... no
[out :: Pace.local] checking for PQconnectdb() in -llibpq... no
[out :: Pace.local] checking for PQconnectdb() in -lms/libpq... no
[out :: Pace.local] Can't find the PostgreSQL client library (libpq)
[out :: Pace.local] *** extconf.rb failed ***
[out :: Pace.local] Could not create Makefile due to some reason, probably lack of
[out :: Pace.local] necessary libraries and/or headers. Check the mkmf.log file for more
[out :: Pace.local] details. You may need configuration options.
and I get the error messages shown in:
## mkmf.log:
find_executable: checking for pg_config... -------------------- yes
--------------------
find_header: checking for libpq-fe.h... -------------------- yes
"gcc -E -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/postgresql/9.1.4/include -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include <libpq-fe.h>
/* end */
--------------------
find_header: checking for libpq/libpq-fs.h... -------------------- yes
"gcc -E -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/postgresql/9.1.4/include -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include <libpq/libpq-fs.h>
/* end */
--------------------
find_header: checking for pg_config_manual.h... -------------------- yes
"gcc -E -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/postgresql/9.1.4/include -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include <pg_config_manual.h>
/* end */
--------------------
have_library: checking for PQconnectdb() in -lpq... -------------------- no
"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/postgresql/9.1.4/include -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -L/usr/local/Cellar/postgresql/9.1.4/lib -lruby -lpq -lpthread -ldl -lobjc "
ld: warning: ignoring file /usr/local/Cellar/postgresql/9.1.4/lib/libpq.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
"_PQconnectdb", referenced from:
_t in cccMktph.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T//ccbuecN1.out (No such file or directory)
checked program was:
/* begin */
1: #include <libpq-fe.h>
2:
3: /*top*/
4: int main() { return 0; }
5: int t() { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return 0; }
/* end */
"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/postgresql/9.1.4/include -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -L/usr/local/Cellar/postgresql/9.1.4/lib -lruby -lpq -lpthread -ldl -lobjc "
conftest.c: In function 't':
conftest.c:5: error: too few arguments to function 'PQconnectdb'
conftest.c: In function 't':
conftest.c:5: error: too few arguments to function 'PQconnectdb'
lipo: can't figure out the architecture type of: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T//cckhI2ka.out
checked program was:
/* begin */
1: #include <libpq-fe.h>
2:
3: /*top*/
4: int main() { return 0; }
5: int t() { PQconnectdb(); return 0; }
/* end */
--------------------
have_library: checking for PQconnectdb() in -llibpq... -------------------- no
"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/postgresql/9.1.4/include -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -L/usr/local/Cellar/postgresql/9.1.4/lib -lruby -llibpq -lpthread -ldl -lobjc "
ld: library not found for -llibpq
collect2: ld returned 1 exit status
ld: library not found for -llibpq
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T//cctsaEf7.out (No such file or directory)
checked program was:
/* begin */
1: #include <libpq-fe.h>
2:
3: /*top*/
4: int main() { return 0; }
5: int t() { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return 0; }
/* end */
"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/postgresql/9.1.4/include -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -L/usr/local/Cellar/postgresql/9.1.4/lib -lruby -llibpq -lpthread -ldl -lobjc "
conftest.c: In function 't':
conftest.c:5: error: too few arguments to function 'PQconnectdb'
conftest.c: In function 't':
conftest.c:5: error: too few arguments to function 'PQconnectdb'
lipo: can't figure out the architecture type of: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T//cc3OxLEw.out
checked program was:
/* begin */
1: #include <libpq-fe.h>
2:
3: /*top*/
4: int main() { return 0; }
5: int t() { PQconnectdb(); return 0; }
/* end */
--------------------
have_library: checking for PQconnectdb() in -lms/libpq... -------------------- no
"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/postgresql/9.1.4/include -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -L/usr/local/Cellar/postgresql/9.1.4/lib -lruby -lms/libpq -lpthread - ldl -lobjc "
ld: library not found for -lms/libpq
collect2: ld returned 1 exit status
ld: library not found for -lms/libpq
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T//ccAWgBGN.out (No such file or directory)
checked program was:
/* begin */
1: #include <libpq-fe.h>
2:
3: /*top*/
4: int main() { return 0; }
5: int t() { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return 0; }
/* end */
"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/postgresql/9.1.4/include -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -L/usr/local/Cellar/postgresql/9.1.4/lib -lruby -lms/libpq -lpthread - ldl -lobjc "
conftest.c: In function 't':
conftest.c:5: error: too few arguments to function 'PQconnectdb'
conftest.c: In function 't':
conftest.c:5: error: too few arguments to function 'PQconnectdb'
lipo: can't figure out the architecture type of: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T//ccbZi3QN.out
checked program was:
/* begin */
1: #include <libpq-fe.h>
2:
3: /*top*/
4: int main() { return 0; }
5: int t() { PQconnectdb(); return 0; }
/* end */
-------------------- | 0 |
11,423,320 | 07/10/2012 23:08:50 | 1,484,193 | 06/26/2012 23:36:50 | 28 | 2 | iphone device token stored more than once in MYSQL database | I am providing APNS in iOS and everything is working well , the problem it is each time I run the app it gives me the device token and then store it in MYSQL database.
my question , is this going to be same after I distribute the app in apple store , am I going to receive the device token each time the app being lunched from users ?
other question , If the app is ready to be distributed , do I have to change the Development Push SSL Certificate ? if yes , is it the same steps ? | iphone | ios | push-notification | null | null | null | open | iphone device token stored more than once in MYSQL database
===
I am providing APNS in iOS and everything is working well , the problem it is each time I run the app it gives me the device token and then store it in MYSQL database.
my question , is this going to be same after I distribute the app in apple store , am I going to receive the device token each time the app being lunched from users ?
other question , If the app is ready to be distributed , do I have to change the Development Push SSL Certificate ? if yes , is it the same steps ? | 0 |
11,423,321 | 07/10/2012 23:08:50 | 1,332,566 | 04/13/2012 22:11:35 | 18 | 1 | Is there a way to get a percentage of the code related to UI for an xcode project? | I want to see how much of the code in an xcode project is related to UI. I know xcode-statistician provides me with some statistic but not the code related to UI
http://xcode-statistician.mac.informer.com/ | objective-c | ios | xcode | user-interface | null | null | open | Is there a way to get a percentage of the code related to UI for an xcode project?
===
I want to see how much of the code in an xcode project is related to UI. I know xcode-statistician provides me with some statistic but not the code related to UI
http://xcode-statistician.mac.informer.com/ | 0 |
11,423,324 | 07/10/2012 23:09:21 | 297,763 | 03/19/2010 22:47:11 | 388 | 19 | How to group a set of objects and a result to return them from a method | I have a method that I am currently building to compare two lists of objects. The lists themselves contain objects
List<TradeFile> list1
List<TradeFile> list2
When I finish comparing TradeFile object from list1 and TradeFile object from list2, I want to return a collection that contains all of the compared TradeFiles and the matching status. So it would be something like:
TradeFile1, TradeFile2, True
TradeFile1, TradeFile2, False
I will use this collection then for reporting later in my process. Should I look at using something like a dictionary that contains a collection of the tradefile objects?
This may work, but really feels messy:
Dictonary<Dictonary<TradeFile,TradeFile>,bool> | c# | null | null | null | null | null | open | How to group a set of objects and a result to return them from a method
===
I have a method that I am currently building to compare two lists of objects. The lists themselves contain objects
List<TradeFile> list1
List<TradeFile> list2
When I finish comparing TradeFile object from list1 and TradeFile object from list2, I want to return a collection that contains all of the compared TradeFiles and the matching status. So it would be something like:
TradeFile1, TradeFile2, True
TradeFile1, TradeFile2, False
I will use this collection then for reporting later in my process. Should I look at using something like a dictionary that contains a collection of the tradefile objects?
This may work, but really feels messy:
Dictonary<Dictonary<TradeFile,TradeFile>,bool> | 0 |
11,423,325 | 07/10/2012 23:09:27 | 1,516,225 | 07/10/2012 23:04:15 | 1 | 0 | EHCache RMI Replication on JBoss/EC2 throws java.rmi.NoSuchObjectException: no such object in table | Trying to create an EHCache RMI-based cache replication between 2 JBoss 4.2 servers on Amazon EC2. Currently, this is set up as manual peer discovery with one-way replication from Server2 to Server1.
Configuration as under:
Server 1
<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=manual"/>
<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="hostName=host1, port=40001,
socketTimeoutMillis=3000"/>
<cache name="cache1"
maxElementsInMemory="0"
eternal="false"
overflowToDisk="true"
timeToIdleSeconds="600"
timeToLiveSeconds="600"
diskPersistent="true"
diskExpiryThreadIntervalSeconds="60"
statistics="true">
<cacheEventListenerFactory
class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicatePuts=false, replicateUpdates=false,
replicateRemovals=false"/>
</cache>
Server 2
<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=manual,
rmiUrls=//host1:40001/cache1"/>
<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="hostName=host2, port=40002,
socketTimeoutMillis=3000"/>
<cache name="cache1"
maxElementsInMemory="0"
eternal="false"
overflowToDisk="false"
timeToIdleSeconds="7200"
timeToLiveSeconds="7200">
<cacheEventListenerFactory
class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicateAsynchronously=false"/>
</cache>
However, when I put new elements into the cache on Server2, it throws the following exception:
Jul 10, 2012 3:25:37 PM net.sf.ehcache.distribution.RMISynchronousCacheReplicator replicatePutNotification
SEVERE: Exception on replication of putNotification. no such object in table. Continuing...
java.rmi.NoSuchObjectException: no such object in table
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
at net.sf.ehcache.distribution.RMICachePeer_Stub.put(Unknown Source)
at net.sf.ehcache.distribution.RMISynchronousCacheReplicator.replicatePutNotification(RMISynchronousCacheReplicator.java:149)
at net.sf.ehcache.distribution.RMISynchronousCacheReplicator.notifyElementPut(RMISynchronousCacheReplicator.java:132)
at net.sf.ehcache.event.RegisteredEventListeners.notifyListener(RegisteredEventListeners.java:294)
at net.sf.ehcache.event.RegisteredEventListeners.invokeListener(RegisteredEventListeners.java:284)
at net.sf.ehcache.event.RegisteredEventListeners.internalNotifyElementPut(RegisteredEventListeners.java:144)
at net.sf.ehcache.event.RegisteredEventListeners.notifyElementPut(RegisteredEventListeners.java:122)
at net.sf.ehcache.Cache.notifyPutInternalListeners(Cache.java:1515)
at net.sf.ehcache.Cache.putInternal(Cache.java:1490)
at net.sf.ehcache.Cache.put(Cache.java:1417)
at net.sf.ehcache.Cache.put(Cache.java:1382)
I've also tried this with Server2 as a stand-alone Java program (using the same ehcache.xml as shown above) instead of a JBoss server. But as long as Server1 is a JBoss server, I see this exception.
It works great if I deploy Server1 and Server2 (JBoss or Java program) on the same host. But as soon as I move them to different hosts, it dies on me.
Any help will be greatly appreciated. Thanks ... | jboss | replication | rmi | ehcache | null | null | open | EHCache RMI Replication on JBoss/EC2 throws java.rmi.NoSuchObjectException: no such object in table
===
Trying to create an EHCache RMI-based cache replication between 2 JBoss 4.2 servers on Amazon EC2. Currently, this is set up as manual peer discovery with one-way replication from Server2 to Server1.
Configuration as under:
Server 1
<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=manual"/>
<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="hostName=host1, port=40001,
socketTimeoutMillis=3000"/>
<cache name="cache1"
maxElementsInMemory="0"
eternal="false"
overflowToDisk="true"
timeToIdleSeconds="600"
timeToLiveSeconds="600"
diskPersistent="true"
diskExpiryThreadIntervalSeconds="60"
statistics="true">
<cacheEventListenerFactory
class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicatePuts=false, replicateUpdates=false,
replicateRemovals=false"/>
</cache>
Server 2
<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=manual,
rmiUrls=//host1:40001/cache1"/>
<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="hostName=host2, port=40002,
socketTimeoutMillis=3000"/>
<cache name="cache1"
maxElementsInMemory="0"
eternal="false"
overflowToDisk="false"
timeToIdleSeconds="7200"
timeToLiveSeconds="7200">
<cacheEventListenerFactory
class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
properties="replicateAsynchronously=false"/>
</cache>
However, when I put new elements into the cache on Server2, it throws the following exception:
Jul 10, 2012 3:25:37 PM net.sf.ehcache.distribution.RMISynchronousCacheReplicator replicatePutNotification
SEVERE: Exception on replication of putNotification. no such object in table. Continuing...
java.rmi.NoSuchObjectException: no such object in table
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
at net.sf.ehcache.distribution.RMICachePeer_Stub.put(Unknown Source)
at net.sf.ehcache.distribution.RMISynchronousCacheReplicator.replicatePutNotification(RMISynchronousCacheReplicator.java:149)
at net.sf.ehcache.distribution.RMISynchronousCacheReplicator.notifyElementPut(RMISynchronousCacheReplicator.java:132)
at net.sf.ehcache.event.RegisteredEventListeners.notifyListener(RegisteredEventListeners.java:294)
at net.sf.ehcache.event.RegisteredEventListeners.invokeListener(RegisteredEventListeners.java:284)
at net.sf.ehcache.event.RegisteredEventListeners.internalNotifyElementPut(RegisteredEventListeners.java:144)
at net.sf.ehcache.event.RegisteredEventListeners.notifyElementPut(RegisteredEventListeners.java:122)
at net.sf.ehcache.Cache.notifyPutInternalListeners(Cache.java:1515)
at net.sf.ehcache.Cache.putInternal(Cache.java:1490)
at net.sf.ehcache.Cache.put(Cache.java:1417)
at net.sf.ehcache.Cache.put(Cache.java:1382)
I've also tried this with Server2 as a stand-alone Java program (using the same ehcache.xml as shown above) instead of a JBoss server. But as long as Server1 is a JBoss server, I see this exception.
It works great if I deploy Server1 and Server2 (JBoss or Java program) on the same host. But as soon as I move them to different hosts, it dies on me.
Any help will be greatly appreciated. Thanks ... | 0 |
11,423,327 | 07/10/2012 23:09:38 | 1,516,194 | 07/10/2012 22:41:14 | 1 | 0 | QTableWidget get Button Signal and execute command through QProcess | as you can see in the code below, I read some informations from an XML file and use these for some QCommandLinkButtons which I insert in the Table via three for-loops.
This works fine. But now i need the clicked signal from each Button.
Additionally i have no idea on which position the Button appears and so I can't use any cell-id.
I need the clicked-signal from a Button and the command I've attached via the Tooltip for execution through QProcess ...
As you see, its a complex problem (at least for me).
Here's the code:
void MainWindow::on_TEST_clicked()
{
XMLRead *XMLReader;
XMLReader = new XMLRead;
QStringList ModuleList;
QStringList CategoriesList;
int iCntSize = XMLReader->Modules("count").toInt();
// GET THE MODULES AND CATEGORIES
for(int iRow = 0; iRow < iCntSize; iRow++)
{
ModuleList << XMLReader->Modules( "modname", "", "", "", iRow );
CategoriesList << XMLReader->Modules("search", ModuleList.at(iRow), "Category");
}
// SET THE COLUMN COUNT
int Columns = 1;
QSet<QString> stringSet = QSet<QString>::fromList(CategoriesList);
if (stringSet.count() < CategoriesList.count())
{
Columns++;
}
ui->MainTable->setColumnCount(Columns);
CategoriesList.removeDuplicates(); // cut for the loops
ui->MainTable->setRowCount(CategoriesList.count());
ui->MainTable->setVerticalHeaderLabels(CategoriesList);
ui->MainTable->horizontalHeader()->hide();
// CONJURE BUTTONS TO TABLE
QString QueryReturn;
QString ThisColumn = "";
for(int iRow = 0; iRow < CategoriesList.count(); iRow++) // loop through rows/categories
{
for(int iCol = 0; iCol < Columns; iCol++) // loop through columns
{
for(int iMod = 0; iMod < ModuleList.count(); iMod++) // loop through modules
{
QString ModsCategory = XMLReader->Modules("search", ModuleList.at(iMod), "Category");
QString Table = XMLReader- >Modules("attribute", ModuleList.at(iMod), "Settings", "Table");
if ( ( ModsCategory == CategoriesList.at(iRow) ) && ( ThisColumn != ModuleList.at(iMod) ) && ( Table == "show") )
{
QCommandLinkButton *MysticalButton = new QCommandLinkButton;
QueryReturn = XMLReader- >Modules("attribute",ModuleList.at(iMod),"Settings","Icon");
QIcon Icon(QueryReturn);
QSize IconSize;
IconSize.scale(48, 48, Qt::KeepAspectRatio);
MysticalButton->setIconSize(IconSize);
MysticalButton->setIcon(Icon);
QueryReturn = XMLReader->Modules("search", ModuleList.at(iMod), "Title");
MysticalButton->setText(QueryReturn);
QueryReturn = XMLReader->Modules("search", ModuleList.at(iMod), "Description");
MysticalButton->setDescription(QueryReturn);
MysticalButton->setStatusTip(QueryReturn);
QueryReturn = XMLReader->Modules("search", ModuleList.at(iMod), "Exec");
MysticalButton->setToolTip(QueryReturn); // We use the Tooltip to get the Command of this Button ...
ui->MainTable->setCellWidget(iRow, iCol, MysticalButton);
ThisColumn = ModuleList.at(iMod);
break;
}
}
}
}
ui->MainTable->resizeColumnsToContents();
ui->MainTable->resizeRowsToContents();
ui->MainTable->verticalHeader()->setResizeMode(QHeaderView::Fixed);
}
I would be very happy about some code example ;) | button | signals | qtablewidget | null | null | null | open | QTableWidget get Button Signal and execute command through QProcess
===
as you can see in the code below, I read some informations from an XML file and use these for some QCommandLinkButtons which I insert in the Table via three for-loops.
This works fine. But now i need the clicked signal from each Button.
Additionally i have no idea on which position the Button appears and so I can't use any cell-id.
I need the clicked-signal from a Button and the command I've attached via the Tooltip for execution through QProcess ...
As you see, its a complex problem (at least for me).
Here's the code:
void MainWindow::on_TEST_clicked()
{
XMLRead *XMLReader;
XMLReader = new XMLRead;
QStringList ModuleList;
QStringList CategoriesList;
int iCntSize = XMLReader->Modules("count").toInt();
// GET THE MODULES AND CATEGORIES
for(int iRow = 0; iRow < iCntSize; iRow++)
{
ModuleList << XMLReader->Modules( "modname", "", "", "", iRow );
CategoriesList << XMLReader->Modules("search", ModuleList.at(iRow), "Category");
}
// SET THE COLUMN COUNT
int Columns = 1;
QSet<QString> stringSet = QSet<QString>::fromList(CategoriesList);
if (stringSet.count() < CategoriesList.count())
{
Columns++;
}
ui->MainTable->setColumnCount(Columns);
CategoriesList.removeDuplicates(); // cut for the loops
ui->MainTable->setRowCount(CategoriesList.count());
ui->MainTable->setVerticalHeaderLabels(CategoriesList);
ui->MainTable->horizontalHeader()->hide();
// CONJURE BUTTONS TO TABLE
QString QueryReturn;
QString ThisColumn = "";
for(int iRow = 0; iRow < CategoriesList.count(); iRow++) // loop through rows/categories
{
for(int iCol = 0; iCol < Columns; iCol++) // loop through columns
{
for(int iMod = 0; iMod < ModuleList.count(); iMod++) // loop through modules
{
QString ModsCategory = XMLReader->Modules("search", ModuleList.at(iMod), "Category");
QString Table = XMLReader- >Modules("attribute", ModuleList.at(iMod), "Settings", "Table");
if ( ( ModsCategory == CategoriesList.at(iRow) ) && ( ThisColumn != ModuleList.at(iMod) ) && ( Table == "show") )
{
QCommandLinkButton *MysticalButton = new QCommandLinkButton;
QueryReturn = XMLReader- >Modules("attribute",ModuleList.at(iMod),"Settings","Icon");
QIcon Icon(QueryReturn);
QSize IconSize;
IconSize.scale(48, 48, Qt::KeepAspectRatio);
MysticalButton->setIconSize(IconSize);
MysticalButton->setIcon(Icon);
QueryReturn = XMLReader->Modules("search", ModuleList.at(iMod), "Title");
MysticalButton->setText(QueryReturn);
QueryReturn = XMLReader->Modules("search", ModuleList.at(iMod), "Description");
MysticalButton->setDescription(QueryReturn);
MysticalButton->setStatusTip(QueryReturn);
QueryReturn = XMLReader->Modules("search", ModuleList.at(iMod), "Exec");
MysticalButton->setToolTip(QueryReturn); // We use the Tooltip to get the Command of this Button ...
ui->MainTable->setCellWidget(iRow, iCol, MysticalButton);
ThisColumn = ModuleList.at(iMod);
break;
}
}
}
}
ui->MainTable->resizeColumnsToContents();
ui->MainTable->resizeRowsToContents();
ui->MainTable->verticalHeader()->setResizeMode(QHeaderView::Fixed);
}
I would be very happy about some code example ;) | 0 |
11,423,333 | 07/10/2012 23:10:41 | 1,516,190 | 07/10/2012 22:40:03 | 1 | 0 | BingBot & BaiduSpider don't respect robots.txt | after my cpu usage suddenly went over 400% due to bots swamping my site, I created a robots.txt as followed and placed the file in my root, eg "www.mywebsite.com/":
User-agent: *<br>
Disallow: /
Now Google respects this file and there is no more occurence in my log file of Google.
However BingBot & BaiduSpider still show up in my log(and plentyful).
As I had this huge increase in cpu usage & also bandwith and my hosting provider was about to suspend my account, I firstly deleted all my pages(in case there was a nasty script), uploaded clean pages, blocked all bots via IP address in .htaccess & then created that robots.txt file.
I searched everywhere to confirm that I did the right steps(haven't tried the "ReWrite" option in .htaccess yet).
Can anyone confirm that what I have done should do the job.(Since I started this venture, my cpu usage went down to 120% within 6 days, but at least blocking the IP addresses should have brought down the cpu usage to my usual 5-10%).
Thanks | cpu-usage | robots.txt | bots | null | null | null | open | BingBot & BaiduSpider don't respect robots.txt
===
after my cpu usage suddenly went over 400% due to bots swamping my site, I created a robots.txt as followed and placed the file in my root, eg "www.mywebsite.com/":
User-agent: *<br>
Disallow: /
Now Google respects this file and there is no more occurence in my log file of Google.
However BingBot & BaiduSpider still show up in my log(and plentyful).
As I had this huge increase in cpu usage & also bandwith and my hosting provider was about to suspend my account, I firstly deleted all my pages(in case there was a nasty script), uploaded clean pages, blocked all bots via IP address in .htaccess & then created that robots.txt file.
I searched everywhere to confirm that I did the right steps(haven't tried the "ReWrite" option in .htaccess yet).
Can anyone confirm that what I have done should do the job.(Since I started this venture, my cpu usage went down to 120% within 6 days, but at least blocking the IP addresses should have brought down the cpu usage to my usual 5-10%).
Thanks | 0 |
11,471,393 | 07/13/2012 13:23:10 | 1,167,466 | 01/24/2012 16:24:32 | 12 | 0 | Google Maps API with optimized waypoints. Waypoint_Order off | I am having problems with the waypoint_order on some request it matches what the legs end location and other times it does not. Here is how I am sending the request along with the waypoints and legs.
var request = {
origin: start,
destination: end,
waypoints: waypts,
optimizeWaypoints: true,
travelMode: google.maps.DirectionsTravelMode.DRIVING,
unitSystem: google.maps.UnitSystem.IMPERIAL
};
Waypoints being passed.
waypt[0] 1450 West Jackson Street Ozark Missouri ----order[0] 3
waypt[1] 2825 S Glenstone Ave Springfield Missouri ----order[1] 1
waypt[2] 404 West South Street Nixa Missouri ----order[2] 0
waypt[3] 500 West Chestnut Expressway Springfield Missouri ----order[3] 4
waypt[4] 715 W. Mt. Vernon Nixa Missouri ----order[4] 2
waypoint order: 3,1,0,4,2
Legs.
legs[0] from 1923 E Kearney St, Springfield, MO 65803, USA
legs[0] to 500 W Chestnut Expy, Springfield, MO 65806, USA
legs[1] from 500 W Chestnut Expy, Springfield, MO 65806, USA
legs[1] to 2825 S Glenstone Ave, Springfield, MO 65804, USA
legs[2] from 2825 S Glenstone Ave, Springfield, MO 65804, USA
legs[2] to 1450 W Jackson St, Ozark, MO 65721, USA
legs[3] from 1450 W Jackson St, Ozark, MO 65721, USA
legs[3] to 715 W Mt Vernon St, Nixa, MO 65714, USA
legs[4] from 715 W Mt Vernon St, Nixa, MO 65714, USA
legs[4] to 404 W South St, Nixa, MO 65714, USA
legs[5] from 404 W South St, Nixa, MO 65714, USA
legs[5] to 3315 S Campbell Ave, Springfield, MO 65807, USA
waypoint order according to legs: [2,1,4,0,3]
Does anybody know why the waypoint_order in result.routes[0].waypoint_order would be off? | javascript | google-maps | google-maps-api-3 | null | null | null | open | Google Maps API with optimized waypoints. Waypoint_Order off
===
I am having problems with the waypoint_order on some request it matches what the legs end location and other times it does not. Here is how I am sending the request along with the waypoints and legs.
var request = {
origin: start,
destination: end,
waypoints: waypts,
optimizeWaypoints: true,
travelMode: google.maps.DirectionsTravelMode.DRIVING,
unitSystem: google.maps.UnitSystem.IMPERIAL
};
Waypoints being passed.
waypt[0] 1450 West Jackson Street Ozark Missouri ----order[0] 3
waypt[1] 2825 S Glenstone Ave Springfield Missouri ----order[1] 1
waypt[2] 404 West South Street Nixa Missouri ----order[2] 0
waypt[3] 500 West Chestnut Expressway Springfield Missouri ----order[3] 4
waypt[4] 715 W. Mt. Vernon Nixa Missouri ----order[4] 2
waypoint order: 3,1,0,4,2
Legs.
legs[0] from 1923 E Kearney St, Springfield, MO 65803, USA
legs[0] to 500 W Chestnut Expy, Springfield, MO 65806, USA
legs[1] from 500 W Chestnut Expy, Springfield, MO 65806, USA
legs[1] to 2825 S Glenstone Ave, Springfield, MO 65804, USA
legs[2] from 2825 S Glenstone Ave, Springfield, MO 65804, USA
legs[2] to 1450 W Jackson St, Ozark, MO 65721, USA
legs[3] from 1450 W Jackson St, Ozark, MO 65721, USA
legs[3] to 715 W Mt Vernon St, Nixa, MO 65714, USA
legs[4] from 715 W Mt Vernon St, Nixa, MO 65714, USA
legs[4] to 404 W South St, Nixa, MO 65714, USA
legs[5] from 404 W South St, Nixa, MO 65714, USA
legs[5] to 3315 S Campbell Ave, Springfield, MO 65807, USA
waypoint order according to legs: [2,1,4,0,3]
Does anybody know why the waypoint_order in result.routes[0].waypoint_order would be off? | 0 |
11,471,398 | 07/13/2012 13:23:18 | 982,720 | 10/06/2011 17:55:53 | 1 | 1 | GAE Full Text Search development console UnicodeEncodeError | I have an index with manny words with accent (e.g: São Paulo, José, etc).
The search api works fine, but when try to do some test queries on development console, I can't access index data.
This error only occurs on development environment. On production GAE everything works fine.
Bellow the traceback:
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/_webapp25.py", line 701, in __call__
handler.get(*groups)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/admin/__init__.py", line 1704, in get
'values': self._ProcessSearchResponse(resp),
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/admin/__init__.py", line 1664, in _ProcessSearchResponse
value = TruncateValue(doc.fields[field_name].value)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/admin/__init__.py", line 158, in TruncateValue
value = str(value)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xc1' in position 5: ordinal not in range(128) | google-app-engine | null | null | null | null | null | open | GAE Full Text Search development console UnicodeEncodeError
===
I have an index with manny words with accent (e.g: São Paulo, José, etc).
The search api works fine, but when try to do some test queries on development console, I can't access index data.
This error only occurs on development environment. On production GAE everything works fine.
Bellow the traceback:
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/_webapp25.py", line 701, in __call__
handler.get(*groups)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/admin/__init__.py", line 1704, in get
'values': self._ProcessSearchResponse(resp),
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/admin/__init__.py", line 1664, in _ProcessSearchResponse
value = TruncateValue(doc.fields[field_name].value)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/admin/__init__.py", line 158, in TruncateValue
value = str(value)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xc1' in position 5: ordinal not in range(128) | 0 |
11,471,403 | 07/13/2012 13:23:31 | 526,924 | 10/28/2010 14:40:15 | 721 | 12 | how to create multiple VerticalFieldManager dynamically Blackberry | I've been struggling to create multiple VerticalFieldManager dynamically on Blackberry. Each subManager will show different data to the user. And each subManager will have a different position on the screen. So i created a class which has a "mainManager" and another class which creates the "submanagers" then i call `mainManager.add(new TheClassExtendingVerticalFieldManager);` to add the subManagers to the mainManager. The problem is that i only get one subManager instead of three. I'm using padding to separate the managers. Here's the code im using. Please guide me in the right direction, it would be much appreciated.
**The class that creates the submanager**
public class ProgramListView extends VerticalFieldManager{
private VerticalFieldManager subManager;
private int _height;
public ProgramListView(int height){
this._height = height;
// subManager = new VerticalFieldManager(
// Manager.NO_HORIZONTAL_SCROLL | Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR |
// Manager.NO_HORIZONTAL_SCROLLBAR | Manager.USE_ALL_WIDTH)
//
// {
//
//
// };
}
public int get_height() {
return _height;
}
public void set_height(int _height) {
this._height = _height;
}
public void setCoordinates(int x, int y){
setPosition(100,140);
}
protected void sublayout(int maxWidth, int maxHeight)
{
int displayWidth = Display.getWidth();
int displayHeight = maxHeight;
this.setPosition(300, 300);
super.sublayout( 40, 40);
setPadding(this.get_height(), 0, 0, 0);
setExtent(displayWidth, this.get_height());
}
public void paint(Graphics graphics)
{
graphics.setBackgroundColor(Color.BLUE);//blue
graphics.clear();
super.paint(graphics);
}
public int getPreferredWidth() {
// TODO Auto-generated method stub
return Display.getWidth();
}
}
**The mainManager class**
public class ProgramLayout extends MainScreen {
private HorizontalFieldManager mainManager;
private int deviceWidth = Display.getWidth();
private int deviceHeight = Display.getHeight();
private Vector subManagers;
private int theheight;
public ProgramLayout(){
setToolbar();
subManagers = new Vector();
theheight = 100;
mainManager = new HorizontalFieldManager(Manager.VERTICAL_SCROLL | Manager.USE_ALL_WIDTH | Manager.USE_ALL_HEIGHT)
{
protected void sublayout(int maxWidth, int maxHeight)
{
int displayWidth = deviceWidth;
int displayHeight = deviceHeight;
super.sublayout( displayWidth, displayHeight);
setExtent(displayWidth, displayHeight);
}
public void paint(Graphics graphics)
{
graphics.setBackgroundColor(Color.BLACK);
graphics.clear();
super.paint(graphics);
}
public int getPreferredWidth() {
// TODO Auto-generated method stub
return Display.getWidth();
}
};
for (int i = 0; i < 3; i++) {
theheight = theheight+100;
subManagers.addElement(new ProgramListView(theheight));
}
for (int i = 0; i < subManagers.size(); i++) {
mainManager.add((VerticalFieldManager)subManagers.elementAt(i));
}
this.add(mainManager);
}
Thanks in advance
| java | blackberry | blackberry-jde | null | null | null | open | how to create multiple VerticalFieldManager dynamically Blackberry
===
I've been struggling to create multiple VerticalFieldManager dynamically on Blackberry. Each subManager will show different data to the user. And each subManager will have a different position on the screen. So i created a class which has a "mainManager" and another class which creates the "submanagers" then i call `mainManager.add(new TheClassExtendingVerticalFieldManager);` to add the subManagers to the mainManager. The problem is that i only get one subManager instead of three. I'm using padding to separate the managers. Here's the code im using. Please guide me in the right direction, it would be much appreciated.
**The class that creates the submanager**
public class ProgramListView extends VerticalFieldManager{
private VerticalFieldManager subManager;
private int _height;
public ProgramListView(int height){
this._height = height;
// subManager = new VerticalFieldManager(
// Manager.NO_HORIZONTAL_SCROLL | Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR |
// Manager.NO_HORIZONTAL_SCROLLBAR | Manager.USE_ALL_WIDTH)
//
// {
//
//
// };
}
public int get_height() {
return _height;
}
public void set_height(int _height) {
this._height = _height;
}
public void setCoordinates(int x, int y){
setPosition(100,140);
}
protected void sublayout(int maxWidth, int maxHeight)
{
int displayWidth = Display.getWidth();
int displayHeight = maxHeight;
this.setPosition(300, 300);
super.sublayout( 40, 40);
setPadding(this.get_height(), 0, 0, 0);
setExtent(displayWidth, this.get_height());
}
public void paint(Graphics graphics)
{
graphics.setBackgroundColor(Color.BLUE);//blue
graphics.clear();
super.paint(graphics);
}
public int getPreferredWidth() {
// TODO Auto-generated method stub
return Display.getWidth();
}
}
**The mainManager class**
public class ProgramLayout extends MainScreen {
private HorizontalFieldManager mainManager;
private int deviceWidth = Display.getWidth();
private int deviceHeight = Display.getHeight();
private Vector subManagers;
private int theheight;
public ProgramLayout(){
setToolbar();
subManagers = new Vector();
theheight = 100;
mainManager = new HorizontalFieldManager(Manager.VERTICAL_SCROLL | Manager.USE_ALL_WIDTH | Manager.USE_ALL_HEIGHT)
{
protected void sublayout(int maxWidth, int maxHeight)
{
int displayWidth = deviceWidth;
int displayHeight = deviceHeight;
super.sublayout( displayWidth, displayHeight);
setExtent(displayWidth, displayHeight);
}
public void paint(Graphics graphics)
{
graphics.setBackgroundColor(Color.BLACK);
graphics.clear();
super.paint(graphics);
}
public int getPreferredWidth() {
// TODO Auto-generated method stub
return Display.getWidth();
}
};
for (int i = 0; i < 3; i++) {
theheight = theheight+100;
subManagers.addElement(new ProgramListView(theheight));
}
for (int i = 0; i < subManagers.size(); i++) {
mainManager.add((VerticalFieldManager)subManagers.elementAt(i));
}
this.add(mainManager);
}
Thanks in advance
| 0 |
11,471,336 | 07/13/2012 13:20:15 | 896,888 | 08/16/2011 14:36:38 | 56 | 3 | ALSA async callbacks? | The ALSA documentation seems to be very lacking... Basically, I need to play sounds asynchronously, be able to stop (all) sounds, and get a callback when one has finished playing successfully.
I can mostly do the first 2, its just the latter im having trouble with.
Does anyone know any snippets that may enlighten me? | audio | asynchronous | callback | alsa | null | null | open | ALSA async callbacks?
===
The ALSA documentation seems to be very lacking... Basically, I need to play sounds asynchronously, be able to stop (all) sounds, and get a callback when one has finished playing successfully.
I can mostly do the first 2, its just the latter im having trouble with.
Does anyone know any snippets that may enlighten me? | 0 |
11,471,407 | 07/13/2012 13:23:53 | 903,790 | 08/20/2011 14:17:50 | 329 | 14 | no module named menu_pool | i installed django cms correctly but it says ``no module named menu_pool``
do i have to install other menu plugin?
this path ``from menus.menu_pool import menu_pool`` i cannot find, what is the problem? can someone please help me find the clue
i followed the django-cms docs as written here: http://docs.django-cms.org/en/2.3/getting_started/tutorial.html#configuration-and-setup
| python | menu | django-cms | null | null | null | open | no module named menu_pool
===
i installed django cms correctly but it says ``no module named menu_pool``
do i have to install other menu plugin?
this path ``from menus.menu_pool import menu_pool`` i cannot find, what is the problem? can someone please help me find the clue
i followed the django-cms docs as written here: http://docs.django-cms.org/en/2.3/getting_started/tutorial.html#configuration-and-setup
| 0 |
11,471,412 | 07/13/2012 13:24:17 | 543,575 | 12/09/2010 16:23:08 | 20 | 6 | javascript verification of empty or null (is it correct?) | I'm using javascript to do a verification if an input field is empty this way:
if($("#nu_username").val() == null || $("#nu_username").val() == ""){
do action...
}
It works well, but I wonder if it's redundant to use both conditions. Do you know it? | javascript | validation | null | null | null | null | open | javascript verification of empty or null (is it correct?)
===
I'm using javascript to do a verification if an input field is empty this way:
if($("#nu_username").val() == null || $("#nu_username").val() == ""){
do action...
}
It works well, but I wonder if it's redundant to use both conditions. Do you know it? | 0 |
11,471,413 | 07/13/2012 13:24:17 | 1,293,430 | 03/26/2012 15:38:48 | 45 | 3 | How to modify replicator activity sharepoint | 'm using a Replicator Activity in my Workflow. I would like at some point, to modify the list I've given to InitialChildData.
I've tried to do something like :
this.replicatorActivity.InitialChildData[3] = "test4"
Hoping that when I would go in my ChildInitialized function it would change me the value of
e.InstanceData
But It didn't changed anything.
Does someone know how I could modify this variable ?
Thanks | sharepoint | workflow | sharepoint-workflow | workflow-activity | null | null | open | How to modify replicator activity sharepoint
===
'm using a Replicator Activity in my Workflow. I would like at some point, to modify the list I've given to InitialChildData.
I've tried to do something like :
this.replicatorActivity.InitialChildData[3] = "test4"
Hoping that when I would go in my ChildInitialized function it would change me the value of
e.InstanceData
But It didn't changed anything.
Does someone know how I could modify this variable ?
Thanks | 0 |
11,261,945 | 06/29/2012 12:39:25 | 1,451,233 | 06/12/2012 12:35:36 | 37 | 0 | Using YQL for crossdomain ajax request | I'm studying javascript and I'm trying to work with some json files. I'm a complete beginner and I've tried in many different ways but now I would like to request a json file from another server using YQL but I don't understand how.
For example if I have a json like :
http://m.airpim.com/json/public/search?q=daniele&k=&e=1
with YQL I transform it in:
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20json%20where%20url%3D'http%3A%2F%2Fm.airpim.com%2Fjson%2Fpublic%2Fsearch%3Fq%3Ddaniele%26k%3D%26e%3D1'&format=json&callback=
But the problem is that I don't know what to put like callback. The idea was to save the "cards" from the json in an array but I don't understand how to do it because I can't really understand what are callbacks in javascript. | javascript | arrays | json | yql | null | null | open | Using YQL for crossdomain ajax request
===
I'm studying javascript and I'm trying to work with some json files. I'm a complete beginner and I've tried in many different ways but now I would like to request a json file from another server using YQL but I don't understand how.
For example if I have a json like :
http://m.airpim.com/json/public/search?q=daniele&k=&e=1
with YQL I transform it in:
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20json%20where%20url%3D'http%3A%2F%2Fm.airpim.com%2Fjson%2Fpublic%2Fsearch%3Fq%3Ddaniele%26k%3D%26e%3D1'&format=json&callback=
But the problem is that I don't know what to put like callback. The idea was to save the "cards" from the json in an array but I don't understand how to do it because I can't really understand what are callbacks in javascript. | 0 |
11,261,953 | 06/29/2012 12:40:11 | 1,048,566 | 11/15/2011 22:18:11 | 106 | 11 | Prestashop give user ability to upload custom image | The title says it all. How can this be achieved in Prestashop version 1.4.7? | prestashop | null | null | null | null | null | open | Prestashop give user ability to upload custom image
===
The title says it all. How can this be achieved in Prestashop version 1.4.7? | 0 |
11,261,955 | 06/29/2012 12:40:12 | 1,281,598 | 03/20/2012 17:35:04 | 21 | 0 | Hibernate: Can I get an example on how to relate these tables? | I have 4 tables. Three of them are tables with one key and they relate to eachother through the fourth table. <br/> Movie.id, Rater.id, and Rating.id are all foreign keys in table MRR. <br/> If it matters, I designated combinations of the Rater and Movie FKs as unique.<br/> I know there are two ways that I can accomplish this: <br/> 1: Using HQL <br/> 2: Using Restrictions (I am using Spring) <br/> Those are the two I know of. Could someone offer a simple example how to select all the comments from a certain rater id? <br/> Thanks. | spring | hibernate | hql | null | null | null | open | Hibernate: Can I get an example on how to relate these tables?
===
I have 4 tables. Three of them are tables with one key and they relate to eachother through the fourth table. <br/> Movie.id, Rater.id, and Rating.id are all foreign keys in table MRR. <br/> If it matters, I designated combinations of the Rater and Movie FKs as unique.<br/> I know there are two ways that I can accomplish this: <br/> 1: Using HQL <br/> 2: Using Restrictions (I am using Spring) <br/> Those are the two I know of. Could someone offer a simple example how to select all the comments from a certain rater id? <br/> Thanks. | 0 |
11,261,956 | 06/29/2012 12:40:19 | 1,436,976 | 06/05/2012 09:16:24 | 25 | 0 | mysql and sqlalchemy with_lockmode('update') how it works? | cities = DBSession.query(City).filter(City.big=='Y').options(joinedload(City.hash)).limit(1)
t0 = time.time()
keyword_statuses = DBSession.query(KeywordStatus).filter(KeywordStatus.status==0).options(joinedload(KeywordStatus.keyword)).with_lockmode("update").limit(1)
for kw_status in keyword_statuses:
kw_status.status = 1
DBSession.commit()
t0 = time.time()
w = SWorker(threads_no=1, network_server='http://192.168.1.242:8180/', keywords=keyword_statuses, cities=cities, saver=MySqlRawSave(DBSession), loglevel='debug')
w.work()
print 'finished'
The above code selects from table a keyword status with select for update.
That it locks the row until the row is updated.
As you can see I update the row and commit the change.
kw_status.status = 1
DBSession.commit()
After that I create a SWorker object which puts tasks in a queue and creates a
number of threads that process the queue ( here just one for simplicity ).
The worker when it finishes processing updates the
kw_status.status = 2
DBSession.commit()
at this point I get an exception
(1205, 'Lock wait timeout exceeded; try restarting transaction') 'UPDATE g_search_keyword_status SET status=%s WHERE g_search_keyword_status.keyword_id = %s' (2, 10000001L)
So it seems that the row is locked. But before I start the worker I have updated the
status to 1 and I have commit the change so the row should be unlocked.
Also I use a scoped_session
DBSession = scoped_session(
sessionmaker(
autoflush=True,
autocommit=False,
bind=engine
)
)
| python | mysql | sqlalchemy | null | null | null | open | mysql and sqlalchemy with_lockmode('update') how it works?
===
cities = DBSession.query(City).filter(City.big=='Y').options(joinedload(City.hash)).limit(1)
t0 = time.time()
keyword_statuses = DBSession.query(KeywordStatus).filter(KeywordStatus.status==0).options(joinedload(KeywordStatus.keyword)).with_lockmode("update").limit(1)
for kw_status in keyword_statuses:
kw_status.status = 1
DBSession.commit()
t0 = time.time()
w = SWorker(threads_no=1, network_server='http://192.168.1.242:8180/', keywords=keyword_statuses, cities=cities, saver=MySqlRawSave(DBSession), loglevel='debug')
w.work()
print 'finished'
The above code selects from table a keyword status with select for update.
That it locks the row until the row is updated.
As you can see I update the row and commit the change.
kw_status.status = 1
DBSession.commit()
After that I create a SWorker object which puts tasks in a queue and creates a
number of threads that process the queue ( here just one for simplicity ).
The worker when it finishes processing updates the
kw_status.status = 2
DBSession.commit()
at this point I get an exception
(1205, 'Lock wait timeout exceeded; try restarting transaction') 'UPDATE g_search_keyword_status SET status=%s WHERE g_search_keyword_status.keyword_id = %s' (2, 10000001L)
So it seems that the row is locked. But before I start the worker I have updated the
status to 1 and I have commit the change so the row should be unlocked.
Also I use a scoped_session
DBSession = scoped_session(
sessionmaker(
autoflush=True,
autocommit=False,
bind=engine
)
)
| 0 |
11,261,961 | 06/29/2012 12:40:25 | 1,491,148 | 06/29/2012 12:26:29 | 1 | 0 | reloading header frame in jsp to update username | I have a web-app using jsf.
In the welcome page there is a header frame on the header in a label Guest is displayed if user is not logged in and it should display username once user has logged in.
i am using the below code to display it
< h:outputLabel id="txtuserLabel" value="#{customerBean.userName}"/>
Now once user logs in, I reload the header.jsp frame using java script
parent.frames['headlayout'].location.reload();
Though the header page gets reloaded but the value of the outputLabel doesn't get updated.
How to get the label value updated once user logs in?
note: the value in bean is getting updated
Kindly help. | html | jsf-2.0 | javabeans | frame | null | null | open | reloading header frame in jsp to update username
===
I have a web-app using jsf.
In the welcome page there is a header frame on the header in a label Guest is displayed if user is not logged in and it should display username once user has logged in.
i am using the below code to display it
< h:outputLabel id="txtuserLabel" value="#{customerBean.userName}"/>
Now once user logs in, I reload the header.jsp frame using java script
parent.frames['headlayout'].location.reload();
Though the header page gets reloaded but the value of the outputLabel doesn't get updated.
How to get the label value updated once user logs in?
note: the value in bean is getting updated
Kindly help. | 0 |
11,261,963 | 06/29/2012 12:40:32 | 1,491,135 | 06/29/2012 12:17:51 | 1 | 0 | Avoiding version update while adding entity to a collection with many-to-many relationship - Nhibernate | Consider this example to understand the issue I have..
There are 3 entities - Company, TicketOwner & Ticket
Company{Id, Name, Location}
Ticket{ Id, Date, Rate}
TicketOwner{ OwnerId, TicketId} - OwnerId can be Company/Person/Group etc
We have established a many-to-many relaptionship between company and ticket using Nhibernate. Though at database level this relationships doesn't exist. So TicketOwner turns out to be the third table. There is one-to-many relationship between Ticket >> TicketOwner at database level. But there is no relationship between company and TicketOwner tables at database level.
At Nhibernate level we have established Many-to-Many relationship using following mapping
HasManyToMany<Ticket>(Reveal.Member<Company>("ShowTickets"))
.AsBag()
.Access.CamelCaseField(Prefix.Underscore)
.Table("TicketOwner")
.ParentKeyColumn("OwnerId")
.ChildKeyColumn("TicketId")
.Cascade.SaveUpdate()
.LazyLoad();
Issue - When we add a ticket to ticket collection(ShowTickets) with Company, there is an update on Company to update the version number. Which I think is not required. Is there a way to avoid this version update while adding a ticket to ticket collection on Company.
| nhibernate | update | fluent-nhibernate | many-to-many | mappings | null | open | Avoiding version update while adding entity to a collection with many-to-many relationship - Nhibernate
===
Consider this example to understand the issue I have..
There are 3 entities - Company, TicketOwner & Ticket
Company{Id, Name, Location}
Ticket{ Id, Date, Rate}
TicketOwner{ OwnerId, TicketId} - OwnerId can be Company/Person/Group etc
We have established a many-to-many relaptionship between company and ticket using Nhibernate. Though at database level this relationships doesn't exist. So TicketOwner turns out to be the third table. There is one-to-many relationship between Ticket >> TicketOwner at database level. But there is no relationship between company and TicketOwner tables at database level.
At Nhibernate level we have established Many-to-Many relationship using following mapping
HasManyToMany<Ticket>(Reveal.Member<Company>("ShowTickets"))
.AsBag()
.Access.CamelCaseField(Prefix.Underscore)
.Table("TicketOwner")
.ParentKeyColumn("OwnerId")
.ChildKeyColumn("TicketId")
.Cascade.SaveUpdate()
.LazyLoad();
Issue - When we add a ticket to ticket collection(ShowTickets) with Company, there is an update on Company to update the version number. Which I think is not required. Is there a way to avoid this version update while adding a ticket to ticket collection on Company.
| 0 |
11,261,964 | 06/29/2012 12:40:33 | 457,500 | 09/24/2010 16:08:49 | 1,000 | 47 | Dealing with two DateTimePicker too error prone? | So often, I want the user to select a start date and a finish date. But just selecting date is not enough, we also have to alter the data.
By default, the `DateTimePicker.Value` are like
Value 1: 2012-01-01 10:12:09
Value 2: 2012-01-02 10:12:09
When the user selects two dates, it should be obvious that he meant
Value 1: 2012-01-01 00:00:00
Value 2: 2012-01-02 23:59:59
I often forget to do the non-intuitive
DateTime start = dateTimePicker1.Value.Date;
DateTime finish = dateTimePicker1.Value.Date.AddDays(1).AddSeconds(-1);
What more effective way of dealing with this have you found? | c# | null | null | null | null | null | open | Dealing with two DateTimePicker too error prone?
===
So often, I want the user to select a start date and a finish date. But just selecting date is not enough, we also have to alter the data.
By default, the `DateTimePicker.Value` are like
Value 1: 2012-01-01 10:12:09
Value 2: 2012-01-02 10:12:09
When the user selects two dates, it should be obvious that he meant
Value 1: 2012-01-01 00:00:00
Value 2: 2012-01-02 23:59:59
I often forget to do the non-intuitive
DateTime start = dateTimePicker1.Value.Date;
DateTime finish = dateTimePicker1.Value.Date.AddDays(1).AddSeconds(-1);
What more effective way of dealing with this have you found? | 0 |
11,430,095 | 07/11/2012 09:58:22 | 1,168,904 | 01/25/2012 09:59:45 | 490 | 1 | Are hoisting and reordering the same thing? | I read from [Effective Java][1] that In the absence of synchronization the following sequence A below can be converted into sequence B and this is called hoisting. I also read somewhere that if variables are not declared as volatile instructions involving the variables can be reordered . Are hoisting and reordering the same thing?
while (!done) sequence A
i++;
if (!done)
while (true) sequence B
i++;
[1]:http://books.google.co.in/books/about/Effective_Java.html?id=Ft8t0S4VjmwC&redir_esc=y | java | java-memory-model | null | null | null | null | open | Are hoisting and reordering the same thing?
===
I read from [Effective Java][1] that In the absence of synchronization the following sequence A below can be converted into sequence B and this is called hoisting. I also read somewhere that if variables are not declared as volatile instructions involving the variables can be reordered . Are hoisting and reordering the same thing?
while (!done) sequence A
i++;
if (!done)
while (true) sequence B
i++;
[1]:http://books.google.co.in/books/about/Effective_Java.html?id=Ft8t0S4VjmwC&redir_esc=y | 0 |
11,430,096 | 07/11/2012 09:58:24 | 829,194 | 07/05/2011 07:31:28 | 618 | 47 | How to Populate CreatedOn and ModifedOn? | I just started with .net mvc 3. I created model class and added logger fields CreatedOn and ModifiedOn. And I created A crud class for the same model. I want to handle this loggers without any form input filed and want to add to db table automatically. How can I achieve this? Please... | asp.net-mvc-3 | null | null | null | null | null | open | How to Populate CreatedOn and ModifedOn?
===
I just started with .net mvc 3. I created model class and added logger fields CreatedOn and ModifiedOn. And I created A crud class for the same model. I want to handle this loggers without any form input filed and want to add to db table automatically. How can I achieve this? Please... | 0 |
11,430,097 | 07/11/2012 09:58:24 | 1,508,311 | 07/07/2012 05:42:14 | 32 | 0 | Why this column cannot be updated using DropDownList inside the GridView? | I have the following database design:
Employee Table: Username, Name, JobTitle, BadgeNo, IsActive, DivisionCode
Divisions Table: SapCode, DivisionShortcut
***(DivisionCode is a foreign key to the SapCode in the Divisions Table)***
And I have a GridView that I am using it to add, delete and update/edit the employees information. This information is employee Username, Name, BadgeNo, JobTitle, IsActive and the DivisionShortcut. The Divisions will be listed in DropDownList. The problem now is: with updating the division of the employee. I wrote the code but I got the following error:
*
> Invalid column name 'DivisionShortcut'.
*
ASP.NET Code:
<asp:GridView ID="GridView1" runat="server" AllowSorting="True"
AutoGenerateColumns="False" DataKeyNames="Username"
DataSourceID="SqlDataSource1" BorderWidth="1px" BackColor="#DEBA84"
CellPadding="3" CellSpacing="2" BorderStyle="None"
BorderColor="#DEBA84" OnRowEditing="GridView1_RowEditing"
OnRowCancelingEdit="GridView1_RowCancelingEdit"
OnRowUpdating="GridView1_RowUpdating">
<FooterStyle ForeColor="#8C4510"
BackColor="#F7DFB5"></FooterStyle>
<PagerStyle ForeColor="#8C4510"
HorizontalAlign="Center"></PagerStyle>
<HeaderStyle ForeColor="White" Font-Bold="True"
BackColor="#A55129"></HeaderStyle>
<Columns>
<asp:CommandField ButtonType="Image" ShowEditButton="true" ShowCancelButton="true"
EditImageUrl="Images/icons/edit24.png" UpdateImageUrl="Images/icons/update24.png"
CancelImageUrl="Images/icons/cancel324.png" />
<asp:TemplateField HeaderText="Division">
<ItemTemplate>
<%# Eval("DivisionShortcut")%>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DivisionsList" runat="server" DataSourceID="DivisionsListDataSource"
DataTextField="DivisionShortcut" DataValueField="SapCode">
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Username" HeaderText="Network ID" ReadOnly="True"
SortExpression="Username" />
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<%# Eval("Name")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtEmployeeName" runat="server" Text='<%# Bind("Name")%>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Job Title">
<ItemTemplate>
<%# Eval("JobTitle")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtJobTitle" runat="server" Text='<%# Bind("JobTitle")%>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Badge No.">
<ItemTemplate>
<%# Eval("BadgeNo")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtBadgeNo" runat="server" Text='<%# Bind("BadgeNo")%>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Is Active?">
<ItemTemplate>
<%# Eval("IsActive")%>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="isActive" runat="server"
Checked='<%# Eval("IsActive").ToString().Equals("True") %>'/>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Delete?">
<ItemTemplate>
<span onclick="return confirm('Are you sure to Delete the record?')">
<asp:ImageButton ID="lnkB" runat="server" ImageUrl="Images/icons/delete24.png" CommandName="Delete" />
</span>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:UsersInfoDBConnectionString %>"
SelectCommand="SELECT dbo.Divisions.DivisionShortcut, dbo.employee.Username, dbo.employee.Name, dbo.employee.JobTitle, dbo.employee.BadgeNo, dbo.employee.IsActive
FROM dbo.Divisions INNER JOIN
dbo.employee ON dbo.Divisions.SapCode = dbo.employee.DivisionCode"
UpdateCommand="UPDATE [employee] SET [Name] = @Name, [JobTitle] = @JobTitle,
[BadgeNo] = @BadgeNo WHERE [Username] = @Username"
DeleteCommand="DELETE FROM [employee] WHERE [Username] = @Username">
<UpdateParameters>
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="JobTitle" Type="String" />
<asp:Parameter Name="BadgeNo" Type="String" />
<asp:Parameter Name="Username" Type="String" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="Username" Type="String" />
</DeleteParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="DivisionsListDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:UsersInfoDBConnectionString %>"
SelectCommand="SELECT * FROM Divisions">
</asp:SqlDataSource>
Code-Behind:
//For editing any row in the GridView
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
}
//For canceling any editng in any row in the GridView
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
e.Cancel = true;
GridView1.EditIndex = -1;
}
//For updating the information in any row in the GridView
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
GridViewRow gvrow = GridView1.Rows[e.RowIndex];
DropDownList DivisionsList = (DropDownList)gvrow.FindControl("DivisionsList");
TextBox txtEmployeeName = (TextBox)gvrow.FindControl("txtEmployeeName");
TextBox txtJobTitle = (TextBox)gvrow.FindControl("txtJobTitle");
TextBox txtBadgeNo = (TextBox)gvrow.FindControl("txtBadgeNo");
CheckBox isActive = (CheckBox)gvrow.FindControl("isActive");
//For getting the ID (primary key) of that row
string username = GridView1.DataKeys[e.RowIndex].Value.ToString();
string name = txtEmployeeName.Text;
string jobTitle = txtJobTitle.Text;
string badgeNo = txtBadgeNo.Text;
string division = DivisionsList.SelectedValue.ToString();
UpdateEmployeeInfo(username, name, jobTitle, badgeNo, division);
}
private void UpdateEmployeeInfo(string username, string name, string jobTitle, string badgeNo, string division)
{
string connString = ConfigurationManager.ConnectionStrings["UsersInfoDBConnectionString"].ConnectionString;
SqlConnection conn = new SqlConnection(connString);
string update = @"UPDATE Employee SET Name = @Name, JobTitle = @JobTitle,
BadgeNo = @BadgeNo, DivisionShortcut = @division WHERE Username = @Username;
UPDATE Divisions SET [DivisionShortcut] = @division WHERE SapCode = @SapCode;";
SqlCommand cmd = new SqlCommand(update, conn);
cmd.Parameters.AddWithValue("@Name", name);
cmd.Parameters.AddWithValue("@JobTitle", jobTitle);
cmd.Parameters.AddWithValue("@BadgeNo", badgeNo);
cmd.Parameters.AddWithValue("@division", division);
cmd.Parameters.AddWithValue("@Username", username);
//cmd.Parameters.AddWithValue("@IsActive", isActive.checked);
try
{
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
GridView1.EditIndex = -1;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cmd.Dispose();
conn.Close();
conn.Dispose();
}
GridView1.DataBind();
}
**So how I can be able to update the Divivsion field for the employee using the DropDownList inside the GridView?** | c# | asp.net | sql | gridview | sql-server-2008-r2 | null | open | Why this column cannot be updated using DropDownList inside the GridView?
===
I have the following database design:
Employee Table: Username, Name, JobTitle, BadgeNo, IsActive, DivisionCode
Divisions Table: SapCode, DivisionShortcut
***(DivisionCode is a foreign key to the SapCode in the Divisions Table)***
And I have a GridView that I am using it to add, delete and update/edit the employees information. This information is employee Username, Name, BadgeNo, JobTitle, IsActive and the DivisionShortcut. The Divisions will be listed in DropDownList. The problem now is: with updating the division of the employee. I wrote the code but I got the following error:
*
> Invalid column name 'DivisionShortcut'.
*
ASP.NET Code:
<asp:GridView ID="GridView1" runat="server" AllowSorting="True"
AutoGenerateColumns="False" DataKeyNames="Username"
DataSourceID="SqlDataSource1" BorderWidth="1px" BackColor="#DEBA84"
CellPadding="3" CellSpacing="2" BorderStyle="None"
BorderColor="#DEBA84" OnRowEditing="GridView1_RowEditing"
OnRowCancelingEdit="GridView1_RowCancelingEdit"
OnRowUpdating="GridView1_RowUpdating">
<FooterStyle ForeColor="#8C4510"
BackColor="#F7DFB5"></FooterStyle>
<PagerStyle ForeColor="#8C4510"
HorizontalAlign="Center"></PagerStyle>
<HeaderStyle ForeColor="White" Font-Bold="True"
BackColor="#A55129"></HeaderStyle>
<Columns>
<asp:CommandField ButtonType="Image" ShowEditButton="true" ShowCancelButton="true"
EditImageUrl="Images/icons/edit24.png" UpdateImageUrl="Images/icons/update24.png"
CancelImageUrl="Images/icons/cancel324.png" />
<asp:TemplateField HeaderText="Division">
<ItemTemplate>
<%# Eval("DivisionShortcut")%>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DivisionsList" runat="server" DataSourceID="DivisionsListDataSource"
DataTextField="DivisionShortcut" DataValueField="SapCode">
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Username" HeaderText="Network ID" ReadOnly="True"
SortExpression="Username" />
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<%# Eval("Name")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtEmployeeName" runat="server" Text='<%# Bind("Name")%>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Job Title">
<ItemTemplate>
<%# Eval("JobTitle")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtJobTitle" runat="server" Text='<%# Bind("JobTitle")%>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Badge No.">
<ItemTemplate>
<%# Eval("BadgeNo")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtBadgeNo" runat="server" Text='<%# Bind("BadgeNo")%>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Is Active?">
<ItemTemplate>
<%# Eval("IsActive")%>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="isActive" runat="server"
Checked='<%# Eval("IsActive").ToString().Equals("True") %>'/>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Delete?">
<ItemTemplate>
<span onclick="return confirm('Are you sure to Delete the record?')">
<asp:ImageButton ID="lnkB" runat="server" ImageUrl="Images/icons/delete24.png" CommandName="Delete" />
</span>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:UsersInfoDBConnectionString %>"
SelectCommand="SELECT dbo.Divisions.DivisionShortcut, dbo.employee.Username, dbo.employee.Name, dbo.employee.JobTitle, dbo.employee.BadgeNo, dbo.employee.IsActive
FROM dbo.Divisions INNER JOIN
dbo.employee ON dbo.Divisions.SapCode = dbo.employee.DivisionCode"
UpdateCommand="UPDATE [employee] SET [Name] = @Name, [JobTitle] = @JobTitle,
[BadgeNo] = @BadgeNo WHERE [Username] = @Username"
DeleteCommand="DELETE FROM [employee] WHERE [Username] = @Username">
<UpdateParameters>
<asp:Parameter Name="Name" Type="String" />
<asp:Parameter Name="JobTitle" Type="String" />
<asp:Parameter Name="BadgeNo" Type="String" />
<asp:Parameter Name="Username" Type="String" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="Username" Type="String" />
</DeleteParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="DivisionsListDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:UsersInfoDBConnectionString %>"
SelectCommand="SELECT * FROM Divisions">
</asp:SqlDataSource>
Code-Behind:
//For editing any row in the GridView
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
}
//For canceling any editng in any row in the GridView
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
e.Cancel = true;
GridView1.EditIndex = -1;
}
//For updating the information in any row in the GridView
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
GridViewRow gvrow = GridView1.Rows[e.RowIndex];
DropDownList DivisionsList = (DropDownList)gvrow.FindControl("DivisionsList");
TextBox txtEmployeeName = (TextBox)gvrow.FindControl("txtEmployeeName");
TextBox txtJobTitle = (TextBox)gvrow.FindControl("txtJobTitle");
TextBox txtBadgeNo = (TextBox)gvrow.FindControl("txtBadgeNo");
CheckBox isActive = (CheckBox)gvrow.FindControl("isActive");
//For getting the ID (primary key) of that row
string username = GridView1.DataKeys[e.RowIndex].Value.ToString();
string name = txtEmployeeName.Text;
string jobTitle = txtJobTitle.Text;
string badgeNo = txtBadgeNo.Text;
string division = DivisionsList.SelectedValue.ToString();
UpdateEmployeeInfo(username, name, jobTitle, badgeNo, division);
}
private void UpdateEmployeeInfo(string username, string name, string jobTitle, string badgeNo, string division)
{
string connString = ConfigurationManager.ConnectionStrings["UsersInfoDBConnectionString"].ConnectionString;
SqlConnection conn = new SqlConnection(connString);
string update = @"UPDATE Employee SET Name = @Name, JobTitle = @JobTitle,
BadgeNo = @BadgeNo, DivisionShortcut = @division WHERE Username = @Username;
UPDATE Divisions SET [DivisionShortcut] = @division WHERE SapCode = @SapCode;";
SqlCommand cmd = new SqlCommand(update, conn);
cmd.Parameters.AddWithValue("@Name", name);
cmd.Parameters.AddWithValue("@JobTitle", jobTitle);
cmd.Parameters.AddWithValue("@BadgeNo", badgeNo);
cmd.Parameters.AddWithValue("@division", division);
cmd.Parameters.AddWithValue("@Username", username);
//cmd.Parameters.AddWithValue("@IsActive", isActive.checked);
try
{
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
GridView1.EditIndex = -1;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cmd.Dispose();
conn.Close();
conn.Dispose();
}
GridView1.DataBind();
}
**So how I can be able to update the Divivsion field for the employee using the DropDownList inside the GridView?** | 0 |
11,430,044 | 07/11/2012 09:55:39 | 1,514,057 | 07/10/2012 07:46:32 | 19 | 0 | clickale table llayout in android | In my application i have a table layout with 4 rows.In 1 row i displayed 2 data with some space in-between them which will look like having 2 columns.Now what i want is i have to start different intent by clicking this data.When i click 1st column it should start an intent and by clicking 2nd should start another intent.Is it possible to define region in table layout.Please help me.
Here is my table layout code:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingTop="4dip"
android:paddingBottom="6dip"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TableLayout
android:id="@+id/tablelayout"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:paddingRight="2dip"
android:stretchColumns="0,1">
<TableRow >
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Income">
</TextView>
<TextView
android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Expense" android:layout_marginLeft="-150dp">
</TextView>
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<View
android:id="@+id/line1"
android:layout_width="wrap_content"
android:layout_height="1dip"
android:layout_weight="1"
android:background="#FF909090"
android:padding="2dip" />
</TableRow>
<TableRow android:id="@+id/tablerowhouse" android:layout_marginTop="30px">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Household:" >
</TextView>
<TextView
android:id="@+id/text50" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Household:" android:layout_marginLeft="-250dp" >
</TextView>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Household:" android:layout_marginLeft="-150dp" >
</TextView>
<TextView
android:id="@+id/text53" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Household:" android:layout_marginLeft="-70dp" >
</TextView>
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<View
android:id="@+id/line1"
android:layout_width="wrap_content"
android:layout_height="1dip"
android:layout_weight="1"
android:background="#FF909090"
android:padding="2dip" />
</TableRow>
<TableRow android:layout_marginTop="40px">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Travel:" android:layout_span="3">
</TextView>
<TextView
android:id="@+id/text51"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Travel" android:layout_marginLeft="-250dp">
</TextView>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Travel:" android:layout_marginLeft="-150dp" >
</TextView>
<TextView
android:id="@+id/text54" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Travel:" android:layout_marginLeft="-70dp">
</TextView>
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<View
android:id="@+id/line1"
android:layout_width="wrap_content"
android:layout_height="1dip"
android:layout_weight="1"
android:background="#FF909090"
android:padding="2dip" />
</TableRow>
<TableRow android:layout_marginTop="40px">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Education:" android:layout_span="4">
</TextView>
<TextView
android:id="@+id/text52"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Education" android:layout_marginLeft="-250dp">
</TextView>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Education:" android:layout_marginLeft="-150dp" >
</TextView>
<TextView
android:id="@+id/text55" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Education:" android:layout_marginLeft="-70dp">
</TextView>
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<View
android:id="@+id/line1"
android:layout_width="wrap_content"
android:layout_height="1dip"
android:layout_weight="1"
android:background="#FF909090"
android:padding="2dip" />
</TableRow>
<TableRow android:layout_marginTop="40px">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Total:" android:layout_span="5">
</TextView>
<TextView
android:id="@+id/totincome"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Total" android:layout_marginLeft="-250dp">
</TextView>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Total:" android:layout_marginLeft="-150dp" >
</TextView>
<TextView
android:id="@+id/totexpense" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Total:" android:layout_marginLeft="-10dp">
</TextView>
</TableRow>
<TableRow android:layout_marginTop="40px">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Balance:" android:layout_span="6" android:layout_marginLeft="100dp" >
</TextView>
<TextView
android:id="@+id/balance"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="balance" android:layout_marginLeft="-150dp" >
</TextView>
</TableRow>
</TableLayout>
</LinearLayout>
| android | tablelayout | null | null | null | null | open | clickale table llayout in android
===
In my application i have a table layout with 4 rows.In 1 row i displayed 2 data with some space in-between them which will look like having 2 columns.Now what i want is i have to start different intent by clicking this data.When i click 1st column it should start an intent and by clicking 2nd should start another intent.Is it possible to define region in table layout.Please help me.
Here is my table layout code:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingTop="4dip"
android:paddingBottom="6dip"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TableLayout
android:id="@+id/tablelayout"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:paddingRight="2dip"
android:stretchColumns="0,1">
<TableRow >
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Income">
</TextView>
<TextView
android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Expense" android:layout_marginLeft="-150dp">
</TextView>
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<View
android:id="@+id/line1"
android:layout_width="wrap_content"
android:layout_height="1dip"
android:layout_weight="1"
android:background="#FF909090"
android:padding="2dip" />
</TableRow>
<TableRow android:id="@+id/tablerowhouse" android:layout_marginTop="30px">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Household:" >
</TextView>
<TextView
android:id="@+id/text50" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Household:" android:layout_marginLeft="-250dp" >
</TextView>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Household:" android:layout_marginLeft="-150dp" >
</TextView>
<TextView
android:id="@+id/text53" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Household:" android:layout_marginLeft="-70dp" >
</TextView>
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<View
android:id="@+id/line1"
android:layout_width="wrap_content"
android:layout_height="1dip"
android:layout_weight="1"
android:background="#FF909090"
android:padding="2dip" />
</TableRow>
<TableRow android:layout_marginTop="40px">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Travel:" android:layout_span="3">
</TextView>
<TextView
android:id="@+id/text51"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Travel" android:layout_marginLeft="-250dp">
</TextView>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Travel:" android:layout_marginLeft="-150dp" >
</TextView>
<TextView
android:id="@+id/text54" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Travel:" android:layout_marginLeft="-70dp">
</TextView>
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<View
android:id="@+id/line1"
android:layout_width="wrap_content"
android:layout_height="1dip"
android:layout_weight="1"
android:background="#FF909090"
android:padding="2dip" />
</TableRow>
<TableRow android:layout_marginTop="40px">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Education:" android:layout_span="4">
</TextView>
<TextView
android:id="@+id/text52"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Education" android:layout_marginLeft="-250dp">
</TextView>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Education:" android:layout_marginLeft="-150dp" >
</TextView>
<TextView
android:id="@+id/text55" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Education:" android:layout_marginLeft="-70dp">
</TextView>
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<View
android:id="@+id/line1"
android:layout_width="wrap_content"
android:layout_height="1dip"
android:layout_weight="1"
android:background="#FF909090"
android:padding="2dip" />
</TableRow>
<TableRow android:layout_marginTop="40px">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Total:" android:layout_span="5">
</TextView>
<TextView
android:id="@+id/totincome"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Total" android:layout_marginLeft="-250dp">
</TextView>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Total:" android:layout_marginLeft="-150dp" >
</TextView>
<TextView
android:id="@+id/totexpense" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Total:" android:layout_marginLeft="-10dp">
</TextView>
</TableRow>
<TableRow android:layout_marginTop="40px">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Balance:" android:layout_span="6" android:layout_marginLeft="100dp" >
</TextView>
<TextView
android:id="@+id/balance"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="balance" android:layout_marginLeft="-150dp" >
</TextView>
</TableRow>
</TableLayout>
</LinearLayout>
| 0 |
11,430,101 | 07/11/2012 09:58:38 | 1,498,591 | 07/03/2012 11:15:25 | 1 | 0 | Jenkins: Does SafeRestart plugin work while jenkins is running as a Tomact service? | Does SafeRestart plugin work while jenkins is running as a Tomact service on windows machine? I am getting "http status 500" error. | tomcat | jenkins | null | null | null | null | open | Jenkins: Does SafeRestart plugin work while jenkins is running as a Tomact service?
===
Does SafeRestart plugin work while jenkins is running as a Tomact service on windows machine? I am getting "http status 500" error. | 0 |
11,430,031 | 07/11/2012 09:54:46 | 240,921 | 12/30/2009 14:00:56 | 2,073 | 110 | Deploying a Cramp app to Torquebox | I've been developing a Cramp application (it makes basic use of Server-Sent Events and uses some EventMachine queues and so on), and it is working fine if I run it in Thin. However it would be nice to be able to deploy it to Torquebox (as this is what our production servers are running). The app deploys and runs fine (as a test, I can access a static route just fine through a Torquebox deployment). However, trying to hit any of the dynamic pages gives me "uncaught throw `async'".
Is there any way to make Torquebox play nicely with the async rack stuff that Cramp depends on?
Alternatively is there any nice way to make an app that I can easily run locally independently of Torquebox, but can also deploy in Torquebox (I don't want to have to write the same app twice).
Full error trace follows:
10:46:09,239 ERROR [org.torquebox.web.servlet.RackFilter] (http-localhost-127.0.0.1-8080-1) Error invoking Rack filter: org.jruby.exceptions.RaiseException: (ThreadError) uncaught throw `async' in thread 0x7d0
at org.jruby.RubyKernel.throw(org/jruby/RubyKernel.java:1212) [jruby.jar:]
at Abstract.process(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/cramp-0.15.1/lib/cramp/abstract.rb:26)
at (Anonymous).call(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/cramp-0.15.1/lib/cramp/abstract.rb:13)
at HttpRouter.process_destination_path(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/http_router-0.11.0/lib/http_router.rb:212)
at (Anonymous).call((eval):34)
at HttpRouter.raw_call(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/http_router-0.11.0/lib/http_router.rb:307)
at Static.call(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/rack-1.3.6/lib/rack/static.rb:53)
at Reloader.call(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/rack-1.3.6/lib/rack/reloader.rb:44)
10:46:09,241 ERROR [org.torquebox.web.servlet.RackFilter] (http-localhost-127.0.0.1-8080-1) Underlying Ruby exception
10:46:09,242 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/].[torquebox.static]] (http-localhost-127.0.0.1-8080-1) Servlet.service() for servlet torquebox.static threw exception: org.jruby.exceptions.RaiseException: (ThreadError) uncaught throw `async' in thread 0x7d0
at org.jruby.RubyKernel.throw(org/jruby/RubyKernel.java:1212) [jruby.jar:]
at Abstract.process(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/cramp-0.15.1/lib/cramp/abstract.rb:26)
at (Anonymous).call(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/cramp-0.15.1/lib/cramp/abstract.rb:13)
at HttpRouter.process_destination_path(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/http_router-0.11.0/lib/http_router.rb:212)
at (Anonymous).call((eval):34) at HttpRouter.raw_call(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/http_router-0.11.0/lib/http_router.rb:307)
at Static.call(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/rack-1.3.6/lib/rack/static.rb:53)
at Reloader.call(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/rack-1.3.6/lib/rack/reloader.rb:44) | ruby | jruby | torquebox | cramp | null | null | open | Deploying a Cramp app to Torquebox
===
I've been developing a Cramp application (it makes basic use of Server-Sent Events and uses some EventMachine queues and so on), and it is working fine if I run it in Thin. However it would be nice to be able to deploy it to Torquebox (as this is what our production servers are running). The app deploys and runs fine (as a test, I can access a static route just fine through a Torquebox deployment). However, trying to hit any of the dynamic pages gives me "uncaught throw `async'".
Is there any way to make Torquebox play nicely with the async rack stuff that Cramp depends on?
Alternatively is there any nice way to make an app that I can easily run locally independently of Torquebox, but can also deploy in Torquebox (I don't want to have to write the same app twice).
Full error trace follows:
10:46:09,239 ERROR [org.torquebox.web.servlet.RackFilter] (http-localhost-127.0.0.1-8080-1) Error invoking Rack filter: org.jruby.exceptions.RaiseException: (ThreadError) uncaught throw `async' in thread 0x7d0
at org.jruby.RubyKernel.throw(org/jruby/RubyKernel.java:1212) [jruby.jar:]
at Abstract.process(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/cramp-0.15.1/lib/cramp/abstract.rb:26)
at (Anonymous).call(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/cramp-0.15.1/lib/cramp/abstract.rb:13)
at HttpRouter.process_destination_path(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/http_router-0.11.0/lib/http_router.rb:212)
at (Anonymous).call((eval):34)
at HttpRouter.raw_call(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/http_router-0.11.0/lib/http_router.rb:307)
at Static.call(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/rack-1.3.6/lib/rack/static.rb:53)
at Reloader.call(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/rack-1.3.6/lib/rack/reloader.rb:44)
10:46:09,241 ERROR [org.torquebox.web.servlet.RackFilter] (http-localhost-127.0.0.1-8080-1) Underlying Ruby exception
10:46:09,242 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/].[torquebox.static]] (http-localhost-127.0.0.1-8080-1) Servlet.service() for servlet torquebox.static threw exception: org.jruby.exceptions.RaiseException: (ThreadError) uncaught throw `async' in thread 0x7d0
at org.jruby.RubyKernel.throw(org/jruby/RubyKernel.java:1212) [jruby.jar:]
at Abstract.process(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/cramp-0.15.1/lib/cramp/abstract.rb:26)
at (Anonymous).call(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/cramp-0.15.1/lib/cramp/abstract.rb:13)
at HttpRouter.process_destination_path(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/http_router-0.11.0/lib/http_router.rb:212)
at (Anonymous).call((eval):34) at HttpRouter.raw_call(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/http_router-0.11.0/lib/http_router.rb:307)
at Static.call(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/rack-1.3.6/lib/rack/static.rb:53)
at Reloader.call(/Users/zofrex/.rvm/gems/jruby-1.6.7.2/gems/rack-1.3.6/lib/rack/reloader.rb:44) | 0 |
11,430,032 | 07/11/2012 09:55:05 | 1,261,750 | 03/11/2012 01:57:24 | 24 | 2 | When exporting an xml file from excel, dates are become 5 digit numbers | When exporting an xml file from excel, dates are become 5 digit numbers.
07/01/2010 becomes 40185.
Same thing happens when I change the format of the cell from date to general.
Any ways to match the 5 digit number to the date?
Or someway to keep the date field in the xml file? | xml | excel | null | null | null | null | open | When exporting an xml file from excel, dates are become 5 digit numbers
===
When exporting an xml file from excel, dates are become 5 digit numbers.
07/01/2010 becomes 40185.
Same thing happens when I change the format of the cell from date to general.
Any ways to match the 5 digit number to the date?
Or someway to keep the date field in the xml file? | 0 |
11,430,108 | 07/11/2012 09:59:18 | 1,495,916 | 07/02/2012 11:22:58 | 11 | 0 | retrieving specific textview id from listview in onitemclicklistener | I am using this in my code , but if i print the "text" i get "Http response collected as xmldocument parsedchild node no 1child node no 1child node no 1child node no 1child node no 1child node no 11034_HAR" when i am supposed to get only 11034_HAR . Can someone explain to me why this is happening.
myList.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
TextView textView = (TextView) arg1.findViewById(R.id.siteid);
String text = textView.getText().toString();
System.out.println(text);
Intent intnt = new Intent(getApplicationContext(), SelectedSiteActivity.class);
startActivity(intnt);
}
}); | android | textview | null | null | null | null | open | retrieving specific textview id from listview in onitemclicklistener
===
I am using this in my code , but if i print the "text" i get "Http response collected as xmldocument parsedchild node no 1child node no 1child node no 1child node no 1child node no 1child node no 11034_HAR" when i am supposed to get only 11034_HAR . Can someone explain to me why this is happening.
myList.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
TextView textView = (TextView) arg1.findViewById(R.id.siteid);
String text = textView.getText().toString();
System.out.println(text);
Intent intnt = new Intent(getApplicationContext(), SelectedSiteActivity.class);
startActivity(intnt);
}
}); | 0 |
11,430,109 | 07/11/2012 09:59:19 | 450,720 | 03/26/2010 18:05:30 | 122 | 7 | Updating a scala case class | This question came to me this evening.
I have two case classes of the same type A and B.
A = Foo(a="foo", b="bar", c="baz")
B = Foo(a=None, b="etch", c=None)
I'm wondering if its possible to update case class A with B in a single operation.
C = B oper A = Foo(a="foo", b="etch", c="baz")
with parameters that are set as None ignored.
I have some intuition that it might be possible to do this with Scalaz by converting the class into a tuple/list first and converting back to a class after the operation is complete. Any ideas? | scala | scalaz | null | null | null | null | open | Updating a scala case class
===
This question came to me this evening.
I have two case classes of the same type A and B.
A = Foo(a="foo", b="bar", c="baz")
B = Foo(a=None, b="etch", c=None)
I'm wondering if its possible to update case class A with B in a single operation.
C = B oper A = Foo(a="foo", b="etch", c="baz")
with parameters that are set as None ignored.
I have some intuition that it might be possible to do this with Scalaz by converting the class into a tuple/list first and converting back to a class after the operation is complete. Any ideas? | 0 |
11,430,110 | 07/11/2012 09:59:20 | 18,856 | 09/19/2008 13:46:04 | 819 | 23 | Why does this parent element not fully contain its child? | When my browser window is maxmised this code works fine, the child is contained within the parent and the parent spans the width of the browser. However, when the browser window is smaller than the child elements width, the parent element fails to contain it (tested in chrome 20 and firefox 13)
http://jsfiddle.net/x9duU/
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example</title>
<style type="text/css">
#toolbar {
background-color:#cccccc;
padding:10px 0;
}
#nav {
background-color:#00cccc;
margin:0 auto;
width:1000px;
}
</style>
</head>
<body>
<div id="toolbar">
<div id="nav">NAVIGATION</div>
</div>
</body>
</html>
I can solve the problem by floating the parent and giving it a minimum with of 100% but this seems wrong. What can I do to solve this? | html | css | null | null | null | null | open | Why does this parent element not fully contain its child?
===
When my browser window is maxmised this code works fine, the child is contained within the parent and the parent spans the width of the browser. However, when the browser window is smaller than the child elements width, the parent element fails to contain it (tested in chrome 20 and firefox 13)
http://jsfiddle.net/x9duU/
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example</title>
<style type="text/css">
#toolbar {
background-color:#cccccc;
padding:10px 0;
}
#nav {
background-color:#00cccc;
margin:0 auto;
width:1000px;
}
</style>
</head>
<body>
<div id="toolbar">
<div id="nav">NAVIGATION</div>
</div>
</body>
</html>
I can solve the problem by floating the parent and giving it a minimum with of 100% but this seems wrong. What can I do to solve this? | 0 |
11,430,111 | 07/11/2012 09:59:22 | 1,254,384 | 03/07/2012 10:16:15 | 15 | 0 | Apostrophes issue while passing as parameter | i tried to fix an issue with apostrophes but did not succeed. Please have a look into this and suggest me the needful.
I am fetching a value from database which has apostrophes. I am passing the value using a variable into another javascript function. But because of the apostrophe, the function is not executing. Please have a look into below mentioned code.
**PHP code:**
<?php
$Id = $abc->id;
$str = $abc->street; // output: 111 O'CG street
?>
**HTML:**
<a href="javascript:void(0)" onclick="show_details(<?php echo $Id1;?>,'<?php echo $str;?>')">
Display
</a>
I tried to use the HTML code using backslash as well. But did not overcome the issue.
**Code with backslash:**
<a href="javascript:void(0)" onclick="show_details(<?php echo $Id1;?>,\"<?php echo $str;?>\")">
Display
</a>
Please suggest me. Thanks in advance.
| php | javascript | mysql | apostrophe | htmlspecialchars | null | open | Apostrophes issue while passing as parameter
===
i tried to fix an issue with apostrophes but did not succeed. Please have a look into this and suggest me the needful.
I am fetching a value from database which has apostrophes. I am passing the value using a variable into another javascript function. But because of the apostrophe, the function is not executing. Please have a look into below mentioned code.
**PHP code:**
<?php
$Id = $abc->id;
$str = $abc->street; // output: 111 O'CG street
?>
**HTML:**
<a href="javascript:void(0)" onclick="show_details(<?php echo $Id1;?>,'<?php echo $str;?>')">
Display
</a>
I tried to use the HTML code using backslash as well. But did not overcome the issue.
**Code with backslash:**
<a href="javascript:void(0)" onclick="show_details(<?php echo $Id1;?>,\"<?php echo $str;?>\")">
Display
</a>
Please suggest me. Thanks in advance.
| 0 |
11,430,113 | 07/11/2012 09:59:26 | 485,978 | 10/25/2010 02:08:24 | 106 | 1 | Annotation in AST | Anyone knows how to put Annotation in a Declared Method or in a Class?
Im trying to create a junit java classes. One a Test Suite, the other a Test Script.
I have created the java classes, except the annotation @Test for the testMethod and Annotations in Test Suite. Please note that this is a JUnit4 suite and script. | java | eclipse | junit | ast | null | null | open | Annotation in AST
===
Anyone knows how to put Annotation in a Declared Method or in a Class?
Im trying to create a junit java classes. One a Test Suite, the other a Test Script.
I have created the java classes, except the annotation @Test for the testMethod and Annotations in Test Suite. Please note that this is a JUnit4 suite and script. | 0 |
11,430,115 | 07/11/2012 09:59:27 | 480,391 | 09/16/2010 11:20:02 | 655 | 42 | Domain model object to access another domain mode object | Service has dal and domain model layers. Domain model has access to dal for manipulating db through it. Now a need arises to have some properties from another object within domain model (this will ease client usage significantly). But I am confused as to where to fill those properties (from "alien") object into a given object. Can I do it in domain model? Or in a service itself? | design-patterns | domain-driven-design | null | null | null | null | open | Domain model object to access another domain mode object
===
Service has dal and domain model layers. Domain model has access to dal for manipulating db through it. Now a need arises to have some properties from another object within domain model (this will ease client usage significantly). But I am confused as to where to fill those properties (from "alien") object into a given object. Can I do it in domain model? Or in a service itself? | 0 |
11,430,118 | 07/11/2012 09:59:33 | 395,901 | 07/13/2010 17:04:07 | 677 | 39 | Codeigniter + HMVC + REST | I'm working on Codeigniter + HMVC based application and I'm trying to add a new module. I use Phil Sturgeon's **REST_Controller 2.6.0** and **Format** libraries to create an REST API as a module.
When I try to get for example http://api.example.com/user/id/1/ or http://api.example.com/user/id/1/format/json I gеt the below error:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Api::$format
Filename: libraries/REST_Controller.php
Line Number: 380
In my **routes.php** I have this:
$route['user/id/(:num)/format/(:any)'] = "api/user/$1/format/$2";
$route['user/id/(:num)'] = "api/user/$1";
The directory structure of the application is:
application
--modules
----api
------config
------controller
Finlay, I use the default configurations and I didn't change anything. The Format library is auto loaded in **autoload.php**. Any ideas?
| php | api | codeigniter | rest | hmvc | null | open | Codeigniter + HMVC + REST
===
I'm working on Codeigniter + HMVC based application and I'm trying to add a new module. I use Phil Sturgeon's **REST_Controller 2.6.0** and **Format** libraries to create an REST API as a module.
When I try to get for example http://api.example.com/user/id/1/ or http://api.example.com/user/id/1/format/json I gеt the below error:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Api::$format
Filename: libraries/REST_Controller.php
Line Number: 380
In my **routes.php** I have this:
$route['user/id/(:num)/format/(:any)'] = "api/user/$1/format/$2";
$route['user/id/(:num)'] = "api/user/$1";
The directory structure of the application is:
application
--modules
----api
------config
------controller
Finlay, I use the default configurations and I didn't change anything. The Format library is auto loaded in **autoload.php**. Any ideas?
| 0 |
11,327,138 | 07/04/2012 10:21:02 | 534,349 | 08/23/2010 10:58:34 | 96 | 1 | KnockoutJS duplicating data overhead | For the past few days I'm getting more interested in Knockoutjs. It looks very promising because it models the MVVM pattern and WPF like bindings, but i do have some doubts whenever it bring something useful to non RIA web apps (and when i say RIA i mean complex in browser applications, let's say an ERP, anyway something a bit more complex than adding a few rows to a table and hiding one)
Let's say you have a combobox with 10 items, and you need to be able to create on client side another 2 items and save them on the server.
The way i see it you would have to create a viewmodel with a Obs. array prefilled with the 10 items, and also render the 10 items inside the combobox (as 10 option elements).
Basically you would have 2 loop twice the item collection and render the items in js viewmodel and the combobox (options).
Now imagine you would have 30 controls wouldn't having information on both knockout view model and html controls with prefilled data be an overhead ? | data | knockout.js | overhead | null | null | null | open | KnockoutJS duplicating data overhead
===
For the past few days I'm getting more interested in Knockoutjs. It looks very promising because it models the MVVM pattern and WPF like bindings, but i do have some doubts whenever it bring something useful to non RIA web apps (and when i say RIA i mean complex in browser applications, let's say an ERP, anyway something a bit more complex than adding a few rows to a table and hiding one)
Let's say you have a combobox with 10 items, and you need to be able to create on client side another 2 items and save them on the server.
The way i see it you would have to create a viewmodel with a Obs. array prefilled with the 10 items, and also render the 10 items inside the combobox (as 10 option elements).
Basically you would have 2 loop twice the item collection and render the items in js viewmodel and the combobox (options).
Now imagine you would have 30 controls wouldn't having information on both knockout view model and html controls with prefilled data be an overhead ? | 0 |
11,326,857 | 07/04/2012 10:05:21 | 1,501,219 | 07/04/2012 09:58:12 | 1 | 0 | Is there a way to set an ASP.Net hidden field value to NULL using Javascript? | I'm looking at tons of examples of how to set a hidden field value using Javascript. My question is actually, can you set a hidden field value to NULL using Javascript / jquery, then have that NULL reflected in the value on serverside?
Every time I try and set null, I get back blank.
I have a specific requirement to know the difference between NULL and blank, and the only allowed mode of communication between client a server is a runat=server hidden field.
Any help would be greatly appreciated.
| javascript | jquery | asp.net | null | hidden-field | null | open | Is there a way to set an ASP.Net hidden field value to NULL using Javascript?
===
I'm looking at tons of examples of how to set a hidden field value using Javascript. My question is actually, can you set a hidden field value to NULL using Javascript / jquery, then have that NULL reflected in the value on serverside?
Every time I try and set null, I get back blank.
I have a specific requirement to know the difference between NULL and blank, and the only allowed mode of communication between client a server is a runat=server hidden field.
Any help would be greatly appreciated.
| 0 |
11,327,228 | 07/04/2012 10:25:56 | 1,379,734 | 05/07/2012 12:29:51 | 25 | 0 | How to resize multiple canvas in WPF? | I want to resize multiple shapes at same time.Here is my xaml code. It has 2 canvas called g6 and g10 but in real project i got nearly 100 canvas. Any solution?
<Canvas xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="svg2" Width="612" Height="800" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Canvas x:Name="g4" RenderTransform="1.3702001,0,0,1.4522231,268.12186,265.31238">
<Canvas x:Name="g6">
<Path Fill="#FFFFFFFF" Stroke="#FF000000" StrokeThickness="0.172" StrokeMiterLimit="4" x:Name="path8" Data="F1 M-153.219,-37.369C-153.219,-37.369 -153.168,-36.483 -153.579,-36.491 -153.99,-36.5 -162.189,-58.998 -172.418,-57.948 -172.419,-57.948 -163.557,-61.389 -153.219,-37.369L-153.219,-37.369z" />
</Canvas>
<Canvas x:Name="g10">
<Path Fill="#FFFFFFFF" Stroke="#FF000000" StrokeThickness="0.172" StrokeMiterLimit="4" x:Name="path12" Data="F1 M-151.46,-38.783C-151.46,-38.783 -151.734,-37.933 -152.117,-38.073 -152.5,-38.212 -152.06,-61.988 -162.059,-64.269 -162.059,-64.269 -152.48,-64.673 -151.46,-38.783z" />
</Canvas>
</Canvas>
</Canvas>
| c# | wpf | forms | canvas | null | null | open | How to resize multiple canvas in WPF?
===
I want to resize multiple shapes at same time.Here is my xaml code. It has 2 canvas called g6 and g10 but in real project i got nearly 100 canvas. Any solution?
<Canvas xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="svg2" Width="612" Height="800" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Canvas x:Name="g4" RenderTransform="1.3702001,0,0,1.4522231,268.12186,265.31238">
<Canvas x:Name="g6">
<Path Fill="#FFFFFFFF" Stroke="#FF000000" StrokeThickness="0.172" StrokeMiterLimit="4" x:Name="path8" Data="F1 M-153.219,-37.369C-153.219,-37.369 -153.168,-36.483 -153.579,-36.491 -153.99,-36.5 -162.189,-58.998 -172.418,-57.948 -172.419,-57.948 -163.557,-61.389 -153.219,-37.369L-153.219,-37.369z" />
</Canvas>
<Canvas x:Name="g10">
<Path Fill="#FFFFFFFF" Stroke="#FF000000" StrokeThickness="0.172" StrokeMiterLimit="4" x:Name="path12" Data="F1 M-151.46,-38.783C-151.46,-38.783 -151.734,-37.933 -152.117,-38.073 -152.5,-38.212 -152.06,-61.988 -162.059,-64.269 -162.059,-64.269 -152.48,-64.673 -151.46,-38.783z" />
</Canvas>
</Canvas>
</Canvas>
| 0 |
11,327,229 | 07/04/2012 10:25:58 | 1,500,915 | 07/04/2012 08:07:28 | 1 | 0 | How to add custom registration fields in magento 1.5 | I have tried to add a custom custom registration fields in magento 1.5 0 I tried to do that following [Adding custom registration fields in magento 1.5][1] and mony other way I've founded But if i add any data during registration for these fields its not saved to the table customer_entity_varchar and neither attribute added in table eav_attribute this is my code :
In `app/local/etc/modules/Mycustommodule_Customer.xml` I have this :
<config>
<modules>
<Mycustommodule_Customer>
<active>true</active>
<codePool>local</codePool>
</Mycustommodule_Customer>
</modules>
</config>
In `app/local/Mycustommodule/Customer/etc/config.xml` this :
<?xml version="1.0"?>
<config>
<modules>
<Mycustommodule_Customer>
<version>0.1.0</version>
</Mycustommodule_Customer>
</modules>
<global>
<models>
<Mycustommodule_Customer>
<class>Mycustommodule_Customer_Model</class>
</Mycustommodule_Customer>
</models>
<resources>
<customerattribute_setup>
<setup>
<modules>Mycustommodule_Customer</modules>
<class>Mycustommodule_Customer_Model_Entity_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</customerattribute_setup>
<customerattribute_write>
<connection>
<use>core_write</use>
</connection>
</customerattribute_write>
<customerattribute_read>
<connection>
<use>core_read</use>
</connection>
</customerattribute_read>
</resources>
<blocks>
<mycustommodule_customerattribute>
<class>Mycustommodule_Customer_Block</class>
</mycustommodule_customerattribute>
</blocks>
<helpers>
<mycustommodule_customerattribute>
<class>Mycustommodule_Customer_Helper</class>
</mycustommodule_customerattribute>
</helpers>
<fieldsets>
<customer_account>
<phone><create>1</create><update>1</update></phone>
</customer_account>
</fieldsets>
</global>
</config>
In `app/local/Mycustommodule/Customer/Model/Entity/Setup.php` this :
class Mycustommodule_Customer_Model_Entity_Setup extends Mage_Customer_Model_Entity_Setup
{
public function getDefaultEntities()
{
$defaultEntities = parent::getDefaultEntities();
$defaultEntities['customer']['attributes']['phone'] = array(
'label' => 'Phone Number',
'visible' => 1,
'required' => 1,
'position' => 1,
);
return $defaultEntities;
}
}
In `app/local/Mycustommodule/Customer/sql/customerattribute_setup/mysql4-install-0.1.0.php` this :
$installer->startSetup();
$installer->addAttribute('customer','phone', array(
'label' => 'Phone Number',
'visible' => 1,
'required' => 1,
'position' => 1,
));
$installer->endSetup();
// Get Customer Type ID
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
$eid = $read->fetchRow(
"select entity_type_id from {$this->getTable('eav_entity_type')} where entity_type_code = 'customer'"
);
$customer_type_id = $eid['entity_type_id'];
// Save Attribute to the customer_form_attribute
$attribute = $eavConfig->getAttribute($customer_type_id, 'phone');
// Here is where you determine in wich areas of magento the attributes are used
$attribute->setData('used_in_forms', array('customer_account_edit', 'customer_account_create', 'adminhtml_customer'));
$attribute->save();
I added the filed into `app/design/frontend/default/mycustommodule/template/customer/form/register.phtml` and `app/design/frontend/default/mycustommodule/template/customer/form/edit.phtml`
What I did wrong or missed ???
[1]: http://stackoverflow.com/questions/6993392/adding-custom-registration-fields-in-magento-1-5 | magento | magento-1.5 | null | null | null | null | open | How to add custom registration fields in magento 1.5
===
I have tried to add a custom custom registration fields in magento 1.5 0 I tried to do that following [Adding custom registration fields in magento 1.5][1] and mony other way I've founded But if i add any data during registration for these fields its not saved to the table customer_entity_varchar and neither attribute added in table eav_attribute this is my code :
In `app/local/etc/modules/Mycustommodule_Customer.xml` I have this :
<config>
<modules>
<Mycustommodule_Customer>
<active>true</active>
<codePool>local</codePool>
</Mycustommodule_Customer>
</modules>
</config>
In `app/local/Mycustommodule/Customer/etc/config.xml` this :
<?xml version="1.0"?>
<config>
<modules>
<Mycustommodule_Customer>
<version>0.1.0</version>
</Mycustommodule_Customer>
</modules>
<global>
<models>
<Mycustommodule_Customer>
<class>Mycustommodule_Customer_Model</class>
</Mycustommodule_Customer>
</models>
<resources>
<customerattribute_setup>
<setup>
<modules>Mycustommodule_Customer</modules>
<class>Mycustommodule_Customer_Model_Entity_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</customerattribute_setup>
<customerattribute_write>
<connection>
<use>core_write</use>
</connection>
</customerattribute_write>
<customerattribute_read>
<connection>
<use>core_read</use>
</connection>
</customerattribute_read>
</resources>
<blocks>
<mycustommodule_customerattribute>
<class>Mycustommodule_Customer_Block</class>
</mycustommodule_customerattribute>
</blocks>
<helpers>
<mycustommodule_customerattribute>
<class>Mycustommodule_Customer_Helper</class>
</mycustommodule_customerattribute>
</helpers>
<fieldsets>
<customer_account>
<phone><create>1</create><update>1</update></phone>
</customer_account>
</fieldsets>
</global>
</config>
In `app/local/Mycustommodule/Customer/Model/Entity/Setup.php` this :
class Mycustommodule_Customer_Model_Entity_Setup extends Mage_Customer_Model_Entity_Setup
{
public function getDefaultEntities()
{
$defaultEntities = parent::getDefaultEntities();
$defaultEntities['customer']['attributes']['phone'] = array(
'label' => 'Phone Number',
'visible' => 1,
'required' => 1,
'position' => 1,
);
return $defaultEntities;
}
}
In `app/local/Mycustommodule/Customer/sql/customerattribute_setup/mysql4-install-0.1.0.php` this :
$installer->startSetup();
$installer->addAttribute('customer','phone', array(
'label' => 'Phone Number',
'visible' => 1,
'required' => 1,
'position' => 1,
));
$installer->endSetup();
// Get Customer Type ID
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
$eid = $read->fetchRow(
"select entity_type_id from {$this->getTable('eav_entity_type')} where entity_type_code = 'customer'"
);
$customer_type_id = $eid['entity_type_id'];
// Save Attribute to the customer_form_attribute
$attribute = $eavConfig->getAttribute($customer_type_id, 'phone');
// Here is where you determine in wich areas of magento the attributes are used
$attribute->setData('used_in_forms', array('customer_account_edit', 'customer_account_create', 'adminhtml_customer'));
$attribute->save();
I added the filed into `app/design/frontend/default/mycustommodule/template/customer/form/register.phtml` and `app/design/frontend/default/mycustommodule/template/customer/form/edit.phtml`
What I did wrong or missed ???
[1]: http://stackoverflow.com/questions/6993392/adding-custom-registration-fields-in-magento-1-5 | 0 |
11,327,235 | 07/04/2012 10:26:17 | 1,500,762 | 07/04/2012 06:59:55 | 1 | 1 | Passing data to tableView in Objective-C and learning about object scope | I've been working with straight objective-c for a few weeks now, and lately I've been building out tiny cocoa mac apps to get started on that front. I'm now trying to figure out a couple quirks I've run into with IB and Cocoa, and I'm fairly certain both are related to object scope.
Below is my file in question, nothing really special going on with the other imports. What is odd here is that my **list** variable will log two different arrays even though I'm targeting the class instance with **self**. Maybe I'm using this keyword wrong, or maybe I'm just missing something obvious, but either way, my **list** var is definitely tracked independently by both the update and create methods.
My second issue is that my **create** method doesn't work if it's not triggered by a IBAction. Currently I've chained it to a separate button to get my table view to reload with the **update** method. Why is it that my **create** method wont work if I set it to *void* and just call that method directly from another controller?
#import "Lesson_14AppDelegate.h"
#import "TableViewController.h"
#import "Transaction.h"
@implementation TableViewController
@synthesize list, transaction;
- (id) init
{
self = [super init];
if (self)
{
Transaction *aTransaction = [[Transaction alloc] init];
transaction = aTransaction;
list = [[NSMutableArray alloc] init];
}
return self;
}
- (NSInteger) numberOfRowsInTableView: (NSTableView *) tableView
{
return [self.list count];
}
- (id) tableView: (NSTableView *) tableView objectValueForTableColumn:(NSTableColumn *) tableColumn row: (NSInteger) row
{
Transaction *t = [self.list objectAtIndex:row];
NSString *identifier = [tableColumn identifier];
return [t valueForKey:identifier];
}
- (IBAction) update: (id) sender
{
[self.list addObject: self.transaction];
[tableView reloadData];
NSLog(@"list: %@", self.list);
}
- (IBAction) create: (float) amount : (NSString *) description
{
[self.list addObject: description];
[tableView reloadData];
NSLog(@"list: %@", self.list);
}
- (void) dealloc
{
[self.list release];
[self.transaction release];
[super dealloc];
}
@end
| objective-c | osx | cocoa | interface-builder | null | null | open | Passing data to tableView in Objective-C and learning about object scope
===
I've been working with straight objective-c for a few weeks now, and lately I've been building out tiny cocoa mac apps to get started on that front. I'm now trying to figure out a couple quirks I've run into with IB and Cocoa, and I'm fairly certain both are related to object scope.
Below is my file in question, nothing really special going on with the other imports. What is odd here is that my **list** variable will log two different arrays even though I'm targeting the class instance with **self**. Maybe I'm using this keyword wrong, or maybe I'm just missing something obvious, but either way, my **list** var is definitely tracked independently by both the update and create methods.
My second issue is that my **create** method doesn't work if it's not triggered by a IBAction. Currently I've chained it to a separate button to get my table view to reload with the **update** method. Why is it that my **create** method wont work if I set it to *void* and just call that method directly from another controller?
#import "Lesson_14AppDelegate.h"
#import "TableViewController.h"
#import "Transaction.h"
@implementation TableViewController
@synthesize list, transaction;
- (id) init
{
self = [super init];
if (self)
{
Transaction *aTransaction = [[Transaction alloc] init];
transaction = aTransaction;
list = [[NSMutableArray alloc] init];
}
return self;
}
- (NSInteger) numberOfRowsInTableView: (NSTableView *) tableView
{
return [self.list count];
}
- (id) tableView: (NSTableView *) tableView objectValueForTableColumn:(NSTableColumn *) tableColumn row: (NSInteger) row
{
Transaction *t = [self.list objectAtIndex:row];
NSString *identifier = [tableColumn identifier];
return [t valueForKey:identifier];
}
- (IBAction) update: (id) sender
{
[self.list addObject: self.transaction];
[tableView reloadData];
NSLog(@"list: %@", self.list);
}
- (IBAction) create: (float) amount : (NSString *) description
{
[self.list addObject: description];
[tableView reloadData];
NSLog(@"list: %@", self.list);
}
- (void) dealloc
{
[self.list release];
[self.transaction release];
[super dealloc];
}
@end
| 0 |
11,327,237 | 07/04/2012 10:26:30 | 1,448,795 | 06/11/2012 11:08:03 | 25 | 0 | posting value from one view to another on the link click | I've got two views namely Index view and Createdialog view.
The code for index view is:
<p>Search For: </p>
@Html.TextBox("companyName", Model);
and the code for Createdialog view is:
@foreach(var item in Model.branch)
{
<tr>
<td><a href="#">
@Html.DisplayFor(itemModel => item.companyName)
</a></td>
<td>@Html.DisplayFor(itemModel => item.branchName)</td>
<td>@Html.DisplayFor(itemModel => item.address)</td>
<td>
@Html.ActionLink("Delete", "Delete", new { id = item.branchId })
@Html.ActionLink("Select", "Index", new { id = item.companyName })
</td>
</tr>
}
Now I want to do is, to send the value of company id from createdialog view to index dialog view and show the companyName in the textbox. Provide suggestion... thank you.
| asp.net-mvc-3 | razor | null | null | null | null | open | posting value from one view to another on the link click
===
I've got two views namely Index view and Createdialog view.
The code for index view is:
<p>Search For: </p>
@Html.TextBox("companyName", Model);
and the code for Createdialog view is:
@foreach(var item in Model.branch)
{
<tr>
<td><a href="#">
@Html.DisplayFor(itemModel => item.companyName)
</a></td>
<td>@Html.DisplayFor(itemModel => item.branchName)</td>
<td>@Html.DisplayFor(itemModel => item.address)</td>
<td>
@Html.ActionLink("Delete", "Delete", new { id = item.branchId })
@Html.ActionLink("Select", "Index", new { id = item.companyName })
</td>
</tr>
}
Now I want to do is, to send the value of company id from createdialog view to index dialog view and show the companyName in the textbox. Provide suggestion... thank you.
| 0 |
11,327,239 | 07/04/2012 10:26:46 | 1,501,224 | 07/04/2012 10:00:47 | 1 | 0 | Error in Xcode "the view outlet was not set.'" | I've a problem in Xcode. Every time I run my app in Simulator, the app is stopped in a black screen view and the debugger write this code:
2012-07-04 11:54:08.348 myApp[661:f803] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "myappViewController" nib but the view outlet was not set.'
Searching through the web I've read to set the link between view and View in Outlets.
For "File's Owner" -> "Connections inspector" -> "Outlets" I have linked view to View.
The result is always the same. Same error.
There's another way to bypass this problem?
Thanks everyone | iphone | objective-c | xcode | viewcontroller | null | null | open | Error in Xcode "the view outlet was not set.'"
===
I've a problem in Xcode. Every time I run my app in Simulator, the app is stopped in a black screen view and the debugger write this code:
2012-07-04 11:54:08.348 myApp[661:f803] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "myappViewController" nib but the view outlet was not set.'
Searching through the web I've read to set the link between view and View in Outlets.
For "File's Owner" -> "Connections inspector" -> "Outlets" I have linked view to View.
The result is always the same. Same error.
There's another way to bypass this problem?
Thanks everyone | 0 |
11,327,242 | 07/04/2012 10:26:57 | 784,597 | 06/05/2011 09:07:37 | 902 | 3 | Liferay : providing tomcat path to build.username.properties | I am using windows 7 Operating System .
I have downloaded tomcat bundle and unzipped it inside the
D:\LiferayJulyServer\liferay-portal-6.1.0-ce-ga1\tomcat-7.0.23
so inside the build.username.properties file inside life ray plug in SDK
app.server.type=tomcat
app.server.dir=${project.dir}/../bundles/tomcat-6.0.26
app.server.deploy.dir=${app.server.dir}/webapps
app.server.lib.global.dir=${app.server.dir}/lib/ext
app.server.portal.dir=${app.server.dir}/webapps/ROOT
So my question is , can i provide the absolute path of tomcat this way
app.server.dir=D:\LiferayJulyServer\liferay-portal-6.1.0-ce-ga1\tomcat-7.0.23
Or please tell me if this is not the way to do it ??
Thanks in advance . | liferay | null | null | null | null | null | open | Liferay : providing tomcat path to build.username.properties
===
I am using windows 7 Operating System .
I have downloaded tomcat bundle and unzipped it inside the
D:\LiferayJulyServer\liferay-portal-6.1.0-ce-ga1\tomcat-7.0.23
so inside the build.username.properties file inside life ray plug in SDK
app.server.type=tomcat
app.server.dir=${project.dir}/../bundles/tomcat-6.0.26
app.server.deploy.dir=${app.server.dir}/webapps
app.server.lib.global.dir=${app.server.dir}/lib/ext
app.server.portal.dir=${app.server.dir}/webapps/ROOT
So my question is , can i provide the absolute path of tomcat this way
app.server.dir=D:\LiferayJulyServer\liferay-portal-6.1.0-ce-ga1\tomcat-7.0.23
Or please tell me if this is not the way to do it ??
Thanks in advance . | 0 |
11,297,768 | 07/02/2012 16:41:16 | 874,927 | 08/02/2011 15:19:48 | 478 | 18 | JQuery object seems to not be assigned a value in module | var Foo = Foo || {};
Foo.Controller = (funtion($){
var $page = $("#bar");
var init = function()
{
console.log($page); // outputs: []
console.log($.isEmptyObject($page)); // outputs: false
}
})(jQuery);
$("#FooPage").bind("pageinit", function () {
Foo.Controller.init();
});
Why does $page not seem to be assigned its value?
I am using JQuery Mobile and the pageinit is the mobile equivalent of document ready. | javascript | jquery | jquery-mobile | null | null | null | open | JQuery object seems to not be assigned a value in module
===
var Foo = Foo || {};
Foo.Controller = (funtion($){
var $page = $("#bar");
var init = function()
{
console.log($page); // outputs: []
console.log($.isEmptyObject($page)); // outputs: false
}
})(jQuery);
$("#FooPage").bind("pageinit", function () {
Foo.Controller.init();
});
Why does $page not seem to be assigned its value?
I am using JQuery Mobile and the pageinit is the mobile equivalent of document ready. | 0 |
11,297,870 | 07/02/2012 16:48:33 | 1,496,651 | 07/02/2012 16:41:48 | 1 | 0 | Facebook ads api create adgroups partial failure | Does facebook ads api allow partial failure when creating ads similar to google? Ex: If I'll create 5 ads on one call and two of them failed, will all of them fail? | facebook | api | partial | ads | null | null | open | Facebook ads api create adgroups partial failure
===
Does facebook ads api allow partial failure when creating ads similar to google? Ex: If I'll create 5 ads on one call and two of them failed, will all of them fail? | 0 |
11,297,955 | 07/02/2012 16:54:26 | 341,508 | 05/14/2010 18:12:03 | 8,174 | 358 | Is it Worth Achieving HATEOAS for Restful Web Services In Real World Usage? | I have been reading a lot about the potential benefits if I were to convert my existing Restful web services to be as HATEOS as possible. I understand the importance in providing links in the payload to reduce the consumer's burden in remembering the next valid available actions. However, I can't seem to wrap my head around how it will help the consumer of my Restful web services in reality.
To illustrate, I take this example from [Rest In Practice][1] book about making a coffee order:-
<order xmlns="http://schemas.restbucks.com">
<location>takeAway</location>
<item>
<name>latte</name>
<quantity>1</quantity>
<milk>whole</milk>
<size>small</size>
</item>
<cost>2.0</cost>
<status>payment-expected</status>
<link rel="payment" href="https://restbucks.com/payment/1234" />
</order>
Basically, this allows the consumer to make a payment defined by the `<link>` tag. However, in reality, the consumer still needs to know all the semantics of that web service call, for example, what method (POST or PUT) to use, what request parameters to use in the payload in order to make the payment, etc... in another word, the consumer still needs to rely on the WADL documentation to know how to make invoke this web service successfully. These <link> tags probably make more sense if they are all using GETs on one specific item. Otherwise, I really don't see much benefits in defining the links here... apart from the fact the consumer knows what actions they can invoke next, and then refer to the WADL to determine how to invoke it correctly.
My next concern is the possibility of ending up with a very heavy payload with all the `<link>` tags. For example, if a GET on /projects/1/users returns all the user information that belong project 1, I assume I will end up with the following <link> tags:-
<project>
<users>
<user id="12" name="mike" ... />
<user id="23" name="kurt" ... />
<user id="65" name="corey" ... />
</user>
<links>
<link rel="self" href="http://server/projects/1/users"/>
<link rel="create_user" href="http://server/projects/1/users"/>
<link rel="get_user_mike" href="http://server/projects/1/users/12"/>
<link rel="get_user_kurt" href="http://server/projects/1/users/23"/>
<link rel="get_user_corey" href="http://server/projects/1/users/65"/>
...
</links>
</project>
If a project contains say, 500 users... wouldn't I have 500 user links in the payload? Otherwise, what is the best approach in redesigning my web services to handle this situation? Or is this acceptable in real world?
Any thoughts or suggestions are greatly appreciated here. Thank you.
[1]: http://www.amazon.com/REST-Practice-Hypermedia-Systems-Architecture/dp/0596805829 | web-services | rest | hateoas | null | null | null | open | Is it Worth Achieving HATEOAS for Restful Web Services In Real World Usage?
===
I have been reading a lot about the potential benefits if I were to convert my existing Restful web services to be as HATEOS as possible. I understand the importance in providing links in the payload to reduce the consumer's burden in remembering the next valid available actions. However, I can't seem to wrap my head around how it will help the consumer of my Restful web services in reality.
To illustrate, I take this example from [Rest In Practice][1] book about making a coffee order:-
<order xmlns="http://schemas.restbucks.com">
<location>takeAway</location>
<item>
<name>latte</name>
<quantity>1</quantity>
<milk>whole</milk>
<size>small</size>
</item>
<cost>2.0</cost>
<status>payment-expected</status>
<link rel="payment" href="https://restbucks.com/payment/1234" />
</order>
Basically, this allows the consumer to make a payment defined by the `<link>` tag. However, in reality, the consumer still needs to know all the semantics of that web service call, for example, what method (POST or PUT) to use, what request parameters to use in the payload in order to make the payment, etc... in another word, the consumer still needs to rely on the WADL documentation to know how to make invoke this web service successfully. These <link> tags probably make more sense if they are all using GETs on one specific item. Otherwise, I really don't see much benefits in defining the links here... apart from the fact the consumer knows what actions they can invoke next, and then refer to the WADL to determine how to invoke it correctly.
My next concern is the possibility of ending up with a very heavy payload with all the `<link>` tags. For example, if a GET on /projects/1/users returns all the user information that belong project 1, I assume I will end up with the following <link> tags:-
<project>
<users>
<user id="12" name="mike" ... />
<user id="23" name="kurt" ... />
<user id="65" name="corey" ... />
</user>
<links>
<link rel="self" href="http://server/projects/1/users"/>
<link rel="create_user" href="http://server/projects/1/users"/>
<link rel="get_user_mike" href="http://server/projects/1/users/12"/>
<link rel="get_user_kurt" href="http://server/projects/1/users/23"/>
<link rel="get_user_corey" href="http://server/projects/1/users/65"/>
...
</links>
</project>
If a project contains say, 500 users... wouldn't I have 500 user links in the payload? Otherwise, what is the best approach in redesigning my web services to handle this situation? Or is this acceptable in real world?
Any thoughts or suggestions are greatly appreciated here. Thank you.
[1]: http://www.amazon.com/REST-Practice-Hypermedia-Systems-Architecture/dp/0596805829 | 0 |
11,297,956 | 07/02/2012 16:54:28 | 498,007 | 11/05/2010 04:47:21 | 55 | 1 | Box2D/AS3 Remove collision detection after some point | I am creating a collecting game.
I'm trying to create a magnet powerup:
<br/><br/>I have a static circle sensor.
<br/>Dynamic circles will from the top at random intervals.
<br/>Those that enter the sensor are pulled to its center.
<br/>I want to remove collision detection from any dynamic objects that enter the sensor.
Here's the code for my contact handler
public class MagnetContactHandler implements IContactListener
{
/* public functions */
public function MagnetContactHandler()
{
}
public function BeginContact(contact:b2Contact):void
{
var go1:GameObject = contact.GetFixtureA().GetBody().GetUserData();
var go2:GameObject;
if (go1 && go1.tag == Main.TAG_BALL)
{
go2 = contact.GetFixtureB().GetBody().GetUserData();
if (go2 && go2.tag == Main.TAG_MAGNET)
{
handleBeginContact(go1, go2, contact.GetManifold().m_localPoint);
}
}
go1 = contact.GetFixtureB().GetBody().GetUserData();
if (go1 && go1.tag == Main.TAG_BALL)
{
go2 = contact.GetFixtureA().GetBody().GetUserData();
if (go2 && go2.tag == Main.TAG_MAGNET)
{
handleBeginContact(go1, go2, contact.GetManifold().m_localPoint);
}
}
}
/* private functions */
private function handleBeginContact(go1:GameObject, go2:GameObject, contactPoint:b2Vec2):void
{
var magnet:Box2DCircle;
var ball:Box2DCircle;
if (go1.tag == Main.TAG_MAGNET)
{
magnet = Box2DCircle(go1);
ball = Box2DCircle(go2);
}
else
{
magnet = Box2DCircle(go2);
ball = Box2DCircle(go1);
var displacment:b2Vec2 = new b2Vec2(0, 0);
displacment.Add(magnet.body.GetPosition());
displacment.Subtract(ball.body.GetPosition());
displacment.Normalize();
displacment.x *= Main.IMPULSE_MAGNET;
displacment.y *= Main.IMPULSE_MAGNET;
// remove collision detection here
if (ball && ball.body) ball.body.ApplyImpulse(displacment,ball.body.GetPosition());
}
}
----------
Thank you in advance for your help. | actionscript-3 | flash | box2d | flashdevelop | null | null | open | Box2D/AS3 Remove collision detection after some point
===
I am creating a collecting game.
I'm trying to create a magnet powerup:
<br/><br/>I have a static circle sensor.
<br/>Dynamic circles will from the top at random intervals.
<br/>Those that enter the sensor are pulled to its center.
<br/>I want to remove collision detection from any dynamic objects that enter the sensor.
Here's the code for my contact handler
public class MagnetContactHandler implements IContactListener
{
/* public functions */
public function MagnetContactHandler()
{
}
public function BeginContact(contact:b2Contact):void
{
var go1:GameObject = contact.GetFixtureA().GetBody().GetUserData();
var go2:GameObject;
if (go1 && go1.tag == Main.TAG_BALL)
{
go2 = contact.GetFixtureB().GetBody().GetUserData();
if (go2 && go2.tag == Main.TAG_MAGNET)
{
handleBeginContact(go1, go2, contact.GetManifold().m_localPoint);
}
}
go1 = contact.GetFixtureB().GetBody().GetUserData();
if (go1 && go1.tag == Main.TAG_BALL)
{
go2 = contact.GetFixtureA().GetBody().GetUserData();
if (go2 && go2.tag == Main.TAG_MAGNET)
{
handleBeginContact(go1, go2, contact.GetManifold().m_localPoint);
}
}
}
/* private functions */
private function handleBeginContact(go1:GameObject, go2:GameObject, contactPoint:b2Vec2):void
{
var magnet:Box2DCircle;
var ball:Box2DCircle;
if (go1.tag == Main.TAG_MAGNET)
{
magnet = Box2DCircle(go1);
ball = Box2DCircle(go2);
}
else
{
magnet = Box2DCircle(go2);
ball = Box2DCircle(go1);
var displacment:b2Vec2 = new b2Vec2(0, 0);
displacment.Add(magnet.body.GetPosition());
displacment.Subtract(ball.body.GetPosition());
displacment.Normalize();
displacment.x *= Main.IMPULSE_MAGNET;
displacment.y *= Main.IMPULSE_MAGNET;
// remove collision detection here
if (ball && ball.body) ball.body.ApplyImpulse(displacment,ball.body.GetPosition());
}
}
----------
Thank you in advance for your help. | 0 |
11,297,847 | 07/02/2012 16:46:34 | 1,496,624 | 07/02/2012 16:30:25 | 1 | 0 | Sitecore, jQuery ajax, and WebMethod returns the page itself | I am trying to use jQuery ajax to call a WebMethod on an aspx page that I have in my application. I am following this article: http://encosia.com/using-jquery-to-directly-call-aspnet-ajax-page-methods/
I noticed that when I try to make the ajax call, it is giving me the page itself (myPage.aspx) and not the results of my WebMethod. At this point, I am basically using the code straight from the article above. The javascript is:
$(document).ready(function () {
// Add the page method call as an onclick handler for the div.
$("#Result").click(function () {
$.ajax({
type: "POST",
url: "myPage.aspx/GetDate",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
// Replace the div's content with the page method's return.
$("#Result").text(msg.d);
}
});
});
});
The myPage.aspx code-behind for the WebMethod is:
[WebMethod]
public static string GetDate()
{
return DateTime.Now.ToString();
}
The strange thing is that I had it working on a separate test page, but when I tried to integrate it into the actual page where I want to use it, it doesn't. I couldn't find anything that resolved my issue when searching the site and web.
I'm running Sitecore 6.5 and .NET Framework version 4.0. Can anyone help or provide insight? | jquery | ajax | sitecore | webmethod | null | null | open | Sitecore, jQuery ajax, and WebMethod returns the page itself
===
I am trying to use jQuery ajax to call a WebMethod on an aspx page that I have in my application. I am following this article: http://encosia.com/using-jquery-to-directly-call-aspnet-ajax-page-methods/
I noticed that when I try to make the ajax call, it is giving me the page itself (myPage.aspx) and not the results of my WebMethod. At this point, I am basically using the code straight from the article above. The javascript is:
$(document).ready(function () {
// Add the page method call as an onclick handler for the div.
$("#Result").click(function () {
$.ajax({
type: "POST",
url: "myPage.aspx/GetDate",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
// Replace the div's content with the page method's return.
$("#Result").text(msg.d);
}
});
});
});
The myPage.aspx code-behind for the WebMethod is:
[WebMethod]
public static string GetDate()
{
return DateTime.Now.ToString();
}
The strange thing is that I had it working on a separate test page, but when I tried to integrate it into the actual page where I want to use it, it doesn't. I couldn't find anything that resolved my issue when searching the site and web.
I'm running Sitecore 6.5 and .NET Framework version 4.0. Can anyone help or provide insight? | 0 |
11,297,960 | 07/02/2012 16:55:06 | 1,420,101 | 05/27/2012 12:03:36 | 1 | 1 | Eclipse viewer unable to instantiate com.mopub.mobileads.MoPubView when including the class in an xml layout | I was able to download and import the moPub libraries for android. After following the simple example on the moPub site, the application works fine in the emulator. However, the eclipse viewer is unable to show the screen properly after adding the control.
The xml include [based on the example]
<com.mopub.mobileads.MoPubView
android:id="@+id/adview"
android:layout_width="fill_parent"
android:layout_height="50px" />
results in the below error when I try to go to the "Graphical Layout" tab
The following classes could not be instantiated:
- com.mopub.mobileads.MoPubView (Open Class, Show Error Log)
See the Error Log (Window > Show View) for more details.
Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse
While this is more of an irritant than a showstopper, it is something I would rather have working. Thank you very much in advance.
| android | eclipse | mopub | null | null | null | open | Eclipse viewer unable to instantiate com.mopub.mobileads.MoPubView when including the class in an xml layout
===
I was able to download and import the moPub libraries for android. After following the simple example on the moPub site, the application works fine in the emulator. However, the eclipse viewer is unable to show the screen properly after adding the control.
The xml include [based on the example]
<com.mopub.mobileads.MoPubView
android:id="@+id/adview"
android:layout_width="fill_parent"
android:layout_height="50px" />
results in the below error when I try to go to the "Graphical Layout" tab
The following classes could not be instantiated:
- com.mopub.mobileads.MoPubView (Open Class, Show Error Log)
See the Error Log (Window > Show View) for more details.
Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse
While this is more of an irritant than a showstopper, it is something I would rather have working. Thank you very much in advance.
| 0 |
11,296,273 | 07/02/2012 15:04:45 | 1,389,110 | 05/11/2012 09:38:29 | 15 | 0 | Windows batch scripting - where to put a .bat such that it can be called from anwhere? | I know how to do this with a bash script on *n*x - by placing it in /usr/bin or /usr/local/bin.
Where in the Windows (7) file system should I place a **.bat** such that it can be called from any directory I'm in on the command line?
Thanks | windows | command-line | batch-file | null | null | null | open | Windows batch scripting - where to put a .bat such that it can be called from anwhere?
===
I know how to do this with a bash script on *n*x - by placing it in /usr/bin or /usr/local/bin.
Where in the Windows (7) file system should I place a **.bat** such that it can be called from any directory I'm in on the command line?
Thanks | 0 |
11,734,166 | 07/31/2012 06:12:34 | 1,459,420 | 06/15/2012 17:45:15 | 59 | 3 | How to apply multy style to single control in wpf? | <Window.Resources>
<Style TargetType="Button" x:Key="style_1">
<Setter Property="Foreground" Value="Green" />
</Style>
<Style TargetType="Button" x:Key="style_2">
<Setter Property="Background" Value="Blue" />
</Style>
</Window.Resources>
<Button x:Name="btn_1" Content="Button" HorizontalAlignment="Left" Height="40" Margin="153,95,0,0" VerticalAlignment="Top" Width="89" Style="{StaticResource style_1}" Click="Button_Click" />
<Button x:Name="btn_2" Content="Button" Height="40" Margin="281,95,262,0" VerticalAlignment="Top" Style="{StaticResource style_2}"/>
Now i want to apply style_1 and style_2 to **btn_1** what should i do for that.
| wpf | styles | null | null | null | null | open | How to apply multy style to single control in wpf?
===
<Window.Resources>
<Style TargetType="Button" x:Key="style_1">
<Setter Property="Foreground" Value="Green" />
</Style>
<Style TargetType="Button" x:Key="style_2">
<Setter Property="Background" Value="Blue" />
</Style>
</Window.Resources>
<Button x:Name="btn_1" Content="Button" HorizontalAlignment="Left" Height="40" Margin="153,95,0,0" VerticalAlignment="Top" Width="89" Style="{StaticResource style_1}" Click="Button_Click" />
<Button x:Name="btn_2" Content="Button" Height="40" Margin="281,95,262,0" VerticalAlignment="Top" Style="{StaticResource style_2}"/>
Now i want to apply style_1 and style_2 to **btn_1** what should i do for that.
| 0 |
11,734,171 | 07/31/2012 06:13:17 | 1,556,649 | 07/27/2012 04:44:21 | 121 | 20 | Dojo : Accordion open and close | > Please ref : [http://jsfiddle.net/n23F3/][1]
I want to know how to implement open & close on the Accordion Title (Red tab).
Now the first tab close only after clicking on the second tab.
I want to implement toggling(switch) on the click event. Can any one help?
[1]: http://jsfiddle.net/n23F3/ | javascript | html | css | dojo | accordion | null | open | Dojo : Accordion open and close
===
> Please ref : [http://jsfiddle.net/n23F3/][1]
I want to know how to implement open & close on the Accordion Title (Red tab).
Now the first tab close only after clicking on the second tab.
I want to implement toggling(switch) on the click event. Can any one help?
[1]: http://jsfiddle.net/n23F3/ | 0 |
11,734,172 | 07/31/2012 06:13:20 | 1,564,723 | 07/31/2012 05:11:19 | 1 | 1 | Jquery multiple file upload and delete | I have a multiple file upload concept required in my project.Suppose user wants to delete the file he already uploaded.
Suppose we have 3 file upload rows and the user deletes the 2nd one.Then the third upload row should come to 2nd then the third upload row having id and name of 2nd upload row.
How i will do that | jquery | null | null | null | null | null | open | Jquery multiple file upload and delete
===
I have a multiple file upload concept required in my project.Suppose user wants to delete the file he already uploaded.
Suppose we have 3 file upload rows and the user deletes the 2nd one.Then the third upload row should come to 2nd then the third upload row having id and name of 2nd upload row.
How i will do that | 0 |
11,734,173 | 07/31/2012 06:13:22 | 1,564,828 | 07/31/2012 06:04:09 | 1 | 0 | uiapplicationdidbecomeactivenotification is called any time? | I use uiapplicationdidbecomeactivenotification/UIApplicationWillResignActiveNotification pair to compute app running time. in callback of uiapplicationdidbecomeactivenotification, I record the startTime, and in callback of UIApplicationWillResignActiveNotification, I record endTime.
in most case, I find the running time is correct. but there are some special case in server's log, I find the running time is strange. like the end time less than start time, or the end time is much more than the start time. so I suspect the uiapplicationdidbecomeactivenotification is not called in some times. if some one meet such kind of case, and give me some suggestion. | iphone | objective-c | null | null | null | null | open | uiapplicationdidbecomeactivenotification is called any time?
===
I use uiapplicationdidbecomeactivenotification/UIApplicationWillResignActiveNotification pair to compute app running time. in callback of uiapplicationdidbecomeactivenotification, I record the startTime, and in callback of UIApplicationWillResignActiveNotification, I record endTime.
in most case, I find the running time is correct. but there are some special case in server's log, I find the running time is strange. like the end time less than start time, or the end time is much more than the start time. so I suspect the uiapplicationdidbecomeactivenotification is not called in some times. if some one meet such kind of case, and give me some suggestion. | 0 |
11,734,174 | 07/31/2012 06:13:34 | 515,772 | 11/22/2010 07:57:03 | 277 | 5 | Resolving KineticJS performance issues in FireFox | Am I the only one having really bad experiences with KineticJS in Firefox? I have tested v12 and v14.1, and they both have issues.
Trying to draw as little as possible, barely helps, and sometimes the browser stalls until you force-close it. | javascript | performance | html5 | canvas | kineticjs | null | open | Resolving KineticJS performance issues in FireFox
===
Am I the only one having really bad experiences with KineticJS in Firefox? I have tested v12 and v14.1, and they both have issues.
Trying to draw as little as possible, barely helps, and sometimes the browser stalls until you force-close it. | 0 |
11,734,176 | 07/31/2012 06:13:36 | 11,265 | 09/16/2008 06:41:51 | 1,293 | 34 | ComponentLookupError on Dexterity types during testing | I have a custom product with a number of Dexterity types, several of which are used by a setuphandler to create the site structure. This works without any issues outside of testing, but within tests it keeps failing:
Traceback (most recent call last):
[snip]
File "/opt/ctcc_plone/src/ctcc.model/ctcc/model/setuphandlers.py", line 52, in setupStructure
random = createSiteFolder(portal, 'ctcc.model.servicefolder', 'Randomisation', 'random')
File "/opt/ctcc_plone/src/ctcc.model/ctcc/model/setuphandlers.py", line 35, in createSiteFolder
return createContentInContainer(context, type, title=title, id=id)
File "/opt/ctcc_plone/eggs/plone.dexterity-1.1-py2.7.egg/plone/dexterity/utils.py", line 166, in createContentInContainer
content = createContent(portal_type, **kw)
File "/opt/ctcc_plone/eggs/plone.dexterity-1.1-py2.7.egg/plone/dexterity/utils.py", line 112, in createContent
fti = getUtility(IDexterityFTI, name=portal_type)
File "/opt/ctcc_plone/eggs/zope.component-3.9.5-py2.7.egg/zope/component/_api.py", line 169, in getUtility
raise ComponentLookupError(interface, name)
ComponentLookupError: (<InterfaceClass plone.dexterity.interfaces.IDexterityFTI>, 'ctcc.model.servicefolder')
I'm ensuring the package's profile is imported during setup:
<!-- language: python -->
class CTCCModelSandboxLayer(PloneSandboxLayer):
defaultBases = (PLONE_FIXTURE,)
def setUpZope(self, app, configurationContext):
import ctcc.model
self.loadZCML(package=ctcc.model)
def setUpPloneSite(self, portal):
self.applyProfile(portal, 'ctcc.model:default')
I've tried an explicit `applyProfile` on `plone.app.dexterity`, as well as `quickInstallProduct`, but for some reason the Dexterity FTI's don't appear to be registered at the time they're called.
I'm using Plone 4.1, Dexterity 1.1, and plone.app.testing 4.2 | testing | plone | null | null | null | null | open | ComponentLookupError on Dexterity types during testing
===
I have a custom product with a number of Dexterity types, several of which are used by a setuphandler to create the site structure. This works without any issues outside of testing, but within tests it keeps failing:
Traceback (most recent call last):
[snip]
File "/opt/ctcc_plone/src/ctcc.model/ctcc/model/setuphandlers.py", line 52, in setupStructure
random = createSiteFolder(portal, 'ctcc.model.servicefolder', 'Randomisation', 'random')
File "/opt/ctcc_plone/src/ctcc.model/ctcc/model/setuphandlers.py", line 35, in createSiteFolder
return createContentInContainer(context, type, title=title, id=id)
File "/opt/ctcc_plone/eggs/plone.dexterity-1.1-py2.7.egg/plone/dexterity/utils.py", line 166, in createContentInContainer
content = createContent(portal_type, **kw)
File "/opt/ctcc_plone/eggs/plone.dexterity-1.1-py2.7.egg/plone/dexterity/utils.py", line 112, in createContent
fti = getUtility(IDexterityFTI, name=portal_type)
File "/opt/ctcc_plone/eggs/zope.component-3.9.5-py2.7.egg/zope/component/_api.py", line 169, in getUtility
raise ComponentLookupError(interface, name)
ComponentLookupError: (<InterfaceClass plone.dexterity.interfaces.IDexterityFTI>, 'ctcc.model.servicefolder')
I'm ensuring the package's profile is imported during setup:
<!-- language: python -->
class CTCCModelSandboxLayer(PloneSandboxLayer):
defaultBases = (PLONE_FIXTURE,)
def setUpZope(self, app, configurationContext):
import ctcc.model
self.loadZCML(package=ctcc.model)
def setUpPloneSite(self, portal):
self.applyProfile(portal, 'ctcc.model:default')
I've tried an explicit `applyProfile` on `plone.app.dexterity`, as well as `quickInstallProduct`, but for some reason the Dexterity FTI's don't appear to be registered at the time they're called.
I'm using Plone 4.1, Dexterity 1.1, and plone.app.testing 4.2 | 0 |
11,734,181 | 07/31/2012 06:14:11 | 887,050 | 08/10/2011 02:38:10 | 292 | 4 | how would I mock a querystring | using the following in Moq
public Mock<HttpRequestBase> Request { get; set; }
how can I mock this Request[....]
(in controller)
var modelFromPost = Request["mymodel"]
here's what I have so far
public class ContextMocks
{
public Mock<HttpContextBase> HttpContext { get; set; }
public Mock<HttpRequestBase> Request { get; set; }
public RouteData RouteData { get; set; }
public ContextMocks(Controller controller)
{
HttpContext = new Mock<HttpContextBase>();
HttpContext.Setup(x => x.Request).Returns(Request.Object);
}
}
cheers! | asp.net-mvc-3 | mocking | null | null | null | null | open | how would I mock a querystring
===
using the following in Moq
public Mock<HttpRequestBase> Request { get; set; }
how can I mock this Request[....]
(in controller)
var modelFromPost = Request["mymodel"]
here's what I have so far
public class ContextMocks
{
public Mock<HttpContextBase> HttpContext { get; set; }
public Mock<HttpRequestBase> Request { get; set; }
public RouteData RouteData { get; set; }
public ContextMocks(Controller controller)
{
HttpContext = new Mock<HttpContextBase>();
HttpContext.Setup(x => x.Request).Returns(Request.Object);
}
}
cheers! | 0 |
11,734,186 | 07/31/2012 06:14:37 | 1,555,505 | 07/26/2012 17:14:12 | 3 | 0 | Compilation Error in perl script while giving present date in input file name | As per below script, Trying to give two Input files. Test_DDD111_20120731.csv and DDD111.txt.
Inside one folder this Test_DDD111*.csv file with different date will be available. I want to give only current date file as input inside this script.
I assign date as $deviationreportdate. But i am getting error, can anyone help me to solve this problem.
Error which i am getting:
Scalar found where operator expected at subscriberdump.pl line 58, near "/Test_DDD(\d+)/${deviationreportdate}"
(Missing operator before ${deviationreportdate}?)
syntax error at subscriberdump.pl line 58, near "/Test_DDD(\d+)/${deviationreportdate}"
Execution of test.pl aborted due to compilation errors.
`######################################`
#!/usr/bin/perl
use strict;
use warnings;
use strict;
use POSIX;
my @array123;
my $daysbefore;
my %month="";
my ($f2_field, @patterns, %patts, $f2_rec);
while (@ARGV)
{
my $par=shift;
if( $par eq "-d" )
{
$daysbefore=shift;
next;
}
}
sub getDate
{
my $daysago=shift;
$daysago=0 unless ($daysago);
my @months=qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
Localtime(time(86400*$daysago));
# YYYYMMDD, e.g. 20060126
return sprintf("%d%02d%02d",$year+1900,$mon+1,$mday);
}
my $deviationreportdate=getDate($daysbefore-1);
my $transactiondate=getDate($daysbefore);
open(OUTPUTFILE,"> /export/home/minsat/DRReports/DUMP/$filename");
for my $Test_file (<`Test_DDD*${deviationreportdate}`*>)
{
if ($Test_file =~ /Test_DDD(\d+)/${deviationreportdate}*)
{
my $file = "UEDP$1.txt";
my $ID="UEDP$1";
open AIN, "<$file" or die($file);
open BIN, "<$Test_file" or die($Test_file);
my %seen;
} | perl | null | null | null | null | null | open | Compilation Error in perl script while giving present date in input file name
===
As per below script, Trying to give two Input files. Test_DDD111_20120731.csv and DDD111.txt.
Inside one folder this Test_DDD111*.csv file with different date will be available. I want to give only current date file as input inside this script.
I assign date as $deviationreportdate. But i am getting error, can anyone help me to solve this problem.
Error which i am getting:
Scalar found where operator expected at subscriberdump.pl line 58, near "/Test_DDD(\d+)/${deviationreportdate}"
(Missing operator before ${deviationreportdate}?)
syntax error at subscriberdump.pl line 58, near "/Test_DDD(\d+)/${deviationreportdate}"
Execution of test.pl aborted due to compilation errors.
`######################################`
#!/usr/bin/perl
use strict;
use warnings;
use strict;
use POSIX;
my @array123;
my $daysbefore;
my %month="";
my ($f2_field, @patterns, %patts, $f2_rec);
while (@ARGV)
{
my $par=shift;
if( $par eq "-d" )
{
$daysbefore=shift;
next;
}
}
sub getDate
{
my $daysago=shift;
$daysago=0 unless ($daysago);
my @months=qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
Localtime(time(86400*$daysago));
# YYYYMMDD, e.g. 20060126
return sprintf("%d%02d%02d",$year+1900,$mon+1,$mday);
}
my $deviationreportdate=getDate($daysbefore-1);
my $transactiondate=getDate($daysbefore);
open(OUTPUTFILE,"> /export/home/minsat/DRReports/DUMP/$filename");
for my $Test_file (<`Test_DDD*${deviationreportdate}`*>)
{
if ($Test_file =~ /Test_DDD(\d+)/${deviationreportdate}*)
{
my $file = "UEDP$1.txt";
my $ID="UEDP$1";
open AIN, "<$file" or die($file);
open BIN, "<$Test_file" or die($Test_file);
my %seen;
} | 0 |
11,734,195 | 07/31/2012 06:15:42 | 1,455,376 | 06/14/2012 05:38:54 | 1 | 1 | Bootstrap Carousel Image does not scale proportionately | My carousel fills the width of the page, but when I scale down the window the y-axis does not respond.
Check it out here: http://sacgamehub.com/index.html
Any ideas? | carousel | bootstrap | null | null | null | null | open | Bootstrap Carousel Image does not scale proportionately
===
My carousel fills the width of the page, but when I scale down the window the y-axis does not respond.
Check it out here: http://sacgamehub.com/index.html
Any ideas? | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.