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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4,544,052 |
12/28/2010 06:13:31
| 542,923 |
12/15/2010 05:32:06
| 6 | 0 |
session problem with jsp
|
good morning sir
am using session for userid in my project but session is automatically null
i want access the same session in differnt jsp file with that session only i want do some task such as auto refresh how it is possible please guide me
|
java
|
jsp
|
struts
| null | null | null |
open
|
session problem with jsp
===
good morning sir
am using session for userid in my project but session is automatically null
i want access the same session in differnt jsp file with that session only i want do some task such as auto refresh how it is possible please guide me
| 0 |
5,642,341 |
04/12/2011 22:24:25
| 415,600 |
08/09/2010 22:13:59
| 423 | 32 |
Is it possible to use multiple arguments in vim command
|
I have this mvn command
mvn install:install-file -DgroupId=i.hate.james.blunt -DartifactId=yourartifactid... -Dversion=1.0 -Dpackaging=jar -Dfile=/path/to/jarfile
And I want to transfer it to a command in vim, at the moment I have this
command -nargs=* MvnAddToRepositoy :!mvn install:install-file -DgroupId=i.hate.james.blunt -DartifactId=<arg1> -Dversion=1.0 -Dpackaging=jar -Dfile=<arg2>
I am unable to find this in vim docs or an example on the net.
Can anyone help?
|
vim
|
vimrc
| null | null | null | null |
open
|
Is it possible to use multiple arguments in vim command
===
I have this mvn command
mvn install:install-file -DgroupId=i.hate.james.blunt -DartifactId=yourartifactid... -Dversion=1.0 -Dpackaging=jar -Dfile=/path/to/jarfile
And I want to transfer it to a command in vim, at the moment I have this
command -nargs=* MvnAddToRepositoy :!mvn install:install-file -DgroupId=i.hate.james.blunt -DartifactId=<arg1> -Dversion=1.0 -Dpackaging=jar -Dfile=<arg2>
I am unable to find this in vim docs or an example on the net.
Can anyone help?
| 0 |
2,071,615 |
01/15/2010 13:06:58
| 125,633 |
06/19/2009 09:36:36
| 151 | 1 |
Auto kill fastcgi process when deploying django
|
Everything goes well days ago. But since today, when I run fastcgi, the process will be killed by system automatically. The worst thing is I don't know why and which process kill the fastcgi process.
Let me give some detail.
we use nginx to serve static files for another django app which listen to 80 port.(this is for production use)
And we use lighttpd/fastcgi for another two django apps, which listen to 8090 and 8091 respectively.(these are for development test)
the command I run are:
*python manage.py runfcgi host=127.0.0.1 port=8090*
and
*python manage.py runfcgi host=127.0.0.1 port=8091*
after I run one of them, I run *ps -ef|grep "python"* and I can see the process of fastcgi, but seconds later, they are gone.
the output of ps are:
root 2685 1 0 2009 ? 00:00:27 /usr/bin/python -tt /usr/sbin/yum-updatesd
root 2827 1 0 03:49 ? 00:00:00 python manage.py runfcgi host=127.0.0.1 port=8090
root 2828 2827 0 03:49 ? 00:00:00 python manage.py runfcgi host=127.0.0.1 port=8090
and fastcgi is killed and our site is down.
So what should be the problem? How can I figure out?
Thanks.
|
fastcgi
|
django
|
python
|
process
| null | null |
open
|
Auto kill fastcgi process when deploying django
===
Everything goes well days ago. But since today, when I run fastcgi, the process will be killed by system automatically. The worst thing is I don't know why and which process kill the fastcgi process.
Let me give some detail.
we use nginx to serve static files for another django app which listen to 80 port.(this is for production use)
And we use lighttpd/fastcgi for another two django apps, which listen to 8090 and 8091 respectively.(these are for development test)
the command I run are:
*python manage.py runfcgi host=127.0.0.1 port=8090*
and
*python manage.py runfcgi host=127.0.0.1 port=8091*
after I run one of them, I run *ps -ef|grep "python"* and I can see the process of fastcgi, but seconds later, they are gone.
the output of ps are:
root 2685 1 0 2009 ? 00:00:27 /usr/bin/python -tt /usr/sbin/yum-updatesd
root 2827 1 0 03:49 ? 00:00:00 python manage.py runfcgi host=127.0.0.1 port=8090
root 2828 2827 0 03:49 ? 00:00:00 python manage.py runfcgi host=127.0.0.1 port=8090
and fastcgi is killed and our site is down.
So what should be the problem? How can I figure out?
Thanks.
| 0 |
11,326,248 |
07/04/2012 09:29:08
| 1,471,529 |
06/21/2012 08:39:49
| 22 | 1 |
Page Curl download link missing
|
Im having dificulty finding the download link given here in stockoverflow about android page curl. Just like the iphone animation between activities. They gave me this link: [http://code.google.com/p/android-page-curl/][1] but i cant find the download link. Is this a deadlink? And Im somehow confused in these two link :
[http://code.google.com/p/android-page-curl/][2]
[https://github.com/harism/android_page_curl/][3]
Are they the same?
[1]: http://code.google.com/p/android-page-curl/
[2]: http://code.google.com/p/android-page-curl/
[3]: https://github.com/harism/android_page_curl/
|
android
| null | null | null | null |
07/05/2012 15:42:09
|
not a real question
|
Page Curl download link missing
===
Im having dificulty finding the download link given here in stockoverflow about android page curl. Just like the iphone animation between activities. They gave me this link: [http://code.google.com/p/android-page-curl/][1] but i cant find the download link. Is this a deadlink? And Im somehow confused in these two link :
[http://code.google.com/p/android-page-curl/][2]
[https://github.com/harism/android_page_curl/][3]
Are they the same?
[1]: http://code.google.com/p/android-page-curl/
[2]: http://code.google.com/p/android-page-curl/
[3]: https://github.com/harism/android_page_curl/
| 1 |
10,685,676 |
05/21/2012 12:56:39
| 1,350,781 |
04/23/2012 07:58:34
| 3 | 0 |
View password protected Pdf file in aspx page
|
I want to open pdf files inside my aspx page. The files are password protected.
I am using a pdf viewer control since i want to display it inside td and use other controls in the same page.I am using Vb.net
This is the pdf viewer am using
[enter link description here][1]
I pass to the pdf viewer control the filepath. Is there a way to send password too? Or passing password from aspx page on load before showing the window that pops to enter the password.I dont want that window to appear.
[1]: http://www.beansoftware.com/ASP.NET-Tutorials/PDF-View-Custom-Control.aspx
|
pdf
| null | null | null | null | null |
open
|
View password protected Pdf file in aspx page
===
I want to open pdf files inside my aspx page. The files are password protected.
I am using a pdf viewer control since i want to display it inside td and use other controls in the same page.I am using Vb.net
This is the pdf viewer am using
[enter link description here][1]
I pass to the pdf viewer control the filepath. Is there a way to send password too? Or passing password from aspx page on load before showing the window that pops to enter the password.I dont want that window to appear.
[1]: http://www.beansoftware.com/ASP.NET-Tutorials/PDF-View-Custom-Control.aspx
| 0 |
8,117,908 |
11/14/2011 06:05:28
| 669,173 |
03/21/2011 09:43:58
| 11 | 0 |
Does \flash player comes preinstalled on android devices?
|
"I want to know that if i buy a new android device will it have perinstalled flash player or i will have to download it from app market??and what about emulator?do they have flash support or they seek the support from flash installed in the computer???"
|
android
|
flash
|
android-emulator
| null | null |
11/14/2011 06:21:15
|
off topic
|
Does \flash player comes preinstalled on android devices?
===
"I want to know that if i buy a new android device will it have perinstalled flash player or i will have to download it from app market??and what about emulator?do they have flash support or they seek the support from flash installed in the computer???"
| 2 |
11,604,515 |
07/22/2012 22:32:35
| 845,081 |
07/14/2011 17:17:41
| 312 | 0 |
check my unix account quota
|
I am using University unix sever, I got an account.
But I don;t know how many quota I got.
How can I check it by command?
Thank you!
I tried `"quota"` but seems not work.
|
unix
| null | null | null | null |
07/22/2012 23:06:07
|
off topic
|
check my unix account quota
===
I am using University unix sever, I got an account.
But I don;t know how many quota I got.
How can I check it by command?
Thank you!
I tried `"quota"` but seems not work.
| 2 |
443,732 |
01/14/2009 16:45:58
| 14,744 |
09/17/2008 02:29:39
| 1,521 | 71 |
Mounting a folder on linux over ssh through windows?
|
I'm a blind student currently in a system admin/shell programming class. Although ssh works fine for executing commands like ls, pwd, etc editors do not work well with my screen reader and an ssh session. I was wondering if it is possible to mount a Linux folder over ssh so it appears as a windows drive? This way I could edit any files I needed to with accessible software and not have to constantly use SCP to send files back and fourth.
|
linux
|
ssh
|
shell
| null | null |
10/26/2011 02:07:36
|
off topic
|
Mounting a folder on linux over ssh through windows?
===
I'm a blind student currently in a system admin/shell programming class. Although ssh works fine for executing commands like ls, pwd, etc editors do not work well with my screen reader and an ssh session. I was wondering if it is possible to mount a Linux folder over ssh so it appears as a windows drive? This way I could edit any files I needed to with accessible software and not have to constantly use SCP to send files back and fourth.
| 2 |
3,795,280 |
09/25/2010 19:41:37
| 303,467 |
03/28/2010 06:09:13
| 60 | 1 |
how can i make jquery tree with two level only?
|
i am beginer in jquery and i don't have experince in jquery but i need to use
tree with two level , since when i click on ?one link new links appear down of it ,
just like hotmail inbox idea ! can some one help ?
|
jquery
|
treeview
| null | null | null | null |
open
|
how can i make jquery tree with two level only?
===
i am beginer in jquery and i don't have experince in jquery but i need to use
tree with two level , since when i click on ?one link new links appear down of it ,
just like hotmail inbox idea ! can some one help ?
| 0 |
3,572,909 |
08/26/2010 07:29:54
| 64,160 |
02/09/2009 12:39:36
| 257 | 5 |
IIS performance improvements
|
What can be done to improve performance in IIS? When i deploy my webapplication to my local IIS machine it goes much slower than when i run the solution in visual studio without debugging. The difference is remarkable, like double as fast.
|
performance
|
iis
| null | null | null | null |
open
|
IIS performance improvements
===
What can be done to improve performance in IIS? When i deploy my webapplication to my local IIS machine it goes much slower than when i run the solution in visual studio without debugging. The difference is remarkable, like double as fast.
| 0 |
10,202,964 |
04/18/2012 04:49:51
| 889,827 |
08/11/2011 11:48:37
| 53 | 8 |
Integration of facebook for using facebook application crediantials
|
I am working on an application in which user firstly need to register him self by giving some information then he or she is able to login and use that application which i have done but now i want if a user in their iphone is logged in with facebook application then the user doesn't need to login again in my application because i want that my application will take all the facebook app crediantials for login and register.
|
iphone
|
objective-c
|
ios
|
facebook
| null |
04/19/2012 13:16:12
|
not a real question
|
Integration of facebook for using facebook application crediantials
===
I am working on an application in which user firstly need to register him self by giving some information then he or she is able to login and use that application which i have done but now i want if a user in their iphone is logged in with facebook application then the user doesn't need to login again in my application because i want that my application will take all the facebook app crediantials for login and register.
| 1 |
2,866,427 |
05/19/2010 14:29:17
| 281,572 |
02/25/2010 20:22:08
| 27 | 0 |
Keeping SQL Server Dev Environment up to date
|
I'm trying to figure out the best way to keep my Development servers synced up to the Production servers. Initially, I was just going to restore the backups from the production environment to the dev environment every week or so, however I realized that this would wipe out any actual development work that had taken place during the week.
I feel like this is a pretty common obstacle, so I'm hoping someone out there can shed some light on how they tackle the issue. I looked online briefly, but didn't really see anything, so any suggestions would be greatly appreciated.
Thanks!
|
sql
|
sql-server-2008
|
development-environment
|
database-restore
| null | null |
open
|
Keeping SQL Server Dev Environment up to date
===
I'm trying to figure out the best way to keep my Development servers synced up to the Production servers. Initially, I was just going to restore the backups from the production environment to the dev environment every week or so, however I realized that this would wipe out any actual development work that had taken place during the week.
I feel like this is a pretty common obstacle, so I'm hoping someone out there can shed some light on how they tackle the issue. I looked online briefly, but didn't really see anything, so any suggestions would be greatly appreciated.
Thanks!
| 0 |
4,461,247 |
12/16/2010 13:33:26
| 271,087 |
02/11/2010 13:18:40
| 1,582 | 95 |
Centering a div with a "Loading..." spinner.gif using jQuery and Ajax.BeginForm
|
The Setup
---------
I have designed a very easy to use MVC wizard. The cherry on the cake is a spinner gif that will appear when I change wizard step. I want it to center on the page, regardless of the size of the browser window.
You can see an example of this at:
[Sample Wizard][1]
PLEASE DON'T COMPLETE THE WIZARD, UNLESS YOU HAVE ENCEPHALITIS...
The Problem
-----------
Problem is, I have a centered CSS layout, controlled with the following rule:
#PageContainer
{
position:relative;
width:800px;
left:50%;
margin:0px 0px 0px -400px;
text-align:left;
}
And this rule seems to interact badly with the jquery code that centers the div with the spinner gif. Ie, it doesn't center.
The Code
--------
My MVC form code is:
@using (Ajax.BeginForm(Model.Step.ActionName,
null,
new AjaxOptions { UpdateTargetId = "wizardStep", OnBegin="isValid", LoadingElementId="PleaseWait" },
new {@name="wizardForm", @id="wizardForm" } ))
{
@* do ajax stuff, see my "Loading... panel below *@
<div id="PleaseWait" style="display:none;">
Please Wait...
</div>
}
jQuery code is:
<script type="text/javascript">
jQuery.fn.center = function () {
this.css("position", "absolute");
this.css("top", ($(window).height() - this.height())/ 2 + $(window).scrollTop() + "px");
this.css("left", ($(window).width() - this.width()) / 2 + $(window).scrollLeft() + "px");
return this;
}
});
function isValid() {
$('#PleaseWait').center();
if (true) // In case i whant to return true
{
return true;
}
else // I whant to return false
{
$('#PleaseWait').hide(); // Manually hide the LoadingElementId
return false;
}
}
</script>
My Analysis
---------------------------
As the jQuery code sets up the div panel to have an absolute position, it therefore has an absolute position relative to the first parent item that does not have position static (the default).
Therefore, as a result of the margin hack used to center the page, there is something creeping into the jQuery calculation that upsets the apple cart.
Ie:
The jQuery calculation is based on the size of the window, but the position of the #PleaseWait panel is positioned with respect to the #PageContainer div (this div is part of the layout). Obviously, these are two very different things. I therefore thought I would get away with figuring out the constant values to subtract from the top and left calculations for the #PleaseWait div.
However, the results are unpredictable and I am now too befuddled to figure it out. Help!
Any help much appreciated.
[1]: http://register.encephalitis.info/membership/form
|
jquery
|
css
|
asp.net-mvc
|
ajax
| null | null |
open
|
Centering a div with a "Loading..." spinner.gif using jQuery and Ajax.BeginForm
===
The Setup
---------
I have designed a very easy to use MVC wizard. The cherry on the cake is a spinner gif that will appear when I change wizard step. I want it to center on the page, regardless of the size of the browser window.
You can see an example of this at:
[Sample Wizard][1]
PLEASE DON'T COMPLETE THE WIZARD, UNLESS YOU HAVE ENCEPHALITIS...
The Problem
-----------
Problem is, I have a centered CSS layout, controlled with the following rule:
#PageContainer
{
position:relative;
width:800px;
left:50%;
margin:0px 0px 0px -400px;
text-align:left;
}
And this rule seems to interact badly with the jquery code that centers the div with the spinner gif. Ie, it doesn't center.
The Code
--------
My MVC form code is:
@using (Ajax.BeginForm(Model.Step.ActionName,
null,
new AjaxOptions { UpdateTargetId = "wizardStep", OnBegin="isValid", LoadingElementId="PleaseWait" },
new {@name="wizardForm", @id="wizardForm" } ))
{
@* do ajax stuff, see my "Loading... panel below *@
<div id="PleaseWait" style="display:none;">
Please Wait...
</div>
}
jQuery code is:
<script type="text/javascript">
jQuery.fn.center = function () {
this.css("position", "absolute");
this.css("top", ($(window).height() - this.height())/ 2 + $(window).scrollTop() + "px");
this.css("left", ($(window).width() - this.width()) / 2 + $(window).scrollLeft() + "px");
return this;
}
});
function isValid() {
$('#PleaseWait').center();
if (true) // In case i whant to return true
{
return true;
}
else // I whant to return false
{
$('#PleaseWait').hide(); // Manually hide the LoadingElementId
return false;
}
}
</script>
My Analysis
---------------------------
As the jQuery code sets up the div panel to have an absolute position, it therefore has an absolute position relative to the first parent item that does not have position static (the default).
Therefore, as a result of the margin hack used to center the page, there is something creeping into the jQuery calculation that upsets the apple cart.
Ie:
The jQuery calculation is based on the size of the window, but the position of the #PleaseWait panel is positioned with respect to the #PageContainer div (this div is part of the layout). Obviously, these are two very different things. I therefore thought I would get away with figuring out the constant values to subtract from the top and left calculations for the #PleaseWait div.
However, the results are unpredictable and I am now too befuddled to figure it out. Help!
Any help much appreciated.
[1]: http://register.encephalitis.info/membership/form
| 0 |
11,313,406 |
07/03/2012 14:44:37
| 1,169,526 |
01/25/2012 15:33:07
| 13 | 0 |
Which os is better for a webserver, ubuntu or debian or something else?
|
I want to set up a webserver and i was wondering which os i should choose. People tell me i should choose between centOS, ubuntu or debian.
Basically the server os has to be able to do the following:
- Run a php/mysql website that will be visited by approxamally 1000 visitors a day.
- Support a server with raid configuration.
Which OS is the best option, and what packages would you advice to install?
|
php
|
ubuntu
|
webserver
|
centos
|
debian
|
07/03/2012 15:53:05
|
off topic
|
Which os is better for a webserver, ubuntu or debian or something else?
===
I want to set up a webserver and i was wondering which os i should choose. People tell me i should choose between centOS, ubuntu or debian.
Basically the server os has to be able to do the following:
- Run a php/mysql website that will be visited by approxamally 1000 visitors a day.
- Support a server with raid configuration.
Which OS is the best option, and what packages would you advice to install?
| 2 |
10,974,214 |
06/11/2012 03:22:56
| 896,066 |
08/16/2011 06:00:15
| 5 | 0 |
I what to be a advanced flash programmer,what technology do I need
|
as title.
I hava learn the foundamentals of actionscript, and some design pattern. but I think these not enough.
|
programmer-skills
| null | null | null | null |
06/11/2012 03:32:28
|
not constructive
|
I what to be a advanced flash programmer,what technology do I need
===
as title.
I hava learn the foundamentals of actionscript, and some design pattern. but I think these not enough.
| 4 |
11,403,667 |
07/09/2012 21:44:19
| 1,440,938 |
06/06/2012 22:39:30
| 61 | 4 |
Concepts of Recommendation Engine
|
I am planning to design a recommendation Engine for my Ecommerce website. I do not have much knowledge regarding this.
Can someone please guide me about the concepts and methodology required in designing an advance recommendation engine like one used by most mordern websites. I have followed some Research papers and came across DataMining and MachineLearning but only in a theoretical fashion. Kindly Guide me through the process. From beginner to advance level.
`Links, Resources most Welcome.`
Ty.
|
php
|
machine-learning
|
artificial-intelligence
|
data-mining
| null |
07/09/2012 21:47:28
|
not a real question
|
Concepts of Recommendation Engine
===
I am planning to design a recommendation Engine for my Ecommerce website. I do not have much knowledge regarding this.
Can someone please guide me about the concepts and methodology required in designing an advance recommendation engine like one used by most mordern websites. I have followed some Research papers and came across DataMining and MachineLearning but only in a theoretical fashion. Kindly Guide me through the process. From beginner to advance level.
`Links, Resources most Welcome.`
Ty.
| 1 |
9,998,001 |
04/03/2012 17:04:23
| 1,054,530 |
11/18/2011 19:54:55
| 6 | 1 |
Regular sets have linear growth?
|
Is it true that the set 0^(n^2) is not regular because it does not grow linearly?
|
dfa
|
fsm
| null | null | null |
04/03/2012 18:05:28
|
off topic
|
Regular sets have linear growth?
===
Is it true that the set 0^(n^2) is not regular because it does not grow linearly?
| 2 |
9,047,146 |
01/28/2012 17:10:33
| 1,066,255 |
11/25/2011 21:03:23
| 84 | 6 |
Alternative ways to push view controllers with storyboard programmatically
|
I'm looking for alternative ways to push view controllers instantiated on storyboard programmatically.
I've actually found two ways, that I use to go to the next view, but also to go back to the previous:
1. using `pushViewController`:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle: nil];
LocationWebView *lvc = [storyboard instantiateViewControllerWithIdentifier:@"LocationWebView"];
[self.navigationController pushViewController:lvc animated:YES];
2. performing `Segue` programmatically:
[self performSegueWithIdentifier: @"SongSegue" sender: self];
Do you have some hints on alternatives and on the best way this operation should be performed? Note that I'm not referring to modal views.
Thanks in advance, yassa
|
ios
|
views
|
push
|
storyboard
| null | null |
open
|
Alternative ways to push view controllers with storyboard programmatically
===
I'm looking for alternative ways to push view controllers instantiated on storyboard programmatically.
I've actually found two ways, that I use to go to the next view, but also to go back to the previous:
1. using `pushViewController`:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle: nil];
LocationWebView *lvc = [storyboard instantiateViewControllerWithIdentifier:@"LocationWebView"];
[self.navigationController pushViewController:lvc animated:YES];
2. performing `Segue` programmatically:
[self performSegueWithIdentifier: @"SongSegue" sender: self];
Do you have some hints on alternatives and on the best way this operation should be performed? Note that I'm not referring to modal views.
Thanks in advance, yassa
| 0 |
1,869,957 |
12/08/2009 21:26:21
| 68,046 |
02/18/2009 20:50:07
| 62 | 3 |
Masters Degree to assist both Technical and Leadership?
|
All,
I currently have 3.5 years of professional experience and am going to start my masters part time. My bachelor is in CS and I am bit undecided when it comes to my masters. The roles in my current position is that of a leader of both technical and business. My question is has anyone completed or know of a masters that mixes in both technical and management/leadership aspects?
Current Prospects:
Masters in Engeneering Management
Masters of Information Systems
|
masters-degree
| null | null | null | null |
01/31/2012 13:06:58
|
off topic
|
Masters Degree to assist both Technical and Leadership?
===
All,
I currently have 3.5 years of professional experience and am going to start my masters part time. My bachelor is in CS and I am bit undecided when it comes to my masters. The roles in my current position is that of a leader of both technical and business. My question is has anyone completed or know of a masters that mixes in both technical and management/leadership aspects?
Current Prospects:
Masters in Engeneering Management
Masters of Information Systems
| 2 |
35,007 |
08/29/2008 18:48:17
| 2,582 |
08/23/2008 04:50:45
| 1 | 0 |
How to expose a collection property?
|
Every time I create an object that has a collection property I go back and forth on the best way to do it?
1. public property with a getter that
returns a reference to private variable
2. explicit get_ObjList and set_ObjList
methods that return and create new or cloned
objects every time
3. explicit get_ObjList that returns an
IEnumerator and a set_ObjList that
takes IEnumerator
Does it make a difference if the collection is an array (i.e., objList.Clone()) versus a List<T>?
If returning the actual collection as a reference is so bad because it creates dependencies, then why return any property as a reference?
|
c#
|
.net
|
architecture
| null | null | null |
open
|
How to expose a collection property?
===
Every time I create an object that has a collection property I go back and forth on the best way to do it?
1. public property with a getter that
returns a reference to private variable
2. explicit get_ObjList and set_ObjList
methods that return and create new or cloned
objects every time
3. explicit get_ObjList that returns an
IEnumerator and a set_ObjList that
takes IEnumerator
Does it make a difference if the collection is an array (i.e., objList.Clone()) versus a List<T>?
If returning the actual collection as a reference is so bad because it creates dependencies, then why return any property as a reference?
| 0 |
8,186,182 |
11/18/2011 17:10:57
| 67,550 |
02/17/2009 20:37:57
| 548 | 2 |
New to Java and JPA: Why so many interfaces?
|
Having a look at some JPA code and I see:
public interface Dao<T extends DomainObject>
public interface EventDao extends Dao<Event> - nothing added to Dao<Event>
public abstract class AbstractDaoJPAImpl<T extends DomainObject> extends JpaDaoSupport implements Dao<T>
public class EventDaoJPAImp extends AbstractDaoJPAImpl<Event> implements EventDao
Why are these 2 interfaces needed? Why not have simply
public abstract class AbstractDao<T extends DomainObject> extends JpaDaoSupport
public class EventDao extends AbstractDaoJPAImpl<Event>
I'm coming from a Ruby on Rails world where things seem simpler. I'm positive this Java approach has many advantages. I can often recognize when an interface should be used, but sometimes I get the feeling Java devs go interface-crazy.
|
java
|
jpa
|
dao
| null | null |
11/19/2011 00:11:26
|
not constructive
|
New to Java and JPA: Why so many interfaces?
===
Having a look at some JPA code and I see:
public interface Dao<T extends DomainObject>
public interface EventDao extends Dao<Event> - nothing added to Dao<Event>
public abstract class AbstractDaoJPAImpl<T extends DomainObject> extends JpaDaoSupport implements Dao<T>
public class EventDaoJPAImp extends AbstractDaoJPAImpl<Event> implements EventDao
Why are these 2 interfaces needed? Why not have simply
public abstract class AbstractDao<T extends DomainObject> extends JpaDaoSupport
public class EventDao extends AbstractDaoJPAImpl<Event>
I'm coming from a Ruby on Rails world where things seem simpler. I'm positive this Java approach has many advantages. I can often recognize when an interface should be used, but sometimes I get the feeling Java devs go interface-crazy.
| 4 |
7,549,927 |
09/26/2011 01:46:22
| 866,786 |
07/28/2011 05:54:25
| 15 | 1 |
How to get touch event on CPTLayer?
|
I'm using core plot to draw a bar chart, I was wondering is there a way I can have touch events on the bars? Thanks.
|
core-plot
| null | null | null | null | null |
open
|
How to get touch event on CPTLayer?
===
I'm using core plot to draw a bar chart, I was wondering is there a way I can have touch events on the bars? Thanks.
| 0 |
8,636,302 |
12/26/2011 13:42:08
| 1,022,108 |
10/31/2011 14:08:46
| 22 | 2 |
Simple virtual file system
|
I need to implement a simple virtual file system driver. The driver should let me mount the filesystem to some point and perform some basic file operations such as create, copy, delete. I don't care whether it will be for windows or linux. If someone has such source code please share it with me.
|
c++
|
c
|
filesystems
|
vfs
| null |
12/26/2011 13:45:35
|
not a real question
|
Simple virtual file system
===
I need to implement a simple virtual file system driver. The driver should let me mount the filesystem to some point and perform some basic file operations such as create, copy, delete. I don't care whether it will be for windows or linux. If someone has such source code please share it with me.
| 1 |
10,732,804 |
05/24/2012 07:11:53
| 1,232,879 |
02/25/2012 18:17:54
| 3 | 2 |
How to check if video file is supported by android videoview?
|
I am trying to play video by Android videoview. Here is my code:
super.onCreate(savedInstanceState);
setContentView(R.layout.video);
VideoView videoView = (VideoView) findViewById(R.id.videoView);
videoView.setVideoURI(uri);
videoView.requestFocus();
videoView.start();
This works fine, however some phones still show dialog box with title "Cannot play video".
My question is how to disable this notification window?
I mean, can I check if the video file is supported or not before calling videoView.start()? Or can I disable or prevent calling the system popup notification window?
I would like to simply skip the video if not supported by the phone, without the notification window.
|
android
|
video
|
videoview
|
playback
| null | null |
open
|
How to check if video file is supported by android videoview?
===
I am trying to play video by Android videoview. Here is my code:
super.onCreate(savedInstanceState);
setContentView(R.layout.video);
VideoView videoView = (VideoView) findViewById(R.id.videoView);
videoView.setVideoURI(uri);
videoView.requestFocus();
videoView.start();
This works fine, however some phones still show dialog box with title "Cannot play video".
My question is how to disable this notification window?
I mean, can I check if the video file is supported or not before calling videoView.start()? Or can I disable or prevent calling the system popup notification window?
I would like to simply skip the video if not supported by the phone, without the notification window.
| 0 |
11,306,838 |
07/03/2012 08:08:05
| 1,496,692 |
07/02/2012 17:08:35
| 3 | 0 |
jquery form validtion empty fields
|
I am trying to make a form validtion using jquery. Basically, what I want is that whenever a user leaves the required field empty, a message shows up next it, informing the user that the field is empty. What I have done so far is this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>formulier</title>
<style type="text/css">
form span{
color:red;
}
</style>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(document).on("ready", loaded);
function loaded(){
console.log("loaded");
$('#naam').blur(validate);
$('#accept').change(checkbox);
}
function validate()
{
console.log("validate");
var lengte= $("#naamveld #postcodeveld #huisnummerveld").val();
console.log(lengte);
if ($(this) !== '')
{
$(".foutmelding1").text("Required")
}
else{
$(".foutmelding1").text("Go on")
}
}
function checkbox(){
if($('input[type=textbox]').is(':checked')){
console.log('checked');
$('button').removeAttr("disabled");
}
else{
console.log('not checked');
$('button').attr("disabled", "disabled");
}
}
</script>
</head>
<body>
<form action="#" method="post">
<fieldset>
<legend>
NAW
</legend>
<p>
<label for="naamveld">Naam: *</label>
<label for="dhr">
<input type="radio" name="gender" value="m" id="dhr" />
dhr. </label>
<label for="mevr">
<input type="radio" name="gender" value="f" id="mevr" />
mevr. </label>
<input type="text" name="name" id="naamveld" class="verplicht" />
<span class="foutmelding"> </span>
</p>
<p>
<label for="straatveld">Straat:</label>
<input type="text" name="street" id="straatveld" />
<label for="straatveld">Huisnummer: *</label>
<input type="text" name="huisnummer" id="huisnummerveld" class="verplicht" />
<span class="foutmelding"> </span>
</p>
<p>
<label for="postcodeveld">Postcode: * </label>
<input type="text" name="zip" class="verplicht" id="postcodeveld" />
<label for="stadveld">Stad:</label>
<input type="text" name="city" class="verplicht" id="stadveld" />
<span class="foutmelding"> </span>
</p>
</fieldset>
<fieldset>
<legend>
Contact
</legend>
<p>
<label for="emailveld">Email:
<input type="text" name="email" id="emailveld" />
</label>
</p>
<p>
<label for="telefoonveld">Telefoon:
<input type="text" name="phone" id="telefoonveld" />
</label>
</p>
<p>
<button name="action" value="send" type="submit" >
Verstuur
</button>
</p>
</fieldset>
</form>
</body>
</html>
|
jquery
|
forms
|
validation
| null | null | null |
open
|
jquery form validtion empty fields
===
I am trying to make a form validtion using jquery. Basically, what I want is that whenever a user leaves the required field empty, a message shows up next it, informing the user that the field is empty. What I have done so far is this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>formulier</title>
<style type="text/css">
form span{
color:red;
}
</style>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(document).on("ready", loaded);
function loaded(){
console.log("loaded");
$('#naam').blur(validate);
$('#accept').change(checkbox);
}
function validate()
{
console.log("validate");
var lengte= $("#naamveld #postcodeveld #huisnummerveld").val();
console.log(lengte);
if ($(this) !== '')
{
$(".foutmelding1").text("Required")
}
else{
$(".foutmelding1").text("Go on")
}
}
function checkbox(){
if($('input[type=textbox]').is(':checked')){
console.log('checked');
$('button').removeAttr("disabled");
}
else{
console.log('not checked');
$('button').attr("disabled", "disabled");
}
}
</script>
</head>
<body>
<form action="#" method="post">
<fieldset>
<legend>
NAW
</legend>
<p>
<label for="naamveld">Naam: *</label>
<label for="dhr">
<input type="radio" name="gender" value="m" id="dhr" />
dhr. </label>
<label for="mevr">
<input type="radio" name="gender" value="f" id="mevr" />
mevr. </label>
<input type="text" name="name" id="naamveld" class="verplicht" />
<span class="foutmelding"> </span>
</p>
<p>
<label for="straatveld">Straat:</label>
<input type="text" name="street" id="straatveld" />
<label for="straatveld">Huisnummer: *</label>
<input type="text" name="huisnummer" id="huisnummerveld" class="verplicht" />
<span class="foutmelding"> </span>
</p>
<p>
<label for="postcodeveld">Postcode: * </label>
<input type="text" name="zip" class="verplicht" id="postcodeveld" />
<label for="stadveld">Stad:</label>
<input type="text" name="city" class="verplicht" id="stadveld" />
<span class="foutmelding"> </span>
</p>
</fieldset>
<fieldset>
<legend>
Contact
</legend>
<p>
<label for="emailveld">Email:
<input type="text" name="email" id="emailveld" />
</label>
</p>
<p>
<label for="telefoonveld">Telefoon:
<input type="text" name="phone" id="telefoonveld" />
</label>
</p>
<p>
<button name="action" value="send" type="submit" >
Verstuur
</button>
</p>
</fieldset>
</form>
</body>
</html>
| 0 |
2,050,174 |
01/12/2010 15:46:42
| 112,222 |
05/25/2009 18:36:48
| 56 | 13 |
What is the best alternative for jQuery thickbox
|
As jQuery thickbox is not maintained anymore ()[ThickBox 3.1][1]What is the best alternative for jQuery thickbox currently available under GPL or similar license. Looks [nyromodal][2] is best available so far, but is there anything better.(nyromodal has some problems in IE 6)
I am looking for a plugin which can handle ajax forms, inline content replacement, images, using hidden elements and ajax call with flexibility using the callback mechanisms..
[1]: http://jquery.com/demo/thickbox/
[2]: http://nyromodal.nyrodev.com/
|
jquery
|
jquery-plugins
|
webdevelopment
|
javscript
| null |
09/15/2011 22:12:20
|
not constructive
|
What is the best alternative for jQuery thickbox
===
As jQuery thickbox is not maintained anymore ()[ThickBox 3.1][1]What is the best alternative for jQuery thickbox currently available under GPL or similar license. Looks [nyromodal][2] is best available so far, but is there anything better.(nyromodal has some problems in IE 6)
I am looking for a plugin which can handle ajax forms, inline content replacement, images, using hidden elements and ajax call with flexibility using the callback mechanisms..
[1]: http://jquery.com/demo/thickbox/
[2]: http://nyromodal.nyrodev.com/
| 4 |
8,603,470 |
12/22/2011 11:49:17
| 810,796 |
06/22/2011 16:53:07
| 55 | 5 |
MVC3 on godaddy
|
I'm trying to publish my site on the godaddy. I also spoke to their technical staff. Basically, I published my site to a local directory on my system (C:/test) and then copied all the resultant files from them on to my root folder on GoDaddy. However, I cannot reach my application!!! The technical guy mentioned that GoDaddy only understands index.html files as the startup. I am not sure how to resolve this. Please help!!
Thanks
|
asp.net-mvc-3
|
godaddy
|
publishing
| null | null |
12/22/2011 20:33:40
|
off topic
|
MVC3 on godaddy
===
I'm trying to publish my site on the godaddy. I also spoke to their technical staff. Basically, I published my site to a local directory on my system (C:/test) and then copied all the resultant files from them on to my root folder on GoDaddy. However, I cannot reach my application!!! The technical guy mentioned that GoDaddy only understands index.html files as the startup. I am not sure how to resolve this. Please help!!
Thanks
| 2 |
8,129,723 |
11/14/2011 23:37:06
| 673,108 |
03/23/2011 13:28:40
| 116 | 4 |
Record mouse movement with javascript
|
I'm a beginner in javascript. But even togh I'm trying to build a simple mouse recorder in javascript.
I will activate this script for aproxematly 50 visitors to analyse how the visitor interacts with my page. With other words: The script will not be live at all time, but still I want the script to be as lightweight as possible for the browser.
I'm now starting out with logging the mouse movement. Is this a good idea of doing it, or is there a better way? Please advice me.
The only parameters I want in this step is:
- x-position of mouse
- y-position of mouse
- the time of the visit
**The javascript:**
<script>
document.onmousemove = xy; // when mouse moves call function "xy"
var st = new Date().getTime(), // start time
w = screen.width, // get the width (my website is a center-layout so width/2 will give me the center of the page wich will make it possible to show the replay from different window sizes)
x = 0, // x position of mouse
y = 0, // y position of mouse
ay = ''; // string that will be sent to PHP to create a replay of the mouse movement (a image will move with the same cordinates)
function xy(e) {
var ex = e.pageX,
ey = e.pageY; // since they will be used more than once below I put them in a variable
if (ex > x+30 || ex < x-30 || ey > y+30 || ey < y-30){ // I don't need to log every pixel since it will return a huge string, 30 px in difference is enough
// make the numbers smaller for the string (approximately is enough for this application), they will later be multiplied by 10
x = Math.round(ex/10);
y = Math.round(ey/10);
// get the curent time for the position to be able to record it later (start time - time now)
var t = new Date().getTime() - st;
// x-position , y-position, curent time on page
xy = xy + x + ',' + y + ',' + t + ',';
// only to show
document.Show.onlyforstackoverflow.value = xy;
// to be able to see difference in pixels later in if (ex > x+30 || ex < x-30 || ey > y+30 || ey < y-30)
x = ex;
y = ey;
} // end if
} //end function
</script>
|
javascript
|
mouse
|
record
|
movement
| null |
11/17/2011 15:44:15
|
off topic
|
Record mouse movement with javascript
===
I'm a beginner in javascript. But even togh I'm trying to build a simple mouse recorder in javascript.
I will activate this script for aproxematly 50 visitors to analyse how the visitor interacts with my page. With other words: The script will not be live at all time, but still I want the script to be as lightweight as possible for the browser.
I'm now starting out with logging the mouse movement. Is this a good idea of doing it, or is there a better way? Please advice me.
The only parameters I want in this step is:
- x-position of mouse
- y-position of mouse
- the time of the visit
**The javascript:**
<script>
document.onmousemove = xy; // when mouse moves call function "xy"
var st = new Date().getTime(), // start time
w = screen.width, // get the width (my website is a center-layout so width/2 will give me the center of the page wich will make it possible to show the replay from different window sizes)
x = 0, // x position of mouse
y = 0, // y position of mouse
ay = ''; // string that will be sent to PHP to create a replay of the mouse movement (a image will move with the same cordinates)
function xy(e) {
var ex = e.pageX,
ey = e.pageY; // since they will be used more than once below I put them in a variable
if (ex > x+30 || ex < x-30 || ey > y+30 || ey < y-30){ // I don't need to log every pixel since it will return a huge string, 30 px in difference is enough
// make the numbers smaller for the string (approximately is enough for this application), they will later be multiplied by 10
x = Math.round(ex/10);
y = Math.round(ey/10);
// get the curent time for the position to be able to record it later (start time - time now)
var t = new Date().getTime() - st;
// x-position , y-position, curent time on page
xy = xy + x + ',' + y + ',' + t + ',';
// only to show
document.Show.onlyforstackoverflow.value = xy;
// to be able to see difference in pixels later in if (ex > x+30 || ex < x-30 || ey > y+30 || ey < y-30)
x = ex;
y = ey;
} // end if
} //end function
</script>
| 2 |
9,426,710 |
02/24/2012 07:00:23
| 428,378 |
08/23/2010 11:59:31
| 74 | 5 |
Live server error but not on MAMP
|
I have just done a fresh install of the latest stable PyroCMS version on my web server. I now can hardly use the site due to PHP errors pertaining to session data. "Cannot modify header data."
Why would the CMS run without error on MAMP but not on the live server?
|
php
|
session
|
header
|
mamp
|
pyrocms
| null |
open
|
Live server error but not on MAMP
===
I have just done a fresh install of the latest stable PyroCMS version on my web server. I now can hardly use the site due to PHP errors pertaining to session data. "Cannot modify header data."
Why would the CMS run without error on MAMP but not on the live server?
| 0 |
373,189 |
12/16/2008 23:42:35
| 46,862 |
12/16/2008 23:29:12
| 1 | 0 |
XPath in XmlStream.addObserver doesn't work the way it should
|
What I want to do is to react only on specified root elements. For example, if user sends XmlStream that looks like:
<auth>
<login>user</login>
<pass>dupa.8</pass>
</auth>
My method ._auth should be executed. I've done it with addObserver method called inside connectionMade method.
self.addObserver("/auth", self._auth)
AFAIK XPath - if I write "/auth" it means that I want my root element to be "auth", so that message:
<longtagislong>
<auth>...</auth>
</longtagislong>
... should be rejected, because auth isn't root.
But Twisted however doesn't work the way I thought it should - my _auth method is executed when second message appears (with auth element inside the tree), not the first one - with auth element as a root.
So, my question is: how to tell Twisted and addObserver method that I want to react only if root element's name is "auth"?
|
xpath
|
python
|
twisted
| null | null | null |
open
|
XPath in XmlStream.addObserver doesn't work the way it should
===
What I want to do is to react only on specified root elements. For example, if user sends XmlStream that looks like:
<auth>
<login>user</login>
<pass>dupa.8</pass>
</auth>
My method ._auth should be executed. I've done it with addObserver method called inside connectionMade method.
self.addObserver("/auth", self._auth)
AFAIK XPath - if I write "/auth" it means that I want my root element to be "auth", so that message:
<longtagislong>
<auth>...</auth>
</longtagislong>
... should be rejected, because auth isn't root.
But Twisted however doesn't work the way I thought it should - my _auth method is executed when second message appears (with auth element inside the tree), not the first one - with auth element as a root.
So, my question is: how to tell Twisted and addObserver method that I want to react only if root element's name is "auth"?
| 0 |
10,538,643 |
05/10/2012 16:43:15
| 1,087,756 |
11/08/2010 17:51:57
| 16 | 0 |
NSTabView setControlTint broken?
|
I cannot get my NSTabView tabs to display with a blue control tint. They are always showing as graphite, in spite of having used [tabView setControlTint: NSBlueControlTint]. I verified that [tabView controlTint] was set properly. I'm running OS X 10.7.3. Any ideas what I'm missing here? Thanks.
|
nstabview
| null | null | null | null | null |
open
|
NSTabView setControlTint broken?
===
I cannot get my NSTabView tabs to display with a blue control tint. They are always showing as graphite, in spite of having used [tabView setControlTint: NSBlueControlTint]. I verified that [tabView controlTint] was set properly. I'm running OS X 10.7.3. Any ideas what I'm missing here? Thanks.
| 0 |
3,610,599 |
08/31/2010 15:32:45
| 436,073 |
08/31/2010 15:08:55
| 1 | 0 |
what is the code for identifying various musical instruments from a given sound file-python
|
plz can u help me with the code for python for this
|
python
| null | null | null | null |
08/31/2010 15:44:18
|
not a real question
|
what is the code for identifying various musical instruments from a given sound file-python
===
plz can u help me with the code for python for this
| 1 |
3,481,301 |
08/13/2010 23:38:10
| 414,506 |
08/08/2010 17:58:49
| 1 | 2 |
What is the purpose of this inside functions?
|
Javascript compiles this code **without** error:
function test() {
property: true;
alert('testing');
}
test(); // Shows message 'testing'
alert(test.property); // Shows 'undefined'
Is the content of *property* accessible in any way?
If not, what is the purpose of accepting this code?
|
javascript
|
function
| null | null | null | null |
open
|
What is the purpose of this inside functions?
===
Javascript compiles this code **without** error:
function test() {
property: true;
alert('testing');
}
test(); // Shows message 'testing'
alert(test.property); // Shows 'undefined'
Is the content of *property* accessible in any way?
If not, what is the purpose of accepting this code?
| 0 |
9,897,813 |
03/27/2012 21:15:52
| 1,296,613 |
03/27/2012 21:00:31
| 1 | 0 |
How to optimize website for mobile devices?
|
What are the differences between web development normal website (desktop version) and website for mobile devices? What is the best way how to create user-friendy website for touch-screen devices (tablet, smarthphone)? Links to step-by-step tutorials would be great. Thank you
|
mobile
|
website
|
devices
| null | null |
03/28/2012 02:54:45
|
not constructive
|
How to optimize website for mobile devices?
===
What are the differences between web development normal website (desktop version) and website for mobile devices? What is the best way how to create user-friendy website for touch-screen devices (tablet, smarthphone)? Links to step-by-step tutorials would be great. Thank you
| 4 |
8,298,486 |
11/28/2011 15:54:33
| 1,004,278 |
10/20/2011 00:53:10
| 333 | 4 |
SQL parsing fails, not sure what the issue is?
|
This parses fine:
MERGE INTO SECURE_GROUPS USING
(SELECT :P94_NAME name FROM dual) data
ON (data.name = PEOPLE.PERSON_NAME)
WHEN NOT MATCHED THEN
INSERT (PERSON_NAME) VALUES (data.name);
This fails with:
1 error has occurred
ORA-06550: line 10, column 51: PL/SQL: ORA-00923: FROM keyword not found where expected ORA-06550: line 9, column 1: PL/SQL: SQL Statement ignored
MERGE INTO SECURE_GROUPS USING
(SELECT :P94_NAME name, :P94_NUMBER num FROM dual) data
ON (data.name = PEOPLE.PERSON_NAME)
WHEN NOT MATCHED THEN
INSERT (PERSON_NAME, PERSON_NUMBER) VALUES (data.name, data.num);
|
sql
|
oracle
|
oracle10g
|
oracle-apex
| null | null |
open
|
SQL parsing fails, not sure what the issue is?
===
This parses fine:
MERGE INTO SECURE_GROUPS USING
(SELECT :P94_NAME name FROM dual) data
ON (data.name = PEOPLE.PERSON_NAME)
WHEN NOT MATCHED THEN
INSERT (PERSON_NAME) VALUES (data.name);
This fails with:
1 error has occurred
ORA-06550: line 10, column 51: PL/SQL: ORA-00923: FROM keyword not found where expected ORA-06550: line 9, column 1: PL/SQL: SQL Statement ignored
MERGE INTO SECURE_GROUPS USING
(SELECT :P94_NAME name, :P94_NUMBER num FROM dual) data
ON (data.name = PEOPLE.PERSON_NAME)
WHEN NOT MATCHED THEN
INSERT (PERSON_NAME, PERSON_NUMBER) VALUES (data.name, data.num);
| 0 |
735,359 |
04/09/2009 18:21:24
| 89,054 |
04/09/2009 12:50:54
| 1 | 0 |
Update span tag value with JQuery
|
I'm trying to update a span tag that is in a fieldset tag that is in a legend tag. The idea is to update the cost of a Software Item as components are selected. The code below works fine if I only have one software item (e.g. - Visual Studio 2008 Pro $2800), but if I add a second item in another fieldset, then when I try to update the span for that fieldset, it updates the span for the fieldset containing my Visual Studio Software. Any ideas what I'm doing wrong?
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$("li").click(function() {
var itemCost = 0;
$("legend").each(function() {
var SoftwareItem = $(this).text();
itemCost = GetItemCost(SoftwareItem);
$("input:checked").each(function() {
var Component = $(this).next("label").text();
itemCost += GetItemCost(Component);
});
$("#ItemCostSpan").text("Item Cost = $ " + itemCost);
});
function GetItemCost(text) {
var start = 0;
start = text.lastIndexOf("$");
var textCost = text.substring(start + 1);
var itemCost = parseFloat(textCost);
return itemCost;
}
});
});
</script>
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<fieldset>
<legend>Visual Studio 2008 Pro $2800</legend>
<ul class="AspNet-CheckBoxList-RepeatDirection-Vertical">
<li class="AspNet-CheckBoxList-Item">
<input id="CheckBoxList1_0" type="checkbox" name="CheckBoxList1$0" value="first1" />
<label for="CheckBoxList1_0">Software Assurance $300.00</label>
</li>
<li class="AspNet-CheckBoxList-Item">
<input id="CheckBoxList1_1" type="checkbox" name="CheckBoxList1$1" value="second2" />
<label for="CheckBoxList1_1">Another Component $255.25</label>
</li>
<li class="AspNet-CheckBoxList-Item">
<input id="CheckBox1" type="checkbox" name="CheckBoxList1$1" value="second2" />
<label for="CheckBoxList1_1">A Second Component $15.25</label>
</li>
</ul>
<span id="ItemCostSpan" style="background-color:White"> </span>
</fieldset>
<fieldset>
<legend>Visio 2008 Pro $415</legend>
<ul class="AspNet-CheckBoxList-RepeatDirection-Vertical">
<li class="AspNet-CheckBoxList-Item">
<input id="CheckBox2" type="checkbox" name="CheckBoxList1$0" value="first1" />
<label for="CheckBoxList1_0">Software Assurance $40.00</label>
</li>
<li class="AspNet-CheckBoxList-Item">
<input id="CheckBox3" type="checkbox" name="CheckBoxList1$1" value="second2" />
<label for="CheckBoxList1_1">Another Component $25.55</label>
</li>
<li class="AspNet-CheckBoxList-Item">
<input id="CheckBox4" type="checkbox" name="CheckBoxList1$1" value="second2" />
<label for="CheckBoxList1_1">A Second Component $10.25</label>
</li>
</ul>
<span id="ItemCostSpan" style="background-color:White"></span>
</fieldset>
<span id="TotalCostSpan" style="background-color:White"></span>
</form>
</body>
</html>
|
jquery
|
span
|
update
| null | null | null |
open
|
Update span tag value with JQuery
===
I'm trying to update a span tag that is in a fieldset tag that is in a legend tag. The idea is to update the cost of a Software Item as components are selected. The code below works fine if I only have one software item (e.g. - Visual Studio 2008 Pro $2800), but if I add a second item in another fieldset, then when I try to update the span for that fieldset, it updates the span for the fieldset containing my Visual Studio Software. Any ideas what I'm doing wrong?
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$("li").click(function() {
var itemCost = 0;
$("legend").each(function() {
var SoftwareItem = $(this).text();
itemCost = GetItemCost(SoftwareItem);
$("input:checked").each(function() {
var Component = $(this).next("label").text();
itemCost += GetItemCost(Component);
});
$("#ItemCostSpan").text("Item Cost = $ " + itemCost);
});
function GetItemCost(text) {
var start = 0;
start = text.lastIndexOf("$");
var textCost = text.substring(start + 1);
var itemCost = parseFloat(textCost);
return itemCost;
}
});
});
</script>
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<fieldset>
<legend>Visual Studio 2008 Pro $2800</legend>
<ul class="AspNet-CheckBoxList-RepeatDirection-Vertical">
<li class="AspNet-CheckBoxList-Item">
<input id="CheckBoxList1_0" type="checkbox" name="CheckBoxList1$0" value="first1" />
<label for="CheckBoxList1_0">Software Assurance $300.00</label>
</li>
<li class="AspNet-CheckBoxList-Item">
<input id="CheckBoxList1_1" type="checkbox" name="CheckBoxList1$1" value="second2" />
<label for="CheckBoxList1_1">Another Component $255.25</label>
</li>
<li class="AspNet-CheckBoxList-Item">
<input id="CheckBox1" type="checkbox" name="CheckBoxList1$1" value="second2" />
<label for="CheckBoxList1_1">A Second Component $15.25</label>
</li>
</ul>
<span id="ItemCostSpan" style="background-color:White"> </span>
</fieldset>
<fieldset>
<legend>Visio 2008 Pro $415</legend>
<ul class="AspNet-CheckBoxList-RepeatDirection-Vertical">
<li class="AspNet-CheckBoxList-Item">
<input id="CheckBox2" type="checkbox" name="CheckBoxList1$0" value="first1" />
<label for="CheckBoxList1_0">Software Assurance $40.00</label>
</li>
<li class="AspNet-CheckBoxList-Item">
<input id="CheckBox3" type="checkbox" name="CheckBoxList1$1" value="second2" />
<label for="CheckBoxList1_1">Another Component $25.55</label>
</li>
<li class="AspNet-CheckBoxList-Item">
<input id="CheckBox4" type="checkbox" name="CheckBoxList1$1" value="second2" />
<label for="CheckBoxList1_1">A Second Component $10.25</label>
</li>
</ul>
<span id="ItemCostSpan" style="background-color:White"></span>
</fieldset>
<span id="TotalCostSpan" style="background-color:White"></span>
</form>
</body>
</html>
| 0 |
10,955,499 |
06/08/2012 20:12:29
| 1,283,726 |
03/21/2012 15:01:33
| 67 | 4 |
Comparison websites: bubble sorting logic?
|
Ok guys, this is actually more of a programming logic question than a "help with my code question". But I have a client with an idea for a comparison website, something similar to hot or not (although not nearly as stupid or cheesy) that will compare two images. Now basically to me this seems to be a sort of [bubble sorting logic][1] but I'm not sure. Has anyone worked with this type of task before that has any insight or pointers on how to accomplish the goal of comparing two pictures that havent been compared before etc.?
I'd love to do this in the LAMP environment but any experience or pointers could be helpful. Basically I'm tasked with creating something like [this][2]
[1]: http://en.wikipedia.org/wiki/Bubble_sort
[2]: http://www.hotstagram.com/
|
php
|
logic
|
bubble-sort
| null | null |
06/08/2012 20:19:50
|
not a real question
|
Comparison websites: bubble sorting logic?
===
Ok guys, this is actually more of a programming logic question than a "help with my code question". But I have a client with an idea for a comparison website, something similar to hot or not (although not nearly as stupid or cheesy) that will compare two images. Now basically to me this seems to be a sort of [bubble sorting logic][1] but I'm not sure. Has anyone worked with this type of task before that has any insight or pointers on how to accomplish the goal of comparing two pictures that havent been compared before etc.?
I'd love to do this in the LAMP environment but any experience or pointers could be helpful. Basically I'm tasked with creating something like [this][2]
[1]: http://en.wikipedia.org/wiki/Bubble_sort
[2]: http://www.hotstagram.com/
| 1 |
6,904,156 |
08/01/2011 20:39:06
| 869,361 |
07/29/2011 12:32:37
| 3 | 0 |
Header file to use string[] and Directory identifier (Directory.GetFiles)
|
I have problem declaring and using string, and Directory. Output fail to appear. The errors have been written beside. Pls point out my mistakes. Tq.
#include <stdio.h> //i list out all headers used coz worry they r the cause of problem
#include "cv.h"
#include "highgui.h"
#include <iostream>
#include <fstream>
#include "C:\Dirent.h\dirent.h" // to use directory
#include <string> // to use string
using namespace std;
int main(int argc, char** argv)
{
// declare file directory
string dir = "C:\asian skin area";
// declare a string representing files in the folder
string[] files; // error: empty attribute block is not allowed.
// error: 'files' undeclared identifier
// to put number of files
int numFiles;
// the string of files get from the directory
files = Directory.GetFiles(dir); // error: 'Directory': undeclared identifier
// error: 'GetFiles' must have class/struct/union
// get the number of files in the folder
numFiles = files.Length; // error: 'Length' must have class/struct/union
// print the number of files in the folder
cout<<"Number of files in the folder is:"<<numFiles+1<<endl;
//press any key to continue
system("PAUSE");
}
|
c#
|
c++
|
programming-languages
| null | null |
08/02/2011 10:09:31
|
not a real question
|
Header file to use string[] and Directory identifier (Directory.GetFiles)
===
I have problem declaring and using string, and Directory. Output fail to appear. The errors have been written beside. Pls point out my mistakes. Tq.
#include <stdio.h> //i list out all headers used coz worry they r the cause of problem
#include "cv.h"
#include "highgui.h"
#include <iostream>
#include <fstream>
#include "C:\Dirent.h\dirent.h" // to use directory
#include <string> // to use string
using namespace std;
int main(int argc, char** argv)
{
// declare file directory
string dir = "C:\asian skin area";
// declare a string representing files in the folder
string[] files; // error: empty attribute block is not allowed.
// error: 'files' undeclared identifier
// to put number of files
int numFiles;
// the string of files get from the directory
files = Directory.GetFiles(dir); // error: 'Directory': undeclared identifier
// error: 'GetFiles' must have class/struct/union
// get the number of files in the folder
numFiles = files.Length; // error: 'Length' must have class/struct/union
// print the number of files in the folder
cout<<"Number of files in the folder is:"<<numFiles+1<<endl;
//press any key to continue
system("PAUSE");
}
| 1 |
4,228,517 |
11/19/2010 19:12:43
| 107,415 |
02/13/2009 01:34:05
| 12,820 | 470 |
MySQL claims that I can use columns in SELECT that aren't in GROUP BY, but I can't with equal performance
|
The MySQL documents state in [section 11.5.3][1] that, despite what the SQL standard may say, it's just fine to use columns in the SELECT clause that aren't in the GROUP BY clause, so long as they are functionally dependent on the grouped key.
> MySQL extends the use of GROUP BY so
> that you can use nonaggregated columns
> or calculations in the select list
> that do not appear in the GROUP BY
> clause. You can use this feature to
> get better performance by avoiding
> unnecessary column sorting and
> grouping. For example, you need not
> group on customer.name in the
> following query:
>
> SELECT order.custid, customer.name,
> MAX(payments) FROM order,customer
> WHERE order.custid = customer.custid
> GROUP BY order.custid;
>
> In standard
> SQL, you would have to add
> customer.name to the GROUP BY clause.
> In MySQL, the name is redundant.
Sounds reasonable. However, though I *can* select those columns, it seems to have an adverse effect on performance.
EXPLAIN SELECT o.id FROM objects o GROUP BY o.id;
+----+-------------+-------+-------+---------------+---------+---------+------+------+--------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+-------+---------------+---------+---------+------+------+--------------------------+
| 1 | SIMPLE | o | range | NULL | PRIMARY | 3 | NULL | 5262 | Using index for group-by |
+----+-------------+-------+-------+---------------+---------+---------+------+------+--------------------------+
(I realize that this query is pretty silly; it's just the simplest version of a more complex query that has the same issue.) When selecting just the primary key ID I group by, then MySQL uses the primary key index. However, when I include other columns, MySQL does not.
EXPLAIN SELECT o.id, o.name FROM objects o GROUP BY o.id;
+----+-------------+-------+------+---------------+------+---------+------+------+----------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+---------------+------+---------+------+------+----------------+
| 1 | SIMPLE | o | ALL | NULL | NULL | NULL | NULL | 5261 | Using filesort |
+----+-------------+-------+------+---------------+------+---------+------+------+----------------+
That use of filesort instead of the index really sets me back. I'm currently looking to select `*` from this table, so would like to avoid having to repeat all columns in the group and index them. Is there any way to get MySQL to use the primary key index, as I expect it to?
[1]: http://dev.mysql.com/doc/refman/4.1/en/group-by-hidden-columns.html
|
mysql
|
optimization
|
indexing
|
group-by
| null | null |
open
|
MySQL claims that I can use columns in SELECT that aren't in GROUP BY, but I can't with equal performance
===
The MySQL documents state in [section 11.5.3][1] that, despite what the SQL standard may say, it's just fine to use columns in the SELECT clause that aren't in the GROUP BY clause, so long as they are functionally dependent on the grouped key.
> MySQL extends the use of GROUP BY so
> that you can use nonaggregated columns
> or calculations in the select list
> that do not appear in the GROUP BY
> clause. You can use this feature to
> get better performance by avoiding
> unnecessary column sorting and
> grouping. For example, you need not
> group on customer.name in the
> following query:
>
> SELECT order.custid, customer.name,
> MAX(payments) FROM order,customer
> WHERE order.custid = customer.custid
> GROUP BY order.custid;
>
> In standard
> SQL, you would have to add
> customer.name to the GROUP BY clause.
> In MySQL, the name is redundant.
Sounds reasonable. However, though I *can* select those columns, it seems to have an adverse effect on performance.
EXPLAIN SELECT o.id FROM objects o GROUP BY o.id;
+----+-------------+-------+-------+---------------+---------+---------+------+------+--------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+-------+---------------+---------+---------+------+------+--------------------------+
| 1 | SIMPLE | o | range | NULL | PRIMARY | 3 | NULL | 5262 | Using index for group-by |
+----+-------------+-------+-------+---------------+---------+---------+------+------+--------------------------+
(I realize that this query is pretty silly; it's just the simplest version of a more complex query that has the same issue.) When selecting just the primary key ID I group by, then MySQL uses the primary key index. However, when I include other columns, MySQL does not.
EXPLAIN SELECT o.id, o.name FROM objects o GROUP BY o.id;
+----+-------------+-------+------+---------------+------+---------+------+------+----------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+---------------+------+---------+------+------+----------------+
| 1 | SIMPLE | o | ALL | NULL | NULL | NULL | NULL | 5261 | Using filesort |
+----+-------------+-------+------+---------------+------+---------+------+------+----------------+
That use of filesort instead of the index really sets me back. I'm currently looking to select `*` from this table, so would like to avoid having to repeat all columns in the group and index them. Is there any way to get MySQL to use the primary key index, as I expect it to?
[1]: http://dev.mysql.com/doc/refman/4.1/en/group-by-hidden-columns.html
| 0 |
7,039,029 |
08/12/2011 10:48:20
| 713,665 |
04/18/2011 15:21:05
| 6 | 0 |
PHP: get contents of the aspx file
|
I got next problem. I need to get HTML of several pages. All works great with PHP functions file() or file_get_contents() or CURL.
But doesn't work for one URL!! Here it is: http://goo.gl/LNF4N (of course, I try to get HTML of non-shortened URL).
I tried all, nothing helps. I can open this page in browswer, it returns 200 status, but... I can't get it's contents! It returns **500 error**, when I try to get it via CURL:
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
ASP.ypDetectClass..ctor() +47
ASP.immigration_immigrating_ainp_application_forms_aspx..ctor() +26
__ASP.FastObjectFactory_app_web_obqstzij.Create_ASP_immigration_immigrating_ainp_application_forms_aspx() +20
System.Web.Compilation.BuildResultCompiledType.CreateInstance() +32
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +119
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +33
System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +160
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
Version Information: Microsoft .NET Framework Version:2.0.50727.3623; ASP.NET Version:2.0.50727.3618 "
|
php
|
file-get-contents
| null | null | null |
08/12/2011 14:48:41
|
too localized
|
PHP: get contents of the aspx file
===
I got next problem. I need to get HTML of several pages. All works great with PHP functions file() or file_get_contents() or CURL.
But doesn't work for one URL!! Here it is: http://goo.gl/LNF4N (of course, I try to get HTML of non-shortened URL).
I tried all, nothing helps. I can open this page in browswer, it returns 200 status, but... I can't get it's contents! It returns **500 error**, when I try to get it via CURL:
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
ASP.ypDetectClass..ctor() +47
ASP.immigration_immigrating_ainp_application_forms_aspx..ctor() +26
__ASP.FastObjectFactory_app_web_obqstzij.Create_ASP_immigration_immigrating_ainp_application_forms_aspx() +20
System.Web.Compilation.BuildResultCompiledType.CreateInstance() +32
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +119
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +33
System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +160
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
Version Information: Microsoft .NET Framework Version:2.0.50727.3623; ASP.NET Version:2.0.50727.3618 "
| 3 |
426,489 |
01/08/2009 23:32:28
| 53,124 |
01/08/2009 22:31:08
| 11 | 1 |
project publishing to windows web server 2008
|
I am workinh with a VS 2008 (c#) project on Windows XP Pro. and trying to publish that application using "Publish Web" wizard to a remote server which is Windows Web Server 2008 os.
But the publishing fails every time with following error:
----------
Connecting to http://XX.XXX.XXX.XX/... Unable to create the Web site 'http://XX.XXX.XXX.XX/'. The Web server does not appear to have FrontPage Server Extensions installed.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
----------
I use these links.
http://learn.iis.net/page.aspx/134/install-frontpage-server-extensions/
http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1630
http://www.rtr.com/fpse/
I have installed FrontPage Server extensions from above links without any problems on the remote server.
And extend the Virtual Server ( the "Default Web Site").
However, the problem remains. I cannot find any solution to this issue.
|
iis7
|
asp.net
|
vs.net
|
c#
| null | null |
open
|
project publishing to windows web server 2008
===
I am workinh with a VS 2008 (c#) project on Windows XP Pro. and trying to publish that application using "Publish Web" wizard to a remote server which is Windows Web Server 2008 os.
But the publishing fails every time with following error:
----------
Connecting to http://XX.XXX.XXX.XX/... Unable to create the Web site 'http://XX.XXX.XXX.XX/'. The Web server does not appear to have FrontPage Server Extensions installed.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
----------
I use these links.
http://learn.iis.net/page.aspx/134/install-frontpage-server-extensions/
http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1630
http://www.rtr.com/fpse/
I have installed FrontPage Server extensions from above links without any problems on the remote server.
And extend the Virtual Server ( the "Default Web Site").
However, the problem remains. I cannot find any solution to this issue.
| 0 |
8,760,256 |
01/06/2012 15:33:20
| 1,088,617 |
12/08/2011 21:34:26
| 126 | 0 |
WPF - show DataGrid row details by clicking row header?
|
Normally row details are show when you click on a row. I want to disable this so that clicking a DataGrid row simply selects it but doesn't show the row details. I want the row details to be shown when a user clicks the row header. How would I do this?
|
c#
|
wpf
|
expression-blend
| null | null | null |
open
|
WPF - show DataGrid row details by clicking row header?
===
Normally row details are show when you click on a row. I want to disable this so that clicking a DataGrid row simply selects it but doesn't show the row details. I want the row details to be shown when a user clicks the row header. How would I do this?
| 0 |
7,060,557 |
08/14/2011 23:53:16
| 497,906 |
11/05/2010 01:24:33
| 58 | 2 |
Spawning Enemy at a Random Location
|
I've been following this code snippet from Ray Wenderlich's tutorials (<http://codeviewer.org/view/code:1d8b>). I'm trying to do almost the same thing, except I'm using a spritesheet (batchnode), and I want the targets/enemies to spawn from the right side of the screen (at any height), and move to the left side (at the same height). Here is my code. (<http://codeviewer.org/view/code:1d8c>).
Extra info - "moles" are my targets/enemies. Commented out code (//) beside the first few lines are just my notes.
|
iphone
|
random
|
cocos2d
|
sprite
|
spawning
| null |
open
|
Spawning Enemy at a Random Location
===
I've been following this code snippet from Ray Wenderlich's tutorials (<http://codeviewer.org/view/code:1d8b>). I'm trying to do almost the same thing, except I'm using a spritesheet (batchnode), and I want the targets/enemies to spawn from the right side of the screen (at any height), and move to the left side (at the same height). Here is my code. (<http://codeviewer.org/view/code:1d8c>).
Extra info - "moles" are my targets/enemies. Commented out code (//) beside the first few lines are just my notes.
| 0 |
11,746,672 |
07/31/2012 18:29:44
| 1,153,562 |
01/17/2012 09:26:30
| 8 | 0 |
SVG Design your layout
|
i wonder how this site/script <http://caseapp.se/eget-iphone-skal> works with the svg. Do thay use a plug to jquery or what?
|
jquery
|
svg
|
jquery-svg
| null | null |
07/31/2012 18:42:04
|
not a real question
|
SVG Design your layout
===
i wonder how this site/script <http://caseapp.se/eget-iphone-skal> works with the svg. Do thay use a plug to jquery or what?
| 1 |
2,942,147 |
05/31/2010 07:52:38
| 349,600 |
05/25/2010 05:54:10
| 9 | 4 |
how find tooltip control
|
how find tooltip control for any control in winform in c#?
|
c#
| null | null | null | null | null |
open
|
how find tooltip control
===
how find tooltip control for any control in winform in c#?
| 0 |
11,161,096 |
06/22/2012 17:18:06
| 376,113 |
06/25/2010 09:37:45
| 3,119 | 147 |
Relational Algebra and R
|
I'm new to R and I was wondering if you can do easily (or with a package) relational Algebra (or SQL like function) ? I might not been using the right tool, what I want is mainly analyze date and generate graphs from different 'group by ' perspective.
|
sql
|
r
|
relational-algebra
| null | null |
06/22/2012 18:22:36
|
not constructive
|
Relational Algebra and R
===
I'm new to R and I was wondering if you can do easily (or with a package) relational Algebra (or SQL like function) ? I might not been using the right tool, what I want is mainly analyze date and generate graphs from different 'group by ' perspective.
| 4 |
100,772 |
09/19/2008 09:39:20
| 17,560 |
09/18/2008 11:39:52
| 58 | 3 |
C# Training videos
|
Hi were can I find training videos for C# ?
|
c#
|
videos
| null | null | null |
12/06/2011 16:54:44
|
not constructive
|
C# Training videos
===
Hi were can I find training videos for C# ?
| 4 |
5,772,666 |
04/24/2011 19:18:57
| 722,877 |
04/24/2011 19:18:57
| 1 | 0 |
Data recording and extraction software for C++
|
I am interested to learn about what libraries, tools, or frameworks there are for having a C++ program record data for later analysis and extraction. I provide a description of what I envision to give an idea of what I'm looking to do, but your suggestions need not fit it exactly.
I'd like to specify different record types for my program to record. For example, there might be a distinct record type for each type of message I get from a device, a record type for the results of major algorithms, a record type for each kind of operator input. Ideally the code changes for adding a new record type would be fairly minimal: Define a struct for the data to record, correlate it to a record type ID, and add the code to record instances to file.
After the main program runs, I'd like to run a data extraction tool that could give a summary of the data recorded and allow me to extract specific record types over a specified time period of the run. I could provide the exec to the tool and it would use some of the same hooks a debugger tool uses to figure out the names of the fields in the struct for use in the extraction report. It would be nice if the extraction report could be specified as .txt, .xml, .csv (for opening in Excel), or .hdf (for opening in Matlab).
This would be for Linux and GCC compiler. Ideally suggestions would be FOSS, but proprietary solutions are welcome too. Let me know!
|
c++
|
c
|
data
|
extraction
|
recording
| null |
open
|
Data recording and extraction software for C++
===
I am interested to learn about what libraries, tools, or frameworks there are for having a C++ program record data for later analysis and extraction. I provide a description of what I envision to give an idea of what I'm looking to do, but your suggestions need not fit it exactly.
I'd like to specify different record types for my program to record. For example, there might be a distinct record type for each type of message I get from a device, a record type for the results of major algorithms, a record type for each kind of operator input. Ideally the code changes for adding a new record type would be fairly minimal: Define a struct for the data to record, correlate it to a record type ID, and add the code to record instances to file.
After the main program runs, I'd like to run a data extraction tool that could give a summary of the data recorded and allow me to extract specific record types over a specified time period of the run. I could provide the exec to the tool and it would use some of the same hooks a debugger tool uses to figure out the names of the fields in the struct for use in the extraction report. It would be nice if the extraction report could be specified as .txt, .xml, .csv (for opening in Excel), or .hdf (for opening in Matlab).
This would be for Linux and GCC compiler. Ideally suggestions would be FOSS, but proprietary solutions are welcome too. Let me know!
| 0 |
6,483,747 |
06/26/2011 11:57:14
| 812,919 |
06/23/2011 19:12:43
| 72 | 4 |
How to make your own online video player
|
I was just wondering how i can make my own on line video player like you tube has, thank you for any answers.
|
video
| null | null | null | null |
06/26/2011 21:21:49
|
not a real question
|
How to make your own online video player
===
I was just wondering how i can make my own on line video player like you tube has, thank you for any answers.
| 1 |
8,969,724 |
01/23/2012 09:50:39
| 505,790 |
11/12/2010 13:29:20
| 17 | 0 |
Change value in an array
|
I am import from a CSV to Mysql, every works fines the only problem is i have to convert normal date to mysql date. can anyone help.
$row=1;
if (($handle = fopen($_FILES['Filedata']['tmp_name'], "r")) !== FALSE) {
while (($data = fgetcsv($handle, 10000, ";")) !== FALSE) {
if($row!=1){
$sql = sprintf('INSERT INTO %s ('.$fields.') VALUES ("%s")', 'flight_tbl' , implode('", "',array_map('mysql_escape_string', $data)));
mysql_query("SET names latin5");
mysql_query($sql);
}
$row++;
|
php
|
mysql
| null | null | null |
01/27/2012 03:15:48
|
too localized
|
Change value in an array
===
I am import from a CSV to Mysql, every works fines the only problem is i have to convert normal date to mysql date. can anyone help.
$row=1;
if (($handle = fopen($_FILES['Filedata']['tmp_name'], "r")) !== FALSE) {
while (($data = fgetcsv($handle, 10000, ";")) !== FALSE) {
if($row!=1){
$sql = sprintf('INSERT INTO %s ('.$fields.') VALUES ("%s")', 'flight_tbl' , implode('", "',array_map('mysql_escape_string', $data)));
mysql_query("SET names latin5");
mysql_query($sql);
}
$row++;
| 3 |
6,748,409 |
07/19/2011 14:02:00
| 839,620 |
07/11/2011 20:34:14
| 36 | 1 |
Head First Design Patterns vs Head First Object Oriented Analysis and Design
|
Currently I am in the process of learning Java via Head First Java and am beginning to look ahead at reading more about OOP / design patterns.
My question is which book I should pursue after Head First Java. I am torn between Head First Design Patterns and Head First Object Oriented Analysis and Design. No doubt, I probably should read both, but I am not exactly sure what the difference is between the two and which would be more suitable as a follow up to Head First Java.
Any suggestions or details from those who have read these would be greatly appreciated.
|
design-patterns
|
object-oriented-analysis
| null | null | null |
07/21/2011 01:37:25
|
off topic
|
Head First Design Patterns vs Head First Object Oriented Analysis and Design
===
Currently I am in the process of learning Java via Head First Java and am beginning to look ahead at reading more about OOP / design patterns.
My question is which book I should pursue after Head First Java. I am torn between Head First Design Patterns and Head First Object Oriented Analysis and Design. No doubt, I probably should read both, but I am not exactly sure what the difference is between the two and which would be more suitable as a follow up to Head First Java.
Any suggestions or details from those who have read these would be greatly appreciated.
| 2 |
11,411,978 |
07/10/2012 11:07:04
| 255,507 |
01/21/2010 05:34:18
| 278 | 4 |
Android Documentation loading very slow
|
After updating documentation with this Jelly Bean update, the normal API reference documentation stored on local machine is taking quite a while to load. In fact checking document from developer.android.com is a bit faster to access.
Any clues or work around to make it faster ?
--Tushar
|
android
|
documentation
|
jelly-bean
| null | null |
07/11/2012 01:45:59
|
not a real question
|
Android Documentation loading very slow
===
After updating documentation with this Jelly Bean update, the normal API reference documentation stored on local machine is taking quite a while to load. In fact checking document from developer.android.com is a bit faster to access.
Any clues or work around to make it faster ?
--Tushar
| 1 |
5,470,431 |
03/29/2011 09:27:55
| 638,007 |
02/28/2011 16:17:19
| 22 | 0 |
How to bind datalist with mulitple datasources
|
Can I bind a datalist with 2 datasource. The scenario is my data list is bound on the design view which displays a list of products, What I want to acheive is , when a user clicks on a side menu filter , the datalist should show the results with respect to that filter click, but i dunno how to disable the previous binding of datalist and bind it with a new datalist depending on the clicked filter option. Any help or suggestions will be appreciated
|
data-binding
|
datasource
|
datalist
| null | null | null |
open
|
How to bind datalist with mulitple datasources
===
Can I bind a datalist with 2 datasource. The scenario is my data list is bound on the design view which displays a list of products, What I want to acheive is , when a user clicks on a side menu filter , the datalist should show the results with respect to that filter click, but i dunno how to disable the previous binding of datalist and bind it with a new datalist depending on the clicked filter option. Any help or suggestions will be appreciated
| 0 |
7,481,821 |
09/20/2011 07:54:30
| 921,143 |
08/31/2011 07:41:59
| 1 | 2 |
Sorting JSON Arrays does not work
|
Please forgive me. My Questin is similar to [Sorting an associative array in PHP](http://stackoverflow.com/questions/777597/sorting-an-associative-array-in-php), but if you take a close look is that the last 4 name on this pic are not in alphabetical order !
http://imageshare.web.id/images/gpvkszm4vnxgiduo4avc.jpg
When I do a print_r($coords); I get an array is like this:
Array
(
[0] => Array
(
[lat] => -29.118130
[lon] => 26.223091
[branch_id] => 103
[name] => STUTTAFORD VAN LINES BLOEMFONTEIN
)
[1] => Array
(
[lat] => -33.923776
[lon] => 18.423346
[branch_id] => 104
[name] => STUTTAFORD VAN LINES CAPE TOWN
)
[2] => Array
(
[lat] => -29.857003
[lon] => 31.024794
[branch_id] => 105
[name] => STUTTAFORD VAN LINES DURBAN
)
The file I use to order looks like so:
$coords = WsapiClient::get(
"{$config['wsapi_url']}/branches/coords/all.json?brand=stuttafords",
array('decode_json' => true)
);
function cmp($a, $b){
if ($a['name'] == $b['name']){
return 0;
}
return strnatcmp($a['name'], $b['name']);
}
usort($coords, 'cmp');
|
php
|
arrays
|
web-services
|
sorting
| null |
09/21/2011 08:26:27
|
too localized
|
Sorting JSON Arrays does not work
===
Please forgive me. My Questin is similar to [Sorting an associative array in PHP](http://stackoverflow.com/questions/777597/sorting-an-associative-array-in-php), but if you take a close look is that the last 4 name on this pic are not in alphabetical order !
http://imageshare.web.id/images/gpvkszm4vnxgiduo4avc.jpg
When I do a print_r($coords); I get an array is like this:
Array
(
[0] => Array
(
[lat] => -29.118130
[lon] => 26.223091
[branch_id] => 103
[name] => STUTTAFORD VAN LINES BLOEMFONTEIN
)
[1] => Array
(
[lat] => -33.923776
[lon] => 18.423346
[branch_id] => 104
[name] => STUTTAFORD VAN LINES CAPE TOWN
)
[2] => Array
(
[lat] => -29.857003
[lon] => 31.024794
[branch_id] => 105
[name] => STUTTAFORD VAN LINES DURBAN
)
The file I use to order looks like so:
$coords = WsapiClient::get(
"{$config['wsapi_url']}/branches/coords/all.json?brand=stuttafords",
array('decode_json' => true)
);
function cmp($a, $b){
if ($a['name'] == $b['name']){
return 0;
}
return strnatcmp($a['name'], $b['name']);
}
usort($coords, 'cmp');
| 3 |
10,255,101 |
04/21/2012 00:28:27
| 1,345,133 |
04/19/2012 21:19:35
| 3 | 0 |
Tab Sound stops on multiple clicks
|
I was running some tests and noticed that after I click my tabs about..hmm..10 times maybe? My click sound disappears all together. Do I need to add some type of onpauses or something? What should I add to this code to make it work?
tabHost.setOnTabChangedListener(new OnTabChangeListener() {
@Override
public void onTabChanged(String tabId) {
//PLAY SOUND HERE
final MediaPlayer tabClick = MediaPlayer.create(TabBarActivity.this, R.raw.click);
tabClick.start();
}
});
|
android
|
android-widget
| null | null | null | null |
open
|
Tab Sound stops on multiple clicks
===
I was running some tests and noticed that after I click my tabs about..hmm..10 times maybe? My click sound disappears all together. Do I need to add some type of onpauses or something? What should I add to this code to make it work?
tabHost.setOnTabChangedListener(new OnTabChangeListener() {
@Override
public void onTabChanged(String tabId) {
//PLAY SOUND HERE
final MediaPlayer tabClick = MediaPlayer.create(TabBarActivity.this, R.raw.click);
tabClick.start();
}
});
| 0 |
6,136,738 |
05/26/2011 09:57:09
| 174,908 |
09/17/2009 11:37:21
| 85 | 0 |
FTP connection issue
|
When I try to connect to my host i get a timeout error
<pre>
Status: Resolving address of ftp.thetascript.com
Status: Connecting to 204.152.255.21:21...
Status: Connection established, waiting for welcome message...
Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Response: 220-You are user number 5 of 50 allowed.
Response: 220-Local time is now 02:42. Server port: 21.
Response: 220-IPv6 connections are also welcome on this server.
Response: 220 You will be disconnected after 15 minutes of inactivity.
Command: USER thetascr
Response: 331 User thetascr OK. Password required
Command: PASS ********
Response: 230 OK. Current restricted directory is /
Command: SYST
Response: 215 UNIX Type: L8
Command: FEAT
Response: 211-Extensions supported:
Response: EPRT
Response: IDLE
Response: MDTM
Response: SIZE
Response: REST STREAM
Response: MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
Response: MLSD
Response: AUTH TLS
Response: PBSZ
Response: PROT
Response: ESTA
Response: PASV
Response: EPSV
Response: SPSV
Response: ESTP
Response: 211 End.
Status: Connected
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is your current location
Command: TYPE I
Response: 200 TYPE is now 8-bit binary
Command: PASV
Response: 227 Entering Passive Mode (204,152,255,21,144,23)
Command: MLSD
Response: 150 Accepted data connection
Response: 226-Options: -a -l
Response: 226 19 matches total
Error: Connection timed out
Error: Failed to retrieve directory listing
Status: Resolving address of ftp.thetascript.com
Status: Connecting to 204.152.255.21:21...
Status: Connection established, waiting for welcome message...
Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Response: 220-You are user number 5 of 50 allowed.
Response: 220-Local time is now 02:43. Server port: 21.
Response: 220-IPv6 connections are also welcome on this server.
Response: 220 You will be disconnected after 15 minutes of inactivity.
Command: USER thetascr
Response: 331 User thetascr OK. Password required
Command: PASS ********
Response: 230 OK. Current restricted directory is /
Status: Connected
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is your current location
Command: TYPE I
Response: 200 TYPE is now 8-bit binary
Command: PASV
Response: 227 Entering Passive Mode (204,152,255,21,148,129)
Command: MLSD
Response: 150 Accepted data connection
Response: 226-Options: -a -l
Response: 226 19 matches total
Error: Connection timed out
Error: Failed to retrieve directory listing
</pre
|
ftp
| null | null | null | null |
05/26/2011 10:47:27
|
off topic
|
FTP connection issue
===
When I try to connect to my host i get a timeout error
<pre>
Status: Resolving address of ftp.thetascript.com
Status: Connecting to 204.152.255.21:21...
Status: Connection established, waiting for welcome message...
Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Response: 220-You are user number 5 of 50 allowed.
Response: 220-Local time is now 02:42. Server port: 21.
Response: 220-IPv6 connections are also welcome on this server.
Response: 220 You will be disconnected after 15 minutes of inactivity.
Command: USER thetascr
Response: 331 User thetascr OK. Password required
Command: PASS ********
Response: 230 OK. Current restricted directory is /
Command: SYST
Response: 215 UNIX Type: L8
Command: FEAT
Response: 211-Extensions supported:
Response: EPRT
Response: IDLE
Response: MDTM
Response: SIZE
Response: REST STREAM
Response: MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
Response: MLSD
Response: AUTH TLS
Response: PBSZ
Response: PROT
Response: ESTA
Response: PASV
Response: EPSV
Response: SPSV
Response: ESTP
Response: 211 End.
Status: Connected
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is your current location
Command: TYPE I
Response: 200 TYPE is now 8-bit binary
Command: PASV
Response: 227 Entering Passive Mode (204,152,255,21,144,23)
Command: MLSD
Response: 150 Accepted data connection
Response: 226-Options: -a -l
Response: 226 19 matches total
Error: Connection timed out
Error: Failed to retrieve directory listing
Status: Resolving address of ftp.thetascript.com
Status: Connecting to 204.152.255.21:21...
Status: Connection established, waiting for welcome message...
Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Response: 220-You are user number 5 of 50 allowed.
Response: 220-Local time is now 02:43. Server port: 21.
Response: 220-IPv6 connections are also welcome on this server.
Response: 220 You will be disconnected after 15 minutes of inactivity.
Command: USER thetascr
Response: 331 User thetascr OK. Password required
Command: PASS ********
Response: 230 OK. Current restricted directory is /
Status: Connected
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is your current location
Command: TYPE I
Response: 200 TYPE is now 8-bit binary
Command: PASV
Response: 227 Entering Passive Mode (204,152,255,21,148,129)
Command: MLSD
Response: 150 Accepted data connection
Response: 226-Options: -a -l
Response: 226 19 matches total
Error: Connection timed out
Error: Failed to retrieve directory listing
</pre
| 2 |
7,538,048 |
09/24/2011 09:03:38
| 1,009,669 |
09/18/2011 04:14:03
| 31 | 0 |
C# issue with overriding ToString()
|
having a slight issue overriding ToString(). I need ToString to return a count of something. However, no matter how i change this code i keep getting this error: "no suitable method found to override. Any help would be appreciated! Below is one version of the code i was attempting to implement.
public class DisplayTextFileInfo
{
public static void displayText(String kFolderOnDisk, String File)
{
Int32 wordCount = 0;
String number = null;
DisplayMediaInfo.theMainDisplay(kFolderOnDisk, File);
wordCount = CountWords.CountWords1(File);
number = wordCount.ToString();
TextFile text = new TextFile { numberOfWords = number };
Console.WriteLine("Word Count:" + text);
}
}
class TextFile
{
public String numberOfWords { get; set; }
public TextFile()
{
numberOfWords = null;
}
//public override String ToString(){}
public override String ToString()
{
return numberOfWords;
}
}
|
c#
|
override
|
tostring
| null | null |
09/24/2011 13:27:49
|
not a real question
|
C# issue with overriding ToString()
===
having a slight issue overriding ToString(). I need ToString to return a count of something. However, no matter how i change this code i keep getting this error: "no suitable method found to override. Any help would be appreciated! Below is one version of the code i was attempting to implement.
public class DisplayTextFileInfo
{
public static void displayText(String kFolderOnDisk, String File)
{
Int32 wordCount = 0;
String number = null;
DisplayMediaInfo.theMainDisplay(kFolderOnDisk, File);
wordCount = CountWords.CountWords1(File);
number = wordCount.ToString();
TextFile text = new TextFile { numberOfWords = number };
Console.WriteLine("Word Count:" + text);
}
}
class TextFile
{
public String numberOfWords { get; set; }
public TextFile()
{
numberOfWords = null;
}
//public override String ToString(){}
public override String ToString()
{
return numberOfWords;
}
}
| 1 |
274,408 |
11/08/2008 05:33:51
| 1,108 |
08/12/2008 12:16:28
| 215 | 10 |
Using SMO to get create script for table defaults
|
I'm trying to create a database scripter tool for a local database I'm using.
I've been able to generate create scripts for the tables, primary keys, indexes, and foreign keys, but I can't find any way to generate create scripts for the table defaults.
For indexes, it's as easy as
foreach (Index index in table.Indexes)
{
ScriptingOptions drop = new ScriptingOptions();
drop.ScriptDrops = true;
drop.IncludeIfNotExists = true;
foreach (string dropstring in index.Script(drop))
{
createScript.Append(dropstring);
}
ScriptingOptions create = new ScriptingOptions();
create.IncludeIfNotExists = true;
foreach (string createstring in index.Script(create))
{
createScript.Append(createstring);
}
}
But the Table object doesn't have a Defaults property. Is there some other way to generate scripts for the table defaults?
|
c#
|
smo
|
sql-server
| null | null | null |
open
|
Using SMO to get create script for table defaults
===
I'm trying to create a database scripter tool for a local database I'm using.
I've been able to generate create scripts for the tables, primary keys, indexes, and foreign keys, but I can't find any way to generate create scripts for the table defaults.
For indexes, it's as easy as
foreach (Index index in table.Indexes)
{
ScriptingOptions drop = new ScriptingOptions();
drop.ScriptDrops = true;
drop.IncludeIfNotExists = true;
foreach (string dropstring in index.Script(drop))
{
createScript.Append(dropstring);
}
ScriptingOptions create = new ScriptingOptions();
create.IncludeIfNotExists = true;
foreach (string createstring in index.Script(create))
{
createScript.Append(createstring);
}
}
But the Table object doesn't have a Defaults property. Is there some other way to generate scripts for the table defaults?
| 0 |
5,752,397 |
04/22/2011 04:53:49
| 590,849 |
01/26/2011 15:42:56
| 140 | 9 |
what is a better way to do multithreading
|
i have an application in which i have a UI activity which is supposed to display data which is retrieved after xml parsing done in another class.
during the xml parsing what i am doing is showing a progressdialog. i pass the handler of my ui activity to the thread doing xml parsing and when parsing is done , the xmlparser therad, using the handler that i have passed dispatches a message which is received by the UI activity after which it starts displaying the data.
the above is how i am doing multithreading.
is there a better way to do the same?
thank you in advance.
|
android
| null | null | null | null | null |
open
|
what is a better way to do multithreading
===
i have an application in which i have a UI activity which is supposed to display data which is retrieved after xml parsing done in another class.
during the xml parsing what i am doing is showing a progressdialog. i pass the handler of my ui activity to the thread doing xml parsing and when parsing is done , the xmlparser therad, using the handler that i have passed dispatches a message which is received by the UI activity after which it starts displaying the data.
the above is how i am doing multithreading.
is there a better way to do the same?
thank you in advance.
| 0 |
5,858,877 |
05/02/2011 15:12:54
| 477,013 |
10/15/2010 14:48:56
| 31 | 4 |
Is there an advantage to using Bash over Perl or Python?
|
Hey I've been using Linux for a while and thought it was time to finally dive into shell scripting.
The problem is I've failed to find any significant advantage of using Bash over something like Perl or Python. Are there any performance or power differences between the two? I'd figure Python/Perl would be more well suited as far as power and efficiency goes.
|
python
|
linux
|
perl
|
bash
|
scripting
|
05/02/2011 18:58:39
|
not constructive
|
Is there an advantage to using Bash over Perl or Python?
===
Hey I've been using Linux for a while and thought it was time to finally dive into shell scripting.
The problem is I've failed to find any significant advantage of using Bash over something like Perl or Python. Are there any performance or power differences between the two? I'd figure Python/Perl would be more well suited as far as power and efficiency goes.
| 4 |
6,761,091 |
07/20/2011 11:22:17
| 47,322 |
12/18/2008 08:33:51
| 2,252 | 111 |
Decrypting RSA data in .NET with only a few values
|
I'm using the Javascript implementation of RSA [from this webpage][1], and I've generated my keypair there. As such, I have `p`, `q`, the public exponent, the public modulo, the private exponent and the private inverse.
How can I use .NET's `RSACryptoServiceProvider` to decrypt the ciphertext with only these values? The .NET docs list three other fields; `DP`, `DQ` and `InverseQ` which I'm not sure how to supply.
[1]: http://www.hanewin.net/encrypt/rsa/rsa-test.htm
|
.net
|
cryptography
|
rsa
| null | null | null |
open
|
Decrypting RSA data in .NET with only a few values
===
I'm using the Javascript implementation of RSA [from this webpage][1], and I've generated my keypair there. As such, I have `p`, `q`, the public exponent, the public modulo, the private exponent and the private inverse.
How can I use .NET's `RSACryptoServiceProvider` to decrypt the ciphertext with only these values? The .NET docs list three other fields; `DP`, `DQ` and `InverseQ` which I'm not sure how to supply.
[1]: http://www.hanewin.net/encrypt/rsa/rsa-test.htm
| 0 |
5,849,289 |
05/01/2011 15:23:17
| 328,146 |
04/28/2010 17:29:31
| 115 | 7 |
Inno Setup refresh desktop
|
Is it possible to refresh the desktop using Inno Setup in the [Code] section?
Either by using SendMessage or somehow use SHChangeNotify?
|
windows
|
inno-setup
|
pascal
| null | null | null |
open
|
Inno Setup refresh desktop
===
Is it possible to refresh the desktop using Inno Setup in the [Code] section?
Either by using SendMessage or somehow use SHChangeNotify?
| 0 |
3,419,721 |
08/05/2010 22:29:10
| 293,039 |
03/13/2010 16:56:07
| 198 | 2 |
Cocoa performClick: in awakeFromNib not working
|
Im trying to call `performClick:` from `awakeFromNib` and its not working. I think its because it needs a sender and `awakeFromNib` has no sender. I have tried using `nil`,`self` and `sender` as the sender of `performClick:` but none seem to work. My code is
- (void)awakeFromNib {
[myButton performClick:sender];
}
Can anyone think of a work around for this? Thanks for any help
|
cocoa
|
nib
|
sender
| null | null | null |
open
|
Cocoa performClick: in awakeFromNib not working
===
Im trying to call `performClick:` from `awakeFromNib` and its not working. I think its because it needs a sender and `awakeFromNib` has no sender. I have tried using `nil`,`self` and `sender` as the sender of `performClick:` but none seem to work. My code is
- (void)awakeFromNib {
[myButton performClick:sender];
}
Can anyone think of a work around for this? Thanks for any help
| 0 |
7,481,785 |
09/20/2011 07:50:54
| 954,257 |
09/20/2011 07:50:54
| 1 | 0 |
My first Jquery Plugin
|
i recently started learning jquery and created a plugin for **preventing browser autofill/suggestion**. Could you guyz see and let me know if i can do it any better?
Here's the code
(function($){
var sTime = new Date().getTime();
$(function(){
return $('form').each(function(i, frm){
var inputs = $(frm +':input');
$.each(inputs, function(){
if($(this).attr('type') == 'text')
$(this).attr('name', $(this).attr('name') + "_" + sTime);
});
$(frm).bind('submit', function(){
var inputs = $(frm +':input');
$.each(inputs, function(){
if($(this).attr('type') == 'text')
$(this).attr('name', $(this).attr('name').replace('_'+sTime, ''));
});
})
})
})
})(jQuery);
Thanks a bunch
|
javascript
|
jquery
| null | null | null |
09/20/2011 09:28:25
|
off topic
|
My first Jquery Plugin
===
i recently started learning jquery and created a plugin for **preventing browser autofill/suggestion**. Could you guyz see and let me know if i can do it any better?
Here's the code
(function($){
var sTime = new Date().getTime();
$(function(){
return $('form').each(function(i, frm){
var inputs = $(frm +':input');
$.each(inputs, function(){
if($(this).attr('type') == 'text')
$(this).attr('name', $(this).attr('name') + "_" + sTime);
});
$(frm).bind('submit', function(){
var inputs = $(frm +':input');
$.each(inputs, function(){
if($(this).attr('type') == 'text')
$(this).attr('name', $(this).attr('name').replace('_'+sTime, ''));
});
})
})
})
})(jQuery);
Thanks a bunch
| 2 |
8,516,142 |
12/15/2011 06:49:54
| 1,085,187 |
12/07/2011 08:20:05
| 1 | 0 |
How to decimal point covert to hex point in C language
|
How to use decimal point covert to hex point in C language programming
|
c
| null | null | null | null |
12/15/2011 06:57:57
|
not a real question
|
How to decimal point covert to hex point in C language
===
How to use decimal point covert to hex point in C language programming
| 1 |
9,780,259 |
03/20/2012 01:25:53
| 1,099,093 |
12/15/2011 03:44:02
| 127 | 6 |
Java TFTP implementation with std libs - how to ack packets?
|
I have tried to implement a TFTP client / server. As per RFC 1350 i got everything right only thing missing now is to confirm each packet that is received by whoever is receiving it be it client or server.
1. Server sends a datagram packet
2. Client receives the datagram packet and sends back ACK ("confirm") msg in a packet
3. Server sends next packet
If Client does not send ACK in say 20s then Server transferes the same packet again until it receives ACK from the Client.
Here is my method for sending and receiving packets. They both work i just need to add the above but i have no absolutely no clue how to implement that.
Server:
private void receiveData() throws Exception
{
Calendar cal = Calendar.getInstance();
SimpleDateFormat prefix = new SimpleDateFormat(date_format);
String date = prefix.format(cal.getTime()).toString();
DatagramPacket receiveData = new DatagramPacket(incomingData, incomingData.length);
OutputStream fos = new FileOutputStream(new File(date+data));
while(true)
{
clientSocket.receive(receiveData);
if(receiveData.getLength() == 512)
{
fos.write(receiveData.getData());
} else {
fos.write(receiveData.getData(), receiveData.getOffset(), receiveData.getLength());
break;
}
}
fos.close();
clientSocket.close();
}
Client:
private void sendData() throws Exception {
DatagramPacket data = new DatagramPacket(outgoingData,
outgoingData.length, clientAddress, clientPort);
InputStream fis = new FileInputStream(responseData);
int a;
while ((a = fis.read(outgoingData, 0, 512)) != -1) {
data.setLength(a);
serverSocket.send(data);
Thread.sleep(5);
}
fis.close();
I am just learning about network programing so would be thankful for any suggestions or code examples.
|
java
|
sockets
|
network-programming
| null | null | null |
open
|
Java TFTP implementation with std libs - how to ack packets?
===
I have tried to implement a TFTP client / server. As per RFC 1350 i got everything right only thing missing now is to confirm each packet that is received by whoever is receiving it be it client or server.
1. Server sends a datagram packet
2. Client receives the datagram packet and sends back ACK ("confirm") msg in a packet
3. Server sends next packet
If Client does not send ACK in say 20s then Server transferes the same packet again until it receives ACK from the Client.
Here is my method for sending and receiving packets. They both work i just need to add the above but i have no absolutely no clue how to implement that.
Server:
private void receiveData() throws Exception
{
Calendar cal = Calendar.getInstance();
SimpleDateFormat prefix = new SimpleDateFormat(date_format);
String date = prefix.format(cal.getTime()).toString();
DatagramPacket receiveData = new DatagramPacket(incomingData, incomingData.length);
OutputStream fos = new FileOutputStream(new File(date+data));
while(true)
{
clientSocket.receive(receiveData);
if(receiveData.getLength() == 512)
{
fos.write(receiveData.getData());
} else {
fos.write(receiveData.getData(), receiveData.getOffset(), receiveData.getLength());
break;
}
}
fos.close();
clientSocket.close();
}
Client:
private void sendData() throws Exception {
DatagramPacket data = new DatagramPacket(outgoingData,
outgoingData.length, clientAddress, clientPort);
InputStream fis = new FileInputStream(responseData);
int a;
while ((a = fis.read(outgoingData, 0, 512)) != -1) {
data.setLength(a);
serverSocket.send(data);
Thread.sleep(5);
}
fis.close();
I am just learning about network programing so would be thankful for any suggestions or code examples.
| 0 |
9,219,641 |
02/09/2012 22:13:59
| 459,343 |
09/27/2010 09:54:20
| 320 | 12 |
AVPlayer video won't mirror
|
I have an app that plays streamed videos on iOS devices using AVPlayer. The app also allows the user to watch the media through Apple TV using AirPlay.
Allowing the video to play over AirPlay works fine. However, I have a problem on devices which support mirroring either over AirPlay or using an AV cable.
Using devices such as the iPhone 4S or iPad 2, the app itself is correctly mirrored but whenever the video plays it only plays on the device, and does not mirror to the TV screen.
In other similar apps I've been able to use MPMoviePlayerController and this mirrors correctly without any problems. Unfortunately, I'm not able to use this approach here.
Has anyone successfully gotten AVPlayer to mirror correctly? As I say, using AirPlay alone works fine, it is just AirPlay or cabled mirroring that's the issue.
|
ios
|
ios5
|
avplayer
|
http-live-streaming
|
airplay
| null |
open
|
AVPlayer video won't mirror
===
I have an app that plays streamed videos on iOS devices using AVPlayer. The app also allows the user to watch the media through Apple TV using AirPlay.
Allowing the video to play over AirPlay works fine. However, I have a problem on devices which support mirroring either over AirPlay or using an AV cable.
Using devices such as the iPhone 4S or iPad 2, the app itself is correctly mirrored but whenever the video plays it only plays on the device, and does not mirror to the TV screen.
In other similar apps I've been able to use MPMoviePlayerController and this mirrors correctly without any problems. Unfortunately, I'm not able to use this approach here.
Has anyone successfully gotten AVPlayer to mirror correctly? As I say, using AirPlay alone works fine, it is just AirPlay or cabled mirroring that's the issue.
| 0 |
2,581,471 |
04/05/2010 22:05:43
| 309,558 |
04/05/2010 22:03:01
| 1 | 0 |
Android Image Orientation Issue on Motorola Droid
|
Our app uses the gallery pick action to grab an image from the device to upload to a new blog post. We're seeing on the Moto Droid that images taken in portrait are being sent back to the app in landscape orientation so the image is sideways. AFAIK this only occurs on the Droid.
Found this via google, but we need the full size image to be uploaded in the correct orientation so the solution doesn't work for us:
http://groups.google.com/group/android-developers/browse_frm/thread/1246475fd4c3fdb6?pli=1
An easy way to reproduce this is to take a picture in portrait on the Droid, then send it to yourself via Gmail. In the email message, the image will be in landscape (sideways). I've tested on the droid 2.1 update and the issue is still there.
|
android
|
image
|
orientation
|
motorola
| null | null |
open
|
Android Image Orientation Issue on Motorola Droid
===
Our app uses the gallery pick action to grab an image from the device to upload to a new blog post. We're seeing on the Moto Droid that images taken in portrait are being sent back to the app in landscape orientation so the image is sideways. AFAIK this only occurs on the Droid.
Found this via google, but we need the full size image to be uploaded in the correct orientation so the solution doesn't work for us:
http://groups.google.com/group/android-developers/browse_frm/thread/1246475fd4c3fdb6?pli=1
An easy way to reproduce this is to take a picture in portrait on the Droid, then send it to yourself via Gmail. In the email message, the image will be in landscape (sideways). I've tested on the droid 2.1 update and the issue is still there.
| 0 |
9,394,225 |
02/22/2012 11:51:46
| 1,216,463 |
02/17/2012 14:32:32
| 1 | 0 |
difference between webservices and API'S?
|
What is the difference between webservices and API'S accesed through http ..
ONTO MY UNDERSTANDING BOTH ARE used for calling external websites or app's services..
plz tell me with some examples on it.
Thanks in advance
|
ruby-on-rails
|
web-services
|
api
| null | null |
02/22/2012 22:18:44
|
not constructive
|
difference between webservices and API'S?
===
What is the difference between webservices and API'S accesed through http ..
ONTO MY UNDERSTANDING BOTH ARE used for calling external websites or app's services..
plz tell me with some examples on it.
Thanks in advance
| 4 |
10,388,883 |
04/30/2012 18:46:31
| 1,321,210 |
04/09/2012 05:04:05
| 11 | 0 |
Mysql SELECT column from 3 tables
|
I've three tables,i want all columns with where condtion a=0 and b=0 and c=1
![enter image description here][1]
[1]: http://i.stack.imgur.com/7WelX.png
|
mysql
|
select
| null | null | null | null |
open
|
Mysql SELECT column from 3 tables
===
I've three tables,i want all columns with where condtion a=0 and b=0 and c=1
![enter image description here][1]
[1]: http://i.stack.imgur.com/7WelX.png
| 0 |
9,368,539 |
02/20/2012 21:17:29
| 849,359 |
07/18/2011 04:43:33
| 221 | 2 |
Web application framework that can handle the most concurrent users?
|
I would like some information (preferably performance tests) on existing web app frameworks that show which one could handle the most number of concurrent users (on a single server without scaling out horizontally).
(node.js seems to handle requests in a very speedy fashion and has been shown to handle a high number of concurrent request on a single server (and thread). However, it constitutes an api not a web app framework.)
|
php
|
asp.net
|
ruby-on-rails
| null | null |
02/20/2012 21:28:47
|
not constructive
|
Web application framework that can handle the most concurrent users?
===
I would like some information (preferably performance tests) on existing web app frameworks that show which one could handle the most number of concurrent users (on a single server without scaling out horizontally).
(node.js seems to handle requests in a very speedy fashion and has been shown to handle a high number of concurrent request on a single server (and thread). However, it constitutes an api not a web app framework.)
| 4 |
11,062,709 |
06/16/2012 10:40:59
| 1,263,313 |
03/12/2012 04:47:29
| 1 | 0 |
Installation of joomla in localhost
|
i have the database and when i want install the joomla and try to run it. It gives an error like that "Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 71 bytes) in /var/www/alichec-joomla/trunk/libraries/joomla/error/exception.php on line 117"
|
joomla
|
installation
| null | null | null | null |
open
|
Installation of joomla in localhost
===
i have the database and when i want install the joomla and try to run it. It gives an error like that "Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 71 bytes) in /var/www/alichec-joomla/trunk/libraries/joomla/error/exception.php on line 117"
| 0 |
11,643,049 |
07/25/2012 05:03:37
| 1,462,833 |
06/18/2012 05:50:49
| 27 | 3 |
TypeError: Error #1010 in AS3 in accordion
|
I had created Accordion in flash. and I am getting following error
TypeError: Error #1010: A term is undefined and has no properties.
at accordionSub_fla::accordionMain_1/mouserOver()
But, this error is only reflecting on Panel3, I have 9 Panels, all of them are working fine except Panel3 and this Panel3 is not opening only. Below is the code of function
function mouserOver(e:MouseEvent):void {
var overed:MovieClip = MovieClip(e.target);
for(var i:int=0; i<numChildren; i++)
{
var mc:MovieClip = MovieClip(getChildAt(i));
if(mc.props.ind <= overed.props.ind)
{
TweenLite.to(mc, 1, {x:mc.props.lx, ease:Expo.easeOut});
var request:URLRequest = new URLRequest(mc.props.links);
myTimer.start();
myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, urlAction);
function urlAction(evt:TimerEvent)
{
navigateToURL(request, 'myFrame');
}
}
else
{
TweenLite.to(mc, 1, {x:mc.props.rx, ease:Expo.easeOut});
}
}}
Any immediate response will be helpful. Thanks.
|
actionscript-3
|
flash
|
accordion
|
typeerror
| null | null |
open
|
TypeError: Error #1010 in AS3 in accordion
===
I had created Accordion in flash. and I am getting following error
TypeError: Error #1010: A term is undefined and has no properties.
at accordionSub_fla::accordionMain_1/mouserOver()
But, this error is only reflecting on Panel3, I have 9 Panels, all of them are working fine except Panel3 and this Panel3 is not opening only. Below is the code of function
function mouserOver(e:MouseEvent):void {
var overed:MovieClip = MovieClip(e.target);
for(var i:int=0; i<numChildren; i++)
{
var mc:MovieClip = MovieClip(getChildAt(i));
if(mc.props.ind <= overed.props.ind)
{
TweenLite.to(mc, 1, {x:mc.props.lx, ease:Expo.easeOut});
var request:URLRequest = new URLRequest(mc.props.links);
myTimer.start();
myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, urlAction);
function urlAction(evt:TimerEvent)
{
navigateToURL(request, 'myFrame');
}
}
else
{
TweenLite.to(mc, 1, {x:mc.props.rx, ease:Expo.easeOut});
}
}}
Any immediate response will be helpful. Thanks.
| 0 |
7,359,637 |
09/09/2011 09:30:27
| 936,491 |
09/09/2011 09:30:27
| 1 | 0 |
Map::using size() and looping
|
int main()
{
map<int,employee> employees;
employee e1;
strcpy(e1.nname,"aaa");
e1.salary=25000;
employee e2;
strcpy(e2.nname,"ccc");
e2.salary=26000;
employees[1]=e1;
employees[2]=e2;
employee e3;
strcpy(e3.nname,"bbb");
e3.salary=26000;
employees[5]=e3;
employee ee;
cout<<employees.size()<<endl;
for(int i=0;i<employees.size();i++)
{
ee=employees[i];
cout<<ee.nname<<endl;
}
o/p: 3 - //so i=3 displays employees[0],1,2,3
aaa - //i=
ccc -
- //2 blank lines
- // <---why blank line cming ,ok cause no data but why it
bbb - //executed 4th and 5th time and we got
// employees[5] ----- bbb?????
//when i printed value of"i" i got from 0 to 5!!!
can any1 explain thanx in advance
|
c++
| null | null | null | null |
09/09/2011 12:07:28
|
not a real question
|
Map::using size() and looping
===
int main()
{
map<int,employee> employees;
employee e1;
strcpy(e1.nname,"aaa");
e1.salary=25000;
employee e2;
strcpy(e2.nname,"ccc");
e2.salary=26000;
employees[1]=e1;
employees[2]=e2;
employee e3;
strcpy(e3.nname,"bbb");
e3.salary=26000;
employees[5]=e3;
employee ee;
cout<<employees.size()<<endl;
for(int i=0;i<employees.size();i++)
{
ee=employees[i];
cout<<ee.nname<<endl;
}
o/p: 3 - //so i=3 displays employees[0],1,2,3
aaa - //i=
ccc -
- //2 blank lines
- // <---why blank line cming ,ok cause no data but why it
bbb - //executed 4th and 5th time and we got
// employees[5] ----- bbb?????
//when i printed value of"i" i got from 0 to 5!!!
can any1 explain thanx in advance
| 1 |
10,207,629 |
04/18/2012 10:35:48
| 1,312,393 |
04/04/2012 09:00:26
| 10 | 1 |
Using a button to show a hidden div when clicked
|
I have been trying to make a button on my site load a div called step2. I have used this method before and had no problems however nothing seems to be happening this time.
Here is the code I wrote to make the step 2 div appear when the button is clicked:
$('#startbutton').click(function() {
$('#step2').show();
});
And here is the HTML code for the button:
<a id="startbutton" class="refer"><span>Invite Your Friends</span></a>
Finally I have the CSS for #step2 to:
display:none;
so that it is hidden when the page loads.
Would be very greatful if someone could help.
Is there something wrong with my code?
|
jquery
|
div
|
hide
|
show
| null |
04/18/2012 11:37:58
|
too localized
|
Using a button to show a hidden div when clicked
===
I have been trying to make a button on my site load a div called step2. I have used this method before and had no problems however nothing seems to be happening this time.
Here is the code I wrote to make the step 2 div appear when the button is clicked:
$('#startbutton').click(function() {
$('#step2').show();
});
And here is the HTML code for the button:
<a id="startbutton" class="refer"><span>Invite Your Friends</span></a>
Finally I have the CSS for #step2 to:
display:none;
so that it is hidden when the page loads.
Would be very greatful if someone could help.
Is there something wrong with my code?
| 3 |
8,388,503 |
12/05/2011 16:31:31
| 1,069,487 |
11/28/2011 14:18:37
| 33 | 1 |
Listen to bindable property in bindable Arraycollection
|
I've got a bindable model class (lets call it myModel) with two properties, label and value. The value gets updated frequently, so it is marked as bindable.
Works fine so far, the data is updated and the standard property change event is dispatched.
Now I have to make an ArrayCollection from the object instances of this model to use it as a data provider in a data group. The data gets then passed to a custom itemRenderer in which I access the myModel properties via data.label and data.value.
The only problem I've got now is that the myModel value property doesn't change any more (I suppose because I stored the objects in the ArrayCollection).
The ArrayCollection is marked bindable as well btw, because new object instances of myModel can be added during runtime.
Is there any way to make this work? Any help regarding this would be much appreciated!
|
flex
|
mobile
|
itemrenderer
|
arraycollection
|
bindable
| null |
open
|
Listen to bindable property in bindable Arraycollection
===
I've got a bindable model class (lets call it myModel) with two properties, label and value. The value gets updated frequently, so it is marked as bindable.
Works fine so far, the data is updated and the standard property change event is dispatched.
Now I have to make an ArrayCollection from the object instances of this model to use it as a data provider in a data group. The data gets then passed to a custom itemRenderer in which I access the myModel properties via data.label and data.value.
The only problem I've got now is that the myModel value property doesn't change any more (I suppose because I stored the objects in the ArrayCollection).
The ArrayCollection is marked bindable as well btw, because new object instances of myModel can be added during runtime.
Is there any way to make this work? Any help regarding this would be much appreciated!
| 0 |
2,759,270 |
05/03/2010 15:48:36
| 181,707 |
09/30/2009 10:00:38
| 123 | 7 |
Complex Join - involving date ranges and sum...
|
I have two tables that I need to join... I want to join table1 and table2 on 'id' - however in table two id is not unique. I only want one value returned for table two, and this value represents the sum of a column called 'total_sold' - within a specified date range (say one month)..
SELECT ta.id, tb.total_sold as total_sold_this_week
FROM table_a as ta
LEFT JOIN table_b as tb ON ta.id=tb.id AND tb.date_sold BETWEEN ADDDATE(NOW(),INTERVAL -3 WEEK) AND NOW()
this works but does not SUM the rows - only returning one row for each id... how do I get the sum from table b instead of only one row???
Please criticise if format of question could use more work - I can rewrite and provide sample data if required - this is a trivialised version of a much larger problem.
-Thanks
|
mysql
|
join
|
sum
|
between
| null | null |
open
|
Complex Join - involving date ranges and sum...
===
I have two tables that I need to join... I want to join table1 and table2 on 'id' - however in table two id is not unique. I only want one value returned for table two, and this value represents the sum of a column called 'total_sold' - within a specified date range (say one month)..
SELECT ta.id, tb.total_sold as total_sold_this_week
FROM table_a as ta
LEFT JOIN table_b as tb ON ta.id=tb.id AND tb.date_sold BETWEEN ADDDATE(NOW(),INTERVAL -3 WEEK) AND NOW()
this works but does not SUM the rows - only returning one row for each id... how do I get the sum from table b instead of only one row???
Please criticise if format of question could use more work - I can rewrite and provide sample data if required - this is a trivialised version of a much larger problem.
-Thanks
| 0 |
9,249,597 |
02/12/2012 14:37:44
| 554,217 |
12/26/2010 09:29:16
| 927 | 2 |
working on linux with lamp and php
|
This is a bit an abstract question, but dont close..cause I am a noob at linux / linux programming..
I wanted to ask you what tutorials/books/resources do I need to read to know how to use linux well when working with lamp and php.
Every employer asked me if I know linux, and I said that I dont know..
I feel knowing linux reduces my chances in getting a job in php. So It is important for me to ask someone who knows php and works with lamp
|
php
|
linux
|
lamp
| null | null |
02/12/2012 14:58:31
|
not constructive
|
working on linux with lamp and php
===
This is a bit an abstract question, but dont close..cause I am a noob at linux / linux programming..
I wanted to ask you what tutorials/books/resources do I need to read to know how to use linux well when working with lamp and php.
Every employer asked me if I know linux, and I said that I dont know..
I feel knowing linux reduces my chances in getting a job in php. So It is important for me to ask someone who knows php and works with lamp
| 4 |
6,632,241 |
07/09/2011 02:04:35
| 836,326 |
07/09/2011 02:04:35
| 1 | 0 |
How can one add a specific part of a binary tree but keep the tree intact (Java)?
|
I am trying to write a code that searches a binary tree for an element and then adds starting at that element. So far I can find the correct position and add to that position, but I lose the rest of the binary tree.
public void add(String addroot, String addleft)
if(root!=nodesearch){
if(root.left!=null){
root=root.left;
add(addroot, addleft);
}
if(root.right!=null){
root=root.right;
add(addroot, addleft);
}
}
else
root=insert();
}
insert() adds the elements and it works fine. Thanks for any help.
|
string
|
binary-tree
|
binary-data
|
binary-search
|
adding
| null |
open
|
How can one add a specific part of a binary tree but keep the tree intact (Java)?
===
I am trying to write a code that searches a binary tree for an element and then adds starting at that element. So far I can find the correct position and add to that position, but I lose the rest of the binary tree.
public void add(String addroot, String addleft)
if(root!=nodesearch){
if(root.left!=null){
root=root.left;
add(addroot, addleft);
}
if(root.right!=null){
root=root.right;
add(addroot, addleft);
}
}
else
root=insert();
}
insert() adds the elements and it works fine. Thanks for any help.
| 0 |
6,936,913 |
08/04/2011 06:11:55
| 501,171 |
11/08/2010 21:18:10
| 1,781 | 66 |
Heroku Cedar stack and Rails 3.1 RC5 not displaying images?
|
Anyone get Rails 3.1 RC5 running on Heroku, Cedar stack? Everything seems to work so far, except that asset images (such as logo, icons, main_bg, etc.) are not being displayed.
I'm not sure if it is related to this [issue][1].
Would like to hear from anyone who was able to fix this problem.
[1]: https://github.com/rails/rails/issues/2299
|
ruby-on-rails-3
|
heroku
|
assets
|
asset-pipeline
| null | null |
open
|
Heroku Cedar stack and Rails 3.1 RC5 not displaying images?
===
Anyone get Rails 3.1 RC5 running on Heroku, Cedar stack? Everything seems to work so far, except that asset images (such as logo, icons, main_bg, etc.) are not being displayed.
I'm not sure if it is related to this [issue][1].
Would like to hear from anyone who was able to fix this problem.
[1]: https://github.com/rails/rails/issues/2299
| 0 |
2,542,002 |
03/29/2010 23:49:38
| 127,193 |
06/22/2009 20:57:14
| 93 | 1 |
is Payment table needed when you have an invoice table like this?
|
this is my invoice table:
Invoice Table:
`invoice_id`
`creation_date`
`due_date`
`payment_date`
`status` enum('not paid','paid','expired')
`user_id`
`total_price`
I wonder if it's Useful to have a payment table in order to record user payments for invoices.
payment table can be like this:
`payment_id`
`payment_date`
`invoice_id`
`price_paid`
`status` enum('successful', 'not successful')
|
database
|
database-design
|
mysql
|
sql
| null | null |
open
|
is Payment table needed when you have an invoice table like this?
===
this is my invoice table:
Invoice Table:
`invoice_id`
`creation_date`
`due_date`
`payment_date`
`status` enum('not paid','paid','expired')
`user_id`
`total_price`
I wonder if it's Useful to have a payment table in order to record user payments for invoices.
payment table can be like this:
`payment_id`
`payment_date`
`invoice_id`
`price_paid`
`status` enum('successful', 'not successful')
| 0 |
10,899,715 |
06/05/2012 14:58:57
| 1,384,737 |
05/09/2012 13:28:57
| 11 | 0 |
How to make one of the fragments full screen on landscape mode?
|
My question may seem to be a little confusing :
i'm developing an application in which i have a main activity and 4 fragments (4 pages) , i need also to indicate that i use ViewPagerIndicator to have the swipe gesture .
fist of all :
In one of my tabs (fragments) i need to play a video on full screen mode and i want force it to pass on landscape mode as well when i chose the appropriate tab ( i call it landscape tab ).
i did some digging and i found out that from the fragment , i can not do such thing ( force the window ,view , to become landscape ), or i did not found the right answer , though i used the code below but i get an error which is logic because i need to call there from the main activity as i understood it :
getActivity().requestWindowFeature(Window.FEATURE_NO_TITLE);
getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
android
|
android-fragments
|
fullscreen
|
landscape
|
videoview
| null |
open
|
How to make one of the fragments full screen on landscape mode?
===
My question may seem to be a little confusing :
i'm developing an application in which i have a main activity and 4 fragments (4 pages) , i need also to indicate that i use ViewPagerIndicator to have the swipe gesture .
fist of all :
In one of my tabs (fragments) i need to play a video on full screen mode and i want force it to pass on landscape mode as well when i chose the appropriate tab ( i call it landscape tab ).
i did some digging and i found out that from the fragment , i can not do such thing ( force the window ,view , to become landscape ), or i did not found the right answer , though i used the code below but i get an error which is logic because i need to call there from the main activity as i understood it :
getActivity().requestWindowFeature(Window.FEATURE_NO_TITLE);
getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
| 0 |
1,062,239 |
06/30/2009 07:30:32
| 120,163 |
06/09/2009 22:13:25
| 275 | 48 |
Is there a network file system for mainframes (System Z)?
|
Network file systems are offered by Windows and (L)Unix. Is there one for IBM Mainframes? (Hard to believe not). Does it offer standard Unix-style access (binary? Ascii? EBCDIC?)
to mainframe data areas? How are datasets/partitioned data sets treated?
Who configures into Z/OS? How do I find out more about such network file systems for mainframes?
|
nfs
|
file
|
system
|
mainframe
| null | null |
open
|
Is there a network file system for mainframes (System Z)?
===
Network file systems are offered by Windows and (L)Unix. Is there one for IBM Mainframes? (Hard to believe not). Does it offer standard Unix-style access (binary? Ascii? EBCDIC?)
to mainframe data areas? How are datasets/partitioned data sets treated?
Who configures into Z/OS? How do I find out more about such network file systems for mainframes?
| 0 |
7,793,929 |
10/17/2011 12:45:53
| 888,181 |
08/10/2011 15:11:17
| 54 | 5 |
Inner Join or UNION
|
For ID =101 Data is coming from different TABLE
All the TABLES have a ID column
Name Income
Table_A a $6,868
Table_B b $4,443
Table_C c $6,726
Table_D d $10,163
Table_E e $4,853
Table_F f $3,368
To get result like above Should I use UNION or Inner JOIN ?
|
sql-server
| null | null | null | null |
10/17/2011 15:33:16
|
not a real question
|
Inner Join or UNION
===
For ID =101 Data is coming from different TABLE
All the TABLES have a ID column
Name Income
Table_A a $6,868
Table_B b $4,443
Table_C c $6,726
Table_D d $10,163
Table_E e $4,853
Table_F f $3,368
To get result like above Should I use UNION or Inner JOIN ?
| 1 |
5,890,912 |
05/04/2011 23:09:57
| 736,801 |
05/03/2011 19:39:47
| 5 | 0 |
Draw a circuit realization of the exclusive OR function (XOR) with two inputs. You may use AND, OR and NOT gates.
|
I am trying to figure out a way of doing this without simply learning all the gates, how would you work this out? I am familiar with boolean algebra and drawing circuits, just not how to work out a question like this.
A similar one from another past exam paper is : Draw a circuit realization of the equivalence function (EQ) with two inputs. You may use AND, OR and NOT-gates.
Hence, why I don't want to just learn off the gates, since nearly anything could be asked.
|
homework
|
logic
|
boolean-logic
|
boolean-expression
| null |
05/06/2011 20:52:54
|
off topic
|
Draw a circuit realization of the exclusive OR function (XOR) with two inputs. You may use AND, OR and NOT gates.
===
I am trying to figure out a way of doing this without simply learning all the gates, how would you work this out? I am familiar with boolean algebra and drawing circuits, just not how to work out a question like this.
A similar one from another past exam paper is : Draw a circuit realization of the equivalence function (EQ) with two inputs. You may use AND, OR and NOT-gates.
Hence, why I don't want to just learn off the gates, since nearly anything could be asked.
| 2 |
6,091,216 |
05/22/2011 22:22:41
| 274,865 |
02/17/2010 00:34:21
| 205 | 22 |
NSView in NSCell
|
I've read a lot about this but i can't get it to work, i have a custom NSCell with this code
#import "ServiceTableCell.h"
@implementation ServiceTableCell
-(void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
NSLog(@"I'm being called");
NSView *newview = [[NSView alloc] initWithFrame:cellFrame];
NSImage *image = [NSImage imageNamed:@"bg.png"];
NSRect imagesize;
NSImageView *IMV = [[NSImageView alloc] initWithFrame:imagesize];
[IMV setImage:image];
[newview addSubview:IMV];
[controlView addSubview:newview];
}
And this my NSTableView data source:
- (long)numberOfRowsInTableView:(NSTableView *)tableView {
return 3;
}
- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(long)row
{
return [[ServiceTableCell alloc] initTextCell:@"dd"];
}
As i understand, the drawwithframe... gets called when the cell is initialized but it never gets called, so, what am I missing?
|
objective-c
|
xcode
|
cocoa
|
nstableview
|
nscell
| null |
open
|
NSView in NSCell
===
I've read a lot about this but i can't get it to work, i have a custom NSCell with this code
#import "ServiceTableCell.h"
@implementation ServiceTableCell
-(void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
NSLog(@"I'm being called");
NSView *newview = [[NSView alloc] initWithFrame:cellFrame];
NSImage *image = [NSImage imageNamed:@"bg.png"];
NSRect imagesize;
NSImageView *IMV = [[NSImageView alloc] initWithFrame:imagesize];
[IMV setImage:image];
[newview addSubview:IMV];
[controlView addSubview:newview];
}
And this my NSTableView data source:
- (long)numberOfRowsInTableView:(NSTableView *)tableView {
return 3;
}
- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(long)row
{
return [[ServiceTableCell alloc] initTextCell:@"dd"];
}
As i understand, the drawwithframe... gets called when the cell is initialized but it never gets called, so, what am I missing?
| 0 |
1,543,094 |
10/09/2009 10:50:49
| 65,359 |
02/12/2009 00:40:48
| 105 | 19 |
jQuery Autocomplete plugin (from Joern) not releasing when other elements clicked.
|
I'm using the jQuery Autocomplete plugin from http://docs.jquery.com/Plugins/Autocomplete on IE7 and it's not releasing the autocomplete when I click outside the Autocomplete input field and results.
It looks like this is a formatting bug that maybe IE7 thinks the entire form is the autocomplete section. If I click on another "focusable" element like a line of text, or another form field, or even the outer edges of the page then it goes away, but not when I click on blank elements close to the autocomplete fields (e.g. the form field)...really wierd. Anyone experience this before?
|
jquery
|
autocomplete
| null | null | null | null |
open
|
jQuery Autocomplete plugin (from Joern) not releasing when other elements clicked.
===
I'm using the jQuery Autocomplete plugin from http://docs.jquery.com/Plugins/Autocomplete on IE7 and it's not releasing the autocomplete when I click outside the Autocomplete input field and results.
It looks like this is a formatting bug that maybe IE7 thinks the entire form is the autocomplete section. If I click on another "focusable" element like a line of text, or another form field, or even the outer edges of the page then it goes away, but not when I click on blank elements close to the autocomplete fields (e.g. the form field)...really wierd. Anyone experience this before?
| 0 |
8,366,119 |
12/03/2011 06:48:10
| 775,936 |
05/30/2011 08:18:08
| 373 | 23 |
Bitwise operations in C
|
I am studying bitwise operations in C and am working on this code. For some reason it compiles fine, but when I try to run it, it fails.
int main(int argc, char** argv) {
int a;
a = test (1100);
printf(a);
return (EXIT_SUCCESS);
}
int func( int x )
{
return ((x - 1) & x) == 0;
}
What am I doing wrong ? Thanks
|
c
| null | null | null | null |
12/04/2011 22:13:39
|
not a real question
|
Bitwise operations in C
===
I am studying bitwise operations in C and am working on this code. For some reason it compiles fine, but when I try to run it, it fails.
int main(int argc, char** argv) {
int a;
a = test (1100);
printf(a);
return (EXIT_SUCCESS);
}
int func( int x )
{
return ((x - 1) & x) == 0;
}
What am I doing wrong ? Thanks
| 1 |
10,902,012 |
06/05/2012 17:30:43
| 894,237 |
08/14/2011 20:56:08
| 144 | 4 |
HTML5 Cloud annimatin
|
Anybody have any idea how they did this cloud animation on the web link below?
I can see the code but I don't know what they used to make this happen.
http://www.ro.me/
|
html5
| null | null | null | null |
07/16/2012 16:47:58
|
not a real question
|
HTML5 Cloud annimatin
===
Anybody have any idea how they did this cloud animation on the web link below?
I can see the code but I don't know what they used to make this happen.
http://www.ro.me/
| 1 |
8,656,254 |
12/28/2011 13:04:24
| 1,103,026 |
12/17/2011 03:09:28
| 8 | 0 |
Read Image failed from website Server setting
|
I want to read images from websites, but maybe there is some special setting in the Server:
http://img2.laibafile.cn/laiba/images/970457/12574220390076481899/a/1/s.jpg
If you open this link, there is a error message showing in IE.
"The requested URL could not be retrieved.Access control configuration prevents your request from being allowed at this time."
And there is the same url link show, if you click that link, you can see the image showing.
This picture is from a BBS, I can use C# HttpWebRequest to login that BBS, can get Cookie & CookieContainer, then I set new Image request the same CookieContainer to login request, also can NOT access the image URL. (I can't set cookie header string to image requst, if set there is also a URL can NOT access Exception.)
Any advice is appreciated!
|
c#
|
image
|
windows-phone-7
| null | null |
12/28/2011 14:11:06
|
too localized
|
Read Image failed from website Server setting
===
I want to read images from websites, but maybe there is some special setting in the Server:
http://img2.laibafile.cn/laiba/images/970457/12574220390076481899/a/1/s.jpg
If you open this link, there is a error message showing in IE.
"The requested URL could not be retrieved.Access control configuration prevents your request from being allowed at this time."
And there is the same url link show, if you click that link, you can see the image showing.
This picture is from a BBS, I can use C# HttpWebRequest to login that BBS, can get Cookie & CookieContainer, then I set new Image request the same CookieContainer to login request, also can NOT access the image URL. (I can't set cookie header string to image requst, if set there is also a URL can NOT access Exception.)
Any advice is appreciated!
| 3 |
4,281,080 |
11/25/2010 21:50:25
| 519,836 |
11/25/2010 08:15:45
| 52 | 0 |
Managing Templates on Member Functions
|
I have this class:
class myclass {
// Definitions of cotrs and dtor...
// ...
// Defining a method of mine that needs a template
template < typename T >
void dosome(T& par);
}
What to do in implementation in cpp file?
I thought ti was good this:
template <typename T>
void myclass::dosome< T >(T& par) {
// My code
}
But compiler gets really mad...
What's the syntax in this context? Thankyou
|
c++
|
templates
|
function
|
member
| null | null |
open
|
Managing Templates on Member Functions
===
I have this class:
class myclass {
// Definitions of cotrs and dtor...
// ...
// Defining a method of mine that needs a template
template < typename T >
void dosome(T& par);
}
What to do in implementation in cpp file?
I thought ti was good this:
template <typename T>
void myclass::dosome< T >(T& par) {
// My code
}
But compiler gets really mad...
What's the syntax in this context? Thankyou
| 0 |
7,008,961 |
08/10/2011 10:00:53
| 121,219 |
06/11/2009 10:07:46
| 436 | 11 |
SSRS '08 Object reference not set to an instance of an object
|
Full error from Preview window in Visual Studio '08 (BIDS): "An error occurred during local report processing. Object reference not set to an instance of an object."
There are no further errors/warnings detailed in the Error List or Output windows.
Background: On this report I am using a table to display a sub-report [x] number of times, dependant on the number of related objects that exist in the SQL database. That is to say that the sub-report is set within one of the cells (the only cell) of the table, in a row that repeats for each item returned in a dataset.
Removing the sub-report allows the master report to compile and run, so I feel the issue is related to the arrangement of the sub-report. If the sub-report only displays once, then the master report compiles and runs fine, it is only when a second instance is required that the issue arises.
When testing the sub-report separately, it compiles and runs when given the parameters for each instance it is being asked to render from the master report. So I can rule out the idea that the data for the second instance is causing it to fail (in some div-by-0 type way).
Given the lack of detail from the error and that the sub-report works on it's own, I do not understand why this is happening.
Does anyone have any ideas for debugging or suggested solutions?
Thanks
Brian
**tldr: Master report fails when a sub-report repeats more than once.**
|
reporting-services
|
ssrs-2008
| null | null | null | null |
open
|
SSRS '08 Object reference not set to an instance of an object
===
Full error from Preview window in Visual Studio '08 (BIDS): "An error occurred during local report processing. Object reference not set to an instance of an object."
There are no further errors/warnings detailed in the Error List or Output windows.
Background: On this report I am using a table to display a sub-report [x] number of times, dependant on the number of related objects that exist in the SQL database. That is to say that the sub-report is set within one of the cells (the only cell) of the table, in a row that repeats for each item returned in a dataset.
Removing the sub-report allows the master report to compile and run, so I feel the issue is related to the arrangement of the sub-report. If the sub-report only displays once, then the master report compiles and runs fine, it is only when a second instance is required that the issue arises.
When testing the sub-report separately, it compiles and runs when given the parameters for each instance it is being asked to render from the master report. So I can rule out the idea that the data for the second instance is causing it to fail (in some div-by-0 type way).
Given the lack of detail from the error and that the sub-report works on it's own, I do not understand why this is happening.
Does anyone have any ideas for debugging or suggested solutions?
Thanks
Brian
**tldr: Master report fails when a sub-report repeats more than once.**
| 0 |
11,570,599 |
07/19/2012 23:06:28
| 1,094,339 |
12/12/2011 18:34:57
| 69 | 5 |
Ajax with Rails
|
I'm trying to figure out how to use AJAX in my rails application but searching seems to be giving me outdated or confusing information. Does anyone have a good explanation of how to use it and or a good reference to learning how?
|
ajax
|
ruby-on-rails-3
| null | null | null |
07/24/2012 01:44:23
|
not a real question
|
Ajax with Rails
===
I'm trying to figure out how to use AJAX in my rails application but searching seems to be giving me outdated or confusing information. Does anyone have a good explanation of how to use it and or a good reference to learning how?
| 1 |
11,095,708 |
06/19/2012 06:44:33
| 1,140,038 |
01/10/2012 03:42:08
| 51 | 0 |
How does this recursive function work?
|
I do not see how this recursive function works:
function f(n) { g(n-1) }
function g(n) {
alert("before: " + n);
if(n > 0) f(n);
alert("after: " + n);
}
f(2);
I have tried to understand this code works and I saw how "before 1", "before 0", and "after 0" execute but... how does "after 1" come from this?
I see it executing as this... f(2) calls g which subtracts 1 so 'n' becomes 1. Alert("before: " + n) is executed, 1 is greater than 0 so it will recall itself and subtract 1. Alert("before:" + n) is executed once again, 0 is not greater than 0 so it will execute Alert("after:" + n) and the function ends?...
|
javascript
|
recursion
| null | null | null | null |
open
|
How does this recursive function work?
===
I do not see how this recursive function works:
function f(n) { g(n-1) }
function g(n) {
alert("before: " + n);
if(n > 0) f(n);
alert("after: " + n);
}
f(2);
I have tried to understand this code works and I saw how "before 1", "before 0", and "after 0" execute but... how does "after 1" come from this?
I see it executing as this... f(2) calls g which subtracts 1 so 'n' becomes 1. Alert("before: " + n) is executed, 1 is greater than 0 so it will recall itself and subtract 1. Alert("before:" + n) is executed once again, 0 is not greater than 0 so it will execute Alert("after:" + n) and the function ends?...
| 0 |
11,539,336 |
07/18/2012 10:31:14
| 1,534,439 |
07/18/2012 10:22:24
| 1 | 0 |
Removing timestamp and source code information from static library built with visual c++
|
I've build a static library with visual c++ 2008. This static library must be used by a third party so I'd like to hide all function and variables names from the lib file. I read and tried all compiler options but I can't find any that solve my problem.
Besides I need to calculate a hash on the lib file but every time I compile it I got different hashes because it seems the compiler insert several timestamp and information about target machine.
Is there a way to avoid all this kind of informations in the lib (or object) files ?
Thanks in advance for all replies,
Danny
|
visual-c++
|
build
|
timestamp
|
remove
| null | null |
open
|
Removing timestamp and source code information from static library built with visual c++
===
I've build a static library with visual c++ 2008. This static library must be used by a third party so I'd like to hide all function and variables names from the lib file. I read and tried all compiler options but I can't find any that solve my problem.
Besides I need to calculate a hash on the lib file but every time I compile it I got different hashes because it seems the compiler insert several timestamp and information about target machine.
Is there a way to avoid all this kind of informations in the lib (or object) files ?
Thanks in advance for all replies,
Danny
| 0 |
5,955,222 |
05/10/2011 19:15:22
| 678,993 |
03/27/2011 14:23:14
| 16 | 0 |
Qt Gestures Programming
|
I would like to know how can we define new gesture and new gesture recognizer classes like QPinchGesture and QPanGesture already defined in Qt as examples. I have gone through the samples and I am not able to understand the proper flow. Please provide sample code if possible.(Apart from classes already defined in Qt)
|
qt
|
gesture-recognition
| null | null | null |
05/10/2011 22:18:50
|
not a real question
|
Qt Gestures Programming
===
I would like to know how can we define new gesture and new gesture recognizer classes like QPinchGesture and QPanGesture already defined in Qt as examples. I have gone through the samples and I am not able to understand the proper flow. Please provide sample code if possible.(Apart from classes already defined in Qt)
| 1 |
4,871,194 |
02/02/2011 05:48:11
| 30,563 |
10/22/2008 22:25:51
| 1,601 | 61 |
What is the best looking desktop application UI that you have seen?
|
I'm designing a new desktop app and would like to get a feel for what good designs you have seen out there.
|
user-interface
|
desktop-application
| null | null | null |
02/02/2011 06:00:43
|
not a real question
|
What is the best looking desktop application UI that you have seen?
===
I'm designing a new desktop app and would like to get a feel for what good designs you have seen out there.
| 1 |
10,404,450 |
05/01/2012 21:13:04
| 1,146,332 |
01/12/2012 19:57:13
| 11 | 1 |
maxima only find the trivial solution of a system of equations
|
I want to solve a simple set of equations.
psi_I(x):=A*exp(%i*k*x)+B*exp(-%i*k*x);
psi_II(x):=C*exp(-kappa*x);
psi_III(x):=D*exp(%i*k*x);
solve( [ psi_I(x_0) = psi_II(x_0)
, psi_II(x_1) = psi_III(x_1)
, at( diff(psi_I(x),x) , [x=x_0] ) = at( diff(psi_II(x),x) , [x=x_0] )
, at( diff(psi_II(x),x) , [x=x_1] ) = at( diff(psi_III(x),x) , [x=x_1] ) ]
, [A, B, C, D]);
the 'solve' function returns
[[A=0,B=0,C=0,D=0]]
but this is not the solution i want.
I can't find the error that is responsible that 'solve' only returns the trivial solution.
Maybe someone of you experts can point me in the right direction!?
Best regards
|
math
|
maxima
| null | null | null |
05/13/2012 12:56:33
|
too localized
|
maxima only find the trivial solution of a system of equations
===
I want to solve a simple set of equations.
psi_I(x):=A*exp(%i*k*x)+B*exp(-%i*k*x);
psi_II(x):=C*exp(-kappa*x);
psi_III(x):=D*exp(%i*k*x);
solve( [ psi_I(x_0) = psi_II(x_0)
, psi_II(x_1) = psi_III(x_1)
, at( diff(psi_I(x),x) , [x=x_0] ) = at( diff(psi_II(x),x) , [x=x_0] )
, at( diff(psi_II(x),x) , [x=x_1] ) = at( diff(psi_III(x),x) , [x=x_1] ) ]
, [A, B, C, D]);
the 'solve' function returns
[[A=0,B=0,C=0,D=0]]
but this is not the solution i want.
I can't find the error that is responsible that 'solve' only returns the trivial solution.
Maybe someone of you experts can point me in the right direction!?
Best regards
| 3 |
8,872,153 |
01/15/2012 18:21:29
| 284,417 |
03/02/2010 13:32:50
| 32 | 4 |
Apache dynamic VirtualHost questions
|
I would like the following functionality
I would like to have my websites at:
/var/www/vhosts/example.org
example.org has the following structure:
httpdocs
logs
subdomains
When i access the http://example.org i would like the documentroot to be
/var/www/vhosts/example.org/httpdocs
when i hit on the browser http://test.example.org the documentroot to be:
/var/www/vhosts/example.org/subdomains/test/httpdocs
I think this could be done with mod_vhost_alias but i could no do it.
If i put this:
UseCanonicalName Off
<VirtualHost *:80>
VirtualDocumentRoot /var/www/vhosts/%0/httpdocs/
</VirtualHost>
for the above example document root is
/var/www/vhosts/example.org/httpdocs (example.org)
and
/var/www/vhosts/test.example.org/httpdocs (test.example.org)
I would like something like:
UseCanonicalName Off
<VirtualHost *:80>
if not subdomain:
VirtualDocumentRoot /var/www/vhosts/%0/httpdocs/
else:
VirtualDocumentRoot /var/www/vhosts/%domain/subdomains/%subdomain/httpdocs/
</VirtualHost>
How can i do it?
|
apache
|
virtual-hosts
| null | null | null |
01/16/2012 06:57:11
|
off topic
|
Apache dynamic VirtualHost questions
===
I would like the following functionality
I would like to have my websites at:
/var/www/vhosts/example.org
example.org has the following structure:
httpdocs
logs
subdomains
When i access the http://example.org i would like the documentroot to be
/var/www/vhosts/example.org/httpdocs
when i hit on the browser http://test.example.org the documentroot to be:
/var/www/vhosts/example.org/subdomains/test/httpdocs
I think this could be done with mod_vhost_alias but i could no do it.
If i put this:
UseCanonicalName Off
<VirtualHost *:80>
VirtualDocumentRoot /var/www/vhosts/%0/httpdocs/
</VirtualHost>
for the above example document root is
/var/www/vhosts/example.org/httpdocs (example.org)
and
/var/www/vhosts/test.example.org/httpdocs (test.example.org)
I would like something like:
UseCanonicalName Off
<VirtualHost *:80>
if not subdomain:
VirtualDocumentRoot /var/www/vhosts/%0/httpdocs/
else:
VirtualDocumentRoot /var/www/vhosts/%domain/subdomains/%subdomain/httpdocs/
</VirtualHost>
How can i do it?
| 2 |
8,893,473 |
01/17/2012 11:00:22
| 1,153,714 |
01/17/2012 10:39:06
| 1 | 0 |
How to add a constraint index in yaml Doctrine 2
|
I`ve got two tables described in yaml.
For example :
<pre>
Entities\User:
type: entity
table: users
id:
id:
type: integer
generator:
strategy: AUTO
fields:
username:
type: string
length: 64
oneToMany:
children:
targetEntity: UserToUser
mappedBy: parent
parents:
targetEntity: UserToUser
mappedBy: child
Entities\UserToUser:
type: entity
table: user_to_user
id:
id:
type: integer
generator:
strategy: AUTO
fields:
user_id:
type: integer
nullable: false
child_id:
type: integer
nullable: false
manyToOne:
parent:
targetEntity: User
inversedBy: children
joinColumn:
name: user_id
referencedColumnName: id
child:
targetEntity: User
inversedBy: parents
joinColumn:
name: child_id
referencedColumnName: id
</pre>
in this case everything generates well but in fact in database in table user_to_user there in no unique index for fields: user_id and child_id.
So there is possibility to add 2 entries with the same value .
I was trying to add constraints
<pre>
uniqueConstraints:
child_user_idx:
columns: child_id,user_id
</pre>
or 2 other ways:
<pre>
id:
user_id:
type: integer
child_id:
type: integer
</pre>
or
<pre>
id:
parent:
associationKey: true
child:
associationKey: true
</pre>
Trying combine these options but as the result using doctrine console validation there were errors every time but generated sql was exactly what I needed .
One of them for example:
he join columns of the association 'parent' have to match to ALL identifier columns of the source entity 'Entities\UserToUser', however 'child_id' are missing.
* The join columns of the association 'child' have to match to ALL identifier columns of the source entity 'Entities\UserToUser', however 'user_id' are missing.
I do not really understand what I have to add so the validation pass correctly
|
doctrine2
|
yaml
| null | null | null | null |
open
|
How to add a constraint index in yaml Doctrine 2
===
I`ve got two tables described in yaml.
For example :
<pre>
Entities\User:
type: entity
table: users
id:
id:
type: integer
generator:
strategy: AUTO
fields:
username:
type: string
length: 64
oneToMany:
children:
targetEntity: UserToUser
mappedBy: parent
parents:
targetEntity: UserToUser
mappedBy: child
Entities\UserToUser:
type: entity
table: user_to_user
id:
id:
type: integer
generator:
strategy: AUTO
fields:
user_id:
type: integer
nullable: false
child_id:
type: integer
nullable: false
manyToOne:
parent:
targetEntity: User
inversedBy: children
joinColumn:
name: user_id
referencedColumnName: id
child:
targetEntity: User
inversedBy: parents
joinColumn:
name: child_id
referencedColumnName: id
</pre>
in this case everything generates well but in fact in database in table user_to_user there in no unique index for fields: user_id and child_id.
So there is possibility to add 2 entries with the same value .
I was trying to add constraints
<pre>
uniqueConstraints:
child_user_idx:
columns: child_id,user_id
</pre>
or 2 other ways:
<pre>
id:
user_id:
type: integer
child_id:
type: integer
</pre>
or
<pre>
id:
parent:
associationKey: true
child:
associationKey: true
</pre>
Trying combine these options but as the result using doctrine console validation there were errors every time but generated sql was exactly what I needed .
One of them for example:
he join columns of the association 'parent' have to match to ALL identifier columns of the source entity 'Entities\UserToUser', however 'child_id' are missing.
* The join columns of the association 'child' have to match to ALL identifier columns of the source entity 'Entities\UserToUser', however 'user_id' are missing.
I do not really understand what I have to add so the validation pass correctly
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.