PostId int64 13 11.8M | PostCreationDate stringlengths 19 19 | OwnerUserId int64 3 1.57M | OwnerCreationDate stringlengths 10 19 | ReputationAtPostCreation int64 -33 210k | OwnerUndeletedAnswerCountAtPostTime int64 0 5.77k | Title stringlengths 10 250 | BodyMarkdown stringlengths 12 30k | Tag1 stringlengths 1 25 ⌀ | Tag2 stringlengths 1 25 ⌀ | Tag3 stringlengths 1 25 ⌀ | Tag4 stringlengths 1 25 ⌀ | Tag5 stringlengths 1 25 ⌀ | PostClosedDate stringlengths 19 19 ⌀ | OpenStatus stringclasses 5 values | unified_texts stringlengths 47 30.1k | OpenStatus_id int64 0 4 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
440,786 | 01/13/2009 21:03:25 | 38,663 | 11/18/2008 18:18:27 | 61 | 3 | junit & java : testing non-public methods | I'm new to doing serious unit testing as well as junit.
JUnit will only test those methods in my class that are public. How do I do junit testing on the ones that are not (i.e., private, protected)?
I can test them by not using junit, but I was wondering what the junit standard method was.
Please let me know.
Thanks,
jbu | junit | testing | public | method | test | null | open | junit & java : testing non-public methods
===
I'm new to doing serious unit testing as well as junit.
JUnit will only test those methods in my class that are public. How do I do junit testing on the ones that are not (i.e., private, protected)?
I can test them by not using junit, but I was wondering what the junit standard method was.
Please let me know.
Thanks,
jbu | 0 |
2,284,265 | 02/17/2010 20:47:19 | 275,581 | 02/17/2010 20:35:17 | 1 | 0 | how to use .vsprops file to override VC++ Directories in MS Visual Studio | I'd like to override the directories used by Visual Studio (devenv.exe) for the compiler and library paths. I know how to do this interactively via Tools->Options->VC++ Directories, but I'd like to automate this.
http://msdn.microsoft.com/en-us/library/t9az1d21(VS.80).aspx has a tantalizing note on this: "If you want to set up directory search paths (for your projects) that can be shared by other users or that can be applied across multiple computers, Visual C++ provides an alternative to using this dialog, through project property sheets. For more information, see Property Sheets (C++)."
If you follow the link to Property Sheets documentation, there's a bunch of information on the mechanism but none on the actual properties you need to set.
I found the information populated by the VC++ Directories dialog, in %LocalAppData%\Microsoft\VisualStudio\8.0\VCComponents.dat (for VS 2005, and 9.0 for VS 2008); it seems to set various properties under VC\VC_OBJECTS_PLATFORM_INFO\win32\Directories and ...\x64\Directories.
Has anyone done this before and know what the mapping is from the property names used in VCComponents.dat to the names to use in a .vsprops file?
I'd like this to work in VS2005, VS2008 and VS2010, ideally.
I don't have VS2010 installed, but apparently Microsoft has completely done away with the VC++ Directories dialog under View Options, made it per project, and so now you get an interactive UI for editing these directories in Project Properties instead of View Options; this also means that there's a UI for it in the properties manager; then if you want to make changes per-machine instead of per-project like it used to be, you just set a property sheet up the way you want, and make all your projects inherit from it. This sounds like a big improvement over the old way. And a direct way to do what I want to do. But only in VS2010.
VS2005 and VS2008 don't have the UI to do set these properties in a project or property sheet, though; I'm happy to do it by hand but I don't know what it's supposed to look like! | visual-c++ | visual-studio-2005 | visual-studio-2008 | visual-studio-2010 | null | null | open | how to use .vsprops file to override VC++ Directories in MS Visual Studio
===
I'd like to override the directories used by Visual Studio (devenv.exe) for the compiler and library paths. I know how to do this interactively via Tools->Options->VC++ Directories, but I'd like to automate this.
http://msdn.microsoft.com/en-us/library/t9az1d21(VS.80).aspx has a tantalizing note on this: "If you want to set up directory search paths (for your projects) that can be shared by other users or that can be applied across multiple computers, Visual C++ provides an alternative to using this dialog, through project property sheets. For more information, see Property Sheets (C++)."
If you follow the link to Property Sheets documentation, there's a bunch of information on the mechanism but none on the actual properties you need to set.
I found the information populated by the VC++ Directories dialog, in %LocalAppData%\Microsoft\VisualStudio\8.0\VCComponents.dat (for VS 2005, and 9.0 for VS 2008); it seems to set various properties under VC\VC_OBJECTS_PLATFORM_INFO\win32\Directories and ...\x64\Directories.
Has anyone done this before and know what the mapping is from the property names used in VCComponents.dat to the names to use in a .vsprops file?
I'd like this to work in VS2005, VS2008 and VS2010, ideally.
I don't have VS2010 installed, but apparently Microsoft has completely done away with the VC++ Directories dialog under View Options, made it per project, and so now you get an interactive UI for editing these directories in Project Properties instead of View Options; this also means that there's a UI for it in the properties manager; then if you want to make changes per-machine instead of per-project like it used to be, you just set a property sheet up the way you want, and make all your projects inherit from it. This sounds like a big improvement over the old way. And a direct way to do what I want to do. But only in VS2010.
VS2005 and VS2008 don't have the UI to do set these properties in a project or property sheet, though; I'm happy to do it by hand but I don't know what it's supposed to look like! | 0 |
926,484 | 05/29/2009 15:07:49 | 14,007 | 09/16/2008 21:40:27 | 192 | 7 | PostGRE vs. mySQL | I tried to Google this but it seems like most of the answers are terribly outdated.
So, the question is simple: why would I choose one over the other? What are the benefits of each, and what drawbacks do they have? | postgre | mysql | database | language-agnostic | null | 05/29/2009 15:44:33 | not constructive | PostGRE vs. mySQL
===
I tried to Google this but it seems like most of the answers are terribly outdated.
So, the question is simple: why would I choose one over the other? What are the benefits of each, and what drawbacks do they have? | 4 |
8,808,107 | 01/10/2012 18:01:21 | 885,457 | 08/09/2011 07:55:09 | 82 | 21 | Is there a list of possible resources that a webbrowser will download when visiting a webpage? | I am building a spider some days now, and I am in a research on how to measure a webpage total weight in bytes. Through my research I came across this problem and the simplest answer was to get the content length of the page. But there is a small problem to that, content length in bytes is not telling us anything about the images that should be downloaded to the temp folder of the browser, nor the javascript or css links from the header of the page. So I actually backed up my conclusions on how to actually measure a page in terms of how much bytes are needed to be sent from the server to the client for all the resources needed to a weppage to work properly and not to measure only the bytes of the document only.
So I made a list of resources that a webbrowser should download when it visits a page:
all images <img src="someimages.jpg" alt=”somedecription” >
all js files <script type="text/javascript" src="somejs.js" ></script>
all css files <link rel="stylesheet" type="text/css" href="somecss.css">
the ico file <link rel="shortcut icon" href="someico.ico">
Are there any other resources that a browser has to download when it visits the page? In other words, what is the list of all the possible resources that a browser does download when visiting a webpage?
| c# | internet-explorer | firefox | browser | webbrowser | null | open | Is there a list of possible resources that a webbrowser will download when visiting a webpage?
===
I am building a spider some days now, and I am in a research on how to measure a webpage total weight in bytes. Through my research I came across this problem and the simplest answer was to get the content length of the page. But there is a small problem to that, content length in bytes is not telling us anything about the images that should be downloaded to the temp folder of the browser, nor the javascript or css links from the header of the page. So I actually backed up my conclusions on how to actually measure a page in terms of how much bytes are needed to be sent from the server to the client for all the resources needed to a weppage to work properly and not to measure only the bytes of the document only.
So I made a list of resources that a webbrowser should download when it visits a page:
all images <img src="someimages.jpg" alt=”somedecription” >
all js files <script type="text/javascript" src="somejs.js" ></script>
all css files <link rel="stylesheet" type="text/css" href="somecss.css">
the ico file <link rel="shortcut icon" href="someico.ico">
Are there any other resources that a browser has to download when it visits the page? In other words, what is the list of all the possible resources that a browser does download when visiting a webpage?
| 0 |
11,046 | 08/14/2008 13:54:56 | 810 | 08/09/2008 03:49:52 | 439 | 28 | Forum software recommandations (.net) | Do you use or do you know a good .net forum software?
It can be free or not. It should have the common features normally found in a forum software.
So far, the best I've come up with is: [YetAnotherForum][1]
[1]: http://www.yetanotherforum.net/ | .net | forum | null | null | null | 11/20/2011 15:43:37 | not constructive | Forum software recommandations (.net)
===
Do you use or do you know a good .net forum software?
It can be free or not. It should have the common features normally found in a forum software.
So far, the best I've come up with is: [YetAnotherForum][1]
[1]: http://www.yetanotherforum.net/ | 4 |
7,963,834 | 11/01/2011 08:03:52 | 493,892 | 11/01/2010 17:59:22 | 17 | 0 | Optamization of perl code for one of the problems? | Which one of the code will be faster?
I have been trying some of the community website with problems.
For a problem I have submitted two solution.
My first solution got accepted yet the other one was rejected.
#INPUT consist of two integer ie 5 10
# 23 200
# Solution 1 (accepted)
@_ = split(/\s/,<>);
if ( $_[0]%5 != 0 ) {
$_[1] = sprintf("%.2f",$_[1]);
print $_[1];
exit;
}
if ( $_[0]+0.5 > $_[1] ) {
$_[1] = sprintf("%.2f",$_[1]);
print $_[1];
exit;
}
$_[1] = sprintf("%.2f",($_[1] - ($_[0]+.5) ) );
print $_[1];
Or
#Solution 2 (rejected)
@_ = split(/\s/,<>);
if ( $_[0]%5 != 0 ) {
print (sprintf("%.2f",$_[1]));
exit;
}
if ( $_[0]+0.5 > $_[1] ) {
print (sprintf("%.2f",$_[1]));
exit;
}
print (sprintf("%.2f",$_[1]));
| perl | null | null | null | null | 11/01/2011 15:14:03 | too localized | Optamization of perl code for one of the problems?
===
Which one of the code will be faster?
I have been trying some of the community website with problems.
For a problem I have submitted two solution.
My first solution got accepted yet the other one was rejected.
#INPUT consist of two integer ie 5 10
# 23 200
# Solution 1 (accepted)
@_ = split(/\s/,<>);
if ( $_[0]%5 != 0 ) {
$_[1] = sprintf("%.2f",$_[1]);
print $_[1];
exit;
}
if ( $_[0]+0.5 > $_[1] ) {
$_[1] = sprintf("%.2f",$_[1]);
print $_[1];
exit;
}
$_[1] = sprintf("%.2f",($_[1] - ($_[0]+.5) ) );
print $_[1];
Or
#Solution 2 (rejected)
@_ = split(/\s/,<>);
if ( $_[0]%5 != 0 ) {
print (sprintf("%.2f",$_[1]));
exit;
}
if ( $_[0]+0.5 > $_[1] ) {
print (sprintf("%.2f",$_[1]));
exit;
}
print (sprintf("%.2f",$_[1]));
| 3 |
9,146,849 | 02/05/2012 04:13:08 | 1,015,791 | 10/27/2011 03:11:30 | 28 | 3 | Code sample socket.io on iisnode and azure | Can someone please post a working code smaple of socket.io that runs on iisnode and azure.It seems that IIS doens't play nicely with socket.io and any code sample I try fails...
thanks
| node.js | azure | socket.io | iisnode | null | 02/05/2012 09:13:10 | not a real question | Code sample socket.io on iisnode and azure
===
Can someone please post a working code smaple of socket.io that runs on iisnode and azure.It seems that IIS doens't play nicely with socket.io and any code sample I try fails...
thanks
| 1 |
11,098,361 | 06/19/2012 09:41:26 | 1,060,026 | 11/22/2011 14:56:13 | 107 | 2 | Chain Commands in C# | I am trying to copy and paste a folder structer on file system programattically. I did it with help of recursion successfully. But for certain validations I need to implemnt chain of commands (which i observed in eclipse java).
Does the chain of commands exist in C#.Net?
I looking for an example on chain of commands.
Regards,
Priyank | c# | null | null | null | null | 06/19/2012 09:55:37 | not a real question | Chain Commands in C#
===
I am trying to copy and paste a folder structer on file system programattically. I did it with help of recursion successfully. But for certain validations I need to implemnt chain of commands (which i observed in eclipse java).
Does the chain of commands exist in C#.Net?
I looking for an example on chain of commands.
Regards,
Priyank | 1 |
3,636,086 | 09/03/2010 13:16:23 | 147,019 | 07/29/2009 11:15:02 | 106 | 9 | blogger.com subdomains | When one registers for a blog in blogger.com, a sub-domain gets created i.e. <your_blog_name>.blogger.com
My question is - Is there no limit to the number of sub-domains you can create with a single domain name?
I am just curious as to how blogger (or any other blog hosting platform) does this? | subdomain | blogger | null | null | null | 09/03/2010 14:46:08 | off topic | blogger.com subdomains
===
When one registers for a blog in blogger.com, a sub-domain gets created i.e. <your_blog_name>.blogger.com
My question is - Is there no limit to the number of sub-domains you can create with a single domain name?
I am just curious as to how blogger (or any other blog hosting platform) does this? | 2 |
11,412,724 | 07/10/2012 11:51:30 | 930,393 | 09/06/2011 09:59:39 | 1,522 | 76 | Disabled validators losing content on postback | **Summary:**
Disabled ASP.NET validators are losing their `InnerHTML` content when posted-back to the server, and then when enabled (locally via JavaScript) show the `ErrorMessage` rather than original `InnerHTML` when fired.
**More Details:**
I deal with some complex forms that require lots of individual controls to be visible/invisible, and their validators to be enabled/disabled, depending on the selection of other controls.
All the validators contain an single "asterisk" image, with the error message shown via the central `asp:ValidatorSummary` object. For instance (formatted for viewing here, normally there is no whitespace)...
<asp:RequiredFieldValidator runat="server" ID="valName"
ControlToValidate="txtName" ErrorMessage="Enter a name">
<img runat="server" src="~/images/error.gif" />
</asp:RequiredFieldValidator>
Rather than use `asp:CustomValidator` on every single validator (which requires local JavaScript and server-side handlers for each), I simply set `.enabled = false` on normal validators as part of the event handler for the "parent" control. (The status of the controls is also set on the server-side on the initial page load, as well as subsequent post-back page loads.)
function showName(show){
document.getElementById("txtName").style.display = (show ? "" : "none");
document.getElementById("valName").enabled = show;
}
The problem lies in the sequence of events where a validator is disabled, the form is posted-back... then a control is changed (via user interation) and the validator is enabled. If the validator now fails (on an attempted post-back) the `<img` code has gone, so instead it displays the `ErrorMessage` text where the image should be.
The `InnerHTML` remains as long as the validator stays enabled.
Other than dynamically adding the image to each validator on every single page load (which I *really* don't want to do), or converting them all to `CustomValidator`s (which again I *really* don't want to do), does anybody know any way around this? Is this a known bug (because I can't find anything obvious)?
I am using ASP.NET 2.0 under Visual Studio 2010 - unfortunately, not in a position at the moment to upgrade to a higher version of ASP.NET.
| asp.net | validator | null | null | null | null | open | Disabled validators losing content on postback
===
**Summary:**
Disabled ASP.NET validators are losing their `InnerHTML` content when posted-back to the server, and then when enabled (locally via JavaScript) show the `ErrorMessage` rather than original `InnerHTML` when fired.
**More Details:**
I deal with some complex forms that require lots of individual controls to be visible/invisible, and their validators to be enabled/disabled, depending on the selection of other controls.
All the validators contain an single "asterisk" image, with the error message shown via the central `asp:ValidatorSummary` object. For instance (formatted for viewing here, normally there is no whitespace)...
<asp:RequiredFieldValidator runat="server" ID="valName"
ControlToValidate="txtName" ErrorMessage="Enter a name">
<img runat="server" src="~/images/error.gif" />
</asp:RequiredFieldValidator>
Rather than use `asp:CustomValidator` on every single validator (which requires local JavaScript and server-side handlers for each), I simply set `.enabled = false` on normal validators as part of the event handler for the "parent" control. (The status of the controls is also set on the server-side on the initial page load, as well as subsequent post-back page loads.)
function showName(show){
document.getElementById("txtName").style.display = (show ? "" : "none");
document.getElementById("valName").enabled = show;
}
The problem lies in the sequence of events where a validator is disabled, the form is posted-back... then a control is changed (via user interation) and the validator is enabled. If the validator now fails (on an attempted post-back) the `<img` code has gone, so instead it displays the `ErrorMessage` text where the image should be.
The `InnerHTML` remains as long as the validator stays enabled.
Other than dynamically adding the image to each validator on every single page load (which I *really* don't want to do), or converting them all to `CustomValidator`s (which again I *really* don't want to do), does anybody know any way around this? Is this a known bug (because I can't find anything obvious)?
I am using ASP.NET 2.0 under Visual Studio 2010 - unfortunately, not in a position at the moment to upgrade to a higher version of ASP.NET.
| 0 |
227,613 | 10/22/2008 21:27:23 | 2,133 | 08/20/2008 13:53:25 | 528 | 22 | copy directory recursively and filter filenames in perl | How do I copy a directory including sub directories excluding files that match a certain regex? | perl | null | null | null | null | null | open | copy directory recursively and filter filenames in perl
===
How do I copy a directory including sub directories excluding files that match a certain regex? | 0 |
836,597 | 05/07/2009 19:38:26 | 101,823 | 05/05/2009 20:23:19 | 23 | 0 | What are good books for Computation Geometry? | I am familiar with O'Rourke's Computational Geometry in C, but it feels a little dated. Any recommendations for books, preferably with source code? | geometry | books | math | algorithm | null | 09/22/2011 00:52:13 | not constructive | What are good books for Computation Geometry?
===
I am familiar with O'Rourke's Computational Geometry in C, but it feels a little dated. Any recommendations for books, preferably with source code? | 4 |
11,395,831 | 07/09/2012 13:15:55 | 1,474,581 | 06/22/2012 10:53:16 | 26 | 2 | How to manually stop a Python script that runs continuously on linux | I have a Python script that is running and continuously dumping errors into a log file.
I want to edit the script and run it again, but don't know how to stop the script.
I'm currently logged on Linux through PuTTy and am doing all the coding there. So, is there a command to stop the python script in linux?
| python | script | stop | null | null | 07/09/2012 19:54:22 | off topic | How to manually stop a Python script that runs continuously on linux
===
I have a Python script that is running and continuously dumping errors into a log file.
I want to edit the script and run it again, but don't know how to stop the script.
I'm currently logged on Linux through PuTTy and am doing all the coding there. So, is there a command to stop the python script in linux?
| 2 |
4,540,436 | 12/27/2010 17:17:29 | 555,183 | 12/27/2010 17:16:16 | 1 | 0 | How to creat asp.net Forum | Hi everyone i just want to creat an asp.net VB Forum and the database should be MS Access. any help? | asp.net | forum | null | null | null | 12/28/2010 03:30:52 | not a real question | How to creat asp.net Forum
===
Hi everyone i just want to creat an asp.net VB Forum and the database should be MS Access. any help? | 1 |
9,353,369 | 02/19/2012 21:20:35 | 956,575 | 09/21/2011 09:31:01 | 70 | 1 | C++ boost library | I am new at C++.
I have installed boost library by downloading it from web site and execute such commands:
./bootstrap.sh
./bjam install
This is my output:
...failed updating 109 targets...
...skipped 9694 targets...
...updated 802 targets...
My application required some of the library import:
#include <boost/mpi/config.hpp> #<----------- FAILED to LOAD
#include <boost/mpi/exception.hpp>#<----------- OK
#include <boost/optional.hpp>#<----------- OK
it is very weird to me, why after install single package some of the references possible to include some of them are not.
Maybe you guys, have better understanding in what is going on and help me to resolve this problem.
Thanks!
| c++ | boost | null | null | null | 02/20/2012 02:31:30 | off topic | C++ boost library
===
I am new at C++.
I have installed boost library by downloading it from web site and execute such commands:
./bootstrap.sh
./bjam install
This is my output:
...failed updating 109 targets...
...skipped 9694 targets...
...updated 802 targets...
My application required some of the library import:
#include <boost/mpi/config.hpp> #<----------- FAILED to LOAD
#include <boost/mpi/exception.hpp>#<----------- OK
#include <boost/optional.hpp>#<----------- OK
it is very weird to me, why after install single package some of the references possible to include some of them are not.
Maybe you guys, have better understanding in what is going on and help me to resolve this problem.
Thanks!
| 2 |
9,389,704 | 02/22/2012 05:47:34 | 1,220,115 | 02/20/2012 03:10:07 | 3 | 0 | Creating Linked List - Compiler Errors | I am trying to create a program for a linked list. I want to create a case statement where the user can choose to
1. add a node
2. delete a node
3. search for a node
4. display linked list (5 nodes per line)
5. quit the program
However the program is still a work in progress and i cant get it to compile thus far. I am trying to find what is causing it not to compile. it seems my main program will not link the header file. any suggestions to while i cant compile or link?? i want to get the errors worked out before i continue working on the main. Also where is the best place to create my struct?
Main.cpp
#include <string>
#include <iostream>
using namespace std;
#include <cstdlib>
#include "list.h"
using namespace std;
int main(int argc, char *argv[])
{
list* list1;
system("PAUSE");
return EXIT_SUCCESS;
}
Link.cpp
#include <iostream>
using namespace std;
#inclide "list.h"
List::List()
{
node *head = NULL;
node *precurrent = NULL;
node *current = NULL;
int *temp = 0;
insert = 0;
search = 0;
remove = 0;
}
List::~List()
{
while (head != 0)
remove();
}
void List::insert(int insert)
{
if (head==null) \\If there is no list already, create a new head.
{
temp = new Node;
temp->data = insert;
head = temp;
}
else \\otherwise, insert the new node after current
{
temp = new Node;
temp->data = insert;
temp->next = current->next;
current->next = temp;
}
}
void List::search(int search)
{
current=head;
while (head->next != 0) //Cycle through the list, and if the number is found, say so
{
if (current->data = search)
cout<<"Number found."<<endl;
else
cout<<"Number not found."<<endl;
}
}
void List::remove(int remove)
{
if (head == null)
cout <<"Error. No List."<<endl;
else if (head->next == null)
{
num = head->data;
delete head;
head=null;
current=null;
}
else if (head == current)
{
temp = head->next;
num = head->data;
delete head;
head=temp;
current=temp;
}
else
{
temp = current->next;
num = current->data;
delete current;
precurrent->next = temp;
current = temp;
}
}
ostream &operator<<(ostream& osObject, list& list){
nodeType<Type>* current = list.head;
int i = 0;
while (current != NULL) //while more data to print
{
osObject << current->info << " ";
current = current->link;
++i;
if (i % 5 == 0)
{
cout << '\n';
i = 0;
}
}
osObject << '\n'; // print the ending newline
return osObject;
}
Link.h
//CLASS PROVIDED: list
//
// CONSTRUCTOR for the list class:
// list()
// Description: Constructor will initialize variables
// Preconditions: None
// Postcondition: int insert = ""
// int search = ""
// int remove = ""
// ~list()
// Description: Destructor destroys variables
// Preconditions: None
// Postcondition: variable deleted
//
// MEMBER FUNCTIONS for the list class
//
// string insert(int)
// Description: Inserts an integer into a linked list
// Precondition: none
// Postcondition: function returns Success/Error message.
//
// string search(int);
// Description: Searches for certain linked list member and returns int to set current variable
// Precondition: none
// Postcondition: function returns int
//
// string remove(int);
// Description: removes linked list member
// Precondition: user sends int to be deleted
// Postcondition: function returned string sddress
//
// void display(void);
// Description: displays entire linked list
// Precondition: none
// Postcondition: function returns screen output
//
// void quit(void);
// Description: closes program
// Precondition: none
// Postcondition: none
//
#ifndef LIST_H
#define LIST_H
#include <string>
#include <iostream>
#include <cstdlib>
using namespace std;
class list
{
friend ostream& operator<< (ostream &os, const list&);
public:
//CONSTRUCTOR/DESTRUCTOR---------------------
list();
~list();
//GETS---------------------------------------
void insert(int);
string search(int);
string remove(int);
void display(void);
void quit(void);
private:
int insert;
int search;
int remove;
};
#endif
| struct | compiler-errors | linked-list | operator-overloading | header-files | 02/22/2012 13:56:44 | not a real question | Creating Linked List - Compiler Errors
===
I am trying to create a program for a linked list. I want to create a case statement where the user can choose to
1. add a node
2. delete a node
3. search for a node
4. display linked list (5 nodes per line)
5. quit the program
However the program is still a work in progress and i cant get it to compile thus far. I am trying to find what is causing it not to compile. it seems my main program will not link the header file. any suggestions to while i cant compile or link?? i want to get the errors worked out before i continue working on the main. Also where is the best place to create my struct?
Main.cpp
#include <string>
#include <iostream>
using namespace std;
#include <cstdlib>
#include "list.h"
using namespace std;
int main(int argc, char *argv[])
{
list* list1;
system("PAUSE");
return EXIT_SUCCESS;
}
Link.cpp
#include <iostream>
using namespace std;
#inclide "list.h"
List::List()
{
node *head = NULL;
node *precurrent = NULL;
node *current = NULL;
int *temp = 0;
insert = 0;
search = 0;
remove = 0;
}
List::~List()
{
while (head != 0)
remove();
}
void List::insert(int insert)
{
if (head==null) \\If there is no list already, create a new head.
{
temp = new Node;
temp->data = insert;
head = temp;
}
else \\otherwise, insert the new node after current
{
temp = new Node;
temp->data = insert;
temp->next = current->next;
current->next = temp;
}
}
void List::search(int search)
{
current=head;
while (head->next != 0) //Cycle through the list, and if the number is found, say so
{
if (current->data = search)
cout<<"Number found."<<endl;
else
cout<<"Number not found."<<endl;
}
}
void List::remove(int remove)
{
if (head == null)
cout <<"Error. No List."<<endl;
else if (head->next == null)
{
num = head->data;
delete head;
head=null;
current=null;
}
else if (head == current)
{
temp = head->next;
num = head->data;
delete head;
head=temp;
current=temp;
}
else
{
temp = current->next;
num = current->data;
delete current;
precurrent->next = temp;
current = temp;
}
}
ostream &operator<<(ostream& osObject, list& list){
nodeType<Type>* current = list.head;
int i = 0;
while (current != NULL) //while more data to print
{
osObject << current->info << " ";
current = current->link;
++i;
if (i % 5 == 0)
{
cout << '\n';
i = 0;
}
}
osObject << '\n'; // print the ending newline
return osObject;
}
Link.h
//CLASS PROVIDED: list
//
// CONSTRUCTOR for the list class:
// list()
// Description: Constructor will initialize variables
// Preconditions: None
// Postcondition: int insert = ""
// int search = ""
// int remove = ""
// ~list()
// Description: Destructor destroys variables
// Preconditions: None
// Postcondition: variable deleted
//
// MEMBER FUNCTIONS for the list class
//
// string insert(int)
// Description: Inserts an integer into a linked list
// Precondition: none
// Postcondition: function returns Success/Error message.
//
// string search(int);
// Description: Searches for certain linked list member and returns int to set current variable
// Precondition: none
// Postcondition: function returns int
//
// string remove(int);
// Description: removes linked list member
// Precondition: user sends int to be deleted
// Postcondition: function returned string sddress
//
// void display(void);
// Description: displays entire linked list
// Precondition: none
// Postcondition: function returns screen output
//
// void quit(void);
// Description: closes program
// Precondition: none
// Postcondition: none
//
#ifndef LIST_H
#define LIST_H
#include <string>
#include <iostream>
#include <cstdlib>
using namespace std;
class list
{
friend ostream& operator<< (ostream &os, const list&);
public:
//CONSTRUCTOR/DESTRUCTOR---------------------
list();
~list();
//GETS---------------------------------------
void insert(int);
string search(int);
string remove(int);
void display(void);
void quit(void);
private:
int insert;
int search;
int remove;
};
#endif
| 1 |
2,325,085 | 02/24/2010 10:06:14 | 274,117 | 02/16/2010 06:48:21 | 10 | 0 | In which order should I read the following C#/.NET books? | > Top Candidates
* APress C# 2008 and .NET 3.5 Platform
* Microsoft Press C# via CLR 3rd Edition
* O'Reilly C# 4.0 in a Nutshell?
> Optional
* Effective Java, 2nd Edition (someone here recommended it for C#) | c# | .net | null | null | null | 02/24/2010 23:22:51 | not constructive | In which order should I read the following C#/.NET books?
===
> Top Candidates
* APress C# 2008 and .NET 3.5 Platform
* Microsoft Press C# via CLR 3rd Edition
* O'Reilly C# 4.0 in a Nutshell?
> Optional
* Effective Java, 2nd Edition (someone here recommended it for C#) | 4 |
4,555,670 | 12/29/2010 16:05:02 | 557,062 | 12/29/2010 11:22:30 | 1 | 0 | jquery - passing value to php | ive got 2 different php files.
first one: `A.php`, second : `B.php`
in A.php, ive got this line:
function altcat(id) {
jQuery("#tvspor2").load("B.php?arupa="+id+"");
}
let me explain what im doing in the A.php:
i ve got a link in the A.php: `<a href='javascript:altcat("5")'>`
so, if a user click this link, A.php send this value to B.php?arupa=. its so simple. and B.php has this line:
if ($_GET["arupa"]) {
echo $_GET["arupa"];
}
in the A.php i ve got this line: `<div id="tvspor2"></div>` so, it shows the result.
for example: if a user clicks the link, result will show 5.
here is my question: i can show result in a div. i want to show result as a link. well, i want to use result value like that: `<a href="-i want to display altcat(id) to here.-">test link</a>`
so, i will able to create dynamic links upon the user choices. can you please kindly show me a way? ive been working on this issue for almost 3 days :( regards
| jquery | null | null | null | null | null | open | jquery - passing value to php
===
ive got 2 different php files.
first one: `A.php`, second : `B.php`
in A.php, ive got this line:
function altcat(id) {
jQuery("#tvspor2").load("B.php?arupa="+id+"");
}
let me explain what im doing in the A.php:
i ve got a link in the A.php: `<a href='javascript:altcat("5")'>`
so, if a user click this link, A.php send this value to B.php?arupa=. its so simple. and B.php has this line:
if ($_GET["arupa"]) {
echo $_GET["arupa"];
}
in the A.php i ve got this line: `<div id="tvspor2"></div>` so, it shows the result.
for example: if a user clicks the link, result will show 5.
here is my question: i can show result in a div. i want to show result as a link. well, i want to use result value like that: `<a href="-i want to display altcat(id) to here.-">test link</a>`
so, i will able to create dynamic links upon the user choices. can you please kindly show me a way? ive been working on this issue for almost 3 days :( regards
| 0 |
3,994,837 | 10/22/2010 07:49:15 | 280,100 | 02/24/2010 06:44:29 | 114 | 6 | Is there a simple example to understand django signal | Suppose a user creates his account in a website so i would like to use django signals to notify the system admins that a new user has been created.
I really dont know how to do this with Django signals
Thanks in advance | python | django | null | null | null | 02/22/2012 14:33:21 | not constructive | Is there a simple example to understand django signal
===
Suppose a user creates his account in a website so i would like to use django signals to notify the system admins that a new user has been created.
I really dont know how to do this with Django signals
Thanks in advance | 4 |
10,371,503 | 04/29/2012 10:44:34 | 360,211 | 06/07/2010 08:50:27 | 1,379 | 50 | Cloud formation (drupal template) where is the mysql? | I created a cloud formation stack based on the drupal template.
That created an EC2 which I can see, but it also asked for a mysql root password during the template set up.
So I expected to see an entry in "Amazon Management Console->Amazon RDS" for that, but I don't.
Can someone explain where this mysql database is? And why it's not under RDS. | amazon-web-services | amazon-rds | null | null | null | null | open | Cloud formation (drupal template) where is the mysql?
===
I created a cloud formation stack based on the drupal template.
That created an EC2 which I can see, but it also asked for a mysql root password during the template set up.
So I expected to see an entry in "Amazon Management Console->Amazon RDS" for that, but I don't.
Can someone explain where this mysql database is? And why it's not under RDS. | 0 |
3,777,121 | 09/23/2010 09:46:45 | 133,516 | 06/09/2009 04:42:06 | 525 | 12 | How to access Windows shell context menu items? | In Windows Explorer, you right click on a file, a context menu shows up which contains built-in items like 'Send to...' and/or 3rd party actions such as 'zip file with Winzip'. My question are:
- How to obtain the full list of available menu items for a specific file?
- For each menu item, how to get the caption?
- How to invoke a specific menu item action for a specific disk file?
Thank you in advance! | c++ | windows | delphi | winapi | shell | null | open | How to access Windows shell context menu items?
===
In Windows Explorer, you right click on a file, a context menu shows up which contains built-in items like 'Send to...' and/or 3rd party actions such as 'zip file with Winzip'. My question are:
- How to obtain the full list of available menu items for a specific file?
- For each menu item, how to get the caption?
- How to invoke a specific menu item action for a specific disk file?
Thank you in advance! | 0 |
1,147,023 | 07/18/2009 08:32:09 | 77,610 | 03/13/2009 08:44:44 | 339 | 14 | Recommended books and resources for learning Matlab | Can anyone recommend good books or online resources for learning Matlab? It's for an experienced programmer, needing to learn Matlab for computational and GUI applications.
Thanks. | matlab | tutorials | null | null | null | 09/26/2011 14:12:57 | not constructive | Recommended books and resources for learning Matlab
===
Can anyone recommend good books or online resources for learning Matlab? It's for an experienced programmer, needing to learn Matlab for computational and GUI applications.
Thanks. | 4 |
4,019,401 | 10/25/2010 22:31:27 | 487,006 | 10/25/2010 22:31:27 | 1 | 0 | What Constitutes a Code Block in Visual Studio 2010? | As per MSDN:
"A code block is a code path with a single entry point, a single exit point, and a set of instructions that are all run in sequence. A code block ends when it reaches a decision point such as a new conditional statement block, a function call, exception throw, enter, leave, try, catch, or a finally construct."
With this in mind, I still have no idea why, according to VS2010's code coverage analysis, this method has three blocks:
public Type Foo()
{
return typeof(string);
}
And this method has two blocks:
public void FooTwo()
{
return;
}
Code lines are more straightforward. They're the number of lines of code including curly brackets. But what are code blocks?
Calvin | visual-studio-2010 | block | null | null | null | null | open | What Constitutes a Code Block in Visual Studio 2010?
===
As per MSDN:
"A code block is a code path with a single entry point, a single exit point, and a set of instructions that are all run in sequence. A code block ends when it reaches a decision point such as a new conditional statement block, a function call, exception throw, enter, leave, try, catch, or a finally construct."
With this in mind, I still have no idea why, according to VS2010's code coverage analysis, this method has three blocks:
public Type Foo()
{
return typeof(string);
}
And this method has two blocks:
public void FooTwo()
{
return;
}
Code lines are more straightforward. They're the number of lines of code including curly brackets. But what are code blocks?
Calvin | 0 |
6,974,265 | 08/07/2011 16:58:56 | 47,633 | 12/19/2008 03:12:14 | 2,746 | 90 | experiences on free and low-cost hosting for play framework applications? | I'd like to know your experience finding a host for play applications on free or low-cost servers
so far now I found the following options:
- [Google Application Engine][1]
module: http://www.playframework.org/modules/gae-1.4/home
cons: can't use mysql, should not use JPA
Instead of JPA it is advised to use siena
http://www.playframework.org/modules/siena-2.0.0/home
nice example: http://viralpatel.net/blogs/2011/01/first-play-framework-gae-siena-application-tutorial-example.html
- [Cloudbees][2]
module: http://www.playframework.org/modules/cloudbees
pricing: http://www.cloudbees.com/platform-pricing.cb
floss: http://www.cloudbees.com/foss/
- [dotCloud][3]
module: http://www.playframework.org/modules/cloudbees
princing: https://www.dotcloud.com/pricing/
floss: https://www.dotcloud.com/pricing/pricing-faq/
do you have any experience with one of these?
any other option you know???
[1]: http://code.google.com/intl/en/appengine/
[2]: http://www.cloudbees.com/
[3]: https://www.dotcloud.com/ | hosting | playframework | cloud-hosting | null | null | 09/20/2011 21:59:58 | not constructive | experiences on free and low-cost hosting for play framework applications?
===
I'd like to know your experience finding a host for play applications on free or low-cost servers
so far now I found the following options:
- [Google Application Engine][1]
module: http://www.playframework.org/modules/gae-1.4/home
cons: can't use mysql, should not use JPA
Instead of JPA it is advised to use siena
http://www.playframework.org/modules/siena-2.0.0/home
nice example: http://viralpatel.net/blogs/2011/01/first-play-framework-gae-siena-application-tutorial-example.html
- [Cloudbees][2]
module: http://www.playframework.org/modules/cloudbees
pricing: http://www.cloudbees.com/platform-pricing.cb
floss: http://www.cloudbees.com/foss/
- [dotCloud][3]
module: http://www.playframework.org/modules/cloudbees
princing: https://www.dotcloud.com/pricing/
floss: https://www.dotcloud.com/pricing/pricing-faq/
do you have any experience with one of these?
any other option you know???
[1]: http://code.google.com/intl/en/appengine/
[2]: http://www.cloudbees.com/
[3]: https://www.dotcloud.com/ | 4 |
8,179,617 | 11/18/2011 08:27:37 | 1,023,476 | 11/01/2011 10:31:40 | 159 | 3 | facebook, LiveId and googlemail login in own application c#.net | I have a project in which my client wants to login using facebook, gmail or Live Id account.
I am just new to OAuth concept.
Some idea but not in deep.
I have few queries, can anyone please help me out.
1. What the internal mechanisum, i need to do with my DB.
i.e. when facebook redirect to my application successfully, do i need to save return details from facebook to my application and then use it like a normal user who is login using my site login page.
2. some of the OAuth, like LIveId not not redirect back to local port.
i.e. it is not accepting localhost:123/mysite/myredirectpage.aspx.
of course it is accepting www.myliveurl.com/myredirectpage.aspx.
Then how can i test the whole things in my local development environment.
Can anyone please help me out?
| facebook | google | oauth-2.0 | windows-live | null | null | open | facebook, LiveId and googlemail login in own application c#.net
===
I have a project in which my client wants to login using facebook, gmail or Live Id account.
I am just new to OAuth concept.
Some idea but not in deep.
I have few queries, can anyone please help me out.
1. What the internal mechanisum, i need to do with my DB.
i.e. when facebook redirect to my application successfully, do i need to save return details from facebook to my application and then use it like a normal user who is login using my site login page.
2. some of the OAuth, like LIveId not not redirect back to local port.
i.e. it is not accepting localhost:123/mysite/myredirectpage.aspx.
of course it is accepting www.myliveurl.com/myredirectpage.aspx.
Then how can i test the whole things in my local development environment.
Can anyone please help me out?
| 0 |
2,016,706 | 01/06/2010 22:19:12 | 200,477 | 11/01/2009 12:41:57 | 222 | 3 | Help with Unit Converter | I am developing a unit converter for my semester project. I need some help on the structure of the classes/interfaces/abstract classes. I want some interface or abstract class that can be inherited by classes (DegreesConverter, MassConverter, LenghtConverter). Like maybe `interface IUnitConvert<Type>`. Any suggestions? | c# | wpf | units-of-measurement | null | null | null | open | Help with Unit Converter
===
I am developing a unit converter for my semester project. I need some help on the structure of the classes/interfaces/abstract classes. I want some interface or abstract class that can be inherited by classes (DegreesConverter, MassConverter, LenghtConverter). Like maybe `interface IUnitConvert<Type>`. Any suggestions? | 0 |
11,118,118 | 06/20/2012 11:00:23 | 1,468,950 | 06/20/2012 10:50:02 | 1 | 0 | Explanation for code, javascript | I need to know what this code does for the game ( it's called dots) I have.
I need be able to explain what this code does and right now I have no idea.
If you need more of the code please tell me and I'll put more, but this is the bit of the code that I do not understand
Thank you.
function compMove() {
if (gameStarted == false) {
return;
}
canMove = false;
compMoveAgain = false;
compDoMove();
if (compMoveAgain == false) {
canMove = true;
} else {
setTimeout(compMove,400);
}
}
function compDoMove() {
var boxY;
var boxX;
var cBoxY;
var cBoxX;
var foundMove;
var lpos;
m1cnt = 0;
m2cnt = 0;
m3cnt = 0;
doneMoves = true;
for (i=0; i<gridSize; i++) {
for (j=0; j<gridSize; j++) {
if (boxes[i][j] == 3) {
if (m1cnt < 10) {
m1x[m1cnt] = j;
m1y[m1cnt] = i;
m1cnt = m1cnt * 1 + 1;
}
} else if (boxes[i][j] == 2) {
if (m2cnt < 10) {
m2x[m2cnt] = j;
m2y[m2cnt] = i;
m2cnt = m2cnt * 1 + 1;
}
} else if (boxes[i][j] < 2) {
if (m3cnt < 100) {
m3x[m3cnt] = j;
m3y[m3cnt] = i;
m3cnt = m3cnt * 1 + 1;
}
}
}
}
if (m1cnt > 0) {
lpos = Math.floor(Math.random() * m1cnt);
boxX = m1x[lpos];
boxY = m1y[lpos];
} else if (m3cnt > 0) {
lpos = Math.floor(Math.random() * m3cnt);
boxX = m3x[lpos];
boxY = m3y[lpos];
} else if (m2cnt > 0) {
lpos = Math.floor(Math.random() * m2cnt);
boxX = m2x[lpos];
boxY = m2y[lpos];
}
cBoxY = boxY;
cBoxX = boxX;
foundMove = false;
compMoveAgain = false;
if (Math.floor(Math.random() * 2) == 1) {
for (j=0; j<2 && foundMove == false; j++) {
cBoxY = (boxY*1 + j*1);
if (cBoxY >= 0 && cBoxY <= gridSize) {
if (hLines[cBoxY][cBoxX] == 0) {
addLine(ctype, htype, cBoxY, cBoxX);
foundMove = true;
}
}
}
cBoxY = boxY;
cBoxX = boxX;
}
for (i=0; i< 2 && foundMove == false; i++) {
cBoxX = (boxX*1 + i*1);
if (cBoxX >= 0 && cBoxX <= gridSize) {
if (vLines[cBoxY][cBoxX] == 0) {
addLine(ctype, vtype, cBoxY, cBoxX);
foundMove = true;
}
}
}
cBoxX = boxX;
for (j=0; j<2 && foundMove == false; j++) {
cBoxY = (boxY*1 + j*1);
if (cBoxY >= 0 && cBoxY <= gridSize) {
if (hLines[cBoxY][cBoxX] == 0) {
addLine(ctype, htype, cBoxY, cBoxX);
foundMove = true;
}
}
}
}
| javascript | function | null | null | null | 06/20/2012 15:04:10 | too localized | Explanation for code, javascript
===
I need to know what this code does for the game ( it's called dots) I have.
I need be able to explain what this code does and right now I have no idea.
If you need more of the code please tell me and I'll put more, but this is the bit of the code that I do not understand
Thank you.
function compMove() {
if (gameStarted == false) {
return;
}
canMove = false;
compMoveAgain = false;
compDoMove();
if (compMoveAgain == false) {
canMove = true;
} else {
setTimeout(compMove,400);
}
}
function compDoMove() {
var boxY;
var boxX;
var cBoxY;
var cBoxX;
var foundMove;
var lpos;
m1cnt = 0;
m2cnt = 0;
m3cnt = 0;
doneMoves = true;
for (i=0; i<gridSize; i++) {
for (j=0; j<gridSize; j++) {
if (boxes[i][j] == 3) {
if (m1cnt < 10) {
m1x[m1cnt] = j;
m1y[m1cnt] = i;
m1cnt = m1cnt * 1 + 1;
}
} else if (boxes[i][j] == 2) {
if (m2cnt < 10) {
m2x[m2cnt] = j;
m2y[m2cnt] = i;
m2cnt = m2cnt * 1 + 1;
}
} else if (boxes[i][j] < 2) {
if (m3cnt < 100) {
m3x[m3cnt] = j;
m3y[m3cnt] = i;
m3cnt = m3cnt * 1 + 1;
}
}
}
}
if (m1cnt > 0) {
lpos = Math.floor(Math.random() * m1cnt);
boxX = m1x[lpos];
boxY = m1y[lpos];
} else if (m3cnt > 0) {
lpos = Math.floor(Math.random() * m3cnt);
boxX = m3x[lpos];
boxY = m3y[lpos];
} else if (m2cnt > 0) {
lpos = Math.floor(Math.random() * m2cnt);
boxX = m2x[lpos];
boxY = m2y[lpos];
}
cBoxY = boxY;
cBoxX = boxX;
foundMove = false;
compMoveAgain = false;
if (Math.floor(Math.random() * 2) == 1) {
for (j=0; j<2 && foundMove == false; j++) {
cBoxY = (boxY*1 + j*1);
if (cBoxY >= 0 && cBoxY <= gridSize) {
if (hLines[cBoxY][cBoxX] == 0) {
addLine(ctype, htype, cBoxY, cBoxX);
foundMove = true;
}
}
}
cBoxY = boxY;
cBoxX = boxX;
}
for (i=0; i< 2 && foundMove == false; i++) {
cBoxX = (boxX*1 + i*1);
if (cBoxX >= 0 && cBoxX <= gridSize) {
if (vLines[cBoxY][cBoxX] == 0) {
addLine(ctype, vtype, cBoxY, cBoxX);
foundMove = true;
}
}
}
cBoxX = boxX;
for (j=0; j<2 && foundMove == false; j++) {
cBoxY = (boxY*1 + j*1);
if (cBoxY >= 0 && cBoxY <= gridSize) {
if (hLines[cBoxY][cBoxX] == 0) {
addLine(ctype, htype, cBoxY, cBoxX);
foundMove = true;
}
}
}
}
| 3 |
8,717,386 | 01/03/2012 19:12:45 | 264,601 | 02/02/2010 18:10:42 | 705 | 8 | Rails conditional layouts: Why does ":for" work as an option for the layout method? | In my controller I'm using `layout 'application', :only => :edit`
But I noticed that `layout 'application', :for => :edit` works as well.
Just curious because docs only mention `:only` & `:except`. I can't explicitly find `:for` in any docs for the `layout` method.
[Rails v2.3 - layout (railsapi.com)][1]
[Rails v3.1 - layout (apidock.com)][2]
[1]: http://railsapi.com/doc/v2.3.2/classes/ActionController/Layout/ClassMethods.html#M000264
[2]: http://apidock.com/rails/AbstractController/Layouts/ClassMethods/layout | ruby-on-rails | templates | null | null | null | null | open | Rails conditional layouts: Why does ":for" work as an option for the layout method?
===
In my controller I'm using `layout 'application', :only => :edit`
But I noticed that `layout 'application', :for => :edit` works as well.
Just curious because docs only mention `:only` & `:except`. I can't explicitly find `:for` in any docs for the `layout` method.
[Rails v2.3 - layout (railsapi.com)][1]
[Rails v3.1 - layout (apidock.com)][2]
[1]: http://railsapi.com/doc/v2.3.2/classes/ActionController/Layout/ClassMethods.html#M000264
[2]: http://apidock.com/rails/AbstractController/Layouts/ClassMethods/layout | 0 |
11,525,847 | 07/17/2012 15:30:28 | 1,108,655 | 12/20/2011 20:43:33 | 6 | 0 | to draw html inside js file | I have to keep a div and inside that I have to have answers and then the div should close.Even after closing the div after the questions in the loop,The div div gets closed without the answers..
code :
if(a.isQuestion == "true"){
ansdetails="";
ansdiv ="";
$.each(a.answers, function(key, b) {
if(a.anstype=="select only one"){
ansdetails +="<div id=\"" +b.nextuid+ "\" data-link=\"Answer" +a.index+ "\" class=\"showfirst\"><tr><th width=\"20\" height=\"40\" align=\"left\" valign=\"top\" scope=\"row\" class=\"questionnaireanswer\"><input name=\"radiobuttton\" answered=\"\" current-index=\""+a.index+"\" value=\"" +b.ansuid +"\" data-value=\"" +b.ansuid+ "\" class=\"\" type=\"radio\">" +b.ansname+ " .</th>\
<td width=\"438\" height=\"40\" align=\"left\" valign=\"top\" class=\"questionnaireanswer\"> " +b.ansvalue+ "</td></tr></div>";
}
else{
ansdetails +=" <div id=\"Answer" +a.index+ "\" class=\"showfirst\">\<tr>\
<th width=\"20\" height=\"40\" align=\"left\" valign=\"top\" scope=\"row\" class=\"questionnaireanswer\"><input name=\"chk\" current-index=\""+a.index+"\" id=\"" +b.ansuid +"\" value=\"" +b.nextuid+ "\" data-value=\"" +b.ansuid+ "\" class=\"\" type=\"checkbox\">" +b.ansname+ " .</th>\
<td width=\"438\" height=\"40\" align=\"left\" valign=\"top\" class=\"questionnaireanswer\"> " +b.ansvalue+ "</td></tr>";
}
});
}
RESULT :
<div id=/"/"></div>
<tr><td><input type=/"radio/" name="dd" value=/"/">Answer 1</td></tr>
<tr><td><input type=/"radio/" name="dd" value=/"/">Answer 2</td></tr>
<tr><td><input type=/"radio/" name="dd" value=/"/">Answer 3</td></tr>
<tr><td><input type=/"radio/" name="dd" value=/"/">Answer 4</td></tr>
EXPECTED RESULT :
<div id=/"/">
<tr><td><input type=/"radio/" name="dd" value=/"/">Answer 1</td></tr>
<tr><td><input type=/"radio/" name="dd" value=/"/">Answer 2</td></tr>
<tr><td><input type=/"radio/" name="dd" value=/"/">Answer 3</td></tr>
<tr><td><input type=/"radio/" name="dd" value=/"/">Answer 4</td></tr>
</div>
| html | null | null | null | null | 07/21/2012 03:35:21 | not a real question | to draw html inside js file
===
I have to keep a div and inside that I have to have answers and then the div should close.Even after closing the div after the questions in the loop,The div div gets closed without the answers..
code :
if(a.isQuestion == "true"){
ansdetails="";
ansdiv ="";
$.each(a.answers, function(key, b) {
if(a.anstype=="select only one"){
ansdetails +="<div id=\"" +b.nextuid+ "\" data-link=\"Answer" +a.index+ "\" class=\"showfirst\"><tr><th width=\"20\" height=\"40\" align=\"left\" valign=\"top\" scope=\"row\" class=\"questionnaireanswer\"><input name=\"radiobuttton\" answered=\"\" current-index=\""+a.index+"\" value=\"" +b.ansuid +"\" data-value=\"" +b.ansuid+ "\" class=\"\" type=\"radio\">" +b.ansname+ " .</th>\
<td width=\"438\" height=\"40\" align=\"left\" valign=\"top\" class=\"questionnaireanswer\"> " +b.ansvalue+ "</td></tr></div>";
}
else{
ansdetails +=" <div id=\"Answer" +a.index+ "\" class=\"showfirst\">\<tr>\
<th width=\"20\" height=\"40\" align=\"left\" valign=\"top\" scope=\"row\" class=\"questionnaireanswer\"><input name=\"chk\" current-index=\""+a.index+"\" id=\"" +b.ansuid +"\" value=\"" +b.nextuid+ "\" data-value=\"" +b.ansuid+ "\" class=\"\" type=\"checkbox\">" +b.ansname+ " .</th>\
<td width=\"438\" height=\"40\" align=\"left\" valign=\"top\" class=\"questionnaireanswer\"> " +b.ansvalue+ "</td></tr>";
}
});
}
RESULT :
<div id=/"/"></div>
<tr><td><input type=/"radio/" name="dd" value=/"/">Answer 1</td></tr>
<tr><td><input type=/"radio/" name="dd" value=/"/">Answer 2</td></tr>
<tr><td><input type=/"radio/" name="dd" value=/"/">Answer 3</td></tr>
<tr><td><input type=/"radio/" name="dd" value=/"/">Answer 4</td></tr>
EXPECTED RESULT :
<div id=/"/">
<tr><td><input type=/"radio/" name="dd" value=/"/">Answer 1</td></tr>
<tr><td><input type=/"radio/" name="dd" value=/"/">Answer 2</td></tr>
<tr><td><input type=/"radio/" name="dd" value=/"/">Answer 3</td></tr>
<tr><td><input type=/"radio/" name="dd" value=/"/">Answer 4</td></tr>
</div>
| 1 |
8,534,633 | 12/16/2011 13:09:52 | 1,093,485 | 12/12/2011 10:08:04 | 15 | 1 | Looking for a good source/book or reference for file - array interaction in C | Good Afternoon people,
I am attempting to port some java code to C and would love a suggestion for a good book/webpage or something that explains in detail:
1. Reading my file and assigning pointers for match.begin and match.end, when comparing a line to a 'pattern'.
2. A way to intelligently (very subjective, i know) format/print the text in between match.begin and match.end.
3. Possibility of splitting an array into several arrays after examining the content of an array element.
I have been looking at the [C++ pages][1] already but these are not always clear to me.
Thanks in advance,
Bas Jansen
[1]: http://www.cplusplus.com | java | c | books | porting | null | 12/23/2011 00:07:14 | off topic | Looking for a good source/book or reference for file - array interaction in C
===
Good Afternoon people,
I am attempting to port some java code to C and would love a suggestion for a good book/webpage or something that explains in detail:
1. Reading my file and assigning pointers for match.begin and match.end, when comparing a line to a 'pattern'.
2. A way to intelligently (very subjective, i know) format/print the text in between match.begin and match.end.
3. Possibility of splitting an array into several arrays after examining the content of an array element.
I have been looking at the [C++ pages][1] already but these are not always clear to me.
Thanks in advance,
Bas Jansen
[1]: http://www.cplusplus.com | 2 |
4,569,952 | 12/31/2010 11:56:50 | 559,032 | 12/31/2010 06:12:42 | 6 | 0 | To getting values on basket | session_start();
if(isset($_REQUEST['action']) && $_REQUEST['action']!="")
if ($action == "addToBasket")
{
$rmrradio1 = 3;
$rmrradio2 = 5.5;
$rmrradio2 = 16;
}
$(document).ready(function(){
$("input[type='radio']").click(function(){
var price = $(this).attr("value");
var name = $(this).attr("name");
add_payment_value(price,name);
});
});
function add_payment_value(price){
// here you can use $.ajax function to add your 'price value' to your cart
$.ajax({
type: "POST",
url: "make-payment.php"// file where you can add price to your database
data: "rmr"=+price+" &action=addtobasket ",
success: function(){} // return something on success
});
}
i have made a code like this. this is for a shopping cart site.the above value jsut added with basket(add my cart) when click the button.i dont know either this code is correct or not. but i need some one help to implement my project.
can any one give me a right code.
many thank you
happy new year | php | jquery | html | css | ajax | 01/02/2011 01:36:19 | not a real question | To getting values on basket
===
session_start();
if(isset($_REQUEST['action']) && $_REQUEST['action']!="")
if ($action == "addToBasket")
{
$rmrradio1 = 3;
$rmrradio2 = 5.5;
$rmrradio2 = 16;
}
$(document).ready(function(){
$("input[type='radio']").click(function(){
var price = $(this).attr("value");
var name = $(this).attr("name");
add_payment_value(price,name);
});
});
function add_payment_value(price){
// here you can use $.ajax function to add your 'price value' to your cart
$.ajax({
type: "POST",
url: "make-payment.php"// file where you can add price to your database
data: "rmr"=+price+" &action=addtobasket ",
success: function(){} // return something on success
});
}
i have made a code like this. this is for a shopping cart site.the above value jsut added with basket(add my cart) when click the button.i dont know either this code is correct or not. but i need some one help to implement my project.
can any one give me a right code.
many thank you
happy new year | 1 |
2,443,401 | 03/14/2010 19:19:20 | 293,521 | 03/14/2010 19:19:20 | 1 | 0 | Reading Lotus Notes Inbox Messages using VB.Net "Interop.Domino.dll" | How can I read Lotus Notes Inbox Messages using VB.Net? | lotus | notes | vb.net | null | null | null | open | Reading Lotus Notes Inbox Messages using VB.Net "Interop.Domino.dll"
===
How can I read Lotus Notes Inbox Messages using VB.Net? | 0 |
600,135 | 03/01/2009 17:24:14 | 20,126 | 09/21/2008 23:21:25 | 38 | 6 | Whats the best CMS/Website Started kit for my project? | I need to build a company profile website, which will contain a gallery of images which this company designed before, and will contain the normal stuff, such as about us, contact us, menus for fast navigation, and also need to give this company a way to edit the site them selves, so which CMS/Website template you recommend for me?
-Free will be better | asp.net | .net | website | web-applications | null | null | open | Whats the best CMS/Website Started kit for my project?
===
I need to build a company profile website, which will contain a gallery of images which this company designed before, and will contain the normal stuff, such as about us, contact us, menus for fast navigation, and also need to give this company a way to edit the site them selves, so which CMS/Website template you recommend for me?
-Free will be better | 0 |
2,985,086 | 06/06/2010 17:17:24 | 359,786 | 06/06/2010 16:54:40 | 1 | 0 | What is the best software to write and organize written copy / content for a website? | I'm a newbie product manager, looking for tips on how to write and organize text copy for my company's website.
I need to be able to prepare the content for our public site and turn it over to the web designer who publishes it to our live site.
I want our UI team to be able to quickly glance at the copy I write and immediately know where on the page I intend for it to go.
Currently, I'm using microsoft word to write and color code different text to signify where I want specific text to go. It is difficult for the UI guy to immediately know if something goes into the nav bar or into a header or a description below a header. In addition to that, it would be helpful for me to be able to write the copy in such a way that the web designer could copy and paste it into the XHTML without having to go back and manually replace special punctuation characters with the XHTML entities.
What software is out there that will allow a comprehensive solution to these web copywriting issues? | website | copy | management | product | writing | 06/07/2010 16:00:17 | off topic | What is the best software to write and organize written copy / content for a website?
===
I'm a newbie product manager, looking for tips on how to write and organize text copy for my company's website.
I need to be able to prepare the content for our public site and turn it over to the web designer who publishes it to our live site.
I want our UI team to be able to quickly glance at the copy I write and immediately know where on the page I intend for it to go.
Currently, I'm using microsoft word to write and color code different text to signify where I want specific text to go. It is difficult for the UI guy to immediately know if something goes into the nav bar or into a header or a description below a header. In addition to that, it would be helpful for me to be able to write the copy in such a way that the web designer could copy and paste it into the XHTML without having to go back and manually replace special punctuation characters with the XHTML entities.
What software is out there that will allow a comprehensive solution to these web copywriting issues? | 2 |
8,937,660 | 01/20/2012 06:39:38 | 1,074,821 | 12/01/2011 06:07:24 | 25 | 1 | how to track location of mobile device using php | I want to track the location (longitude and latitude) of the mobile using php (input - mobile number) and according to location i want to send message to mobile device.
i dont know how to do this in php..
Please help... | php | zend-framework | null | null | null | 01/21/2012 13:55:32 | too localized | how to track location of mobile device using php
===
I want to track the location (longitude and latitude) of the mobile using php (input - mobile number) and according to location i want to send message to mobile device.
i dont know how to do this in php..
Please help... | 3 |
1,807,855 | 11/27/2009 10:11:42 | 215,929 | 11/21/2009 02:25:45 | 17 | 0 | Software Project Management systems | Ok, so I've only recently started getting serious about learning how to program, and I've started using Mercurial to manage my projects. I chose Mercurial over SVN because of it's ability to commit changes to a repo while not connected to the internet (these days I find myself in areas without internet access). I'm looking for a piece of software (preferably free, because I'm on a really tight budget :-P) that will allow me to manage a bug database and TODO list for each of my projects without requiring an internet connection. Is there anything out there that'll allow me to do exactly that (maybe more)? I'd prefer something that can work alongside Mercurial, because it'd be a pain to switch source control systems at this point. | projects | management | tracker | mercurial | null | 09/23/2011 12:47:54 | not constructive | Software Project Management systems
===
Ok, so I've only recently started getting serious about learning how to program, and I've started using Mercurial to manage my projects. I chose Mercurial over SVN because of it's ability to commit changes to a repo while not connected to the internet (these days I find myself in areas without internet access). I'm looking for a piece of software (preferably free, because I'm on a really tight budget :-P) that will allow me to manage a bug database and TODO list for each of my projects without requiring an internet connection. Is there anything out there that'll allow me to do exactly that (maybe more)? I'd prefer something that can work alongside Mercurial, because it'd be a pain to switch source control systems at this point. | 4 |
8,827,906 | 01/11/2012 22:51:41 | 934,703 | 09/08/2011 11:38:34 | 76 | 0 | Javascript doesn't work in Safari | I am using Safari 5.1 for testing, and JS doesn't work at all. In all other browsers it is working perfectly.
This is the slide show I am implementing:[Web page][1]
and this is the demo: [demo][2]
I use this slideshow as it is - I didn't change nothing, simple copy/paste.
Does someone know what's the deal with Safari?
[1]: http://www.scriptiny.com/2008/12/javascript-slideshow/
[2]: http://sandbox.scriptiny.com/javascript-slideshow/ | javascript | jquery | safari | null | null | 01/11/2012 23:27:50 | not a real question | Javascript doesn't work in Safari
===
I am using Safari 5.1 for testing, and JS doesn't work at all. In all other browsers it is working perfectly.
This is the slide show I am implementing:[Web page][1]
and this is the demo: [demo][2]
I use this slideshow as it is - I didn't change nothing, simple copy/paste.
Does someone know what's the deal with Safari?
[1]: http://www.scriptiny.com/2008/12/javascript-slideshow/
[2]: http://sandbox.scriptiny.com/javascript-slideshow/ | 1 |
9,719,149 | 03/15/2012 11:54:41 | 925,222 | 09/02/2011 12:09:42 | 1,846 | 195 | How to decide whether to use LINQ to SQL or ADO.NET | I am just wondering which of the above technology is to use and when with `SQL Server`
- What are the factors that can use to determine which technology is to use
- Will the performance of those technologies acting differently in web based application and standalone application.
Thanks | c# | .net | sql-server | linq-to-sql | ado.net | 03/16/2012 08:41:22 | not a real question | How to decide whether to use LINQ to SQL or ADO.NET
===
I am just wondering which of the above technology is to use and when with `SQL Server`
- What are the factors that can use to determine which technology is to use
- Will the performance of those technologies acting differently in web based application and standalone application.
Thanks | 1 |
4,198,654 | 11/16/2010 20:32:58 | 459,019 | 09/26/2010 23:59:33 | 24 | 0 | Creating a Lua plugin with Objective C Knowledge | I want to build a plugin for an application(TeamSpeak), however I have no lua knowledge. Is it possible to somehow wrap or bridge my Obj-C knowledge to lua?
If needed I could learn the basic syntax of lua to get my plugin started, but ultimately I want the meat of the program in Obj-C.
Any advice appreciated! | objective-c | osx | api | lua | bridge | null | open | Creating a Lua plugin with Objective C Knowledge
===
I want to build a plugin for an application(TeamSpeak), however I have no lua knowledge. Is it possible to somehow wrap or bridge my Obj-C knowledge to lua?
If needed I could learn the basic syntax of lua to get my plugin started, but ultimately I want the meat of the program in Obj-C.
Any advice appreciated! | 0 |
10,581,571 | 05/14/2012 10:27:19 | 1,196,879 | 11/10/2011 13:09:54 | 1 | 1 | Screen became white while installing contact form 7 wordpress plugin | I am using shopperpress theme in my project. It is working fine on our server. But Client server, it is not working properly. I am unable to browse because admin screen become white and nothing is showing. While I delete contact form 7, admin area working properly. It's may be server related problem because it's working properly on my server but not on client server.
So, anyone help me to resolve the problem.
Thanks | wordpress | wordpress-plugin | wordpress-theming | null | null | 05/15/2012 15:32:20 | not a real question | Screen became white while installing contact form 7 wordpress plugin
===
I am using shopperpress theme in my project. It is working fine on our server. But Client server, it is not working properly. I am unable to browse because admin screen become white and nothing is showing. While I delete contact form 7, admin area working properly. It's may be server related problem because it's working properly on my server but not on client server.
So, anyone help me to resolve the problem.
Thanks | 1 |
10,058,569 | 04/07/2012 21:33:08 | 1,319,589 | 04/07/2012 20:47:33 | 1 | 0 | opencv c++, cvSaveImage not saving when program is executed from php | I am programming a face detection app using opencv c++(eclipse) on os X (lion). The program loads an image file, detects the faces, and then saves each individual face into separate files. The program works 100% as it is from a command line or in eclipse. I then wrote a php script for file upload so someone can upload a jpg or png file then the script saves the photo with a unique file name. Then at the end of the php script I have it execute the face detection program.
I am not sure what the difference is in running the application from a command line and having a php call the application to run. Here is my code below.
Facedection function in c++:
void detect_faces(IplImage* img)
{
IplImage* gray;
/* Load the face detector and create memory storage
`cascade` and `storage` are global variables */
//The cascade files are Pre-trained files for object detection so that the detection process
// knows what to detect in the photo or video.
if (!cascade) {
const char* file = "/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml";
cascade = (CvHaarClassifierCascade*) cvLoad(file, 0, 0, 0);
storage = cvCreateMemStorage(0);
}
/* Convert multichannel to 1-channel for faster processing */
if (img->nChannels == 1) {
gray = cvCloneImage(img);
} else {
gray = cvCreateImage(cvGetSize(img), img->depth, 1);
cvCvtColor(img, gray, CV_RGB2GRAY);
}
/* detect faces */
CvSeq* faces = cvHaarDetectObjects(
gray,
cascade,
storage,
1.1,
3,
CV_HAAR_DO_CANNY_PRUNING,
cvSize(20, 20)
);
int i;
int k = 0;
/* Draw red boxes on the faces found */
for( i = 0; i < (faces ? faces->total : 0); i++ )
{
CvRect* r = (CvRect*)cvGetSeqElem(faces, i);
cvRectangle(
img,
cvPoint(r->x, r->y),
cvPoint(r->x + r->width, r->y + r->height),
CV_RGB(255, 0, 0),
1, 8, 0
);
IplImage* clone = cvCreateImage (cvSize(img->width, img->height),
IPL_DEPTH_8U, img->nChannels );
IplImage* gray = cvCreateImage (cvSize(img->width, img->height),
IPL_DEPTH_8U, 1 );
cvCopy (img, clone, 0);
cvNamedWindow ("ROI", CV_WINDOW_AUTOSIZE);
cvCvtColor( clone, gray, CV_RGB2GRAY );
cvSetImageROI ( gray, *r);
//// * rectangle = cvGetImageROI ( clone );
*r = cvGetImageROI ( gray );
cvShowImage ("ROI", gray);
k++;
char *name=0;
name=(char*) calloc(512, 1);
sprintf(name, "/Users/jason/Sites/jason.dev/images/proc_images/Image%d.png", k);
cvSaveImage(name, gray);
}
}
php script:
<?php
mysql_connect("127.0.0.1:3306","xxxx","xxxx");
mysql_select_db("opencv_development");
$uploaddir = "images/";
$file = basename($_FILES['uploadedfile']['name']);
$stamp = date("YmdHis");
$random = rand(0, 999);
$newName = $uploaddir . $stamp . $random . $file;
if ($_FILES['uploadedfile']['size']> 300000) //Limiting image at 300K
{
exit("Your file is too large.");
}
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $newName)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
mysql_query("INSERT INTO recv_img (photo_name) VALUES ('$newName')");
shell_exec("./opencv '$newName'");
?>
As I said above, if I run the application from terminal then it outputs the individual face files. When it is executed from the php script, the image loads into the application, it does the face detection, but it does not save the individual face files.
Let me know if any further information is needed or if I was not clear about something. Any help is greatly appreciated! | php | c++ | opencv | null | null | null | open | opencv c++, cvSaveImage not saving when program is executed from php
===
I am programming a face detection app using opencv c++(eclipse) on os X (lion). The program loads an image file, detects the faces, and then saves each individual face into separate files. The program works 100% as it is from a command line or in eclipse. I then wrote a php script for file upload so someone can upload a jpg or png file then the script saves the photo with a unique file name. Then at the end of the php script I have it execute the face detection program.
I am not sure what the difference is in running the application from a command line and having a php call the application to run. Here is my code below.
Facedection function in c++:
void detect_faces(IplImage* img)
{
IplImage* gray;
/* Load the face detector and create memory storage
`cascade` and `storage` are global variables */
//The cascade files are Pre-trained files for object detection so that the detection process
// knows what to detect in the photo or video.
if (!cascade) {
const char* file = "/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml";
cascade = (CvHaarClassifierCascade*) cvLoad(file, 0, 0, 0);
storage = cvCreateMemStorage(0);
}
/* Convert multichannel to 1-channel for faster processing */
if (img->nChannels == 1) {
gray = cvCloneImage(img);
} else {
gray = cvCreateImage(cvGetSize(img), img->depth, 1);
cvCvtColor(img, gray, CV_RGB2GRAY);
}
/* detect faces */
CvSeq* faces = cvHaarDetectObjects(
gray,
cascade,
storage,
1.1,
3,
CV_HAAR_DO_CANNY_PRUNING,
cvSize(20, 20)
);
int i;
int k = 0;
/* Draw red boxes on the faces found */
for( i = 0; i < (faces ? faces->total : 0); i++ )
{
CvRect* r = (CvRect*)cvGetSeqElem(faces, i);
cvRectangle(
img,
cvPoint(r->x, r->y),
cvPoint(r->x + r->width, r->y + r->height),
CV_RGB(255, 0, 0),
1, 8, 0
);
IplImage* clone = cvCreateImage (cvSize(img->width, img->height),
IPL_DEPTH_8U, img->nChannels );
IplImage* gray = cvCreateImage (cvSize(img->width, img->height),
IPL_DEPTH_8U, 1 );
cvCopy (img, clone, 0);
cvNamedWindow ("ROI", CV_WINDOW_AUTOSIZE);
cvCvtColor( clone, gray, CV_RGB2GRAY );
cvSetImageROI ( gray, *r);
//// * rectangle = cvGetImageROI ( clone );
*r = cvGetImageROI ( gray );
cvShowImage ("ROI", gray);
k++;
char *name=0;
name=(char*) calloc(512, 1);
sprintf(name, "/Users/jason/Sites/jason.dev/images/proc_images/Image%d.png", k);
cvSaveImage(name, gray);
}
}
php script:
<?php
mysql_connect("127.0.0.1:3306","xxxx","xxxx");
mysql_select_db("opencv_development");
$uploaddir = "images/";
$file = basename($_FILES['uploadedfile']['name']);
$stamp = date("YmdHis");
$random = rand(0, 999);
$newName = $uploaddir . $stamp . $random . $file;
if ($_FILES['uploadedfile']['size']> 300000) //Limiting image at 300K
{
exit("Your file is too large.");
}
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $newName)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
mysql_query("INSERT INTO recv_img (photo_name) VALUES ('$newName')");
shell_exec("./opencv '$newName'");
?>
As I said above, if I run the application from terminal then it outputs the individual face files. When it is executed from the php script, the image loads into the application, it does the face detection, but it does not save the individual face files.
Let me know if any further information is needed or if I was not clear about something. Any help is greatly appreciated! | 0 |
7,260,647 | 08/31/2011 16:59:46 | 922,082 | 08/31/2011 16:59:46 | 1 | 0 | lightbox recently stopped working | Not sure what happened. Everything was working fine for a year, but just recently the pop-up window in doesn't open. When you click on the thumbnail, only the first image opens in a new browser window and there is no "next" or "prev" functionality. Do I need new code due to the new browser versions? If so can anyone point me in the right direction to get it? The original code was written by a guy that's no longer with my group. Here's the page in question: http://www.haibua.com/work.php | javascript | jquery | lightbox | null | null | 08/31/2011 17:28:36 | too localized | lightbox recently stopped working
===
Not sure what happened. Everything was working fine for a year, but just recently the pop-up window in doesn't open. When you click on the thumbnail, only the first image opens in a new browser window and there is no "next" or "prev" functionality. Do I need new code due to the new browser versions? If so can anyone point me in the right direction to get it? The original code was written by a guy that's no longer with my group. Here's the page in question: http://www.haibua.com/work.php | 3 |
11,373,452 | 07/07/2012 08:18:06 | 313,389 | 04/10/2010 08:52:41 | 1,330 | 14 | Is it possible to show a special category's new post in wordpress? | I want to display the new posts with these conditions:
a) if the page is a category list page, display only new posts of that category.
b) if the page is a post page,display only new posts of that post category.
Is it possible? Is there any plugin doing this ? | wordpress | wordpress-plugin | null | null | null | 07/31/2012 12:56:18 | not a real question | Is it possible to show a special category's new post in wordpress?
===
I want to display the new posts with these conditions:
a) if the page is a category list page, display only new posts of that category.
b) if the page is a post page,display only new posts of that post category.
Is it possible? Is there any plugin doing this ? | 1 |
11,676,756 | 07/26/2012 19:35:54 | 1,555,837 | 07/26/2012 19:29:00 | 1 | 0 | AdbWinApi documentations/examples | I do need to embed some ADB functionality in my Windows program and was surprised by lack of any documentation on AdbWinApi dll.
I do need the following functions:
1.) Connect to device and check if specific package installed
2.) If not , install new package
3.) Run this application after install
Easy done form command line, but somehow no documentation found how to do it from inside other program ( spanning ADB process is a possibility , but frankly, i don't like it) .
Any recommendations/suggestions/etc ?
Thanks
Stas
| android | documentation | android-ndk | android-sdk-2.3 | null | null | open | AdbWinApi documentations/examples
===
I do need to embed some ADB functionality in my Windows program and was surprised by lack of any documentation on AdbWinApi dll.
I do need the following functions:
1.) Connect to device and check if specific package installed
2.) If not , install new package
3.) Run this application after install
Easy done form command line, but somehow no documentation found how to do it from inside other program ( spanning ADB process is a possibility , but frankly, i don't like it) .
Any recommendations/suggestions/etc ?
Thanks
Stas
| 0 |
2,274,872 | 02/16/2010 17:25:26 | 274,570 | 02/16/2010 17:25:26 | 1 | 0 | php email sending application form | **i have an account on www.justfree.com for web hosting.I want to make a email sending application form...plz tell me the coding for that using mail function** | php | null | null | null | null | 04/21/2012 01:00:02 | not a real question | php email sending application form
===
**i have an account on www.justfree.com for web hosting.I want to make a email sending application form...plz tell me the coding for that using mail function** | 1 |
7,084,094 | 08/16/2011 19:48:37 | 200,567 | 11/01/2009 18:31:13 | 643 | 11 | Get Date from String '2011-08-16T19:03:21.000Z' | I ask a database for the date of an object. I get back a string as such: `2011-08-16T19:03:21.000Z` (Here's another one: `2011-08-12T02:13:16.000Z`);
Edit: Here is another one that I made August 16th, 2011, at 12:51 PM for testing purposes: `2011-08-16T19:51:24.000Z`
I want to convert this date to another format for display purposes. This format may change in the future, so I don't want to do direct string manipulation. The best thing to do is turn it into an NSDate, and then back to the correctly formatted string. However, I cannot, for the life of me, get the darn string into an NSDate.
- (NSString *)makeDateStringReadable:(NSString *)dateString {
NSLog(@"The String: %@", dateString);
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-ddTHH:mm:ss.zzzz"];
NSDate *theDate = [formatter dateFromString:dateString];
NSLog(@"The Date: %@", theDate);
[formatter setDateFormat:@"yyyy-MM-dd"];
NSString *finalString = [formatter stringFromDate:theDate];
[formatter release];
return finalString;
}
The original string is passed in, and is logged out, but the "The Date:" log always shows null. I'm assuming the format is not correct... but I can't get it to be correct. I've tried using [this][1] as a reference as well.
Can I get the aid of a DateFormatter guru? Thank you so much!
[1]: http://unicode.org/reports/tr35/#Date_Format_Patterns | iphone | objective-c | ios | nsdateformatter | dateformat | null | open | Get Date from String '2011-08-16T19:03:21.000Z'
===
I ask a database for the date of an object. I get back a string as such: `2011-08-16T19:03:21.000Z` (Here's another one: `2011-08-12T02:13:16.000Z`);
Edit: Here is another one that I made August 16th, 2011, at 12:51 PM for testing purposes: `2011-08-16T19:51:24.000Z`
I want to convert this date to another format for display purposes. This format may change in the future, so I don't want to do direct string manipulation. The best thing to do is turn it into an NSDate, and then back to the correctly formatted string. However, I cannot, for the life of me, get the darn string into an NSDate.
- (NSString *)makeDateStringReadable:(NSString *)dateString {
NSLog(@"The String: %@", dateString);
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-ddTHH:mm:ss.zzzz"];
NSDate *theDate = [formatter dateFromString:dateString];
NSLog(@"The Date: %@", theDate);
[formatter setDateFormat:@"yyyy-MM-dd"];
NSString *finalString = [formatter stringFromDate:theDate];
[formatter release];
return finalString;
}
The original string is passed in, and is logged out, but the "The Date:" log always shows null. I'm assuming the format is not correct... but I can't get it to be correct. I've tried using [this][1] as a reference as well.
Can I get the aid of a DateFormatter guru? Thank you so much!
[1]: http://unicode.org/reports/tr35/#Date_Format_Patterns | 0 |
9,501,815 | 02/29/2012 15:22:45 | 275,390 | 02/17/2010 16:09:58 | 1,579 | 56 | Creating an AsyncTask class on its own seperate | I've been working on an app and I've managed to get the AsyncTask to work fine when it's an inner class, which means in the same `main.java class` and when i looked at the code and it look so hard to get into and i am planning of doing refactoring the code so that the AsyncTask will have its onw separate class.
i started to doing it but then it raised few questions like, how would i show the `ProgressDialog box or toastText`
can anbydoy give me some direction please?
here is my code:
public class Main extends ListActivity{
@Override
public void onCreate(Bundle savedInstanceState)
{
............
.............
new taskDoSomething().execute();
} //
private class taskDoSomething extends AsyncTask<Void, Void, List<Employee>>
{
@Override
protected List<Surah> doInBackground(Void... params)
{
//do some stuffs...
try {
///
catch (Exception e)
{
//
}
}
protected void onProgressUpdate(Void... values)
{
super.onProgressUpdate(values);
m_ProgressDialog.dismiss();
}
protected void onPostExecute(List<Employee> result)
{
m_orders.clear();
m_orders.addAll(result);
m_ProgressDialog.dismiss();
m_adapter.notifyDataSetChanged();
}
}
} | android | android-asynctask | null | null | null | null | open | Creating an AsyncTask class on its own seperate
===
I've been working on an app and I've managed to get the AsyncTask to work fine when it's an inner class, which means in the same `main.java class` and when i looked at the code and it look so hard to get into and i am planning of doing refactoring the code so that the AsyncTask will have its onw separate class.
i started to doing it but then it raised few questions like, how would i show the `ProgressDialog box or toastText`
can anbydoy give me some direction please?
here is my code:
public class Main extends ListActivity{
@Override
public void onCreate(Bundle savedInstanceState)
{
............
.............
new taskDoSomething().execute();
} //
private class taskDoSomething extends AsyncTask<Void, Void, List<Employee>>
{
@Override
protected List<Surah> doInBackground(Void... params)
{
//do some stuffs...
try {
///
catch (Exception e)
{
//
}
}
protected void onProgressUpdate(Void... values)
{
super.onProgressUpdate(values);
m_ProgressDialog.dismiss();
}
protected void onPostExecute(List<Employee> result)
{
m_orders.clear();
m_orders.addAll(result);
m_ProgressDialog.dismiss();
m_adapter.notifyDataSetChanged();
}
}
} | 0 |
5,989,801 | 05/13/2011 09:21:22 | 752,013 | 05/13/2011 08:24:14 | 1 | 0 | Prsing NSMutableString use NXMLparsing | Hello freind pleae i have a question i use NXMLparser i receive a response (soapResults type NSMutableString like this
<articles>
<Article>
<id>1</id>
<Title>chemise</Title>
<Quantity>23</Quantity>
<Prix>45</Prix>
</Article>
<Article>
<id>0</id>
<Title>pantalon </Title>
<Quantity>10</Quantity>
<Prix>120</Prix>
</Article>
<Article>
<id>3</id>
<Title>chort</Title>
<Quantity>3</Quantity>
<Prix>89</Prix>
</Article>
</articles>
) from my server how i can parsing ele | iphone | null | null | null | null | 10/21/2011 12:37:14 | not a real question | Prsing NSMutableString use NXMLparsing
===
Hello freind pleae i have a question i use NXMLparser i receive a response (soapResults type NSMutableString like this
<articles>
<Article>
<id>1</id>
<Title>chemise</Title>
<Quantity>23</Quantity>
<Prix>45</Prix>
</Article>
<Article>
<id>0</id>
<Title>pantalon </Title>
<Quantity>10</Quantity>
<Prix>120</Prix>
</Article>
<Article>
<id>3</id>
<Title>chort</Title>
<Quantity>3</Quantity>
<Prix>89</Prix>
</Article>
</articles>
) from my server how i can parsing ele | 1 |
3,658,510 | 09/07/2010 12:08:01 | 191,776 | 10/17/2009 19:08:19 | 118 | 0 | Unused Return Status Codes in C | I want to return a unique status code to a waiting parent process from a child process through exit(), based on the execution of child's code. If execvp fails, then the exit() is used. I assume that if execvp is successful, the command executed will send its status code.
pid=fork();
if(pid==0)
{
if(execvp(cmdName,cmdArgs)==-1)
{
printf("Exec failed!\n");
exit(K); //K?
}
}
waitpid(pid,&status,0);
Suppose the command passed to execvp() is "ls", the man page says that it may return 0(success), 1 or 2(failure).
What safe unique value K can I use to indicate the return status of a child process, which won't clash with any value returned by the command executed by execvp()? | c | exec | null | null | null | null | open | Unused Return Status Codes in C
===
I want to return a unique status code to a waiting parent process from a child process through exit(), based on the execution of child's code. If execvp fails, then the exit() is used. I assume that if execvp is successful, the command executed will send its status code.
pid=fork();
if(pid==0)
{
if(execvp(cmdName,cmdArgs)==-1)
{
printf("Exec failed!\n");
exit(K); //K?
}
}
waitpid(pid,&status,0);
Suppose the command passed to execvp() is "ls", the man page says that it may return 0(success), 1 or 2(failure).
What safe unique value K can I use to indicate the return status of a child process, which won't clash with any value returned by the command executed by execvp()? | 0 |
8,966,648 | 01/23/2012 02:31:12 | 1,164,206 | 01/23/2012 02:03:03 | 6 | 0 | Picturebox Issue | I am stuck on making this space invaders game. I cannot figure out how to group pictureboxes together to make all the invaders move exactly the same. What happens is that when they move to the bottom, 1 of the pictureboxes moves farther down then the other 4. I have the same picturebox code for 4 other picture boxes.
namespace Space_Invaders
{
public partial class Form1 : Form
{
int speedx = 5;
int speedy = 5;
public Form1()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
pictureBox7.Location = new Point(pictureBox7.Location.X + speedx, pictureBox7.Location.Y + speedy);
if (pictureBox7.Location.Y > 420)// bounce off bottom
{
speedy = -speedy;
}
if (pictureBox7.Location.Y < 10)// bounce off top
{
speedy = -speedy;
}
if (pictureBox7.Location.X > 400)// bounce off right
{
speedx = -speedx;
}
if (pictureBox7.Location.X < 0)//bounce off left
{
speedx = -speedx;
}
}
}
| c# | c | null | null | null | 01/23/2012 03:36:25 | too localized | Picturebox Issue
===
I am stuck on making this space invaders game. I cannot figure out how to group pictureboxes together to make all the invaders move exactly the same. What happens is that when they move to the bottom, 1 of the pictureboxes moves farther down then the other 4. I have the same picturebox code for 4 other picture boxes.
namespace Space_Invaders
{
public partial class Form1 : Form
{
int speedx = 5;
int speedy = 5;
public Form1()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
pictureBox7.Location = new Point(pictureBox7.Location.X + speedx, pictureBox7.Location.Y + speedy);
if (pictureBox7.Location.Y > 420)// bounce off bottom
{
speedy = -speedy;
}
if (pictureBox7.Location.Y < 10)// bounce off top
{
speedy = -speedy;
}
if (pictureBox7.Location.X > 400)// bounce off right
{
speedx = -speedx;
}
if (pictureBox7.Location.X < 0)//bounce off left
{
speedx = -speedx;
}
}
}
| 3 |
10,746,130 | 05/24/2012 22:23:16 | 155,011 | 08/12/2009 11:36:32 | 414 | 3 | PaperPosition and PaperSize is ther some simple way to calculate dependency | I use matlab in order to generate plots in pdf files. These plots in pdf should have correct sized therefore I use PaperSize. Then I have to position plot with correct PaperPosition. The problem is that matlab uses some strange equation in order to calculate position of the plot on the page. So plot positioning is constant shooting with parameters instead of calculating it. For example:
set(gcf, 'PaperPosition', [-0.3 -0 7.2 3.1]); %Position the plot further to the left and down. Extend the plot to fill entire paper.[left bottom width height]
set(gcf, 'PaperSize', [6.5 3]); %Keep the paper size [width height]
Do you know how matlab calculates this position ?
| matlab | plot | null | null | null | null | open | PaperPosition and PaperSize is ther some simple way to calculate dependency
===
I use matlab in order to generate plots in pdf files. These plots in pdf should have correct sized therefore I use PaperSize. Then I have to position plot with correct PaperPosition. The problem is that matlab uses some strange equation in order to calculate position of the plot on the page. So plot positioning is constant shooting with parameters instead of calculating it. For example:
set(gcf, 'PaperPosition', [-0.3 -0 7.2 3.1]); %Position the plot further to the left and down. Extend the plot to fill entire paper.[left bottom width height]
set(gcf, 'PaperSize', [6.5 3]); %Keep the paper size [width height]
Do you know how matlab calculates this position ?
| 0 |
10,478,353 | 05/07/2012 07:35:40 | 1,315,883 | 04/05/2012 17:15:20 | 28 | 4 | How to use API using ASP.net/C#? | I want to use Photobucket API for my project work and as I am new to C# and Asp.net I am not sure how to begin with and use this API, the below link provides the detail of the classes created for API
https://bitbucket.org/photobucket/api-dotnet/changeset/179816cef52b
but I am not able to understand how to use them?
Can anyone please help me with this thing...
Thanks in advance... | c# | asp.net | api | photobucket | null | 05/07/2012 15:42:26 | not a real question | How to use API using ASP.net/C#?
===
I want to use Photobucket API for my project work and as I am new to C# and Asp.net I am not sure how to begin with and use this API, the below link provides the detail of the classes created for API
https://bitbucket.org/photobucket/api-dotnet/changeset/179816cef52b
but I am not able to understand how to use them?
Can anyone please help me with this thing...
Thanks in advance... | 1 |
8,031,720 | 11/07/2011 01:01:35 | 985,501 | 10/08/2011 15:46:06 | 3 | 1 | MySQL RELOAD and RESET QUERY CACHE | I'm using phpmyadmin and working on someone site whose information is pulled from a database with a table called "profile_types" I had to add a row for a new type but the website isn't reflecting the changes. I've been reading around and "have query cache" is set to yes so figured I should clear the cache and see if that helps any.
So after reading I was trying to use RESET QUERY CACHEl but kept getting an error about using RELOAD> So after some more reading I can't figure out how to use the RELOAD command. As far as I know this is the databases only user account so I'd figured it was admin and had the necessary privs. Am I missing something? Also, do you guys thinks doing the RESET QUERY CACHE would maybe allow it to update the site with the new record? I've cleared my browsers cache and tried all that and no go so figured this was my last option. | mysql | query | caching | phpmyadmin | reload | null | open | MySQL RELOAD and RESET QUERY CACHE
===
I'm using phpmyadmin and working on someone site whose information is pulled from a database with a table called "profile_types" I had to add a row for a new type but the website isn't reflecting the changes. I've been reading around and "have query cache" is set to yes so figured I should clear the cache and see if that helps any.
So after reading I was trying to use RESET QUERY CACHEl but kept getting an error about using RELOAD> So after some more reading I can't figure out how to use the RELOAD command. As far as I know this is the databases only user account so I'd figured it was admin and had the necessary privs. Am I missing something? Also, do you guys thinks doing the RESET QUERY CACHE would maybe allow it to update the site with the new record? I've cleared my browsers cache and tried all that and no go so figured this was my last option. | 0 |
10,078,039 | 04/09/2012 18:42:07 | 1,322,497 | 04/09/2012 18:36:32 | 1 | 0 | Inject HTML source into an iframe to avoid cross site scripting issue | I am trying to specify the source of an iframe to a blank HTML page. As the source is located on a different domain, I am getting 'Permission denied' error. Is there a way for me to inject the HTML source into the iframe to avoid the cross site issue? | javascript | ajax | security | web | null | 04/10/2012 21:42:36 | not a real question | Inject HTML source into an iframe to avoid cross site scripting issue
===
I am trying to specify the source of an iframe to a blank HTML page. As the source is located on a different domain, I am getting 'Permission denied' error. Is there a way for me to inject the HTML source into the iframe to avoid the cross site issue? | 1 |
10,850,580 | 06/01/2012 12:48:08 | 1,029,733 | 11/04/2011 13:13:53 | 380 | 1 | Finding adresses of next hop | I have the next table:
Network adress NetMask Next Hop
128.96.166.0 255.255.255.0 1
128.96.166.0 255.255.252.0 2
0.0.0.0 0.0.0.0 3
I want to find the adreeses range, for which the router will send to each Hop. for example, the adress's IP: 128.96.166.0 would send to Hop 1.
I don't understand how the NetMak help me to detrmine it. Is it not always would go to hop 1? | ip | router | null | null | null | null | open | Finding adresses of next hop
===
I have the next table:
Network adress NetMask Next Hop
128.96.166.0 255.255.255.0 1
128.96.166.0 255.255.252.0 2
0.0.0.0 0.0.0.0 3
I want to find the adreeses range, for which the router will send to each Hop. for example, the adress's IP: 128.96.166.0 would send to Hop 1.
I don't understand how the NetMak help me to detrmine it. Is it not always would go to hop 1? | 0 |
2,154,473 | 01/28/2010 12:34:51 | 113,141 | 05/27/2009 12:53:28 | 3,853 | 235 | Game development - handling collisions with sloped terrain | I'm trying to figure out how to handle collisions with a player trying to move over sloped terrain. For example, consider if a player is at the bottom of a half-pipe and wants to go left:
- At first the player is on the flat and can go directly left
- At some point the player starts going up a slope, and so needs to go up and left in order to remain on top of the terrain
How should I handle this?
- Should try and move the player directly left and see if they have collided with terrain - if they have then work out if I should nudge the players position?
- Should I try and work out what the terrain to the players left looks like, and determine in advance what height the player should be placed at? | collision-detection | null | null | null | null | null | open | Game development - handling collisions with sloped terrain
===
I'm trying to figure out how to handle collisions with a player trying to move over sloped terrain. For example, consider if a player is at the bottom of a half-pipe and wants to go left:
- At first the player is on the flat and can go directly left
- At some point the player starts going up a slope, and so needs to go up and left in order to remain on top of the terrain
How should I handle this?
- Should try and move the player directly left and see if they have collided with terrain - if they have then work out if I should nudge the players position?
- Should I try and work out what the terrain to the players left looks like, and determine in advance what height the player should be placed at? | 0 |
11,404,648 | 07/09/2012 23:23:12 | 1,382,299 | 03/27/2011 15:53:29 | 473 | 2 | MySQL ODBC + setting up a DSN on windows + MySQL Workbench | Sorry for the vague title, but here's my problem.
I connect to my database in MySQL Workbench using the following method : TCP/IP over SSH
However, when I try to set up the DSN on Windows 7 via:
Control Panel -> Administrative Tools ->Data Sources (ODBC)
It won't connect. My other databases that connect in MySQL Workbench using Standard TCP/IP are able to connect when I set up the DSN on Windows, but I think the SSH is throwing it off.
Could someone please let me know if it's possible to set up a DSN on windows using a connection that uses SSH?
| windows-7 | mysql-workbench | dsn | null | null | 07/10/2012 19:18:47 | off topic | MySQL ODBC + setting up a DSN on windows + MySQL Workbench
===
Sorry for the vague title, but here's my problem.
I connect to my database in MySQL Workbench using the following method : TCP/IP over SSH
However, when I try to set up the DSN on Windows 7 via:
Control Panel -> Administrative Tools ->Data Sources (ODBC)
It won't connect. My other databases that connect in MySQL Workbench using Standard TCP/IP are able to connect when I set up the DSN on Windows, but I think the SSH is throwing it off.
Could someone please let me know if it's possible to set up a DSN on windows using a connection that uses SSH?
| 2 |
2,553,357 | 03/31/2010 13:39:35 | 109,035 | 05/18/2009 21:44:38 | 7,654 | 493 | Stop Implicit Typecast | My issue is within AMO in a C# console application. I have a DataSourceView that has a table which has a column of type Decimal.
When I try to create a measure out of it, AMO says that it cannot create a measure because the data type is string.
I believe there may be some implicit typecasting going on in the background that is causing this.
Is there an application wide setting to stop implict typecasting? | c# | casting | null | null | null | null | open | Stop Implicit Typecast
===
My issue is within AMO in a C# console application. I have a DataSourceView that has a table which has a column of type Decimal.
When I try to create a measure out of it, AMO says that it cannot create a measure because the data type is string.
I believe there may be some implicit typecasting going on in the background that is causing this.
Is there an application wide setting to stop implict typecasting? | 0 |
11,568,637 | 07/19/2012 20:18:16 | 1,325,349 | 04/10/2012 23:59:00 | 68 | 2 | VBA to Rearrange certain columns and rows | I have a excel spreadsheet formatted like this:
![Before][1]
What I have been trying to do is format it to look like this:
![After][2]
[1]: http://i.stack.imgur.com/mO1UM.png
[2]: http://i.stack.imgur.com/qw0nC.png
So it's kind of transposed I guess (not sure how to call it).
I've spent the last hour and a half trying to do it in VBA with no success.
This is just a sample of how it is formatted, in reality there's about 50,000 of these, so I need to do it using VBA or something of the sort.
Would someone be able to help me out with how to do this?
Thank You. | excel | vba | macros | transpose | null | null | open | VBA to Rearrange certain columns and rows
===
I have a excel spreadsheet formatted like this:
![Before][1]
What I have been trying to do is format it to look like this:
![After][2]
[1]: http://i.stack.imgur.com/mO1UM.png
[2]: http://i.stack.imgur.com/qw0nC.png
So it's kind of transposed I guess (not sure how to call it).
I've spent the last hour and a half trying to do it in VBA with no success.
This is just a sample of how it is formatted, in reality there's about 50,000 of these, so I need to do it using VBA or something of the sort.
Would someone be able to help me out with how to do this?
Thank You. | 0 |
11,316,329 | 07/03/2012 17:45:28 | 1,499,542 | 07/03/2012 17:34:08 | 1 | 0 | How to create a asynchronous web part using C# | I want to know about creating a web part using c#. Scenario will be like when 2-3 web part loading , it will show a waiting image for one by one and there must be delay of at least 10 sec. | c# | sharepoint | web | part | null | 07/03/2012 22:03:04 | not a real question | How to create a asynchronous web part using C#
===
I want to know about creating a web part using c#. Scenario will be like when 2-3 web part loading , it will show a waiting image for one by one and there must be delay of at least 10 sec. | 1 |
11,355,605 | 07/06/2012 03:57:02 | 1,505,663 | 07/06/2012 03:30:25 | 1 | 0 | python syntax error in function | I am a beginner to python, and I have a problem when I was trying my new program.
I was trying to define a function to lowercase the inputs, but it only work with integers but int with letters, nor letters, here's what i get:
def SomeString(string):
lowcase = str(string)
lowcase.lower()
print lowcase
Only integers work, integers with letters or letters wont work:
>>> SomeString(TEST0110)
SyntaxError: invalid syntax
and
>>> SomeString(TESTString)
Traceback (most recent call last):
File "<pyshell#10>", line 1, in <module>
SomeString(TESTString)
NameError: name 'TESTString' is not defined
I tried not to use function to do this and it worked fine:
>>> String = "TEST0110"
>>> String.lower()
'test0110'
I don't know why it won't work with function, please help.
THanks. | python | function | python-2.7 | null | null | null | open | python syntax error in function
===
I am a beginner to python, and I have a problem when I was trying my new program.
I was trying to define a function to lowercase the inputs, but it only work with integers but int with letters, nor letters, here's what i get:
def SomeString(string):
lowcase = str(string)
lowcase.lower()
print lowcase
Only integers work, integers with letters or letters wont work:
>>> SomeString(TEST0110)
SyntaxError: invalid syntax
and
>>> SomeString(TESTString)
Traceback (most recent call last):
File "<pyshell#10>", line 1, in <module>
SomeString(TESTString)
NameError: name 'TESTString' is not defined
I tried not to use function to do this and it worked fine:
>>> String = "TEST0110"
>>> String.lower()
'test0110'
I don't know why it won't work with function, please help.
THanks. | 0 |
10,314,705 | 04/25/2012 11:30:22 | 1,355,776 | 04/25/2012 09:26:52 | 1 | 0 | Configure Linux IP stack as strong end system model | I'm playing around with configuration of the Linux IP stack and want to learn how to configure it as a strong end system model described in RFC1122. The ambition is to also have one routing table per interface. Source based routing seems to be one solution to this behavior:
http://pastebin.com/ZwgSRWgP
or
http://www.linuxjournal.com/article/7291
Are there any alternatives to this solution or drawbacks with it? Putting the VLAN interfaces into different network namespaces seems to be another solution to get a strong end system model (as long as I configure only one IP address on each VLAN) and one routing table per interface.
Any ideas? | linux | networking | network-programming | null | null | 04/27/2012 14:15:59 | off topic | Configure Linux IP stack as strong end system model
===
I'm playing around with configuration of the Linux IP stack and want to learn how to configure it as a strong end system model described in RFC1122. The ambition is to also have one routing table per interface. Source based routing seems to be one solution to this behavior:
http://pastebin.com/ZwgSRWgP
or
http://www.linuxjournal.com/article/7291
Are there any alternatives to this solution or drawbacks with it? Putting the VLAN interfaces into different network namespaces seems to be another solution to get a strong end system model (as long as I configure only one IP address on each VLAN) and one routing table per interface.
Any ideas? | 2 |
3,580,092 | 08/26/2010 22:33:58 | 311,364 | 04/07/2010 20:26:21 | 1 | 3 | Persistently overriding svn's mime to binary mapping? | Svn won't diff a file it thinks is binary
$ svn diff data/assets/site/ir_gallery/images.kml
Index: data/assets/site/ir_gallery/images.kml
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/vnd.google-earth.kml+xml
A recent stack overflow answer ( http://stackoverflow.com/questions/2634043/svn-diff-file-marked-as-binary-type ) showed you can force a mime type:
$ svn propset svn:mime-type 'text/plain' data/assets/site/ir_gallery/images.kml
property 'svn:mime-type' set on 'data/assets/site/ir_gallery/images.kml'
That prior answer is incomplete... you also have to:
$ svn commit
My new question is: can I set a default, so all future "vnd.google-earth.kml+xml" files are treated as text by svn? The redbook appears silent on this topic: http://svnbook.red-bean.com/en/1.2/svn.advanced.props.html saying only:
if a file's svn:mime-type property is set to a non-text MIME type
(generally, something that doesn't begin with text/, though there are
exceptions)".
What exceptions? Are these exceptions baked into the svn code, or accessible? | svn | mime-types | null | null | null | null | open | Persistently overriding svn's mime to binary mapping?
===
Svn won't diff a file it thinks is binary
$ svn diff data/assets/site/ir_gallery/images.kml
Index: data/assets/site/ir_gallery/images.kml
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/vnd.google-earth.kml+xml
A recent stack overflow answer ( http://stackoverflow.com/questions/2634043/svn-diff-file-marked-as-binary-type ) showed you can force a mime type:
$ svn propset svn:mime-type 'text/plain' data/assets/site/ir_gallery/images.kml
property 'svn:mime-type' set on 'data/assets/site/ir_gallery/images.kml'
That prior answer is incomplete... you also have to:
$ svn commit
My new question is: can I set a default, so all future "vnd.google-earth.kml+xml" files are treated as text by svn? The redbook appears silent on this topic: http://svnbook.red-bean.com/en/1.2/svn.advanced.props.html saying only:
if a file's svn:mime-type property is set to a non-text MIME type
(generally, something that doesn't begin with text/, though there are
exceptions)".
What exceptions? Are these exceptions baked into the svn code, or accessible? | 0 |
6,824,864 | 07/26/2011 03:18:04 | 862,666 | 07/26/2011 03:10:36 | 1 | 0 | how to read from a file, and how to write to a file using Ant svn | i'm going through a task which asking me to read from a file, and write the readable data to another file after doing some modifications in the data that have been read .... could some one give me a clue to this task ...
thanks in advance | svn | ant | cvs | cvs2svn | null | 07/26/2011 14:10:23 | not a real question | how to read from a file, and how to write to a file using Ant svn
===
i'm going through a task which asking me to read from a file, and write the readable data to another file after doing some modifications in the data that have been read .... could some one give me a clue to this task ...
thanks in advance | 1 |
5,098,343 | 02/23/2011 22:57:51 | 345,653 | 05/20/2010 02:11:12 | 82 | 1 | How can view all zones in a an Orchard theme? | I'm trying to learn orchard. The theme machine has many zones to place widgets. Is there a way through the browser to see all the zones available and their location on the page? | orchard | null | null | null | null | null | open | How can view all zones in a an Orchard theme?
===
I'm trying to learn orchard. The theme machine has many zones to place widgets. Is there a way through the browser to see all the zones available and their location on the page? | 0 |
4,975,222 | 02/11/2011 23:51:11 | 27,305 | 10/13/2008 03:41:50 | 1,662 | 19 | Jquery - disable select when dragging | I'm trying to do my own drag and drop function using jquery library. But everytime I mousedown on an image, then mousemove, my browser "highlights" or "selects" the image, which disrupts my mousemove operation.
How do I disable the select/highlight? I tried `$('img').onselectstart = function() {return false;}`, but that didn't work. | javascript | jquery | dom | null | null | null | open | Jquery - disable select when dragging
===
I'm trying to do my own drag and drop function using jquery library. But everytime I mousedown on an image, then mousemove, my browser "highlights" or "selects" the image, which disrupts my mousemove operation.
How do I disable the select/highlight? I tried `$('img').onselectstart = function() {return false;}`, but that didn't work. | 0 |
3,887,004 | 10/08/2010 01:03:53 | 312,480 | 04/08/2010 23:50:03 | 236 | 16 | Best ivy practice: Split code into multiple projects or use one project with multiple configurations? | At work we have a number of projects which need to share some common code. Some code is completely universal while some of the code is only shared by a subset of our projects. Should I split up the common code into two separate projects or use two different ivy configurations for a single project?
---
**Option 1** - Two separate projects.
- Proj 1 - Common published as default configuration
- Proj 1 - Common-xml published as default configuration
Potential Issues: Requires that I have two separate projects, with two separate build files and two separate ivy files.
**Option 2** - One project, multiple ivy configurations for different artifacts
- Artifact 1 - Common published as core
- Artifact 2 - Common xml published as core-xml
Potential Issues: I may have to maintain separate source directories in the same project.
In either case, the common xml component may rely on the common core component.
---
So, SF, what should I do for maintaining my common code? What issues did I miss with the two methods, and what are any other pros/cons or alternative solutions? | java | project-management | ivy | null | null | null | open | Best ivy practice: Split code into multiple projects or use one project with multiple configurations?
===
At work we have a number of projects which need to share some common code. Some code is completely universal while some of the code is only shared by a subset of our projects. Should I split up the common code into two separate projects or use two different ivy configurations for a single project?
---
**Option 1** - Two separate projects.
- Proj 1 - Common published as default configuration
- Proj 1 - Common-xml published as default configuration
Potential Issues: Requires that I have two separate projects, with two separate build files and two separate ivy files.
**Option 2** - One project, multiple ivy configurations for different artifacts
- Artifact 1 - Common published as core
- Artifact 2 - Common xml published as core-xml
Potential Issues: I may have to maintain separate source directories in the same project.
In either case, the common xml component may rely on the common core component.
---
So, SF, what should I do for maintaining my common code? What issues did I miss with the two methods, and what are any other pros/cons or alternative solutions? | 0 |
8,701,119 | 01/02/2012 12:57:27 | 1,126,239 | 01/02/2012 12:41:49 | 1 | 0 | jQuery: nth-child selector not working in ie7 | So I've got a grid of divs, not all equal heights and I need them all to line up properly. I've used the nth-child jQuery selector (see below) to select the first div of each row and apply a **clear:both** style to it. This works in ie8 and up as well as chrome and safari however in ie7 it just ignores the nth-child bit and therefore doesn't apply my css.
I used jQuery over css3 so that it would work in ie7 - so am slighty baffled by the fact it's not..
See the html for yourself at http://jackbeck.co.uk/?portfolio=courses
jQuery code in header:
<script type="text/javascript">
jQuery(document).ready(function($){
$('.project.small:nth-child(4n+1)').css("clear", "both");
});
</script>'
Anyone able to help? | jquery | css | nth-child | null | null | null | open | jQuery: nth-child selector not working in ie7
===
So I've got a grid of divs, not all equal heights and I need them all to line up properly. I've used the nth-child jQuery selector (see below) to select the first div of each row and apply a **clear:both** style to it. This works in ie8 and up as well as chrome and safari however in ie7 it just ignores the nth-child bit and therefore doesn't apply my css.
I used jQuery over css3 so that it would work in ie7 - so am slighty baffled by the fact it's not..
See the html for yourself at http://jackbeck.co.uk/?portfolio=courses
jQuery code in header:
<script type="text/javascript">
jQuery(document).ready(function($){
$('.project.small:nth-child(4n+1)').css("clear", "both");
});
</script>'
Anyone able to help? | 0 |
5,138,989 | 02/28/2011 06:46:32 | 502,052 | 11/09/2010 15:12:23 | 523 | 8 | Trouble setting SSL certificates in order to make HTTPS requests using Apache\Phusion Passenger and Virtual Hosts in localhost | I am using Ruby on Rails 3 and I would like to make to work HTTPS connections on *localhost*.
I am using:
- Apache v2 + Phusion Passenger
- Mac OS + Snow Leopard v10.6.6
My Ruby on Rails installation use the [Typhoeus gem][1] (it is possible to use the Ruby net\http library but the result doesn't change) to make HTTP requests over HTTPS.
I created self-signed *ca.key*, *pjtname.crt* and *pjtname.key* as [detailed on the Apple website][2].
*Notice*: Following instruction from the Apple website, on running the `openssl req -new -key server.key -out server.csr` command (see the link) at this point
Common Name (eg, YOUR name) []: (this is the important one)
I entered `*pjtname.com` so that is valid for all sub_domain of that site.
----------
In my Apache `httpd.conf` I have two virtual hosts configured in this way:
# Secure (SSL/TLS) connections
#Include /private/etc/apache2/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
# starting without SSL on platforms with no /dev/random equivalent
# but a statically compiled-in mod_ssl.
#
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Include /private/etc/apache2/other/*.conf
# Passenger configuration
LoadModule passenger_module /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/ext/apache2/mod_passenger.so
PassengerRoot /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2
PassengerRuby /Users/<my_user_name>/.rvm/wrappers/ruby-1.9.2-p136/ruby
# Go ahead and accept connections for these vhosts
# from non-SNI clients
SSLStrictSNIVHostCheck off
# Ensure that Apache listens on port 443
Listen 443
# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80
NameVirtualHost *:443
#
# PJTNAME.COM and subdomains SETTING
#
<VirtualHost *:443>
# Because this virtual host is defined first, it will
# be used as the default if the hostname is not received
# in the SSL handshake, e.g. if the browser doesn't support
# SNI.
ServerName pjtname.com:443
DocumentRoot "/Users/<my_user_name>/Sites/pjtname.com/pjtname.com/public"
ServerAdmin you@example.com
ErrorLog "/private/var/log/apache2/error_log"
TransferLog "/private/var/log/apache2/access_log"
RackEnv development
<Directory "/Users/<my_user_name>/Sites/pjtname.com/pjtname.com/public">
Order allow,deny
Allow from all
</Directory>
# SSL Configuration
SSLEngine on
# Self Signed certificates
# Server Certificate
SSLCertificateFile /private/etc/apache2/ssl/wildcard.certificate/pjtname.crt
# Server Private Key
SSLCertificateKeyFile /private/etc/apache2/ssl/wildcard.certificate/pjtname.key
# Server Intermediate Bundle
SSLCertificateChainFile /private/etc/apache2/ssl/wildcard.certificate/ca.crt
</VirtualHost>
# HTTP Setting
<VirtualHost *:80>
ServerName pjtname.com
DocumentRoot "/Users/<my_user_name>/Sites/pjtname.com/pjtname.com/public"
RackEnv development
<Directory "/Users/<my_user_name>/Sites/pjtname.com/pjtname.com/public">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:443>
ServerName users.pjtname.com:443
DocumentRoot "/Users/<my_user_name>/Sites/pjtname.com/users.pjtname.com/public"
ServerAdmin you@example.com
ErrorLog "/private/var/log/apache2/error_log"
TransferLog "/private/var/log/apache2/access_log"
RackEnv development
<Directory "/Users/<my_user_name>/Sites/pjtname.com/users.pjtname.com/public">
Order allow,deny
Allow from all
</Directory>
# SSL Configuration
SSLEngine on
# Self Signed certificates
# Server Certificate
SSLCertificateFile /private/etc/apache2/ssl/wildcard.certificate/pjtname.crt
# Server Private Key
SSLCertificateKeyFile /private/etc/apache2/ssl/wildcard.certificate/pjtname.key
# Server Intermediate Bundle
SSLCertificateChainFile /private/etc/apache2/ssl/wildcard.certificate/ca.crt
</VirtualHost>
# HTTP Setting
<VirtualHost *:80>
ServerName users.pjtname.com
DocumentRoot "/Users/<my_user_name>/Sites/pjtname.com/users.pjtname.com/public"
RackEnv development
<Directory "/Users/<my_user_name>/Sites/pjtname.com/users.pjtname.com/public">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
All seems to work properly, but when I make a request (using Typhoeus - I can use also the Ruby Net::Http library and the result doesn't change) from the `pjtname.com` RoR application:
# Typhoeus request
Typhoeus::Request.get("https://users.pjtname.com/")
I get something like a warning about the certificate:
--- &id001 !ruby/object:Typhoeus::Response
app_connect_time: 0.0
body: ""
code: 0
connect_time: 0.000625
# Here is the warning
curl_error_message: Peer certificate cannot be authenticated with known CA certificates
curl_return_code: 60
effective_url: https://users.pjtname.com/
headers: ""
http_version:
mock: false
name_lookup_time: 0.000513
pretransfer_time: 0.0
request: !ruby/object:Typhoeus::Request
after_complete:
auth_method:
body:
...
All this means that something is wrong. So, **what I have to do to avoid the "Peer certificate cannot be authenticated with known CA certificates" warning and make the HTTPS connection to work? Where is\are the error\errors?**
P.S.: if you need some more info, let me know.
[1]: https://github.com/dbalatero/typhoeus
[2]: http://developer.apple.com/internet/serverside/modssl.html | ruby-on-rails | ruby | apache | ruby-on-rails-3 | ssl | null | open | Trouble setting SSL certificates in order to make HTTPS requests using Apache\Phusion Passenger and Virtual Hosts in localhost
===
I am using Ruby on Rails 3 and I would like to make to work HTTPS connections on *localhost*.
I am using:
- Apache v2 + Phusion Passenger
- Mac OS + Snow Leopard v10.6.6
My Ruby on Rails installation use the [Typhoeus gem][1] (it is possible to use the Ruby net\http library but the result doesn't change) to make HTTP requests over HTTPS.
I created self-signed *ca.key*, *pjtname.crt* and *pjtname.key* as [detailed on the Apple website][2].
*Notice*: Following instruction from the Apple website, on running the `openssl req -new -key server.key -out server.csr` command (see the link) at this point
Common Name (eg, YOUR name) []: (this is the important one)
I entered `*pjtname.com` so that is valid for all sub_domain of that site.
----------
In my Apache `httpd.conf` I have two virtual hosts configured in this way:
# Secure (SSL/TLS) connections
#Include /private/etc/apache2/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
# starting without SSL on platforms with no /dev/random equivalent
# but a statically compiled-in mod_ssl.
#
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Include /private/etc/apache2/other/*.conf
# Passenger configuration
LoadModule passenger_module /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2/ext/apache2/mod_passenger.so
PassengerRoot /Users/<my_user_name>/.rvm/gems/ruby-1.9.2-p136/gems/passenger-3.0.2
PassengerRuby /Users/<my_user_name>/.rvm/wrappers/ruby-1.9.2-p136/ruby
# Go ahead and accept connections for these vhosts
# from non-SNI clients
SSLStrictSNIVHostCheck off
# Ensure that Apache listens on port 443
Listen 443
# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80
NameVirtualHost *:443
#
# PJTNAME.COM and subdomains SETTING
#
<VirtualHost *:443>
# Because this virtual host is defined first, it will
# be used as the default if the hostname is not received
# in the SSL handshake, e.g. if the browser doesn't support
# SNI.
ServerName pjtname.com:443
DocumentRoot "/Users/<my_user_name>/Sites/pjtname.com/pjtname.com/public"
ServerAdmin you@example.com
ErrorLog "/private/var/log/apache2/error_log"
TransferLog "/private/var/log/apache2/access_log"
RackEnv development
<Directory "/Users/<my_user_name>/Sites/pjtname.com/pjtname.com/public">
Order allow,deny
Allow from all
</Directory>
# SSL Configuration
SSLEngine on
# Self Signed certificates
# Server Certificate
SSLCertificateFile /private/etc/apache2/ssl/wildcard.certificate/pjtname.crt
# Server Private Key
SSLCertificateKeyFile /private/etc/apache2/ssl/wildcard.certificate/pjtname.key
# Server Intermediate Bundle
SSLCertificateChainFile /private/etc/apache2/ssl/wildcard.certificate/ca.crt
</VirtualHost>
# HTTP Setting
<VirtualHost *:80>
ServerName pjtname.com
DocumentRoot "/Users/<my_user_name>/Sites/pjtname.com/pjtname.com/public"
RackEnv development
<Directory "/Users/<my_user_name>/Sites/pjtname.com/pjtname.com/public">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:443>
ServerName users.pjtname.com:443
DocumentRoot "/Users/<my_user_name>/Sites/pjtname.com/users.pjtname.com/public"
ServerAdmin you@example.com
ErrorLog "/private/var/log/apache2/error_log"
TransferLog "/private/var/log/apache2/access_log"
RackEnv development
<Directory "/Users/<my_user_name>/Sites/pjtname.com/users.pjtname.com/public">
Order allow,deny
Allow from all
</Directory>
# SSL Configuration
SSLEngine on
# Self Signed certificates
# Server Certificate
SSLCertificateFile /private/etc/apache2/ssl/wildcard.certificate/pjtname.crt
# Server Private Key
SSLCertificateKeyFile /private/etc/apache2/ssl/wildcard.certificate/pjtname.key
# Server Intermediate Bundle
SSLCertificateChainFile /private/etc/apache2/ssl/wildcard.certificate/ca.crt
</VirtualHost>
# HTTP Setting
<VirtualHost *:80>
ServerName users.pjtname.com
DocumentRoot "/Users/<my_user_name>/Sites/pjtname.com/users.pjtname.com/public"
RackEnv development
<Directory "/Users/<my_user_name>/Sites/pjtname.com/users.pjtname.com/public">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
All seems to work properly, but when I make a request (using Typhoeus - I can use also the Ruby Net::Http library and the result doesn't change) from the `pjtname.com` RoR application:
# Typhoeus request
Typhoeus::Request.get("https://users.pjtname.com/")
I get something like a warning about the certificate:
--- &id001 !ruby/object:Typhoeus::Response
app_connect_time: 0.0
body: ""
code: 0
connect_time: 0.000625
# Here is the warning
curl_error_message: Peer certificate cannot be authenticated with known CA certificates
curl_return_code: 60
effective_url: https://users.pjtname.com/
headers: ""
http_version:
mock: false
name_lookup_time: 0.000513
pretransfer_time: 0.0
request: !ruby/object:Typhoeus::Request
after_complete:
auth_method:
body:
...
All this means that something is wrong. So, **what I have to do to avoid the "Peer certificate cannot be authenticated with known CA certificates" warning and make the HTTPS connection to work? Where is\are the error\errors?**
P.S.: if you need some more info, let me know.
[1]: https://github.com/dbalatero/typhoeus
[2]: http://developer.apple.com/internet/serverside/modssl.html | 0 |
7,298,683 | 09/04/2011 10:50:24 | 862,216 | 07/25/2011 19:13:16 | 12 | 1 | Textarea: problem in Opera -- text does not get wrapped onto the next line? | I do not want the scroll bars,hence i've given `overflow:hidden`.
A simple text area:
<textarea cols=10 rows=2 style='overflow:hidden' ></textarea>
when opened in Opera Browser -- fails to wrap the entered text onto the next line when the entered text exceeds the column length (Text gets wrapped onto the next line in every other browser -- FF,Chrome,Safari) | html | textarea | null | null | null | null | open | Textarea: problem in Opera -- text does not get wrapped onto the next line?
===
I do not want the scroll bars,hence i've given `overflow:hidden`.
A simple text area:
<textarea cols=10 rows=2 style='overflow:hidden' ></textarea>
when opened in Opera Browser -- fails to wrap the entered text onto the next line when the entered text exceeds the column length (Text gets wrapped onto the next line in every other browser -- FF,Chrome,Safari) | 0 |
9,752,361 | 03/17/2012 17:53:37 | 967,078 | 09/27/2011 12:55:41 | 3 | 0 | SQL ROW_NUMBER with INNER JOIN | I need to use ROW_NUMBER() in the following Query to return rows 5 to 10 of the result. Can anyone please show me what I need to do? I've been trying to no avail. If anyone can help I'd really appreciate it.
Thanks,
J
SELECT * FROM villa_data INNER JOIN villa_prices ON villa_prices.starRating=villa_data.starRating
WHERE villa_data.capacity >= 3 AND villa_data.bedrooms >= 1 AND villa_prices.period = 'lowSeason'
ORDER BY villa_prices.price,villa_data.bedrooms,villa_data.capacity | sql | sql-server | row-number | null | null | null | open | SQL ROW_NUMBER with INNER JOIN
===
I need to use ROW_NUMBER() in the following Query to return rows 5 to 10 of the result. Can anyone please show me what I need to do? I've been trying to no avail. If anyone can help I'd really appreciate it.
Thanks,
J
SELECT * FROM villa_data INNER JOIN villa_prices ON villa_prices.starRating=villa_data.starRating
WHERE villa_data.capacity >= 3 AND villa_data.bedrooms >= 1 AND villa_prices.period = 'lowSeason'
ORDER BY villa_prices.price,villa_data.bedrooms,villa_data.capacity | 0 |
7,962,310 | 11/01/2011 03:57:48 | 270,577 | 02/10/2010 19:57:52 | 504 | 1 | User defined exceptions: when do we use them? What is an "exceptional" situation? | I'm sure that this question has been addressed in many best practices books, but still...
Most of the times I see examples of wrong usage of custom exceptions, therefore I was wondering what would be a good situation to use them?
In particular, at the moment I'm working on a type checker for a compilers course.Therefore, I have a SymbolTable class, which is rather similar to a Map<String, Object>.The key difference from your ordinary map is that each symbol has to be defined at most once, so a put(String, Object) operation should fail if the key we're trying to insert is already present in the SymbolTable.
So here's the question: whenever we try to insert a key, and that key already exists in the SymbolTable, how should the SymbolTable behave? Should we have a
boolean insert(String key, Object value);
method that returns "false" in case the insert fails?Or should we rather use an insert method that has a return value "void" and throws an exception when a duplicate value is encountered?
Thanks in advance:) | java | custom-exceptions | null | null | null | null | open | User defined exceptions: when do we use them? What is an "exceptional" situation?
===
I'm sure that this question has been addressed in many best practices books, but still...
Most of the times I see examples of wrong usage of custom exceptions, therefore I was wondering what would be a good situation to use them?
In particular, at the moment I'm working on a type checker for a compilers course.Therefore, I have a SymbolTable class, which is rather similar to a Map<String, Object>.The key difference from your ordinary map is that each symbol has to be defined at most once, so a put(String, Object) operation should fail if the key we're trying to insert is already present in the SymbolTable.
So here's the question: whenever we try to insert a key, and that key already exists in the SymbolTable, how should the SymbolTable behave? Should we have a
boolean insert(String key, Object value);
method that returns "false" in case the insert fails?Or should we rather use an insert method that has a return value "void" and throws an exception when a duplicate value is encountered?
Thanks in advance:) | 0 |
2,043,555 | 01/11/2010 17:26:37 | 174,375 | 09/16/2009 14:27:39 | 303 | 15 | Microsoft Chart Controls in Visual Studio 2010? | Is this possible? I installed them, but they don't appear. Do I have to import them or something? | asp.net-4.0 | null | null | null | null | null | open | Microsoft Chart Controls in Visual Studio 2010?
===
Is this possible? I installed them, but they don't appear. Do I have to import them or something? | 0 |
7,854,463 | 10/21/2011 19:40:58 | 513,302 | 11/19/2010 09:29:56 | 407 | 24 | Can wordpress hacked easily or is it about any site? What was the reason? | One of my friend who is RIA developer and do action scripting. He started a blog and worked on it, after some time he saw that his blog is hacked that was developed in WP and some text was written in it so he just went to FTP and deleted all files.
So all this seems that a WP site's probability for being hacked is more than site built in RoR or Django or CakePHP or kohana e.tc. Is it true? What was actually the reason of hacking? Is there really some security vulnerabilities in WP?
I am a PHP developer and also have developed many custom sites, and also have worked in WP and joomla e.t.c. but never heard any thing like that. If it is problem there then can SSL solve this problem? Confused that how that happened...
Please tell me if you have any idea so that I can understand it and get out of curiosity.
thanks | security | wordpress | web-security | hacking | null | 10/21/2011 20:50:21 | not constructive | Can wordpress hacked easily or is it about any site? What was the reason?
===
One of my friend who is RIA developer and do action scripting. He started a blog and worked on it, after some time he saw that his blog is hacked that was developed in WP and some text was written in it so he just went to FTP and deleted all files.
So all this seems that a WP site's probability for being hacked is more than site built in RoR or Django or CakePHP or kohana e.tc. Is it true? What was actually the reason of hacking? Is there really some security vulnerabilities in WP?
I am a PHP developer and also have developed many custom sites, and also have worked in WP and joomla e.t.c. but never heard any thing like that. If it is problem there then can SSL solve this problem? Confused that how that happened...
Please tell me if you have any idea so that I can understand it and get out of curiosity.
thanks | 4 |
10,722,455 | 05/23/2012 14:50:22 | 1,385,385 | 05/09/2012 18:34:05 | 36 | 1 | Optimizing python script with multithreading | Hello Guys! I have written small web page crawler functions. But I am new to multithreading, I could not optimize it. My code is:
alreadySeenURLs = dict() #the dictionary of already seen crawlers
candidates = set() #the set of URL candidates to crawl
def initializeCandidates(url):
#gets page with urllib2
page = getPage(url)
#parses page with BeautifulSoup
parsedPage = getParsedPage(page)
#function which return all links from parsed page as set
initialURLsFromRoot = getLinksFromParsedPage(parsedPage)
return initialURLsFromRoot
def updateCandidates(oldCandidates, newCandidates):
return oldCandidates.union(newCandidates)
candidates = initializeCandidates(rootURL)
for url in candidates:
print len(candidates)
#fingerprint of URL
fp = hashlib.sha1(url).hexdigest()
#checking whether url is in alreadySeenURLs
if fp in alreadySeenURLs:
continue
alreadySeenURLs[fp] = url
#do some processing
print url
page = getPage(url)
parsedPage = getParsedPage(page, fix=True)
newCandidates = getLinksFromParsedPage(parsedPage)
candidates = updateCandidates(candidates, newCandidates)
As one can see, here it takes one url from candidates at specific time. I wanted to make this script multithreaded, in such a way, that it could take at least N urls from candidates, and do the job. Can anyone guide me? Give any links or suggestions? | python | multithreading | web-crawler | web-scraping | python-multithreading | 05/23/2012 20:33:13 | not constructive | Optimizing python script with multithreading
===
Hello Guys! I have written small web page crawler functions. But I am new to multithreading, I could not optimize it. My code is:
alreadySeenURLs = dict() #the dictionary of already seen crawlers
candidates = set() #the set of URL candidates to crawl
def initializeCandidates(url):
#gets page with urllib2
page = getPage(url)
#parses page with BeautifulSoup
parsedPage = getParsedPage(page)
#function which return all links from parsed page as set
initialURLsFromRoot = getLinksFromParsedPage(parsedPage)
return initialURLsFromRoot
def updateCandidates(oldCandidates, newCandidates):
return oldCandidates.union(newCandidates)
candidates = initializeCandidates(rootURL)
for url in candidates:
print len(candidates)
#fingerprint of URL
fp = hashlib.sha1(url).hexdigest()
#checking whether url is in alreadySeenURLs
if fp in alreadySeenURLs:
continue
alreadySeenURLs[fp] = url
#do some processing
print url
page = getPage(url)
parsedPage = getParsedPage(page, fix=True)
newCandidates = getLinksFromParsedPage(parsedPage)
candidates = updateCandidates(candidates, newCandidates)
As one can see, here it takes one url from candidates at specific time. I wanted to make this script multithreaded, in such a way, that it could take at least N urls from candidates, and do the job. Can anyone guide me? Give any links or suggestions? | 4 |
7,200,120 | 08/26/2011 04:50:35 | 907,107 | 08/23/2011 06:17:27 | 1 | 0 | Getting response code 404 on upload image on server in blackberry | I am new in Blackberry. I want to upload image on server. I found this link.http://stackoverflow.com/questions/5342577/blackberry-jde-how-to-upload-an-image-in-server-using-multipartpostdata
I used the same. But the image is not uploaded on server. Please help me. I stuck on this.
Thank you. | blackberry | null | null | null | null | null | open | Getting response code 404 on upload image on server in blackberry
===
I am new in Blackberry. I want to upload image on server. I found this link.http://stackoverflow.com/questions/5342577/blackberry-jde-how-to-upload-an-image-in-server-using-multipartpostdata
I used the same. But the image is not uploaded on server. Please help me. I stuck on this.
Thank you. | 0 |
4,755,487 | 01/21/2011 04:48:42 | 583,952 | 01/21/2011 04:31:44 | 1 | 0 | How to have multiple buttons in one activity | I am making an Android app that uses many buttons.
My main.xml layout has three buttons.
I know how to use buttons to go from one activity to another, But i dont know how to have multiple buttons on one activity, with each launhing a different activity than the other.
EXAMPLE
**Main.xml**
Button1
Button2
**Main2.xml**
Launched by button1
**About.xml**
Launched by Button2
How do i make the main.java file do this??
| android | null | null | null | null | null | open | How to have multiple buttons in one activity
===
I am making an Android app that uses many buttons.
My main.xml layout has three buttons.
I know how to use buttons to go from one activity to another, But i dont know how to have multiple buttons on one activity, with each launhing a different activity than the other.
EXAMPLE
**Main.xml**
Button1
Button2
**Main2.xml**
Launched by button1
**About.xml**
Launched by Button2
How do i make the main.java file do this??
| 0 |
7,295,589 | 09/03/2011 20:08:37 | 784,980 | 06/05/2011 18:12:28 | 95 | 1 | Post+Redirect+Get while using submitted data for rendering the result view | There's a web programming technique called [Post+Redirect+Get][1] that tries to avoid duplicate form submissions when hitting the refresh button.
This pattern is also discussed in the following thread:
http://stackoverflow.com/questions/1317486/how-to-avoid-resubmit-in-jsp-when-refresh
The problem is, this technique does not work in scenarios where after the redirection I need to render the result view **using the submitted parameters**. Since the second request (the one that requests for the result page) has no parameters submitted with.
In my specific scenario, I have a search form, that returns a list of books according to the filled in criteria. In the result page, the original search form is shown in the header, re-filled with the parameters that were submitted (as is done in Google search). Suppose each book on the received list is presented in such a way that you can edit its details. So the user edits one of the books on the list, and submits the edited list (i.e. by this he submits both the edited book and the original search criteria). The application should now both update the database and search the database again according to the submitted criteria.
So I can do the database updating before the redirection. But I cannot do the new search after the redirection since by this time I do not have the criteria parameters.
**I have seen two solutions:**
1. Before the redirection, save the submitted parameters on the session, then read them from the session after the redirection when you render the result view (and maybe remove them from the session after you are done). ---> **I prefer not to use this method since I do not want to use the session for that aspect of my application.**
2. When you redirect to the result URL, concatenate the submitted parameters to the URL (as done in GET requests) (or anyway only those parameters that you will need for rendering the result view), this way you can have the parameters after the redirection when you render the result view ---> **An OK solution, not too happy with it since the user will get the result view with a very long URL.**
**My question is, have you come across any other methods - preferably elegant - to solve this problem?**
Thanks!!
P.S. I am using Java and the Spring Framework but I think my question is applicable to any reasonable web framework.
[1]: http://en.wikipedia.org/wiki/Post/Redirect/Get | web-applications | java-ee | redirect | spring-mvc | null | null | open | Post+Redirect+Get while using submitted data for rendering the result view
===
There's a web programming technique called [Post+Redirect+Get][1] that tries to avoid duplicate form submissions when hitting the refresh button.
This pattern is also discussed in the following thread:
http://stackoverflow.com/questions/1317486/how-to-avoid-resubmit-in-jsp-when-refresh
The problem is, this technique does not work in scenarios where after the redirection I need to render the result view **using the submitted parameters**. Since the second request (the one that requests for the result page) has no parameters submitted with.
In my specific scenario, I have a search form, that returns a list of books according to the filled in criteria. In the result page, the original search form is shown in the header, re-filled with the parameters that were submitted (as is done in Google search). Suppose each book on the received list is presented in such a way that you can edit its details. So the user edits one of the books on the list, and submits the edited list (i.e. by this he submits both the edited book and the original search criteria). The application should now both update the database and search the database again according to the submitted criteria.
So I can do the database updating before the redirection. But I cannot do the new search after the redirection since by this time I do not have the criteria parameters.
**I have seen two solutions:**
1. Before the redirection, save the submitted parameters on the session, then read them from the session after the redirection when you render the result view (and maybe remove them from the session after you are done). ---> **I prefer not to use this method since I do not want to use the session for that aspect of my application.**
2. When you redirect to the result URL, concatenate the submitted parameters to the URL (as done in GET requests) (or anyway only those parameters that you will need for rendering the result view), this way you can have the parameters after the redirection when you render the result view ---> **An OK solution, not too happy with it since the user will get the result view with a very long URL.**
**My question is, have you come across any other methods - preferably elegant - to solve this problem?**
Thanks!!
P.S. I am using Java and the Spring Framework but I think my question is applicable to any reasonable web framework.
[1]: http://en.wikipedia.org/wiki/Post/Redirect/Get | 0 |
10,950,186 | 06/08/2012 13:52:31 | 1,399,136 | 05/16/2012 16:24:54 | 17 | 0 | PHP / MYSQL Date will not insert | I am trying to insert a date from a variable into a mysql database. The format of the column is date and it has dates in the column. The dates in the column look like yyyy-mm-dd
my date variable also looks like this however it will not insert the date into the column and even i do not get an error just a white screen.
//here is the code to insert this does not work
mysql_query("INSERT INTO `vipanda2`.`invoices` (account_id, purchased_date, sales_rep, INV_ID)
VALUES ('".$acctid."', '".$date"','".$row['8']."', '".$invid."' )") or die("load1 -" . mysql_error());
//this does work but it does not have the date.
mysql_query("INSERT INTO `vipanda2`.`invoices` (account_id, sales_rep, INV_ID)
VALUES ('".$acctid."', '".$row['8']."', '".$invid."')") or die("load1 -" . mysql_error());
not sure what the problem is. I have displayed the $date variable onto the screen and it looks fine ex. 2012-06-01
so I am not sure why it can not insert this into the database.
| php | mysql | date | null | null | null | open | PHP / MYSQL Date will not insert
===
I am trying to insert a date from a variable into a mysql database. The format of the column is date and it has dates in the column. The dates in the column look like yyyy-mm-dd
my date variable also looks like this however it will not insert the date into the column and even i do not get an error just a white screen.
//here is the code to insert this does not work
mysql_query("INSERT INTO `vipanda2`.`invoices` (account_id, purchased_date, sales_rep, INV_ID)
VALUES ('".$acctid."', '".$date"','".$row['8']."', '".$invid."' )") or die("load1 -" . mysql_error());
//this does work but it does not have the date.
mysql_query("INSERT INTO `vipanda2`.`invoices` (account_id, sales_rep, INV_ID)
VALUES ('".$acctid."', '".$row['8']."', '".$invid."')") or die("load1 -" . mysql_error());
not sure what the problem is. I have displayed the $date variable onto the screen and it looks fine ex. 2012-06-01
so I am not sure why it can not insert this into the database.
| 0 |
11,324,217 | 07/04/2012 07:20:35 | 1,500,791 | 07/04/2012 07:13:48 | 1 | 0 | STOP NETWORKING REMOTELY | I am using 2 laptops, wrote a client script on window and server script on ubuntu. Now I want to stop networking on ubuntu server by giving some command on client. Scripts r written in python.
Can anyone help me with the commands as I am new to python.
| python | networking | null | null | null | 07/04/2012 07:27:26 | not a real question | STOP NETWORKING REMOTELY
===
I am using 2 laptops, wrote a client script on window and server script on ubuntu. Now I want to stop networking on ubuntu server by giving some command on client. Scripts r written in python.
Can anyone help me with the commands as I am new to python.
| 1 |
8,100,239 | 11/11/2011 21:33:34 | 645,627 | 03/05/2011 01:06:34 | 91 | 2 | MySQL ORDER BY COUNT()? | I have a table setup in my database with this structure ([http://cl.ly/3D1D3m1O0v3d0x2j0Z0E][1])
I have running a query through a while loop and I want to order by the count of the prof column.
This is what my query currently looks like, though I keep getting errors.
$order_list = mysql_query("
SELECT COUNT(prof),
FROM prof_rating
ORDER BY COUNT(prof) ASC'");
This is the warning I keep getting.
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in
[1]: http://cl.ly/3D1D3m1O0v3d0x2j0Z0E | mysql | order-by | null | null | null | null | open | MySQL ORDER BY COUNT()?
===
I have a table setup in my database with this structure ([http://cl.ly/3D1D3m1O0v3d0x2j0Z0E][1])
I have running a query through a while loop and I want to order by the count of the prof column.
This is what my query currently looks like, though I keep getting errors.
$order_list = mysql_query("
SELECT COUNT(prof),
FROM prof_rating
ORDER BY COUNT(prof) ASC'");
This is the warning I keep getting.
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in
[1]: http://cl.ly/3D1D3m1O0v3d0x2j0Z0E | 0 |
5,592,328 | 04/08/2011 08:17:12 | 339,160 | 05/12/2010 09:38:54 | 196 | 0 | Select all Data from XML |
I have a XML like the sample given bellow.I want to select the information from Apply and Value irrespective of NameValue Id .Any idea how to achieve this ?
<NameValueList>
<NameValue Id="LegacyB2BRCOMM">
<DSAttributeList />
<Apply>false</Apply>
<Value>False</Value>
</NameValue>
<NameValue Id="Persist">
<DSAttributeList />
<Apply>false</Apply>
<Value>False</Value>
</NameValue>
....
</NameValueList>
| xml | xml-schema | null | null | null | null | open | Select all Data from XML
===
I have a XML like the sample given bellow.I want to select the information from Apply and Value irrespective of NameValue Id .Any idea how to achieve this ?
<NameValueList>
<NameValue Id="LegacyB2BRCOMM">
<DSAttributeList />
<Apply>false</Apply>
<Value>False</Value>
</NameValue>
<NameValue Id="Persist">
<DSAttributeList />
<Apply>false</Apply>
<Value>False</Value>
</NameValue>
....
</NameValueList>
| 0 |
1,727,291 | 11/13/2009 05:26:19 | 210,208 | 11/13/2009 05:26:19 | 1 | 0 | Where do I get sample code in C++ creating iterator for my own container? | I have been searching for sample code creating iterator for my own container, but I haven't really found a good example. I know this been asked before (http://stackoverflow.com/questions/148540/c-creating-my-own-iterators) but didn't see any satisfactory answer with examples.
I am looking for simple sample code to start how to design my own iterator.
Thanks | stl | c++ | iterator | list | containers | null | open | Where do I get sample code in C++ creating iterator for my own container?
===
I have been searching for sample code creating iterator for my own container, but I haven't really found a good example. I know this been asked before (http://stackoverflow.com/questions/148540/c-creating-my-own-iterators) but didn't see any satisfactory answer with examples.
I am looking for simple sample code to start how to design my own iterator.
Thanks | 0 |
3,921,717 | 10/13/2010 07:54:53 | 66,056 | 02/13/2009 13:05:45 | 729 | 32 | Does Google ruin its Google Earth images on purpose? | until a few years ago you would find single satellite images of larger regions on Google Earth. The most recent images, however, look more like patchwork. Often there are [patches](http://nenya1.net/temp/patch.kmz) completely surrounded by another image (from another database?), which makes you wonder if that patch isn't also visible on the other image. I find this annoying because the changing colors make the image unclear.
Does Google do this on purpose, e.g. to protect its copyright on the images? And do you get better images with the Pro version?
TIA
Steven | google-earth | null | null | null | null | 10/13/2010 08:00:10 | not a real question | Does Google ruin its Google Earth images on purpose?
===
until a few years ago you would find single satellite images of larger regions on Google Earth. The most recent images, however, look more like patchwork. Often there are [patches](http://nenya1.net/temp/patch.kmz) completely surrounded by another image (from another database?), which makes you wonder if that patch isn't also visible on the other image. I find this annoying because the changing colors make the image unclear.
Does Google do this on purpose, e.g. to protect its copyright on the images? And do you get better images with the Pro version?
TIA
Steven | 1 |
10,142,890 | 04/13/2012 14:38:57 | 1,278,137 | 03/19/2012 08:25:47 | 1 | 0 | Listview with more than one split button -- didn't quite work for me |
Not sure if this is the proper way to do things. But anyway, I tried out this solution at :
http://stackoverflow.com/questions/8322742/listview-with-more-than-one-split-button
It didn't quite work for me.
The buttons are displayed but not in the correct row but the next row.
Perhaps Pablo the solution provider in the original thread, or anybody help? (I was looking for a means to contact Pablo but doesn't seem possible.)
Thanks.
| jquery | mobile | null | null | null | 04/13/2012 17:34:21 | too localized | Listview with more than one split button -- didn't quite work for me
===
Not sure if this is the proper way to do things. But anyway, I tried out this solution at :
http://stackoverflow.com/questions/8322742/listview-with-more-than-one-split-button
It didn't quite work for me.
The buttons are displayed but not in the correct row but the next row.
Perhaps Pablo the solution provider in the original thread, or anybody help? (I was looking for a means to contact Pablo but doesn't seem possible.)
Thanks.
| 3 |
7,255,417 | 08/31/2011 10:03:55 | 919,246 | 08/30/2011 08:06:45 | 1 | 0 | How to remove a non existing inherit final error? | I'm using junit 4.8.1 and I run all jUnit test of the 6 Projects from the eclipse project called AllTests, which looks like this
package ch.mct.jdyna.tests;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({
ch.mct.jdyna.core.duplicatechecking.AllTests.class,
ch.mct.jdyna.core.matching.AllTests.class,
ch.mct.jdyna.core.matchingoptimization.AllTests.class,
ch.mct.jdyna.core.textanalysis.testing.AllTests.class,
ch.mct.jdyna.dataaccesslayer.testing.AllTests.class,
ch.mct.jdyna.dataacquisition.testing.AllTests.class,
})
public class AllTests {
}
In the projects I also have a file in the same style calling all jUnit tests of the project itself.
The Problem is, when I call the test method testCreateProfiles() from the global context, there is an error, from the class AllTests in the Project itself everything is green.
The Method to test:
/**
* Test method for
* {@link ch.mct.jdyna.dataacquisition.CvPreprocessing#createProfiles(java.util.List)}
* .
*/
@Test
public final void testCreateProfiles() {
List<Cv> cvs = new LinkedList<Cv>();
for (int i = 0; i < 10; ++i)
cvs.add(testingCv);
List<CurriculumVitae> actualList = CvPreprocessing.createProfiles(cvs);
assertEquals(cvs.size(), actualList.size());
}
The error is:
java.lang.VerifyError: Cannot inherit from final class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at ch.mct.jdyna.dataacquisition.CvPreprocessing.createProfiles(CvPreprocessing.java:71)
at ch.mct.jdyna.dataacquisition.testing.CvPreprocessingTest.testCreateProfiles(CvPreprocessingTest.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Does anyone have experience with this kind of problem?
Thanks in advance.
Manu | java | unit-testing | junit | null | null | null | open | How to remove a non existing inherit final error?
===
I'm using junit 4.8.1 and I run all jUnit test of the 6 Projects from the eclipse project called AllTests, which looks like this
package ch.mct.jdyna.tests;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({
ch.mct.jdyna.core.duplicatechecking.AllTests.class,
ch.mct.jdyna.core.matching.AllTests.class,
ch.mct.jdyna.core.matchingoptimization.AllTests.class,
ch.mct.jdyna.core.textanalysis.testing.AllTests.class,
ch.mct.jdyna.dataaccesslayer.testing.AllTests.class,
ch.mct.jdyna.dataacquisition.testing.AllTests.class,
})
public class AllTests {
}
In the projects I also have a file in the same style calling all jUnit tests of the project itself.
The Problem is, when I call the test method testCreateProfiles() from the global context, there is an error, from the class AllTests in the Project itself everything is green.
The Method to test:
/**
* Test method for
* {@link ch.mct.jdyna.dataacquisition.CvPreprocessing#createProfiles(java.util.List)}
* .
*/
@Test
public final void testCreateProfiles() {
List<Cv> cvs = new LinkedList<Cv>();
for (int i = 0; i < 10; ++i)
cvs.add(testingCv);
List<CurriculumVitae> actualList = CvPreprocessing.createProfiles(cvs);
assertEquals(cvs.size(), actualList.size());
}
The error is:
java.lang.VerifyError: Cannot inherit from final class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at ch.mct.jdyna.dataacquisition.CvPreprocessing.createProfiles(CvPreprocessing.java:71)
at ch.mct.jdyna.dataacquisition.testing.CvPreprocessingTest.testCreateProfiles(CvPreprocessingTest.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Does anyone have experience with this kind of problem?
Thanks in advance.
Manu | 0 |
6,675,763 | 07/13/2011 07:55:55 | 128,585 | 06/25/2009 03:24:13 | 4,124 | 200 | Assigning FK when creating a model results in "A dependent property in a ReferentialConstraint is mapped to a store-generated column." | I have this code and the following EF model:
![enter image description here][1]
var modelToAdd = new Package
{
PackageID = model.LearningPackageID, // not auto-generated PK!
Name = model.Name,
Description = model.Description,
DateCreated = DateTime.Now,
ModuleID = model.ModuleID
};
activityRepo.AddPackage(modelToAdd);
This doesn't work too
var modelToAdd = new Pacakge
{
PackageID = model.LearningPackageID, // not auto-generated PK!
Name = model.Name,
Description = model.Description,
DateCreated = DateTime.Now
};
// assume moduleID is defined to a valid module ID (yes, tested)
var module = entities.Modules.Where( x => x.ID == moduleID);
module.Pacakges.Add(modelToAdd);
entities.SaveChanges();
Basically, there's a 1:M relationship beteen Modules and Packages. However, when I try to set ModuleID (which is gotten from a dropdown), for both cases I'll get:
A dependent property in a ReferentialConstraint is mapped to a store-generated column.
**PackageID is alpha-numeric and is not auto-generated, either is ModuleID, as it is a FK**
What should I do?
[1]: http://i.stack.imgur.com/2UiwF.png | entity-framework-4 | null | null | null | null | null | open | Assigning FK when creating a model results in "A dependent property in a ReferentialConstraint is mapped to a store-generated column."
===
I have this code and the following EF model:
![enter image description here][1]
var modelToAdd = new Package
{
PackageID = model.LearningPackageID, // not auto-generated PK!
Name = model.Name,
Description = model.Description,
DateCreated = DateTime.Now,
ModuleID = model.ModuleID
};
activityRepo.AddPackage(modelToAdd);
This doesn't work too
var modelToAdd = new Pacakge
{
PackageID = model.LearningPackageID, // not auto-generated PK!
Name = model.Name,
Description = model.Description,
DateCreated = DateTime.Now
};
// assume moduleID is defined to a valid module ID (yes, tested)
var module = entities.Modules.Where( x => x.ID == moduleID);
module.Pacakges.Add(modelToAdd);
entities.SaveChanges();
Basically, there's a 1:M relationship beteen Modules and Packages. However, when I try to set ModuleID (which is gotten from a dropdown), for both cases I'll get:
A dependent property in a ReferentialConstraint is mapped to a store-generated column.
**PackageID is alpha-numeric and is not auto-generated, either is ModuleID, as it is a FK**
What should I do?
[1]: http://i.stack.imgur.com/2UiwF.png | 0 |
8,769,254 | 01/07/2012 11:18:56 | 484,390 | 10/22/2010 15:45:33 | 646 | 0 | Add characters in the variable | I need to make the string/varchar variable with value "20061212" to be string/varchar value "2006-12-12 00:00:00"
I can't find the right sql syntax code to make it happened in SQL server.
The code can be created as stored procedure or similiar in SQL server.
// Fullmetalboy | sql | sql-server | stored-procedures | null | null | null | open | Add characters in the variable
===
I need to make the string/varchar variable with value "20061212" to be string/varchar value "2006-12-12 00:00:00"
I can't find the right sql syntax code to make it happened in SQL server.
The code can be created as stored procedure or similiar in SQL server.
// Fullmetalboy | 0 |
11,628,582 | 07/24/2012 10:07:11 | 1,548,248 | 07/24/2012 09:46:24 | 1 | 0 | how to achieve in php to if user1 visit site1 through url1 then open content1,and if user2 visit same site1 through url2 then open content2 | How to achieve in php to if user1 visit site1 through url1
then open content1,and if user2 visit same site1 through
url2 then open content2.
Content1 and content2 are the forms for login. | php | null | null | null | null | 07/24/2012 10:54:38 | not a real question | how to achieve in php to if user1 visit site1 through url1 then open content1,and if user2 visit same site1 through url2 then open content2
===
How to achieve in php to if user1 visit site1 through url1
then open content1,and if user2 visit same site1 through
url2 then open content2.
Content1 and content2 are the forms for login. | 1 |
9,837,358 | 03/23/2012 10:10:56 | 927,748 | 09/04/2011 16:47:14 | 1 | 0 | binary generated, but it's show grey window instead my image | i have problem, nearly same like this one
http://stackoverflow.com/questions/8756397/c-eclipse-opencv-exe-file-and-binaries-generated-but-no-image-displayed
but his solution still not solve the problem...
i was trying this on my win 7 and linux... | opencv | eclipse-cdt | null | null | null | null | open | binary generated, but it's show grey window instead my image
===
i have problem, nearly same like this one
http://stackoverflow.com/questions/8756397/c-eclipse-opencv-exe-file-and-binaries-generated-but-no-image-displayed
but his solution still not solve the problem...
i was trying this on my win 7 and linux... | 0 |
1,301,606 | 08/19/2009 18:00:28 | 142,080 | 07/21/2009 15:09:20 | 321 | 21 | How can I practice better object-oriented programming? | I have been programming in object-oriented languages for years now but secretly I look at some of the things my colleagues do with envy. A lot of them seem to have some inner OO instinct that I don't have - no matter how hard I try. I've read all the good books on OO but still can't seem to crack it. I feel like the guy who gave 110% to be a professional footballer but just didn't have the natural talent to make it. I'm at a loss and thinking of switching careers - what should do I? | oop | null | null | null | null | 03/03/2012 00:09:39 | not constructive | How can I practice better object-oriented programming?
===
I have been programming in object-oriented languages for years now but secretly I look at some of the things my colleagues do with envy. A lot of them seem to have some inner OO instinct that I don't have - no matter how hard I try. I've read all the good books on OO but still can't seem to crack it. I feel like the guy who gave 110% to be a professional footballer but just didn't have the natural talent to make it. I'm at a loss and thinking of switching careers - what should do I? | 4 |
9,680,763 | 03/13/2012 08:48:23 | 1,196,808 | 02/08/2012 09:47:30 | 8 | 0 | Using another domain for email | Why does companies use a extra domain to send a email? for example, is there any reason why facebook email are from facebookmail.com instead of facebook.com? | email | null | null | null | null | 03/13/2012 15:09:30 | off topic | Using another domain for email
===
Why does companies use a extra domain to send a email? for example, is there any reason why facebook email are from facebookmail.com instead of facebook.com? | 2 |
4,649,896 | 01/10/2011 18:05:29 | 321,555 | 04/16/2010 20:27:42 | 171 | 10 | Add a class to a specific element and not to all that have the same class | My problem must be very simple to solve for many of you but I have no idea how to specify the element, here's what's going on.
I have a list of products with their images and an *Add To Cart* button for each product. I want to add a class to the product's container when its specific Add To Cart button has been clicked.
So far I'm able to do it but all products' containers get the class added.
Here's my basic HTML:
<div class="prod-img"><a href="#"><img src="images/product-1.jpg" alt=""></a></div>
<a href="#" class="add"><img src="images/button-add-to-cart.png" alt="Add to Cart"></a>
<div class="prod-img"><a href="#"><img src="images/product-2.jpg" alt=""></a></div>
<a href="#" class="add"><img src="images/button-add-to-cart.png" alt="Add to Cart"></a>
<div class="prod-img"><a href="#"><img src="images/product-3.jpg" alt=""></a></div>
<a href="#" class="add"><img src="images/button-add-to-cart.png" alt="Add to Cart"></a>
My jQuery:
$('.add').click(function(){
$(this).replaceWith('<img src="images/button-added-to-cart.png" alt="Item added to Cart" class="added">');
$('.prod-img').addClass('prod-added');
return false;
});
Just FYI, once the Add To Cart button is clicked it gets replaced with an "Item Added to Cart" image.
How can I make the specific product's container get a class ('prod-added') to it without adding it to the rest of the products?
Thanks for any help on this. | jquery | null | null | null | null | null | open | Add a class to a specific element and not to all that have the same class
===
My problem must be very simple to solve for many of you but I have no idea how to specify the element, here's what's going on.
I have a list of products with their images and an *Add To Cart* button for each product. I want to add a class to the product's container when its specific Add To Cart button has been clicked.
So far I'm able to do it but all products' containers get the class added.
Here's my basic HTML:
<div class="prod-img"><a href="#"><img src="images/product-1.jpg" alt=""></a></div>
<a href="#" class="add"><img src="images/button-add-to-cart.png" alt="Add to Cart"></a>
<div class="prod-img"><a href="#"><img src="images/product-2.jpg" alt=""></a></div>
<a href="#" class="add"><img src="images/button-add-to-cart.png" alt="Add to Cart"></a>
<div class="prod-img"><a href="#"><img src="images/product-3.jpg" alt=""></a></div>
<a href="#" class="add"><img src="images/button-add-to-cart.png" alt="Add to Cart"></a>
My jQuery:
$('.add').click(function(){
$(this).replaceWith('<img src="images/button-added-to-cart.png" alt="Item added to Cart" class="added">');
$('.prod-img').addClass('prod-added');
return false;
});
Just FYI, once the Add To Cart button is clicked it gets replaced with an "Item Added to Cart" image.
How can I make the specific product's container get a class ('prod-added') to it without adding it to the rest of the products?
Thanks for any help on this. | 0 |
8,382,706 | 12/05/2011 08:35:23 | 585,418 | 01/22/2011 07:21:57 | 1 | 1 | Android Amazon payment system implementation | Anyone can help me for implementing the Amazon payment System in the Android application?
Is there any link or library or sample source code available for that?
Thanks | android | null | null | null | null | 12/05/2011 17:12:54 | not a real question | Android Amazon payment system implementation
===
Anyone can help me for implementing the Amazon payment System in the Android application?
Is there any link or library or sample source code available for that?
Thanks | 1 |
10,560,288 | 05/12/2012 01:14:48 | 512,602 | 11/18/2010 18:59:09 | 362 | 20 | iPhone and Android app scenario needs validation | I have read that MONO Develop has been passed from Novell to Xamarine and evolved to allow developing .NET apps for iPhone and Android.
Here is a scenario that I would like you, mobile apps gurus to confirm or infirm:
Can I h(once in a while) ave my app download html files from my dedicated web server (once in a while) and store them onto the mobile device.
List the downloaded pages to the user in several ways: by date, authors, language and so on.
When the user taps on a lnie, launch Safari or Chrome to show the html / CSS / Javascript web page as if it has just been served on the web.
If you validate this idea, I have a second question:
In order to sell an app to the users, do you HAVE to go through Apple Store or Google App store?
Or can I live on my own and not pay the commissions to those big companies?
It may look silly, but I'm on a niche market where people will come to me without the help of these majors. | android | iphone | validation | mono | null | 05/12/2012 03:04:24 | not a real question | iPhone and Android app scenario needs validation
===
I have read that MONO Develop has been passed from Novell to Xamarine and evolved to allow developing .NET apps for iPhone and Android.
Here is a scenario that I would like you, mobile apps gurus to confirm or infirm:
Can I h(once in a while) ave my app download html files from my dedicated web server (once in a while) and store them onto the mobile device.
List the downloaded pages to the user in several ways: by date, authors, language and so on.
When the user taps on a lnie, launch Safari or Chrome to show the html / CSS / Javascript web page as if it has just been served on the web.
If you validate this idea, I have a second question:
In order to sell an app to the users, do you HAVE to go through Apple Store or Google App store?
Or can I live on my own and not pay the commissions to those big companies?
It may look silly, but I'm on a niche market where people will come to me without the help of these majors. | 1 |
4,507,020 | 12/22/2010 07:24:52 | 171,950 | 09/11/2009 09:06:13 | 569 | 9 | Rapid, Ajaxian and Indexable Java Web App? | I am search for a Java web app with the following characteristics:
- Allow Rapid Development
- Has built-in support for AJAX
- Indexable by search engines (i.e. the output is HTML not JS)
- Provide clean URLs (example.com/path/path/file)
Thanks. | java | ajax | web-applications | search-engine | rad | null | open | Rapid, Ajaxian and Indexable Java Web App?
===
I am search for a Java web app with the following characteristics:
- Allow Rapid Development
- Has built-in support for AJAX
- Indexable by search engines (i.e. the output is HTML not JS)
- Provide clean URLs (example.com/path/path/file)
Thanks. | 0 |
8,517,883 | 12/15/2011 09:33:19 | 32,582 | 10/29/2008 21:47:04 | 790 | 54 | What is the Node/Shard limit for MongoDB ona 64 bit machine? | We are currently setting up a mongodb database for our enviroment. We are running into specific collections which will initially be more then 2gb of size.
Out deployment enviroment is a 64bit Ubuntu machine.
We are trying to find what is the limit of a sizes of a specific collection and shard for mongodb in a sharding enviroment? | mongodb | sharding | null | null | null | null | open | What is the Node/Shard limit for MongoDB ona 64 bit machine?
===
We are currently setting up a mongodb database for our enviroment. We are running into specific collections which will initially be more then 2gb of size.
Out deployment enviroment is a 64bit Ubuntu machine.
We are trying to find what is the limit of a sizes of a specific collection and shard for mongodb in a sharding enviroment? | 0 |
11,389,218 | 07/09/2012 04:49:41 | 1,511,006 | 07/09/2012 04:40:35 | 1 | 0 | Need a simple python script to divide a text file (based on the first row) | OK, I should've learned python ages ago, but didn't. Now I need a script to divide a text file into multiple text files.
The output files have to be exactly the same as the input, except they should only contain subsets of the information, based on the values in the first row.
So, if I have a file specifying "Sample1" in the first row, all the columns marked Sample1 should become a new file, the same for "Sample2", "Sample3", etc.
Here's an example of what I mean...
Input file: https://docs.google.com/open?id=0B9o3EYTdM8lQT0oyZkVVM3RUVUk
Output: https://docs.google.com/file/d/0B9o3EYTdM8lQajNoU0JvR0dMSmc/edit?pli=1
Any help would be great. Cheers
| python | null | null | null | null | 07/10/2012 11:50:30 | not a real question | Need a simple python script to divide a text file (based on the first row)
===
OK, I should've learned python ages ago, but didn't. Now I need a script to divide a text file into multiple text files.
The output files have to be exactly the same as the input, except they should only contain subsets of the information, based on the values in the first row.
So, if I have a file specifying "Sample1" in the first row, all the columns marked Sample1 should become a new file, the same for "Sample2", "Sample3", etc.
Here's an example of what I mean...
Input file: https://docs.google.com/open?id=0B9o3EYTdM8lQT0oyZkVVM3RUVUk
Output: https://docs.google.com/file/d/0B9o3EYTdM8lQajNoU0JvR0dMSmc/edit?pli=1
Any help would be great. Cheers
| 1 |
7,343,942 | 09/08/2011 06:23:33 | 934,170 | 09/08/2011 06:23:33 | 1 | 0 | how to make .bat runnable under the server mode of Tomcat? | A click on a button in a web page will invoke a server-side bat-file, which will prompt the cmd window. It works well if `Tomcat` is started by start.bat. But if `Tomcat` is started by service.bat, a process named `cmd.exe` can be found in the Process Monitor, but no more effects. It looks like hanged, or waiting for sth. No cmd window has been prompted. Is there any Tomcat configuration needed to be done? | tomcat | batch-file | cmd.exe | null | null | 09/08/2011 19:58:57 | off topic | how to make .bat runnable under the server mode of Tomcat?
===
A click on a button in a web page will invoke a server-side bat-file, which will prompt the cmd window. It works well if `Tomcat` is started by start.bat. But if `Tomcat` is started by service.bat, a process named `cmd.exe` can be found in the Process Monitor, but no more effects. It looks like hanged, or waiting for sth. No cmd window has been prompted. Is there any Tomcat configuration needed to be done? | 2 |
4,633,578 | 01/08/2011 11:11:37 | 293,353 | 03/14/2010 11:18:26 | 1 | 0 | Replace a method call | I want to achieve below task:
1. I need to search Html.Resource("key") in my application and replace it with GetResource("key",object)
2. The GetResource method has two parameters: the first parameter should be the same as the original method,"key" in this case, and I need to pass in the second parameter which is variable.
3. I need to replace only when the Html.Resource("key") occurs inside certain tags like td and div else I need not replace it.
Thanks in advance
| javascript | html | regex | null | null | null | open | Replace a method call
===
I want to achieve below task:
1. I need to search Html.Resource("key") in my application and replace it with GetResource("key",object)
2. The GetResource method has two parameters: the first parameter should be the same as the original method,"key" in this case, and I need to pass in the second parameter which is variable.
3. I need to replace only when the Html.Resource("key") occurs inside certain tags like td and div else I need not replace it.
Thanks in advance
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.