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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1,089,925 | 07/07/2009 01:23:25 | 106,178 | 05/13/2009 10:15:58 | 36 | 2 | At witt's end... Javascript won't replace '\n'! | I've been going at this problem for a solid couple hours now and having zero luck. No clue how this is even possible; I'll try to summarize.
I'm using TinyMCE to insert new content to a DB, that content is being sent back as an AJAX response after it is inserted into the DB and then shown on the page, replacing some old content. All of that isn't really relevant (as far as I can tell) to the problem, but it serves as a background to the problem.
Anyhow, the response text has '\n' appropriately wherever the content had line breaks. I can't seem to remove those damn '\n' for the life of me. I've tried a dozen regex/replace combos with zero luck. I've verified I am not losing my mind and that the code generally works by attempting to replace other words within that string and that works perfectly fine - it just will NOT replace '\n'. Here's some code I've used attempting to replace the '\n's:
> responseText = responseText.replace(/\r|\n|\r\n/g, "");
> responseText = responseText.replace(Array("\r", "\n", "\f", "\r\n", "\n"), "");
Niether of those do anything to the variable. I alert it immediately after to check for changes, nada. I have no idea if it will help, but here's a snippet of an example '\n' copy-pasted that will not disappear OR change.
High School transcript</li>\n<li>SAT/ACT
As a side note, I've tried doing this via PHP before the responseText is sent back to javascript with a similar replace & regex and it does NOT work either. | javascript | jquery | regex | null | null | null | open | At witt's end... Javascript won't replace '\n'!
===
I've been going at this problem for a solid couple hours now and having zero luck. No clue how this is even possible; I'll try to summarize.
I'm using TinyMCE to insert new content to a DB, that content is being sent back as an AJAX response after it is inserted into the DB and then shown on the page, replacing some old content. All of that isn't really relevant (as far as I can tell) to the problem, but it serves as a background to the problem.
Anyhow, the response text has '\n' appropriately wherever the content had line breaks. I can't seem to remove those damn '\n' for the life of me. I've tried a dozen regex/replace combos with zero luck. I've verified I am not losing my mind and that the code generally works by attempting to replace other words within that string and that works perfectly fine - it just will NOT replace '\n'. Here's some code I've used attempting to replace the '\n's:
> responseText = responseText.replace(/\r|\n|\r\n/g, "");
> responseText = responseText.replace(Array("\r", "\n", "\f", "\r\n", "\n"), "");
Niether of those do anything to the variable. I alert it immediately after to check for changes, nada. I have no idea if it will help, but here's a snippet of an example '\n' copy-pasted that will not disappear OR change.
High School transcript</li>\n<li>SAT/ACT
As a side note, I've tried doing this via PHP before the responseText is sent back to javascript with a similar replace & regex and it does NOT work either. | 0 |
3,374,019 | 07/30/2010 17:36:31 | 340,628 | 05/13/2010 19:45:23 | 1,134 | 34 | What is the most cool feature of WPF | What is is in your opinion the most cool feature of WPF that one absolutely should view at. | wpf | null | null | null | null | 07/30/2010 18:29:07 | not a real question | What is the most cool feature of WPF
===
What is is in your opinion the most cool feature of WPF that one absolutely should view at. | 1 |
10,640,093 | 05/17/2012 16:56:59 | 266,569 | 02/04/2010 20:51:43 | 21 | 4 | Jsoup getting different html compared to Firefox and other browsers | I'm in trouble with some url's from a web-store called Kabum.
The url is http://www.kabum.com.br/cgi-local/kabum3/produtos/descricao.cgi?id=01:02:23:55:159
If I enter the site in the address bar, or click the link, I got a page with the product, but If I use Jsoup, I get a page with only a meta refresh to the same address.
Tried setting the user agent, the referrer and follow the link in meta, but I got the same page.
My code is here:
<!-- language: lang-java -->
Document doc;
String url = "http://www.kabum.com.br/cgi-local/kabum3/produtos/descricao.cgi?id=01:02:23:55:159";
try {
String ua = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0";
String referrer = "http://www.google.com";
doc = Jsoup.connect(url).timeout(20000).userAgent(ua).referrer(referrer).get();
Elements meta = doc.select("html head meta");
for (Iterator<Element> it = meta.iterator(); it.hasNext();) {
Element element = it.next();
if (element.attr("http-equiv").matches("refresh")) {
String novaUrl = element.attr("content").replaceFirst("\\d?;url=", "");
System.out.printf("redirecting to %s%n", novaUrl);
doc = Jsoup.connect(novaUrl).userAgent(ua).referrer(referrer).get();
break;
}
}
} catch (IOException ex) {
Logger.getLogger(Teste1.class.getName()).log(Level.SEVERE, null, ex);
return;
}
System.out.println(doc);
| java | web-scraping | jsoup | null | null | null | open | Jsoup getting different html compared to Firefox and other browsers
===
I'm in trouble with some url's from a web-store called Kabum.
The url is http://www.kabum.com.br/cgi-local/kabum3/produtos/descricao.cgi?id=01:02:23:55:159
If I enter the site in the address bar, or click the link, I got a page with the product, but If I use Jsoup, I get a page with only a meta refresh to the same address.
Tried setting the user agent, the referrer and follow the link in meta, but I got the same page.
My code is here:
<!-- language: lang-java -->
Document doc;
String url = "http://www.kabum.com.br/cgi-local/kabum3/produtos/descricao.cgi?id=01:02:23:55:159";
try {
String ua = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0";
String referrer = "http://www.google.com";
doc = Jsoup.connect(url).timeout(20000).userAgent(ua).referrer(referrer).get();
Elements meta = doc.select("html head meta");
for (Iterator<Element> it = meta.iterator(); it.hasNext();) {
Element element = it.next();
if (element.attr("http-equiv").matches("refresh")) {
String novaUrl = element.attr("content").replaceFirst("\\d?;url=", "");
System.out.printf("redirecting to %s%n", novaUrl);
doc = Jsoup.connect(novaUrl).userAgent(ua).referrer(referrer).get();
break;
}
}
} catch (IOException ex) {
Logger.getLogger(Teste1.class.getName()).log(Level.SEVERE, null, ex);
return;
}
System.out.println(doc);
| 0 |
8,214,634 | 11/21/2011 16:01:24 | 413,515 | 08/06/2010 22:00:35 | 72 | 1 | time now in Riyadh (KSA) , by javascript | How are you ?
I want to add block in site about time now in Riyadh (+3 time zone) (Capital of saudi arabia)
for example when the visitor from Germany or Spain come to my site , he wants to know the time in Riyadh , how can show the time now in Riyadh .
also I want the time 12h ( 12:10:25 am ) ..
Thank you very much for helping me ..
| javascript | null | null | null | null | 11/21/2011 19:39:25 | not a real question | time now in Riyadh (KSA) , by javascript
===
How are you ?
I want to add block in site about time now in Riyadh (+3 time zone) (Capital of saudi arabia)
for example when the visitor from Germany or Spain come to my site , he wants to know the time in Riyadh , how can show the time now in Riyadh .
also I want the time 12h ( 12:10:25 am ) ..
Thank you very much for helping me ..
| 1 |
10,693,869 | 05/21/2012 23:20:28 | 1,009,091 | 10/23/2011 00:32:51 | 16 | 0 | Can neural bots trained by a neural network be used for the following purpose? | Hey I have a task to perform, which is basically to somehow retrieve powerpoint presentations or pdf documents pertaining to a certain field. Let's say I want to retrieve ppt and pdf lecture notes pertaining to bioinformatics field. I would like to know if this task can be achieved by adapting the approach of using neural bots trained by a neural network? Just wanted to confirm that this approach is not completely wrong before I proceeded further with my implementation.
And in case someone is wondering why a neural network or any learning algorithm at all is required in this case well here is my plan (which might be wrong or there might be an easier way to achieve this so please feel free to correct me):
I generate neural bots trained by a neural network (not sure how this training happens yet, I am assuming by supervised learning using a sample training set of certain ppt and pdf files) and then these bots retrieve pages that are similar to what they learnt through their training.
So is the above approach a correct way to go about completing this task?
| machine-learning | web-crawler | neural-network | genetic-algorithm | information-retrieval | null | open | Can neural bots trained by a neural network be used for the following purpose?
===
Hey I have a task to perform, which is basically to somehow retrieve powerpoint presentations or pdf documents pertaining to a certain field. Let's say I want to retrieve ppt and pdf lecture notes pertaining to bioinformatics field. I would like to know if this task can be achieved by adapting the approach of using neural bots trained by a neural network? Just wanted to confirm that this approach is not completely wrong before I proceeded further with my implementation.
And in case someone is wondering why a neural network or any learning algorithm at all is required in this case well here is my plan (which might be wrong or there might be an easier way to achieve this so please feel free to correct me):
I generate neural bots trained by a neural network (not sure how this training happens yet, I am assuming by supervised learning using a sample training set of certain ppt and pdf files) and then these bots retrieve pages that are similar to what they learnt through their training.
So is the above approach a correct way to go about completing this task?
| 0 |
4,041,861 | 10/28/2010 10:17:14 | 102,205 | 05/06/2009 12:51:32 | 1,072 | 137 | Best way to achieve multilingual URLs? | I'm developing a niche social networking site that is going multilingual. That means our current URL structure will soon need to start using translated words for slugs like the following:
`www.example.com/home` becomes `www.example.com/inicio`
`www.example.com/profile` becomes `www.example.com/perfil`
`www.example.com/help` becomes `www.example.com/ayuda`
And so on. My question is: what's the best way to support this in a PHP application? For incoming requests, I thought a dictionary like the following in my `router.php` file would suffice:
<?php
$request = explode("/", trim($_SERVER['REQUEST_URI'], "/"));
// Dictionaries of page slugs.
$slugs = array(
'es' => array(
'inicio' => 'home',
'perfil' => 'profile',
'ayuda' => 'help',
)
// additional languages can be added here
);
// Rewrite any incoming (foreign) requests
if ($host=="www.example.es") { // to be made programmatic
$lang = "es"; // pick up from locale constant rather being hard-coded
if (array_key_exists($request[0], $slugs[$lang])) {
$request[0] = $slugs[$lang][$request[0]];
}
}
...
Which basically takes URL segments and matches them against an English counter-part if it exists. If not, then it will proceed as normal and most likely cause a 404 as a controller doesn't exist for URL segment.
Although this words, I need it to be backwards-compatible too. For example, when building URLs in my application.
Naturally, as the application is only English at the moment these are just hard-coded. So say, when fetching a `User` object I do the following:
<?php
class User {
function __construct($id) {
// fetch user details
$this->profile_url = ROOT . "/profile/" . $this->username;
}
}
What is the best method to then replace instances of `"/profile/"` being hard-coded to getting the translated version, i.e. `"/perfil/"` in the Spanish site? | php | internationalization | url-routing | multilingual | null | null | open | Best way to achieve multilingual URLs?
===
I'm developing a niche social networking site that is going multilingual. That means our current URL structure will soon need to start using translated words for slugs like the following:
`www.example.com/home` becomes `www.example.com/inicio`
`www.example.com/profile` becomes `www.example.com/perfil`
`www.example.com/help` becomes `www.example.com/ayuda`
And so on. My question is: what's the best way to support this in a PHP application? For incoming requests, I thought a dictionary like the following in my `router.php` file would suffice:
<?php
$request = explode("/", trim($_SERVER['REQUEST_URI'], "/"));
// Dictionaries of page slugs.
$slugs = array(
'es' => array(
'inicio' => 'home',
'perfil' => 'profile',
'ayuda' => 'help',
)
// additional languages can be added here
);
// Rewrite any incoming (foreign) requests
if ($host=="www.example.es") { // to be made programmatic
$lang = "es"; // pick up from locale constant rather being hard-coded
if (array_key_exists($request[0], $slugs[$lang])) {
$request[0] = $slugs[$lang][$request[0]];
}
}
...
Which basically takes URL segments and matches them against an English counter-part if it exists. If not, then it will proceed as normal and most likely cause a 404 as a controller doesn't exist for URL segment.
Although this words, I need it to be backwards-compatible too. For example, when building URLs in my application.
Naturally, as the application is only English at the moment these are just hard-coded. So say, when fetching a `User` object I do the following:
<?php
class User {
function __construct($id) {
// fetch user details
$this->profile_url = ROOT . "/profile/" . $this->username;
}
}
What is the best method to then replace instances of `"/profile/"` being hard-coded to getting the translated version, i.e. `"/perfil/"` in the Spanish site? | 0 |
7,556,711 | 09/26/2011 14:31:42 | 280,407 | 02/24/2010 14:42:24 | 70 | 0 | Troubleshoot Windows Binary | When there is a GUI program not behaving as I expect it to in Linux I run it from the terminal so that I can see what errors are happening in the background, this helps in configuring the system and figuring out dependencies when the problem is not from the program but rather the system. This is especially helpful when the program doesn't give any feedback to the user in the GUI.
Is there a way to do the same thing in Windows? | windows | null | null | null | null | null | open | Troubleshoot Windows Binary
===
When there is a GUI program not behaving as I expect it to in Linux I run it from the terminal so that I can see what errors are happening in the background, this helps in configuring the system and figuring out dependencies when the problem is not from the program but rather the system. This is especially helpful when the program doesn't give any feedback to the user in the GUI.
Is there a way to do the same thing in Windows? | 0 |
574,092 | 02/22/2009 01:09:52 | 69,467 | 02/22/2009 01:09:51 | 1 | 0 | Win32 help please | Does anyone know any ebooks i can download to learn it pro or can anyone teach it to me i really want to get good at it | winapi | learning | it | pro | null | 04/28/2012 05:02:35 | not constructive | Win32 help please
===
Does anyone know any ebooks i can download to learn it pro or can anyone teach it to me i really want to get good at it | 4 |
7,215,660 | 08/27/2011 16:04:44 | 915,639 | 08/27/2011 16:04:44 | 1 | 0 | I need to make a small change to my existing local buisnes pages name | About a year ago when I created a page for our marina I was in a bit of a rush to get it up and going and I used mt. instead of mount and managed to leave everything in lower case.now that it has quite a few fans my boss is starting to get on my case about fixing it but from what i have read this isnt possible. I would like to know if I can call facebook and have them fix it for me. | facebook | change | name | null | null | 08/27/2011 17:43:43 | off topic | I need to make a small change to my existing local buisnes pages name
===
About a year ago when I created a page for our marina I was in a bit of a rush to get it up and going and I used mt. instead of mount and managed to leave everything in lower case.now that it has quite a few fans my boss is starting to get on my case about fixing it but from what i have read this isnt possible. I would like to know if I can call facebook and have them fix it for me. | 2 |
9,185,722 | 02/07/2012 23:33:46 | 1,078,381 | 12/02/2011 23:27:33 | 44 | 0 | From Java to Kinect programming | I know nothing about C# or some other MS stuff, but i'm interested in Kinect programming. How long does it take to know some C# tricks and begin playing with Kinect on a serious level? Are there any good Java libs for this? Or it's just a wasting of time? | java | kinect | null | null | null | 02/08/2012 06:44:39 | not constructive | From Java to Kinect programming
===
I know nothing about C# or some other MS stuff, but i'm interested in Kinect programming. How long does it take to know some C# tricks and begin playing with Kinect on a serious level? Are there any good Java libs for this? Or it's just a wasting of time? | 4 |
1,664,394 | 11/02/2009 23:36:34 | 73,482 | 03/04/2009 02:03:12 | 51 | 2 | Significant Whitespace in C# like Python or Haskell? | I'm wondering if any other C# developers would find it an improvement to have a complier directive for CSC to make whitespace significant ala Haskell or Python where the kinds of whitespace creates code blocks.
While this would certainly be a massive departure from c-style languages, it seems to me that since C# is ultimately being compiled down to IL (which would still have the curly braces and semicolons), it really is just a parsing trick the compiler can handle either way (i.e. it can either deal with significant whitespaces or not). Since curlies and semicolons are often a barrier to entry to C# & they are really only parsing helpers (they don't in themselves impart meaning to your code) they could be removed ala Haskell/Python.
F# handles with the the #light complier directive which you can read about here: http://blogs.msdn.com/dsyme/archive/2006/08/24/715626.aspx
I'd like to see the same thing in C#: a #SigSpace or somesuch directive that would direct CSC to treat the source like a Haskell file in terms of whitespace (just as an example).
standard C#:
public void WhiteSpaceSig()
{
List<string> names = new List<string>();
List<string> colors = new List<string>();
foreach (string name in names)
{
foreach (string color in colors)
{
// bla bla bla
}
}
}
significant whitespace:
#SigSpace
public void WhiteSpaceSig()
List<string> names = new List<string>()
List<string> colors = new List<string>()
foreach (string name in names)
foreach (string color in colors)
// bla bla bla | c# | null | null | null | null | 11/03/2009 02:43:36 | not constructive | Significant Whitespace in C# like Python or Haskell?
===
I'm wondering if any other C# developers would find it an improvement to have a complier directive for CSC to make whitespace significant ala Haskell or Python where the kinds of whitespace creates code blocks.
While this would certainly be a massive departure from c-style languages, it seems to me that since C# is ultimately being compiled down to IL (which would still have the curly braces and semicolons), it really is just a parsing trick the compiler can handle either way (i.e. it can either deal with significant whitespaces or not). Since curlies and semicolons are often a barrier to entry to C# & they are really only parsing helpers (they don't in themselves impart meaning to your code) they could be removed ala Haskell/Python.
F# handles with the the #light complier directive which you can read about here: http://blogs.msdn.com/dsyme/archive/2006/08/24/715626.aspx
I'd like to see the same thing in C#: a #SigSpace or somesuch directive that would direct CSC to treat the source like a Haskell file in terms of whitespace (just as an example).
standard C#:
public void WhiteSpaceSig()
{
List<string> names = new List<string>();
List<string> colors = new List<string>();
foreach (string name in names)
{
foreach (string color in colors)
{
// bla bla bla
}
}
}
significant whitespace:
#SigSpace
public void WhiteSpaceSig()
List<string> names = new List<string>()
List<string> colors = new List<string>()
foreach (string name in names)
foreach (string color in colors)
// bla bla bla | 4 |
6,439,226 | 06/22/2011 11:42:33 | 810,256 | 06/22/2011 11:42:33 | 1 | 0 | how get CSV FILE from the FTP server to local drive using extended stored procedures | Please give example to get file (auto) from FTP server to local machine with the help of extended stored procedures in in c# application | c# | sql | xsp | null | null | 06/22/2011 13:47:22 | not a real question | how get CSV FILE from the FTP server to local drive using extended stored procedures
===
Please give example to get file (auto) from FTP server to local machine with the help of extended stored procedures in in c# application | 1 |
7,290,686 | 09/03/2011 01:57:16 | 743,393 | 05/07/2011 20:16:49 | 1 | 0 | VB6 application won't run in some computers, in others it runs fine | I have a VB6 application, the installer is compiled using INNO Setup.
The installer runs fine. But in about 10% of computers when the user clicks the Icon to run the installed app, it doesn't start, no error message, only a Beep sound.
This is happening on XP and also Win 7.
I develop in XP and Win 7 and the application works OK, so I haven't been able to reproduce the issue.
The installer registers all ocx and dlls needed (afaik). (Well not completely all, it assumes MS run-time components should be there, but I guess an error message should show up if something is missing)
I was thinking some kind of user permissions, UAC, but even users in the admin group have had the issue.
Could you point me to what possible issues to look for and test in order to patch the app.
Thanks!
| vb6 | runtime-error | null | null | null | null | open | VB6 application won't run in some computers, in others it runs fine
===
I have a VB6 application, the installer is compiled using INNO Setup.
The installer runs fine. But in about 10% of computers when the user clicks the Icon to run the installed app, it doesn't start, no error message, only a Beep sound.
This is happening on XP and also Win 7.
I develop in XP and Win 7 and the application works OK, so I haven't been able to reproduce the issue.
The installer registers all ocx and dlls needed (afaik). (Well not completely all, it assumes MS run-time components should be there, but I guess an error message should show up if something is missing)
I was thinking some kind of user permissions, UAC, but even users in the admin group have had the issue.
Could you point me to what possible issues to look for and test in order to patch the app.
Thanks!
| 0 |
3,455,342 | 08/11/2010 04:42:47 | 188,326 | 10/12/2009 09:50:40 | 213 | 2 | Where is the place to disscuss vrapper problems? | http://sourceforge.net/projects/vrapper/
Vrapper is my favoriate vim-like plugin for eclipse. I got some problem with it - the ":format" does not work. I don't know where to ask my question. Can anybody point me out? | eclipse | null | null | null | null | 03/13/2012 21:53:48 | off topic | Where is the place to disscuss vrapper problems?
===
http://sourceforge.net/projects/vrapper/
Vrapper is my favoriate vim-like plugin for eclipse. I got some problem with it - the ":format" does not work. I don't know where to ask my question. Can anybody point me out? | 2 |
3,428,332 | 08/06/2010 22:49:01 | 23,903 | 09/16/2008 16:05:24 | 13,310 | 327 | Why are there so many different calling conventions? | Historically, why does it seem like just about everyone and their kid brother defined their own calling conventions? You've got C, C++, Windows, Pascal, Fortran, Fastcall and probably a zillion others I didn't think to mention. Shouldn't one convention be the most efficient for the vast majority of use cases? | history | low-level | calling-convention | asm | null | null | open | Why are there so many different calling conventions?
===
Historically, why does it seem like just about everyone and their kid brother defined their own calling conventions? You've got C, C++, Windows, Pascal, Fortran, Fastcall and probably a zillion others I didn't think to mention. Shouldn't one convention be the most efficient for the vast majority of use cases? | 0 |
10,160,530 | 04/15/2012 08:18:39 | 1,334,195 | 04/15/2012 06:53:20 | 1 | 0 | Update datatables (JQuery) when button is clicked | I've created a simple form and I'm using datatables.net (JQuery plugin) to display some data in it. Data are being populated by a php script (process.php) which returns the proper results in JSON format. In the form, there is a button that sends the value of the textbox to the process.php. **The problem is that I cannot update/alter datatable with the new data received by process.php script when the button is clicked**.
The code of the form:
<form name="myform" id="myform" action="" method="POST">
<label for="id">Enter an id:</label>
<input type="text" name="txtId" id="txtId" value=""/>
<input type="button" id="btnSubmit" name="btnSubmit" value="Search">
</form>
<div id="results">
<table class="display" id="example">
<thead>
<tr>
<th>id</th>
<th>Surname</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<!-- data goes here -->
</tbody>
</table>
</div>
To create the datatable, I'm using the following JQuery code:
$(document).ready(function() {
var oTable = $('#example').dataTable( {
"sPaginationType": "full_numbers",
"iDisplayLength": 10,
//"bServerSide": true,
"sAjaxSource": "process.php"
} );
$("#btnSubmit").click(function(){
$.ajax({
type: "POST",
url: "process.php",
data: 'txtId=' + $("txtId").val(),
success: function(result) {
oTable.fnReloadAjax();
oTable.fnDraw();
}
});
});
} );
process.php script (works fine) is:
<?php
$result="";
if (empty($_REQUEST["txtId"])) {
$result = '{"aaData":[["1","Surname1","Name1"]]}';
}
else {
$result = '{"aaData":[["2","Surname2","Name2"]]}';
}
print $result;
?>
| jquery | jquery-ajax | jquery-plugins | datatables | datatables.net | null | open | Update datatables (JQuery) when button is clicked
===
I've created a simple form and I'm using datatables.net (JQuery plugin) to display some data in it. Data are being populated by a php script (process.php) which returns the proper results in JSON format. In the form, there is a button that sends the value of the textbox to the process.php. **The problem is that I cannot update/alter datatable with the new data received by process.php script when the button is clicked**.
The code of the form:
<form name="myform" id="myform" action="" method="POST">
<label for="id">Enter an id:</label>
<input type="text" name="txtId" id="txtId" value=""/>
<input type="button" id="btnSubmit" name="btnSubmit" value="Search">
</form>
<div id="results">
<table class="display" id="example">
<thead>
<tr>
<th>id</th>
<th>Surname</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<!-- data goes here -->
</tbody>
</table>
</div>
To create the datatable, I'm using the following JQuery code:
$(document).ready(function() {
var oTable = $('#example').dataTable( {
"sPaginationType": "full_numbers",
"iDisplayLength": 10,
//"bServerSide": true,
"sAjaxSource": "process.php"
} );
$("#btnSubmit").click(function(){
$.ajax({
type: "POST",
url: "process.php",
data: 'txtId=' + $("txtId").val(),
success: function(result) {
oTable.fnReloadAjax();
oTable.fnDraw();
}
});
});
} );
process.php script (works fine) is:
<?php
$result="";
if (empty($_REQUEST["txtId"])) {
$result = '{"aaData":[["1","Surname1","Name1"]]}';
}
else {
$result = '{"aaData":[["2","Surname2","Name2"]]}';
}
print $result;
?>
| 0 |
7,312,419 | 09/05/2011 20:19:57 | 623,929 | 02/18/2011 23:31:13 | 18 | 1 | Java int equality inconsistency? | This is driving me insane because it completely violates my attempts to de-buggify it:
int k = keyCode; //keyCode being a variable declared by a keyPress
//in the Processing library
//k and keyCode are working properly.
if ((k - UP)*500 == 0); //int UP=38;
{
println((k-UP)*500 == 0);
//some other code here
}
The result? "false" (and by removing the '== 0', a number that isn't 0).
As far as I know only when you use the arrow keys (k==37,38,39,40; 38 being UP) make this condition true.
Is there any such inconsistency, and what may cause it?
(The strange format of the condition is because it fixed a similar problem with the RIGHT key not working correctly with just k==RIGHT). | java | syntax | processing | condition | null | 09/06/2011 08:55:43 | too localized | Java int equality inconsistency?
===
This is driving me insane because it completely violates my attempts to de-buggify it:
int k = keyCode; //keyCode being a variable declared by a keyPress
//in the Processing library
//k and keyCode are working properly.
if ((k - UP)*500 == 0); //int UP=38;
{
println((k-UP)*500 == 0);
//some other code here
}
The result? "false" (and by removing the '== 0', a number that isn't 0).
As far as I know only when you use the arrow keys (k==37,38,39,40; 38 being UP) make this condition true.
Is there any such inconsistency, and what may cause it?
(The strange format of the condition is because it fixed a similar problem with the RIGHT key not working correctly with just k==RIGHT). | 3 |
11,295,483 | 07/02/2012 14:16:38 | 694,449 | 04/06/2011 08:36:56 | 51 | 2 | google search images | Hi I need to send GET method to google to show me images something like this:
**web search:**
https://www.google.jo/search?q=Palestine
thanks
| search | google | null | null | null | 07/02/2012 20:56:33 | not a real question | google search images
===
Hi I need to send GET method to google to show me images something like this:
**web search:**
https://www.google.jo/search?q=Palestine
thanks
| 1 |
3,246,361 | 07/14/2010 13:04:28 | 30,419 | 10/22/2008 15:39:54 | 2,519 | 116 | Passing IDs between web applications | We have several web applications that create a shopping cart, save it to a database, then redirect to a centralized web application to process and accept payment for the shopping cart. Right now, we are using GUIDs for the shopping cart IDs and passing those GUIDs in the querystring to the payment application. We are using GUIDs so that a user cannot easily guess the shopping cart ID of another user and simply plug that ID into the URL.
Now, using GUIDs in the database is bad for indexing and using GUIDs in the URL does not truly prevent a user from accessing another cart. However, using passing integers around would make it too easy.
What is the best and most secure way to pass the IDs from the individual applications to the centralized payment application?
I know that some people may say, "Who cares if someone else wants to pay for someone else's shopping cart?" However, we have the same concern when passing IDs to the page that displays the receipt and that page includes the customer's name. | asp.net | database-design | null | null | null | null | open | Passing IDs between web applications
===
We have several web applications that create a shopping cart, save it to a database, then redirect to a centralized web application to process and accept payment for the shopping cart. Right now, we are using GUIDs for the shopping cart IDs and passing those GUIDs in the querystring to the payment application. We are using GUIDs so that a user cannot easily guess the shopping cart ID of another user and simply plug that ID into the URL.
Now, using GUIDs in the database is bad for indexing and using GUIDs in the URL does not truly prevent a user from accessing another cart. However, using passing integers around would make it too easy.
What is the best and most secure way to pass the IDs from the individual applications to the centralized payment application?
I know that some people may say, "Who cares if someone else wants to pay for someone else's shopping cart?" However, we have the same concern when passing IDs to the page that displays the receipt and that page includes the customer's name. | 0 |
5,041,321 | 02/18/2011 12:32:41 | 447,221 | 07/21/2010 09:10:12 | 146 | 14 | What are the best .NET perfomance practices? | What are the best perfomance CPU/Memory practices for speed?
I have a project (trading platform) http://code.google.com/p/sample-trade/ and i need to process large data in short time?
I have millisecond timings e. g. when obtaining current market quotes. | optimization | trading | cpu-speed | null | null | 02/18/2011 23:09:08 | not a real question | What are the best .NET perfomance practices?
===
What are the best perfomance CPU/Memory practices for speed?
I have a project (trading platform) http://code.google.com/p/sample-trade/ and i need to process large data in short time?
I have millisecond timings e. g. when obtaining current market quotes. | 1 |
6,815,165 | 07/25/2011 11:11:13 | 716,480 | 04/20/2011 05:12:29 | 60 | 0 | Can i check in app purchase on jailbreak | I am just worried that can i test in app purchase on the iphone which is jail broken
Please tell me i have used all weapons to use it in my device but every time the Productid is zero
please help | iphone | in-app-purchase | jailbreak | null | null | 07/25/2011 13:11:42 | not a real question | Can i check in app purchase on jailbreak
===
I am just worried that can i test in app purchase on the iphone which is jail broken
Please tell me i have used all weapons to use it in my device but every time the Productid is zero
please help | 1 |
4,756,066 | 01/21/2011 06:34:58 | 579,217 | 01/17/2011 23:48:39 | 8 | 0 | Rails and Sencha Nested JSON: Has Many through? | I want to process nested JSON data sent from rails in Sencha.
In rails, my model associations are:
class User < ActiveRecord::Base
has_many :codes
has_many :stores, :through => :codes, :uniq => true
class Store < ActiveRecord::Base
has_many :deals
has_many :orders
has_many :rewards
has_many :codes
has_many :users, :through => :codes, :uniq => true
class Code < ActiveRecord::Base
validates :unique_code, :uniqueness => true
belongs_to :store
belongs_to :order
belongs_to :user
belongs_to :earn
As you can see, the class Code stores all the relationship information between User and Store.
Now, I can send nested JSON to sencha using
@user.to_json(:include => :stores, :deals, :rewards) (not proper code)
However how can I process the nested structure in Sencha? My goal is basically to have a ListPanel that first list and displays Stores that Users are subscribed to, and when clicked, details of the relationship are loaded such as what deals and rewards that store is currently offering.
I don't see an option for a "has many through" relationship in Sencha.
Thanks for the help.
| ruby-on-rails | json | nested | associations | sencha-touch | null | open | Rails and Sencha Nested JSON: Has Many through?
===
I want to process nested JSON data sent from rails in Sencha.
In rails, my model associations are:
class User < ActiveRecord::Base
has_many :codes
has_many :stores, :through => :codes, :uniq => true
class Store < ActiveRecord::Base
has_many :deals
has_many :orders
has_many :rewards
has_many :codes
has_many :users, :through => :codes, :uniq => true
class Code < ActiveRecord::Base
validates :unique_code, :uniqueness => true
belongs_to :store
belongs_to :order
belongs_to :user
belongs_to :earn
As you can see, the class Code stores all the relationship information between User and Store.
Now, I can send nested JSON to sencha using
@user.to_json(:include => :stores, :deals, :rewards) (not proper code)
However how can I process the nested structure in Sencha? My goal is basically to have a ListPanel that first list and displays Stores that Users are subscribed to, and when clicked, details of the relationship are loaded such as what deals and rewards that store is currently offering.
I don't see an option for a "has many through" relationship in Sencha.
Thanks for the help.
| 0 |
11,551,172 | 07/18/2012 22:15:11 | 1,536,229 | 07/18/2012 21:50:55 | 1 | 0 | How to use regular expressions to return only a part of a file name? | I am having trouble to create a regular expression that returns only a part of a string.
Passing the following strings:
/path/of/the/file/1 - 2 - Lecture 1.2_ Max Bense (13_49).mp4
/path/of/the/file/1 - 3 - Lecture 1.3_ Michael Friedman (12_15).mp4
/path/of/the/file/2 - 1 - Lecture 2.1_ Paul Feyerabend (12_55).mp4
/path/of/the/file/2 - 2 - Lecture 2.2_ Alhazen (11_37).mp4
/path/of/the/file/3 - 2 - Lecture 3.2_ Study Case - Dominicus Gundissalinus (14_30).mp4
/path/of/the/file/3 - 3 - Lecture 3.3_ Study Case - Carl Friedrich von Weizsacker (11_48).mp4
It should return only the following parts respectively:
Max Bense
Michael Friedman
Paul Feyerabend
Alhazen
Study Case - Dominicus Gundissalinus
Study Case - Carl Friedrich von Weizsacker | regex | sed | grep | expression | null | null | open | How to use regular expressions to return only a part of a file name?
===
I am having trouble to create a regular expression that returns only a part of a string.
Passing the following strings:
/path/of/the/file/1 - 2 - Lecture 1.2_ Max Bense (13_49).mp4
/path/of/the/file/1 - 3 - Lecture 1.3_ Michael Friedman (12_15).mp4
/path/of/the/file/2 - 1 - Lecture 2.1_ Paul Feyerabend (12_55).mp4
/path/of/the/file/2 - 2 - Lecture 2.2_ Alhazen (11_37).mp4
/path/of/the/file/3 - 2 - Lecture 3.2_ Study Case - Dominicus Gundissalinus (14_30).mp4
/path/of/the/file/3 - 3 - Lecture 3.3_ Study Case - Carl Friedrich von Weizsacker (11_48).mp4
It should return only the following parts respectively:
Max Bense
Michael Friedman
Paul Feyerabend
Alhazen
Study Case - Dominicus Gundissalinus
Study Case - Carl Friedrich von Weizsacker | 0 |
11,135,712 | 06/21/2012 09:55:35 | 91,970 | 04/17/2009 05:32:48 | 1,973 | 39 | How do I do 'validates_presence_of' new column in Devise - other than email & pw on the User model? | This is my `User` model:
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable, :token_authenticatable, :confirmable, :timeoutable,
:recoverable, :rememberable, :trackable, :validatable,
:email_regexp => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i
attr_accessible :email, :password, :password_confirmation, :remember_me, :name, :confirmed_at, :confirmation_token, :category_ids
validates_uniqueness_of :email, :case_sensitive => false
validates_confirmation_of :password
end
What I want to do is to enforce the presence of 'category_ids' on an 'activated' account.
I am doing [Email Only Sign-up][1] - which is important to note, because it is a two-stage process. The first time a user enters their email address, they are sent an activation email - with a link to `Confirmations` controller.
The view for that `Confirmations Controller` has the additional details that need to be validated.
If I just did a regular `validates_presence_of` on the `User` model, then when a user initially submits just an email address - Rails would fail it (which I don't want).
The user should:
1. Enter email address
2. Click confirmation/activation link in email
3. Fill in name, password and select a category.
4. Submit.
Step #3, Devise enforces presence_of_validation for name & pw. But not my custom item called `category`.
How do I do that?
Thanks.
[1]: https://github.com/plataformatec/devise/wiki/How%20To:%20Email-only%20sign-up | ruby-on-rails | ruby-on-rails-3 | devise | null | null | null | open | How do I do 'validates_presence_of' new column in Devise - other than email & pw on the User model?
===
This is my `User` model:
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable, :token_authenticatable, :confirmable, :timeoutable,
:recoverable, :rememberable, :trackable, :validatable,
:email_regexp => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i
attr_accessible :email, :password, :password_confirmation, :remember_me, :name, :confirmed_at, :confirmation_token, :category_ids
validates_uniqueness_of :email, :case_sensitive => false
validates_confirmation_of :password
end
What I want to do is to enforce the presence of 'category_ids' on an 'activated' account.
I am doing [Email Only Sign-up][1] - which is important to note, because it is a two-stage process. The first time a user enters their email address, they are sent an activation email - with a link to `Confirmations` controller.
The view for that `Confirmations Controller` has the additional details that need to be validated.
If I just did a regular `validates_presence_of` on the `User` model, then when a user initially submits just an email address - Rails would fail it (which I don't want).
The user should:
1. Enter email address
2. Click confirmation/activation link in email
3. Fill in name, password and select a category.
4. Submit.
Step #3, Devise enforces presence_of_validation for name & pw. But not my custom item called `category`.
How do I do that?
Thanks.
[1]: https://github.com/plataformatec/devise/wiki/How%20To:%20Email-only%20sign-up | 0 |
8,890,319 | 01/17/2012 05:56:32 | 427,452 | 08/22/2010 04:44:58 | 3 | 0 | Struts 2 POST Limits | I have a very nasty error in a web app I'm programming in Struts 2.
I have a quite complicated web form where most of the fields are disabled by default and they are enabled by the use of checkboxes. When all the optional blocks are disabled and only the main one is enabled, the form works perfectly, but when I enable at least one of the blocks, things become awful.
After many debug attempts, I observed that when one of the auxiliar block is enabled, when I submit the form it doesn't reach the action and just tries to refresh itself, which causes a lot of problems as many of the lists I use to populate the comboboxes are load on run by jQuery, so it produces Exceptions like
`tag 'select', field 'list', name 'f_sel_pais': The requested list key 'paises' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location]`
because most of the lists are null when it tries to reload itself. I also have the load of the default lists on a separate input() method rather than in a prepare() method as the latter would load itself in every call of the action and this is something that generally drains resources innecessarilly.
I have no idea why this happens. My best guess is that, as the form is rather complicated, surpasses the size limit of a form in struts 2, which causes this rare behaviour, but I haven't found a thing about something like that so it may be something else.
The form is very extense and complicated, but if it helps you to get a clue of what my problem is, here is it;
<div class="body" style="width: auto">
<h1><s:property value="Title"/> Familia</h1>
<s:set name="listSex" value="#{'M':'Masculino','F':'Femenino'}"/>
<s:form theme="simple" id="fForm" action="familia!save" onsubmit="checkLocs()">
<table>
<tr><td><s:checkbox name="check_report"/><label>Imprimir un Reporte al Guardar</label></td><td><s:submit value="Grabar"/></td></tr>
<s:hidden name="curFamilia.id" value="%{curFamilia.id}"/>
<tr><td><label>Nombre de Familia:</label></td><td colspan="3"><s:textfield cssClass="required" cssStyle="width:100%;" name="curFamilia.denominador" id="txtFamilia" value="%{curFamilia.denominador}"/></td></tr>
<tr><td><label>País de Residencia</label></td><td><s:select cssClass="required" name="f_sel_pais" id="f_lpais" value="%{curFamilia.pais.id}" list="paises" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(1,this,'f_')"/></td><td><label>Zona:</label></td><td><s:textfield cssClass="required" id="f_zona" name="curFamilia.zona" value="%{curFamilia.zona}"/></td></tr>
<tr><td><label>Departamento de Residencia</label></td><td><s:select cssClass="required" name="f_sel_dep" id="f_ldep" value="%{curFamilia.departamento.id}" list="f_ldep" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(2,this,'f_')"/></td><td><label>Dirección:</label></td><td><s:textfield cssClass="required" id="f_dir" name="curFamilia.direccion" value="%{curFamilia.direccion}"/></td></tr>
<tr><td><label>Otro Departamento:</label></td><td><s:textfield id="f_o_dep" name="f_o_dep" disabled="true" /></td><td><label>Teléfono:</label></td><td><s:textfield cssClass="required" id="f_telf" name="curFamilia.telefono" value="%{curFamilia.telefono}"/></td></tr>
<tr><td><label>Provincia de Residencia</label></td><td><s:select cssClass="required" name="f_sel_prov" id="f_lprov" value="%{curFamilia.provincia.id}" list="f_lprov" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(3,this,'f_')"/></td><td><label>Correo:</label></td><td><s:textfield id="f_email" cssClass="required" name="curFamilia.correo" value="%{curFamilia.correo}"/></td></tr>
<tr><td><label>Otra Provincia:</label></td><td><s:textfield id="f_o_prov" name="f_o_prov" disabled="true" /></td></tr>
<tr><td><label>Distrito de Residencia</label></td><td><s:select cssClass="required" name="f_sel_dist" id="f_ldist" value="%{curFamilia.distrito.id}" list="f_ldist" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(4,this,'f_')"/></td></tr>
<tr><td><label>Otro Distrito:</label></td><td><s:textfield id="f_o_dist" name="f_o_dist" disabled="true" /></td></tr>
</table>
<table>
<tr>
<td>
<div id="cellPadre">
<table>
<s:hidden name="curFamilia.papa.id" value="%{curFamilia.papa.id}"/>
<tr><td colspan="2"><h3><s:checkbox name="checkPadre" id="checkPadre" value="%{checkPadre}" onchange="toggle(this,'p_')"/>Padre</h3></td></tr>
<tr><td><label>Nombres:</label></td><td><s:textfield name="curFamilia.papa.nombre" id="p_nombre" value="%{curFamilia.papa.nombre}"/></td></tr>
<tr><td><label>Apellido Paterno:</label></td><td><s:textfield name="curFamilia.papa.apepat" id="p_apepat" value="%{curFamilia.papa.apepat}"/></td></tr>
<tr><td><label>Apellido Materno:</label></td><td><s:textfield name="curFamilia.papa.apemat" id="p_apemat" value="%{curFamilia.papa.apemat}"/></td></tr>
<tr><td><label>Sexo</label></td><td><s:select name="curFamilia.papa.sexo" id="p_sex" value="M" list="#listSex"/></td></tr>
<tr><td><label>DNI o Documento:</label></td><td><s:textfield name="curFamilia.papa.dni" id="p_dni" value="%{curFamilia.papa.dni}"/></td></tr>
<tr><td><label>Teléfono:</label></td><td><s:textfield name="curFamilia.papa.telefono" id="p_telf" value="%{curFamilia.papa.telefono}"/></td></tr>
<tr><td><label>Celular:</label></td><td><s:textfield name="curFamilia.papa.celular" id="p_cel" value="%{curFamilia.papa.celular}"/></td></tr>
<tr><td><label>Correo:</label></td><td><s:textfield name="curFamilia.papa.correo" id="p_mail" value="%{curFamilia.papa.correo}"/></td></tr>
<tr><td><label>Nacionalidad:</label></td><td><s:select name="p_sel_nac" id="p_nac" value="%{curFamilia.papa.nacionalidad.id}" list="paises" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione"/></td></tr>
<tr><td><label>País de Residencia:</label></td><td><s:select name="p_sel_pais" id="p_lpais" value="%{curFamilia.papa.pais.id}" list="paises" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(1,this,'p_')"/></td></tr>
<tr><td><label>Departamento de Residencia</label></td><td><s:select name="p_sel_dep" id="p_ldep" value="%{curFamilia.papa.departamento.id}" list="p_ldep" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(2,this,'p_')"/></td></tr>
<tr><td><label>Otro Departamento:</label></td><td><s:textfield id="p_o_dep" name="p_o_dep" disabled="true" /></td></tr>
<tr><td><label>Provincia de Residencia</label></td><td><s:select name="p_sel_prov" id="p_lprov" value="%{curFamilia.papa.provincia.id}" list="p_lprov" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(3,this,'p_')"/></td></tr>
<tr><td><label>Otra Provincia:</label></td><td><s:textfield id="p_o_prov" name="p_o_prov" disabled="true" /></td></tr>
<tr><td><label>Distrito de Residencia</label></td><td><s:select name="p_sel_dist" id="p_ldist" value="%{curFamilia.papa.distrito.id}" list="p_ldist" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(4,this,'p_')"/></td></tr>
<tr><td><label>Otro Distrito:</label></td><td><s:textfield id="p_o_dist" name="p_o_dist" disabled="true" /></td></tr>
<tr><td><label>Dirección:</label></td><td><s:textfield name="curFamilia.papa.direccion" id="p_direc" value="%{curFamilia.papa.direccion}"/></td></tr>
<tr><td><label>Año de Promoción:</label></td><td><s:textfield id="p_txtFechaNac" name="curFamilia.papa.anhopromo" value="%{curFamilia.papa.anhopromo}"/></td></tr>
<tr><td><label>Grado de Estudio:</label></td><td><s:select name="curFamilia.papa.grado" id="p_grado" value="%{curFamilia.papa.grado}" list="grados" listValue="getMensaje()"/></td></tr>
<tr><td><label>Centro de Labor:</label></td><td><s:textfield name="curFamilia.papa.lugar_trabajo" id="p_labor" value="%{curFamilia.papa.lugar_trabajo}"/></td></tr>
<tr><td><label>Cargo:</label></td><td><s:textfield name="curFamilia.papa.cargo" id="p_cargo" value="%{curFamilia.papa.cargo}"/></td></tr>
<tr><td><label>Dir. de Labor:</label></td><td><s:textfield name="curFamilia.papa.direccion_trabajo" id="p_dirtrab" value="%{curFamilia.papa.direccion_trabajo}"/></td></tr>
<tr><td><label>Teléfono de Labor:</label></td><td><s:textfield name="curFamilia.papa.telefono_trabajo" id="p_telftrab" value="%{curFamilia.papa.telefono_trabajo}"/></td></tr>
<tr><td><label>Religión:</label></td><td><s:select cssClass="required" name="curFamilia.papa.religion" id="p_relig" value="%{curFamilia.papa.religion}" list="religiones" listValue="mensaje" headerKey="" headerValue="Seleccione"/></td></tr>
<tr><td><label>Parroguia:</label></td><td><s:textfield cssClass="required" name="curFamilia.papa.parroquia" id="p_parr" value="%{curFamilia.papa.parroquia}"/></td></tr>
<tr><td><label>Dir. de Parroguia:</label></td><td><s:textfield name="curFamilia.papa.direccion_parroquia" id="p_dirparr" value="%{curFamilia.papa.direccion_parroquia}"/></td></tr>
</table>
</div>
</td>
<td>
<div id="cellMadre">
<table>
<s:hidden name="curFamilia.mama.id" value="%{curFamilia.papa.id}"/>
<tr><td colspan="2"><h3><s:checkbox name="checkMadre" id="checkMadre" value="%{checkMadre}" onchange="toggle(this,'m_')"/>Madre</h3></td></tr>
<tr><td><label>Nombres:</label></td><td><s:textfield name="curFamilia.mama.nombre" id="m_nombre" value="%{curFamilia.mama.nombre}"/></td></tr>
<tr><td><label>Apellido Paterno:</label></td><td><s:textfield name="curFamilia.mama.apepat" id="m_apepat" value="%{curFamilia.mama.apepat}"/></td></tr>
<tr><td><label>Apellido Materno:</label></td><td><s:textfield name="curFamilia.mama.apemat" id="m_apemat" value="%{curFamilia.mama.apemat}"/></td></tr>
<tr><td><label>Sexo</label></td><td><s:select name="curFamilia.mama.sexo" id="m_sex" value="M" list="#listSex"/></td></tr>
<tr><td><label>DNI o Documento:</label></td><td><s:textfield name="curFamilia.mama.dni" id="m_dni" value="%{curFamilia.mama.dni}"/></td></tr>
<tr><td><label>Teléfono:</label></td><td><s:textfield name="curFamilia.mama.telefono" id="m_telf" value="%{curFamilia.mama.telefono}"/></td></tr>
<tr><td><label>Celular:</label></td><td><s:textfield name="curFamilia.mama.celular" id="m_cel" value="%{curFamilia.mama.celular}"/></td></tr>
<tr><td><label>Correo:</label></td><td><s:textfield name="curFamilia.mama.correo" id="m_mail" value="%{curFamilia.mama.correo}"/></td></tr>
<tr><td><label>Nacionalidad:</label></td><td><s:select name="m_sel_nac" id="m_nac" value="%{curFamilia.mama.nacionalidad.id}" list="paises" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione"/></td></tr>
<tr><td><label>País de Residencia:</label></td><td><s:select name="m_sel_pais" id="m_lpais" value="%{curFamilia.mama.pais.id}" list="paises" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(1,this,'m_')"/></td></tr>
<tr><td><label>Departamento de Residencia</label></td><td><s:select name="m_sel_dep" id="m_ldep" value="%{curFamilia.mama.departamento.id}" list="m_ldep" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(2,this,'m_')"/></td></tr>
<tr><td><label>Otro Departamento:</label></td><td><s:textfield id="m_o_dep" name="m_o_dep" disabled="true" /></td></tr>
<tr><td><label>Provincia de Residencia</label></td><td><s:select name="m_sel_prov" id="m_lprov" value="%{curFamilia.mama.provincia.id}" list="m_lprov" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(3,this,'m_')"/></td></tr>
<tr><td><label>Otra Provincia:</label></td><td><s:textfield id="m_o_prov" name="m_o_prov" disabled="true" /></td></tr>
<tr><td><label>Distrito de Residencia</label></td><td><s:select name="m_sel_dist" id="m_ldist" value="%{curFamilia.mama.distrito.id}" list="m_ldist" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(4,this,'m_')"/></td></tr>
<tr><td><label>Otro Distrito:</label></td><td><s:textfield id="m_o_dist" name="m_o_dist" disabled="true" /></td></tr>
<tr><td><label>Dirección:</label></td><td><s:textfield name="curFamilia.mama.direccion" id="m_direc" value="%{curFamilia.mama.direccion}"/></td></tr>
<tr><td><label>Fecha de Nac.</label></td><td><s:textfield id="m_txtFechaNac" name="curFamilia.mama.fechanac" value="%{curFamilia.mama.formatFecha()}"/></td></tr>
<tr><td><label>Año de Promoción:</label></td><td><s:textfield id="m_txtFechaNac" name="curFamilia.mama.anhopromo" value="%{curFamilia.mama.anhopromo}"/></td></tr>
<tr><td><label>Grado de Estudio:</label></td><td><s:select name="curFamilia.mama.grado" id="m_grado" value="%{curFamilia.mama.grado}" list="grados" listValue="getMensaje()"/></td></tr>
<tr><td><label>Centro de Labor:</label></td><td><s:textfield name="curFamilia.mama.lugar_trabajo" id="m_labor" value="%{curFamilia.mama.lugar_trabajo}"/></td></tr>
<tr><td><label>Cargo:</label></td><td><s:textfield name="curFamilia.mama.cargo" id="m_cargo" value="%{curFamilia.mama.cargo}"/></td></tr>
<tr><td><label>Dir. de Labor:</label></td><td><s:textfield name="curFamilia.mama.direccion_trabajo" id="m_dirtrab" value="%{curFamilia.mama.direccion_trabajo}"/></td></tr>
<tr><td><label>Teléfono de Labor:</label></td><td><s:textfield name="curFamilia.mama.telefono_trabajo" id="m_telftrab" value="%{curFamilia.mama.telefono_trabajo}"/></td></tr>
<tr><td><label>Religión:</label></td><td><s:select cssClass="required" id="m_relig" name="curFamilia.mama.religion" value="%{curFamilia.mama.religion}" list="religiones" listValue="mensaje" headerKey="" headerValue="Seleccione"/></td></tr>
<tr><td><label>Parroguia:</label></td><td><s:textfield name="curFamilia.mama.parroquia" id="m_parr" value="%{curFamilia.mama.parroquia}"/></td></tr>
<tr><td><label>Dir. de Parroguia:</label></td><td><s:textfield name="curFamilia.mama.direccion_parroquia" id="m_dirparr" value="%{curFamilia.mama.direccion_parroquia}"/></td></tr>
</table>
</div>
</td>
<td>
<div id="cellTutor">
<table>
<s:hidden name="curFamilia.tutor.id" value="%{curFamilia.tutor.id}"/>
<tr><td colspan="2"><h3><s:checkbox name="checkTutor" id="checkTutor" value="%{checkTutor}" onchange="toggle(this,'t_')"/>Tutor</h3></td></tr>
<tr><td><label>Nombres:</label></td><td><s:textfield name="curFamilia.tutor.nombre" id="t_nombre" value="%{curFamilia.tutor.nombre}"/></td></tr>
<tr><td><label>Apellido Paterno:</label></td><td><s:textfield name="curFamilia.tutor.apepat" id="t_apepat" value="%{curFamilia.tutor.apepat}"/></td></tr>
<tr><td><label>Apellido Materno:</label></td><td><s:textfield name="curFamilia.tutor.apemat" id="t_apemat" value="%{curFamilia.tutor.apemat}"/></td></tr>
<tr><td><label>Sexo</label></td><td><s:select name="curFamilia.tutor.sexo" id="t_sex" value="M" list="#listSex"/></td></tr>
<tr><td><label>DNI o Documento:</label></td><td><s:textfield name="curFamilia.tutor.dni" id="t_dni" value="%{curFamilia.tutor.dni}"/></td></tr>
<tr><td><label>Teléfono:</label></td><td><s:textfield name="curFamilia.tutor.telefono" id="t_telf" value="%{curFamilia.tutor.telefono}"/></td></tr>
<tr><td><label>Celular:</label></td><td><s:textfield name="curFamilia.tutor.celular" id="t_cel" value="%{curFamilia.tutor.celular}"/></td></tr>
<tr><td><label>Correo:</label></td><td><s:textfield name="curFamilia.tutor.correo" id="t_mail" value="%{curFamilia.tutor.correo}"/></td></tr>
<tr><td><label>Nacionalidad:</label></td><td><s:select name="t_sel_nac" id="t_nac" value="%{curFamilia.tutor.nacionalidad.id}" list="paises" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione"/></td></tr>
<tr><td><label>País de Residencia:</label></td><td><s:select name="t_sel_pais" id="t_lpais" value="%{curFamilia.tutor.pais.id}" list="paises" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(1,this,'t_')"/></td></tr>
<tr><td><label>Departamento de Residencia</label></td><td><s:select name="t_sel_dep" id="t_ldep" value="%{curFamilia.tutor.departamento.id}" list="t_ldep" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(2,this,'t_')"/></td></tr>
<tr><td><label>Otro Departamento:</label></td><td><s:textfield id="t_o_dep" name="t_o_dep" disabled="true" /></td></tr>
<tr><td><label>Provincia de Residencia</label></td><td><s:select name="t_sel_prov" id="t_lprov" value="%{curFamilia.tutor.provincia.id}" list="t_lprov" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(3,this,'t_')"/></td></tr>
<tr><td><label>Otra Provincia:</label></td><td><s:textfield id="t_o_prov" name="t_o_prov" disabled="true" /></td></tr>
<tr><td><label>Distrito de Residencia</label></td><td><s:select name="t_sel_dist" id="t_ldist" value="%{curFamilia.tutor.distrito.id}" list="t_ldist" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(4,this,'t_')"/></td></tr>
<tr><td><label>Otro Distrito:</label></td><td><s:textfield id="t_o_dist" name="t_o_dist" disabled="true" /></td></tr>
<tr><td><label>Dirección:</label></td><td><s:textfield name="curFamilia.tutor.direccion" id="t_direc" value="%{curFamilia.tutor.direccion}"/></td></tr>
<tr><td><label>Fecha de Nac.</label></td><td><s:textfield id="t_txtFechaNac" name="curFamilia.tutor.fechanac" value="%{curFamilia.tutor.formatFecha()}"/></td></tr>
<tr><td><label>Año de Promoción:</label></td><td><s:textfield id="t_txtFechaNac" name="curFamilia.tutor.anhopromo" value="%{curFamilia.tutor.anhopromo}"/></td></tr>
<tr><td><label>Grado de Estudio:</label></td><td><s:select name="curFamilia.tutor.grado" id="t_grado" value="%{curFamilia.tutor.grado}" list="grados" listValue="getMensaje()"/></td></tr>
<tr><td><label>Centro de Labor:</label></td><td><s:textfield name="curFamilia.tutor.lugar_trabajo" id="t_labor" value="%{curFamilia.tutor.lugar_trabajo}"/></td></tr>
<tr><td><label>Cargo:</label></td><td><s:textfield name="curFamilia.tutor.cargo" id="t_cargo" value="%{curFamilia.tutor.cargo}"/></td></tr>
<tr><td><label>Dir. de Labor:</label></td><td><s:textfield name="curFamilia.tutor.direccion_trabajo" id="t_dirtrab" value="%{curFamilia.tutor.direccion_trabajo}"/></td></tr>
<tr><td><label>Teléfono de Labor:</label></td><td><s:textfield name="curFamilia.tutor.telefono_trabajo" id="t_telftrab" value="%{curFamilia.tutor.telefono_trabajo}"/></td></tr>
<tr><td><label>Religión:</label></td><td><s:select cssClass="required" id="t_relig" name="curFamilia.tutor.religion" value="%{curFamilia.tutor.religion}" list="religiones" listValue="mensaje" headerKey="" headerValue="Seleccione"/></td></tr>
<tr><td><label>Parroquia:</label></td><td><s:textfield name="curFamilia.tutor.iglesia" id="t_parr" value="%{curFamilia.tutor.iglesia}"/></td></tr>
<tr><td><label>Dir. de Parroguia:</label></td><td><s:textfield name="curFamilia.tutor.direccion_parroquia" id="t_dirparr" value="%{curFamilia.tutor.direccion_parroquia}"/></td></tr>
</table>
</div>
</td>
</tr>
</table>
</s:form>
</div>
Thank you for your time, Any help on this will be highly appreciated | post | struts2 | action | limits | .refresh | 01/17/2012 06:28:25 | not a real question | Struts 2 POST Limits
===
I have a very nasty error in a web app I'm programming in Struts 2.
I have a quite complicated web form where most of the fields are disabled by default and they are enabled by the use of checkboxes. When all the optional blocks are disabled and only the main one is enabled, the form works perfectly, but when I enable at least one of the blocks, things become awful.
After many debug attempts, I observed that when one of the auxiliar block is enabled, when I submit the form it doesn't reach the action and just tries to refresh itself, which causes a lot of problems as many of the lists I use to populate the comboboxes are load on run by jQuery, so it produces Exceptions like
`tag 'select', field 'list', name 'f_sel_pais': The requested list key 'paises' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location]`
because most of the lists are null when it tries to reload itself. I also have the load of the default lists on a separate input() method rather than in a prepare() method as the latter would load itself in every call of the action and this is something that generally drains resources innecessarilly.
I have no idea why this happens. My best guess is that, as the form is rather complicated, surpasses the size limit of a form in struts 2, which causes this rare behaviour, but I haven't found a thing about something like that so it may be something else.
The form is very extense and complicated, but if it helps you to get a clue of what my problem is, here is it;
<div class="body" style="width: auto">
<h1><s:property value="Title"/> Familia</h1>
<s:set name="listSex" value="#{'M':'Masculino','F':'Femenino'}"/>
<s:form theme="simple" id="fForm" action="familia!save" onsubmit="checkLocs()">
<table>
<tr><td><s:checkbox name="check_report"/><label>Imprimir un Reporte al Guardar</label></td><td><s:submit value="Grabar"/></td></tr>
<s:hidden name="curFamilia.id" value="%{curFamilia.id}"/>
<tr><td><label>Nombre de Familia:</label></td><td colspan="3"><s:textfield cssClass="required" cssStyle="width:100%;" name="curFamilia.denominador" id="txtFamilia" value="%{curFamilia.denominador}"/></td></tr>
<tr><td><label>País de Residencia</label></td><td><s:select cssClass="required" name="f_sel_pais" id="f_lpais" value="%{curFamilia.pais.id}" list="paises" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(1,this,'f_')"/></td><td><label>Zona:</label></td><td><s:textfield cssClass="required" id="f_zona" name="curFamilia.zona" value="%{curFamilia.zona}"/></td></tr>
<tr><td><label>Departamento de Residencia</label></td><td><s:select cssClass="required" name="f_sel_dep" id="f_ldep" value="%{curFamilia.departamento.id}" list="f_ldep" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(2,this,'f_')"/></td><td><label>Dirección:</label></td><td><s:textfield cssClass="required" id="f_dir" name="curFamilia.direccion" value="%{curFamilia.direccion}"/></td></tr>
<tr><td><label>Otro Departamento:</label></td><td><s:textfield id="f_o_dep" name="f_o_dep" disabled="true" /></td><td><label>Teléfono:</label></td><td><s:textfield cssClass="required" id="f_telf" name="curFamilia.telefono" value="%{curFamilia.telefono}"/></td></tr>
<tr><td><label>Provincia de Residencia</label></td><td><s:select cssClass="required" name="f_sel_prov" id="f_lprov" value="%{curFamilia.provincia.id}" list="f_lprov" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(3,this,'f_')"/></td><td><label>Correo:</label></td><td><s:textfield id="f_email" cssClass="required" name="curFamilia.correo" value="%{curFamilia.correo}"/></td></tr>
<tr><td><label>Otra Provincia:</label></td><td><s:textfield id="f_o_prov" name="f_o_prov" disabled="true" /></td></tr>
<tr><td><label>Distrito de Residencia</label></td><td><s:select cssClass="required" name="f_sel_dist" id="f_ldist" value="%{curFamilia.distrito.id}" list="f_ldist" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(4,this,'f_')"/></td></tr>
<tr><td><label>Otro Distrito:</label></td><td><s:textfield id="f_o_dist" name="f_o_dist" disabled="true" /></td></tr>
</table>
<table>
<tr>
<td>
<div id="cellPadre">
<table>
<s:hidden name="curFamilia.papa.id" value="%{curFamilia.papa.id}"/>
<tr><td colspan="2"><h3><s:checkbox name="checkPadre" id="checkPadre" value="%{checkPadre}" onchange="toggle(this,'p_')"/>Padre</h3></td></tr>
<tr><td><label>Nombres:</label></td><td><s:textfield name="curFamilia.papa.nombre" id="p_nombre" value="%{curFamilia.papa.nombre}"/></td></tr>
<tr><td><label>Apellido Paterno:</label></td><td><s:textfield name="curFamilia.papa.apepat" id="p_apepat" value="%{curFamilia.papa.apepat}"/></td></tr>
<tr><td><label>Apellido Materno:</label></td><td><s:textfield name="curFamilia.papa.apemat" id="p_apemat" value="%{curFamilia.papa.apemat}"/></td></tr>
<tr><td><label>Sexo</label></td><td><s:select name="curFamilia.papa.sexo" id="p_sex" value="M" list="#listSex"/></td></tr>
<tr><td><label>DNI o Documento:</label></td><td><s:textfield name="curFamilia.papa.dni" id="p_dni" value="%{curFamilia.papa.dni}"/></td></tr>
<tr><td><label>Teléfono:</label></td><td><s:textfield name="curFamilia.papa.telefono" id="p_telf" value="%{curFamilia.papa.telefono}"/></td></tr>
<tr><td><label>Celular:</label></td><td><s:textfield name="curFamilia.papa.celular" id="p_cel" value="%{curFamilia.papa.celular}"/></td></tr>
<tr><td><label>Correo:</label></td><td><s:textfield name="curFamilia.papa.correo" id="p_mail" value="%{curFamilia.papa.correo}"/></td></tr>
<tr><td><label>Nacionalidad:</label></td><td><s:select name="p_sel_nac" id="p_nac" value="%{curFamilia.papa.nacionalidad.id}" list="paises" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione"/></td></tr>
<tr><td><label>País de Residencia:</label></td><td><s:select name="p_sel_pais" id="p_lpais" value="%{curFamilia.papa.pais.id}" list="paises" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(1,this,'p_')"/></td></tr>
<tr><td><label>Departamento de Residencia</label></td><td><s:select name="p_sel_dep" id="p_ldep" value="%{curFamilia.papa.departamento.id}" list="p_ldep" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(2,this,'p_')"/></td></tr>
<tr><td><label>Otro Departamento:</label></td><td><s:textfield id="p_o_dep" name="p_o_dep" disabled="true" /></td></tr>
<tr><td><label>Provincia de Residencia</label></td><td><s:select name="p_sel_prov" id="p_lprov" value="%{curFamilia.papa.provincia.id}" list="p_lprov" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(3,this,'p_')"/></td></tr>
<tr><td><label>Otra Provincia:</label></td><td><s:textfield id="p_o_prov" name="p_o_prov" disabled="true" /></td></tr>
<tr><td><label>Distrito de Residencia</label></td><td><s:select name="p_sel_dist" id="p_ldist" value="%{curFamilia.papa.distrito.id}" list="p_ldist" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(4,this,'p_')"/></td></tr>
<tr><td><label>Otro Distrito:</label></td><td><s:textfield id="p_o_dist" name="p_o_dist" disabled="true" /></td></tr>
<tr><td><label>Dirección:</label></td><td><s:textfield name="curFamilia.papa.direccion" id="p_direc" value="%{curFamilia.papa.direccion}"/></td></tr>
<tr><td><label>Año de Promoción:</label></td><td><s:textfield id="p_txtFechaNac" name="curFamilia.papa.anhopromo" value="%{curFamilia.papa.anhopromo}"/></td></tr>
<tr><td><label>Grado de Estudio:</label></td><td><s:select name="curFamilia.papa.grado" id="p_grado" value="%{curFamilia.papa.grado}" list="grados" listValue="getMensaje()"/></td></tr>
<tr><td><label>Centro de Labor:</label></td><td><s:textfield name="curFamilia.papa.lugar_trabajo" id="p_labor" value="%{curFamilia.papa.lugar_trabajo}"/></td></tr>
<tr><td><label>Cargo:</label></td><td><s:textfield name="curFamilia.papa.cargo" id="p_cargo" value="%{curFamilia.papa.cargo}"/></td></tr>
<tr><td><label>Dir. de Labor:</label></td><td><s:textfield name="curFamilia.papa.direccion_trabajo" id="p_dirtrab" value="%{curFamilia.papa.direccion_trabajo}"/></td></tr>
<tr><td><label>Teléfono de Labor:</label></td><td><s:textfield name="curFamilia.papa.telefono_trabajo" id="p_telftrab" value="%{curFamilia.papa.telefono_trabajo}"/></td></tr>
<tr><td><label>Religión:</label></td><td><s:select cssClass="required" name="curFamilia.papa.religion" id="p_relig" value="%{curFamilia.papa.religion}" list="religiones" listValue="mensaje" headerKey="" headerValue="Seleccione"/></td></tr>
<tr><td><label>Parroguia:</label></td><td><s:textfield cssClass="required" name="curFamilia.papa.parroquia" id="p_parr" value="%{curFamilia.papa.parroquia}"/></td></tr>
<tr><td><label>Dir. de Parroguia:</label></td><td><s:textfield name="curFamilia.papa.direccion_parroquia" id="p_dirparr" value="%{curFamilia.papa.direccion_parroquia}"/></td></tr>
</table>
</div>
</td>
<td>
<div id="cellMadre">
<table>
<s:hidden name="curFamilia.mama.id" value="%{curFamilia.papa.id}"/>
<tr><td colspan="2"><h3><s:checkbox name="checkMadre" id="checkMadre" value="%{checkMadre}" onchange="toggle(this,'m_')"/>Madre</h3></td></tr>
<tr><td><label>Nombres:</label></td><td><s:textfield name="curFamilia.mama.nombre" id="m_nombre" value="%{curFamilia.mama.nombre}"/></td></tr>
<tr><td><label>Apellido Paterno:</label></td><td><s:textfield name="curFamilia.mama.apepat" id="m_apepat" value="%{curFamilia.mama.apepat}"/></td></tr>
<tr><td><label>Apellido Materno:</label></td><td><s:textfield name="curFamilia.mama.apemat" id="m_apemat" value="%{curFamilia.mama.apemat}"/></td></tr>
<tr><td><label>Sexo</label></td><td><s:select name="curFamilia.mama.sexo" id="m_sex" value="M" list="#listSex"/></td></tr>
<tr><td><label>DNI o Documento:</label></td><td><s:textfield name="curFamilia.mama.dni" id="m_dni" value="%{curFamilia.mama.dni}"/></td></tr>
<tr><td><label>Teléfono:</label></td><td><s:textfield name="curFamilia.mama.telefono" id="m_telf" value="%{curFamilia.mama.telefono}"/></td></tr>
<tr><td><label>Celular:</label></td><td><s:textfield name="curFamilia.mama.celular" id="m_cel" value="%{curFamilia.mama.celular}"/></td></tr>
<tr><td><label>Correo:</label></td><td><s:textfield name="curFamilia.mama.correo" id="m_mail" value="%{curFamilia.mama.correo}"/></td></tr>
<tr><td><label>Nacionalidad:</label></td><td><s:select name="m_sel_nac" id="m_nac" value="%{curFamilia.mama.nacionalidad.id}" list="paises" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione"/></td></tr>
<tr><td><label>País de Residencia:</label></td><td><s:select name="m_sel_pais" id="m_lpais" value="%{curFamilia.mama.pais.id}" list="paises" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(1,this,'m_')"/></td></tr>
<tr><td><label>Departamento de Residencia</label></td><td><s:select name="m_sel_dep" id="m_ldep" value="%{curFamilia.mama.departamento.id}" list="m_ldep" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(2,this,'m_')"/></td></tr>
<tr><td><label>Otro Departamento:</label></td><td><s:textfield id="m_o_dep" name="m_o_dep" disabled="true" /></td></tr>
<tr><td><label>Provincia de Residencia</label></td><td><s:select name="m_sel_prov" id="m_lprov" value="%{curFamilia.mama.provincia.id}" list="m_lprov" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(3,this,'m_')"/></td></tr>
<tr><td><label>Otra Provincia:</label></td><td><s:textfield id="m_o_prov" name="m_o_prov" disabled="true" /></td></tr>
<tr><td><label>Distrito de Residencia</label></td><td><s:select name="m_sel_dist" id="m_ldist" value="%{curFamilia.mama.distrito.id}" list="m_ldist" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(4,this,'m_')"/></td></tr>
<tr><td><label>Otro Distrito:</label></td><td><s:textfield id="m_o_dist" name="m_o_dist" disabled="true" /></td></tr>
<tr><td><label>Dirección:</label></td><td><s:textfield name="curFamilia.mama.direccion" id="m_direc" value="%{curFamilia.mama.direccion}"/></td></tr>
<tr><td><label>Fecha de Nac.</label></td><td><s:textfield id="m_txtFechaNac" name="curFamilia.mama.fechanac" value="%{curFamilia.mama.formatFecha()}"/></td></tr>
<tr><td><label>Año de Promoción:</label></td><td><s:textfield id="m_txtFechaNac" name="curFamilia.mama.anhopromo" value="%{curFamilia.mama.anhopromo}"/></td></tr>
<tr><td><label>Grado de Estudio:</label></td><td><s:select name="curFamilia.mama.grado" id="m_grado" value="%{curFamilia.mama.grado}" list="grados" listValue="getMensaje()"/></td></tr>
<tr><td><label>Centro de Labor:</label></td><td><s:textfield name="curFamilia.mama.lugar_trabajo" id="m_labor" value="%{curFamilia.mama.lugar_trabajo}"/></td></tr>
<tr><td><label>Cargo:</label></td><td><s:textfield name="curFamilia.mama.cargo" id="m_cargo" value="%{curFamilia.mama.cargo}"/></td></tr>
<tr><td><label>Dir. de Labor:</label></td><td><s:textfield name="curFamilia.mama.direccion_trabajo" id="m_dirtrab" value="%{curFamilia.mama.direccion_trabajo}"/></td></tr>
<tr><td><label>Teléfono de Labor:</label></td><td><s:textfield name="curFamilia.mama.telefono_trabajo" id="m_telftrab" value="%{curFamilia.mama.telefono_trabajo}"/></td></tr>
<tr><td><label>Religión:</label></td><td><s:select cssClass="required" id="m_relig" name="curFamilia.mama.religion" value="%{curFamilia.mama.religion}" list="religiones" listValue="mensaje" headerKey="" headerValue="Seleccione"/></td></tr>
<tr><td><label>Parroguia:</label></td><td><s:textfield name="curFamilia.mama.parroquia" id="m_parr" value="%{curFamilia.mama.parroquia}"/></td></tr>
<tr><td><label>Dir. de Parroguia:</label></td><td><s:textfield name="curFamilia.mama.direccion_parroquia" id="m_dirparr" value="%{curFamilia.mama.direccion_parroquia}"/></td></tr>
</table>
</div>
</td>
<td>
<div id="cellTutor">
<table>
<s:hidden name="curFamilia.tutor.id" value="%{curFamilia.tutor.id}"/>
<tr><td colspan="2"><h3><s:checkbox name="checkTutor" id="checkTutor" value="%{checkTutor}" onchange="toggle(this,'t_')"/>Tutor</h3></td></tr>
<tr><td><label>Nombres:</label></td><td><s:textfield name="curFamilia.tutor.nombre" id="t_nombre" value="%{curFamilia.tutor.nombre}"/></td></tr>
<tr><td><label>Apellido Paterno:</label></td><td><s:textfield name="curFamilia.tutor.apepat" id="t_apepat" value="%{curFamilia.tutor.apepat}"/></td></tr>
<tr><td><label>Apellido Materno:</label></td><td><s:textfield name="curFamilia.tutor.apemat" id="t_apemat" value="%{curFamilia.tutor.apemat}"/></td></tr>
<tr><td><label>Sexo</label></td><td><s:select name="curFamilia.tutor.sexo" id="t_sex" value="M" list="#listSex"/></td></tr>
<tr><td><label>DNI o Documento:</label></td><td><s:textfield name="curFamilia.tutor.dni" id="t_dni" value="%{curFamilia.tutor.dni}"/></td></tr>
<tr><td><label>Teléfono:</label></td><td><s:textfield name="curFamilia.tutor.telefono" id="t_telf" value="%{curFamilia.tutor.telefono}"/></td></tr>
<tr><td><label>Celular:</label></td><td><s:textfield name="curFamilia.tutor.celular" id="t_cel" value="%{curFamilia.tutor.celular}"/></td></tr>
<tr><td><label>Correo:</label></td><td><s:textfield name="curFamilia.tutor.correo" id="t_mail" value="%{curFamilia.tutor.correo}"/></td></tr>
<tr><td><label>Nacionalidad:</label></td><td><s:select name="t_sel_nac" id="t_nac" value="%{curFamilia.tutor.nacionalidad.id}" list="paises" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione"/></td></tr>
<tr><td><label>País de Residencia:</label></td><td><s:select name="t_sel_pais" id="t_lpais" value="%{curFamilia.tutor.pais.id}" list="paises" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(1,this,'t_')"/></td></tr>
<tr><td><label>Departamento de Residencia</label></td><td><s:select name="t_sel_dep" id="t_ldep" value="%{curFamilia.tutor.departamento.id}" list="t_ldep" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(2,this,'t_')"/></td></tr>
<tr><td><label>Otro Departamento:</label></td><td><s:textfield id="t_o_dep" name="t_o_dep" disabled="true" /></td></tr>
<tr><td><label>Provincia de Residencia</label></td><td><s:select name="t_sel_prov" id="t_lprov" value="%{curFamilia.tutor.provincia.id}" list="t_lprov" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(3,this,'t_')"/></td></tr>
<tr><td><label>Otra Provincia:</label></td><td><s:textfield id="t_o_prov" name="t_o_prov" disabled="true" /></td></tr>
<tr><td><label>Distrito de Residencia</label></td><td><s:select name="t_sel_dist" id="t_ldist" value="%{curFamilia.tutor.distrito.id}" list="t_ldist" listKey="id" listValue="nombre" headerKey="" headerValue="Seleccione" onchange="changer(4,this,'t_')"/></td></tr>
<tr><td><label>Otro Distrito:</label></td><td><s:textfield id="t_o_dist" name="t_o_dist" disabled="true" /></td></tr>
<tr><td><label>Dirección:</label></td><td><s:textfield name="curFamilia.tutor.direccion" id="t_direc" value="%{curFamilia.tutor.direccion}"/></td></tr>
<tr><td><label>Fecha de Nac.</label></td><td><s:textfield id="t_txtFechaNac" name="curFamilia.tutor.fechanac" value="%{curFamilia.tutor.formatFecha()}"/></td></tr>
<tr><td><label>Año de Promoción:</label></td><td><s:textfield id="t_txtFechaNac" name="curFamilia.tutor.anhopromo" value="%{curFamilia.tutor.anhopromo}"/></td></tr>
<tr><td><label>Grado de Estudio:</label></td><td><s:select name="curFamilia.tutor.grado" id="t_grado" value="%{curFamilia.tutor.grado}" list="grados" listValue="getMensaje()"/></td></tr>
<tr><td><label>Centro de Labor:</label></td><td><s:textfield name="curFamilia.tutor.lugar_trabajo" id="t_labor" value="%{curFamilia.tutor.lugar_trabajo}"/></td></tr>
<tr><td><label>Cargo:</label></td><td><s:textfield name="curFamilia.tutor.cargo" id="t_cargo" value="%{curFamilia.tutor.cargo}"/></td></tr>
<tr><td><label>Dir. de Labor:</label></td><td><s:textfield name="curFamilia.tutor.direccion_trabajo" id="t_dirtrab" value="%{curFamilia.tutor.direccion_trabajo}"/></td></tr>
<tr><td><label>Teléfono de Labor:</label></td><td><s:textfield name="curFamilia.tutor.telefono_trabajo" id="t_telftrab" value="%{curFamilia.tutor.telefono_trabajo}"/></td></tr>
<tr><td><label>Religión:</label></td><td><s:select cssClass="required" id="t_relig" name="curFamilia.tutor.religion" value="%{curFamilia.tutor.religion}" list="religiones" listValue="mensaje" headerKey="" headerValue="Seleccione"/></td></tr>
<tr><td><label>Parroquia:</label></td><td><s:textfield name="curFamilia.tutor.iglesia" id="t_parr" value="%{curFamilia.tutor.iglesia}"/></td></tr>
<tr><td><label>Dir. de Parroguia:</label></td><td><s:textfield name="curFamilia.tutor.direccion_parroquia" id="t_dirparr" value="%{curFamilia.tutor.direccion_parroquia}"/></td></tr>
</table>
</div>
</td>
</tr>
</table>
</s:form>
</div>
Thank you for your time, Any help on this will be highly appreciated | 1 |
10,317,898 | 04/25/2012 14:34:05 | 1,356,474 | 04/25/2012 14:28:23 | 1 | 0 | Convert apache rewrites to nginx rewrites | We're about to move our application from Apache to NginX. Our application is a nifty user of mod_rewrite to make seo friendly urls. But for some reason, we're not able to fully transform the rewrites from apache to nginx.
Our Apache rewrites is viewable at: http://pastebin.com/3k4faVYr
And our NginX rewrites is viewable at: http://pastebin.com/iFazM36c
Is there anybody who're able to assist in the rewrites? | apache | mod-rewrite | nginx | null | null | 04/26/2012 14:36:48 | off topic | Convert apache rewrites to nginx rewrites
===
We're about to move our application from Apache to NginX. Our application is a nifty user of mod_rewrite to make seo friendly urls. But for some reason, we're not able to fully transform the rewrites from apache to nginx.
Our Apache rewrites is viewable at: http://pastebin.com/3k4faVYr
And our NginX rewrites is viewable at: http://pastebin.com/iFazM36c
Is there anybody who're able to assist in the rewrites? | 2 |
5,287,380 | 03/13/2011 04:15:27 | 629,223 | 02/22/2011 22:46:32 | 21 | 1 | I need help with classes. (C++) | Well I am trying to do an exercise in my programming book and it's difficult for me to grasp exactly what it wants.
My "enterAccountData()" function is suppose to ask the user for an account number and a balance neither of which can be negative and the account number cannot be less than 1000
The second one is the one I am stuck on "computeInterest()" THis function is suppose to accept an integer argument that represents the number of years the account will earn interest. The function then displays the account number from the previous function and displays its ending balance at the end of each year based on the interest rate attached to the BankAccount class. (The interest rate on "BankAccount" has to be a constant static field which is set at 3 percent(0.03)).
So My question is this: How do I set up "computeInterest()" too allow it to calculate the interest using the constant static field when my debugger will not allow me to actually keep the field as a constant? I am not trying to stop any random errors from happening for now, just trying to get the jist of what the book is exactly asking for. Here is my code.
#include <iostream>
#include <iomanip>
using namespace std;
class BankAccount
{
private:
int accountNum;
double accountBal;
static double annualIntRate;
public:
void enterAccountData(int, double);
void computeInterest();
void displayAccount();
};
//implementation section:
double BankAccount::annualIntRate = 0.03;
void BankAccount::enterAccountData(int number, double balance)
{
cout << setprecision(2) << fixed;
accountNum = number;
accountBal = balance;
cout << "Enter the account number " << endl;
cin >> number;
while(number < 0 || number < 999)
{
cout << "Account numbers cannot be negative or less than 1000 " <<
"Enter a new account number: " << endl;
cin >> number;
}
cout << "Enter the account balance " << endl;
cin >> balance;
while(balance < 0)
{
cout << "Account balances cannot be negative. " <<
"Enter a new account balance: " << endl;
cin >> balance;
}
return;
}
void BankAccount::computeInterest()
{
const int MONTHS_IN_YEAR = 12;
int months;
double rate = 0;
int counter = 0;
BankAccount::annualIntRate = rate;
cout << "How many months will the account be held for? ";
cin >> months;
counter = 0;
do
{
balance = accountBal * rate + accountBal;
counter++;
}while(months < counter);
cout << "Balance is:$" << accountBal << endl;
}
int main()
{
const int QUIT = 0;
const int MAX_ACCOUNTS = 10;
int counter;
int input;
int number = 0;
double balance = 0;
BankAccount accounts[MAX_ACCOUNTS];
//BankAccount display;
counter = 0;
do
{
accounts[counter].enterAccountData(number, balance);
cout << " Enter " << QUIT << " to stop, or press 1 to proceed.";
cin >> input;
counter++;
}while(input != QUIT && counter != 10);
accounts[counter].computeInterest();
system("pause");
return 0;
} | c++ | class | null | null | null | null | open | I need help with classes. (C++)
===
Well I am trying to do an exercise in my programming book and it's difficult for me to grasp exactly what it wants.
My "enterAccountData()" function is suppose to ask the user for an account number and a balance neither of which can be negative and the account number cannot be less than 1000
The second one is the one I am stuck on "computeInterest()" THis function is suppose to accept an integer argument that represents the number of years the account will earn interest. The function then displays the account number from the previous function and displays its ending balance at the end of each year based on the interest rate attached to the BankAccount class. (The interest rate on "BankAccount" has to be a constant static field which is set at 3 percent(0.03)).
So My question is this: How do I set up "computeInterest()" too allow it to calculate the interest using the constant static field when my debugger will not allow me to actually keep the field as a constant? I am not trying to stop any random errors from happening for now, just trying to get the jist of what the book is exactly asking for. Here is my code.
#include <iostream>
#include <iomanip>
using namespace std;
class BankAccount
{
private:
int accountNum;
double accountBal;
static double annualIntRate;
public:
void enterAccountData(int, double);
void computeInterest();
void displayAccount();
};
//implementation section:
double BankAccount::annualIntRate = 0.03;
void BankAccount::enterAccountData(int number, double balance)
{
cout << setprecision(2) << fixed;
accountNum = number;
accountBal = balance;
cout << "Enter the account number " << endl;
cin >> number;
while(number < 0 || number < 999)
{
cout << "Account numbers cannot be negative or less than 1000 " <<
"Enter a new account number: " << endl;
cin >> number;
}
cout << "Enter the account balance " << endl;
cin >> balance;
while(balance < 0)
{
cout << "Account balances cannot be negative. " <<
"Enter a new account balance: " << endl;
cin >> balance;
}
return;
}
void BankAccount::computeInterest()
{
const int MONTHS_IN_YEAR = 12;
int months;
double rate = 0;
int counter = 0;
BankAccount::annualIntRate = rate;
cout << "How many months will the account be held for? ";
cin >> months;
counter = 0;
do
{
balance = accountBal * rate + accountBal;
counter++;
}while(months < counter);
cout << "Balance is:$" << accountBal << endl;
}
int main()
{
const int QUIT = 0;
const int MAX_ACCOUNTS = 10;
int counter;
int input;
int number = 0;
double balance = 0;
BankAccount accounts[MAX_ACCOUNTS];
//BankAccount display;
counter = 0;
do
{
accounts[counter].enterAccountData(number, balance);
cout << " Enter " << QUIT << " to stop, or press 1 to proceed.";
cin >> input;
counter++;
}while(input != QUIT && counter != 10);
accounts[counter].computeInterest();
system("pause");
return 0;
} | 0 |
3,218,385 | 07/10/2010 07:57:07 | 262,627 | 01/30/2010 20:04:08 | 419 | 14 | Basic drawing tools for .NET application | I need a control that allows loading a picture, performing some basic drawing tasks with it (including adding text, pencil, oval, horizontal and diagonal lines), and exporting it as bitmap.
Anything like that available?
Thanks | .net | drawing | bitmap | picture | null | null | open | Basic drawing tools for .NET application
===
I need a control that allows loading a picture, performing some basic drawing tasks with it (including adding text, pencil, oval, horizontal and diagonal lines), and exporting it as bitmap.
Anything like that available?
Thanks | 0 |
7,658,428 | 10/05/2011 08:11:52 | 1,866 | 08/19/2008 00:19:07 | 260 | 4 | Custom wcf data provider and debugging a relationship error | I'm implementing a custom data provider, I have gotten it to the point that it returns data and can be filtered, but am having some trouble getting relationships to work.
When querying the metadata the relationships look correct, and when querying a table the related property links appear, but when attempting to access a ResourceReference property I get the following exception:
Object reference not set to an instance of an object.
System.NullReferenceException
stacktrace at System.Data.Services.Providers.DataServiceProviderWrapper.GetResourceAssociationSet(ResourceSetWrapper resourceSet, ResourceType resourceType, ResourceProperty resourceProperty)
at System.Data.Services.Providers.DataServiceProviderWrapper.GetContainer(ResourceSetWrapper sourceContainer, ResourceType sourceResourceType, ResourceProperty navigationProperty)
at System.Data.Services.Providers.DataServiceProviderWrapper.GetResourceProperties(ResourceSetWrapper resourceSet, ResourceType resourceType)
at System.Data.Services.Serializers.SyndicationSerializer.WriteObjectProperties(IExpandedResult expanded, Object customObject, ResourceType resourceType, Uri absoluteUri, String relativeUri, SyndicationItem item, DictionaryContent content, EpmSourcePathSegment currentSourceRoot)
at System.Data.Services.Serializers.SyndicationSerializer.WriteEntryElement(IExpandedResult expanded, Object element, ResourceType expectedType, Uri absoluteUri, String relativeUri, SyndicationItem target)
at System.Data.Services.Serializers.SyndicationSerializer.WriteTopLevelElement(IExpandedResult expanded, Object element)
at System.Data.Services.Serializers.Serializer.WriteRequest(IEnumerator queryResults, Boolean hasMoved)
at System.Data.Services.ResponseBodyWriter.Write(Stream stream)
Here's a sample of how I create the relationships:
var sourceReference = new ResourceProperty(
relatedType.ResourceTypeName,
ResourcePropertyKind.ResourceReference,
relatedType.ResourceType);
sourceReference.CanReflectOnInstanceTypeProperty = false;
compoundType.ResourceType.AddProperty(sourceReference);
var destinationReference = new ResourceProperty(
compoundType.ResourceSetName,
ResourcePropertyKind.ResourceSetReference,
compoundType.ResourceType);
destinationReference.CanReflectOnInstanceTypeProperty = false;
source.ResourceType.AddProperty(destinationReference);
var sourceAssociation = new ResourceAssociationSet(
"source",
new ResourceAssociationSetEnd(compoundType.ResourceSet, compoundType.ResourceType, sourceReference),
new ResourceAssociationSetEnd(relatedType.ResourceSet, relatedType.ResourceType, null));
var destinationAssociation = new ResourceAssociationSet(
"destination",
new ResourceAssociationSetEnd(relatedType.ResourceSet, relatedType.ResourceType, destinationReference),
new ResourceAssociationSetEnd(compoundType.ResourceSet, compoundType.ResourceType, null));
From looking at the sample code on the OData website I thought I'd done it all correctly, and cannot determine my error. Any ideas? or tips on debugging a custom WCF Data service? | wcf | wcf-data-services | null | null | null | null | open | Custom wcf data provider and debugging a relationship error
===
I'm implementing a custom data provider, I have gotten it to the point that it returns data and can be filtered, but am having some trouble getting relationships to work.
When querying the metadata the relationships look correct, and when querying a table the related property links appear, but when attempting to access a ResourceReference property I get the following exception:
Object reference not set to an instance of an object.
System.NullReferenceException
stacktrace at System.Data.Services.Providers.DataServiceProviderWrapper.GetResourceAssociationSet(ResourceSetWrapper resourceSet, ResourceType resourceType, ResourceProperty resourceProperty)
at System.Data.Services.Providers.DataServiceProviderWrapper.GetContainer(ResourceSetWrapper sourceContainer, ResourceType sourceResourceType, ResourceProperty navigationProperty)
at System.Data.Services.Providers.DataServiceProviderWrapper.GetResourceProperties(ResourceSetWrapper resourceSet, ResourceType resourceType)
at System.Data.Services.Serializers.SyndicationSerializer.WriteObjectProperties(IExpandedResult expanded, Object customObject, ResourceType resourceType, Uri absoluteUri, String relativeUri, SyndicationItem item, DictionaryContent content, EpmSourcePathSegment currentSourceRoot)
at System.Data.Services.Serializers.SyndicationSerializer.WriteEntryElement(IExpandedResult expanded, Object element, ResourceType expectedType, Uri absoluteUri, String relativeUri, SyndicationItem target)
at System.Data.Services.Serializers.SyndicationSerializer.WriteTopLevelElement(IExpandedResult expanded, Object element)
at System.Data.Services.Serializers.Serializer.WriteRequest(IEnumerator queryResults, Boolean hasMoved)
at System.Data.Services.ResponseBodyWriter.Write(Stream stream)
Here's a sample of how I create the relationships:
var sourceReference = new ResourceProperty(
relatedType.ResourceTypeName,
ResourcePropertyKind.ResourceReference,
relatedType.ResourceType);
sourceReference.CanReflectOnInstanceTypeProperty = false;
compoundType.ResourceType.AddProperty(sourceReference);
var destinationReference = new ResourceProperty(
compoundType.ResourceSetName,
ResourcePropertyKind.ResourceSetReference,
compoundType.ResourceType);
destinationReference.CanReflectOnInstanceTypeProperty = false;
source.ResourceType.AddProperty(destinationReference);
var sourceAssociation = new ResourceAssociationSet(
"source",
new ResourceAssociationSetEnd(compoundType.ResourceSet, compoundType.ResourceType, sourceReference),
new ResourceAssociationSetEnd(relatedType.ResourceSet, relatedType.ResourceType, null));
var destinationAssociation = new ResourceAssociationSet(
"destination",
new ResourceAssociationSetEnd(relatedType.ResourceSet, relatedType.ResourceType, destinationReference),
new ResourceAssociationSetEnd(compoundType.ResourceSet, compoundType.ResourceType, null));
From looking at the sample code on the OData website I thought I'd done it all correctly, and cannot determine my error. Any ideas? or tips on debugging a custom WCF Data service? | 0 |
4,806,415 | 01/26/2011 15:35:19 | 590,808 | 01/26/2011 15:14:23 | 1 | 0 | DEVELOPMENT COST FOR iPAD APPLICATION AND ON GOING MAINTENANCE | I'm working on cost associated with an Ipad App I would like to have developed. The application would serve as a simple data editing tool for a SQL Server 2008 database. The user would be supplied a record from the DB and would make corrections within the record and "submit" the changes to the system. I'm not worried about having the most advanced graphics/display but would like to make sure at least 1 new release/update is generated each year based on user feedback. I've seen estimates for development cost between 10/hour to 250/hour. Has any one had any experience in developing Ipad apps and pricing the cost associated with them? Also, what types of features in the apps tend to push the cost up or down during development. Lastly, is it safe to assume maintenance cost for future updates would run the same cost as development cost?
Thanks,
Jarrod | ipad | maintenance | outsourcing | null | null | 01/26/2011 15:37:36 | off topic | DEVELOPMENT COST FOR iPAD APPLICATION AND ON GOING MAINTENANCE
===
I'm working on cost associated with an Ipad App I would like to have developed. The application would serve as a simple data editing tool for a SQL Server 2008 database. The user would be supplied a record from the DB and would make corrections within the record and "submit" the changes to the system. I'm not worried about having the most advanced graphics/display but would like to make sure at least 1 new release/update is generated each year based on user feedback. I've seen estimates for development cost between 10/hour to 250/hour. Has any one had any experience in developing Ipad apps and pricing the cost associated with them? Also, what types of features in the apps tend to push the cost up or down during development. Lastly, is it safe to assume maintenance cost for future updates would run the same cost as development cost?
Thanks,
Jarrod | 2 |
9,361,332 | 02/20/2012 12:45:21 | 459,943 | 09/27/2010 21:00:17 | 222 | 8 | How can I add LBtnMouseDown event to edit control | I want when a "LBUTTONDOWN" on edit control, empty the text box.
I know how can I empty the text box , but I don't know where is the place where this event is added .
**My dialog function:**
INT CALLBACK dlgProc(HWND hwnd, unsigned int msg, WPARAM wp, LPARAM lp){
switch(msg){
case WM_INITDIALOG:
SetDlgItemText(hwnd, IDC_EDIT1, L"Please enter the txt");
break;
case WM_COMMAND:
switch(LOWORD(wp)){
case BTN_EXIT:
DestroyWindow(hwnd);
break;
case IDC_BUTTON1:
int len = GetWindowTextLength(GetDlgItem(hwnd,IDC_EDIT1));
if(len > 0){
TCHAR *buff = new TCHAR[len+1];
GetDlgItemText(hwnd, IDC_EDIT1, buff, len+1);
MessageBox(NULL,buff,L"Error message",MB_OK);
delete buff;
}
break;
}
break;
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return false;
}
return true;
}
| winapi | null | null | null | null | null | open | How can I add LBtnMouseDown event to edit control
===
I want when a "LBUTTONDOWN" on edit control, empty the text box.
I know how can I empty the text box , but I don't know where is the place where this event is added .
**My dialog function:**
INT CALLBACK dlgProc(HWND hwnd, unsigned int msg, WPARAM wp, LPARAM lp){
switch(msg){
case WM_INITDIALOG:
SetDlgItemText(hwnd, IDC_EDIT1, L"Please enter the txt");
break;
case WM_COMMAND:
switch(LOWORD(wp)){
case BTN_EXIT:
DestroyWindow(hwnd);
break;
case IDC_BUTTON1:
int len = GetWindowTextLength(GetDlgItem(hwnd,IDC_EDIT1));
if(len > 0){
TCHAR *buff = new TCHAR[len+1];
GetDlgItemText(hwnd, IDC_EDIT1, buff, len+1);
MessageBox(NULL,buff,L"Error message",MB_OK);
delete buff;
}
break;
}
break;
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return false;
}
return true;
}
| 0 |
4,174,599 | 11/13/2010 20:42:31 | 362,479 | 06/09/2010 13:33:56 | 36 | 0 | sql stored procedure parameter problem | I have this weird problem with one of my SP's.
I have a SP and one of the parameters is nvarchar type.
and I am declaring the parameter, I am including value too, but when I am running there is no data returned.
short example:
@BookName nvarchar = null
Then in the where clause I have:
AND (o.BookName = @BookName OR @BookName IS NULL)
No data is returned.
But when I am doing:
AND (o.BookName = 'SQL Book' OR @BookName IS NULL)
I am getting the proper results.
Just to let you know that the field is no FK.
Any ideas what can be the reason?
Thanks
| sql | stored-procedures | null | null | null | null | open | sql stored procedure parameter problem
===
I have this weird problem with one of my SP's.
I have a SP and one of the parameters is nvarchar type.
and I am declaring the parameter, I am including value too, but when I am running there is no data returned.
short example:
@BookName nvarchar = null
Then in the where clause I have:
AND (o.BookName = @BookName OR @BookName IS NULL)
No data is returned.
But when I am doing:
AND (o.BookName = 'SQL Book' OR @BookName IS NULL)
I am getting the proper results.
Just to let you know that the field is no FK.
Any ideas what can be the reason?
Thanks
| 0 |
3,257,629 | 07/15/2010 16:19:53 | 357,349 | 06/03/2010 10:26:33 | 74 | 1 | Transfer App from LG to Droid | I need to test Android App specifically on LG Ally mobile. I am on windows and unable to find driver. I am unable to test it.
I can deploy app on Droid, however it doesn't work with Droid (I know Apps should be universal and should work independent of Device make, but this acts weird as it involves muting and unmuting of microphone and for some reason Droid gives up on me).
Is there a way to download app on Droid and then transfer it to LG mobile. | android | null | null | null | null | 07/15/2010 17:24:14 | off topic | Transfer App from LG to Droid
===
I need to test Android App specifically on LG Ally mobile. I am on windows and unable to find driver. I am unable to test it.
I can deploy app on Droid, however it doesn't work with Droid (I know Apps should be universal and should work independent of Device make, but this acts weird as it involves muting and unmuting of microphone and for some reason Droid gives up on me).
Is there a way to download app on Droid and then transfer it to LG mobile. | 2 |
11,415,477 | 07/10/2012 14:25:14 | 1,463,542 | 06/18/2012 11:41:49 | 84 | 1 | How can i make my php file public? | I have apache server with easyphp. And i want my friend to open my php file in his browser with my ip adress. So how can i do that? Thanks. | php | apache | null | null | null | 07/10/2012 16:06:41 | off topic | How can i make my php file public?
===
I have apache server with easyphp. And i want my friend to open my php file in his browser with my ip adress. So how can i do that? Thanks. | 2 |
10,140,001 | 04/13/2012 11:31:44 | 1,270,187 | 03/14/2012 21:30:31 | 52 | 1 | For loop for second items in list of lists only. (python) | What I have
-----------
is something like this
def mymethod():
return [[1,2,3,4],
[1,2,3,4],
[1,2,3,4],
[1,2,3,4]]
mylist = mymethod()
for _, thing, _, _ in mylist:
print thing
# this bit is meant to be outside the for loop,
# I mean it to represent the last value thing was in the for
if thing:
print thing
## What I want ##
what I want to do is avoid the dummy variables, is there a smarter way to do this than
for thing in mylist:
print thing[2]
because then i would have to use `thing[2]` any other time I needed it, without assigning it to a new variable and then things are just getting messy.
newish to python so sorry if I'm missing something obvious | python | coding-style | for-loop | nested-lists | null | null | open | For loop for second items in list of lists only. (python)
===
What I have
-----------
is something like this
def mymethod():
return [[1,2,3,4],
[1,2,3,4],
[1,2,3,4],
[1,2,3,4]]
mylist = mymethod()
for _, thing, _, _ in mylist:
print thing
# this bit is meant to be outside the for loop,
# I mean it to represent the last value thing was in the for
if thing:
print thing
## What I want ##
what I want to do is avoid the dummy variables, is there a smarter way to do this than
for thing in mylist:
print thing[2]
because then i would have to use `thing[2]` any other time I needed it, without assigning it to a new variable and then things are just getting messy.
newish to python so sorry if I'm missing something obvious | 0 |
7,679,349 | 10/06/2011 19:20:26 | 982,827 | 10/06/2011 18:59:20 | 1 | 0 | How can i use rake cache and is it in rails 3.1? | Is rake-cache a default gem in rails 3.1? I'm interesting in proxy cashing so how can i write my code for using it? Can i write code for browser caching and will it work with proxy cashing?
P.S. Sorry for my English! | ruby-on-rails | rack-cache | null | null | null | null | open | How can i use rake cache and is it in rails 3.1?
===
Is rake-cache a default gem in rails 3.1? I'm interesting in proxy cashing so how can i write my code for using it? Can i write code for browser caching and will it work with proxy cashing?
P.S. Sorry for my English! | 0 |
9,308,033 | 02/16/2012 08:46:34 | 486,301 | 10/25/2010 10:37:08 | 11 | 1 | Android Bluetooth chat for android device and Bluetooth SPP device | I Am able to connect SPP Device with Android device successfully,I used Android Bluetooth chat for this with well-known UUID:00001101-0000-1000-8000-00805F9B34FB.But i am not able to receive message properly.
Can any one help me in this,
Thanks in advance...
| android | uuid | rfcomm | null | null | null | open | Android Bluetooth chat for android device and Bluetooth SPP device
===
I Am able to connect SPP Device with Android device successfully,I used Android Bluetooth chat for this with well-known UUID:00001101-0000-1000-8000-00805F9B34FB.But i am not able to receive message properly.
Can any one help me in this,
Thanks in advance...
| 0 |
7,405,880 | 09/13/2011 17:20:41 | 927,768 | 09/04/2011 17:10:25 | 1 | 0 | Hibernate querying issue | I have the following code on the webservice that uses Hibernate
Session session = ICDBHibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
User user = (User) session.load(User.class, userid);
userId is a paramter sent from the client.
User class
package com.icdb.data;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
public class User implements java.io.Serializable {
private Integer userid;
private String username;
private String email;
private String password;
private String firstname;
private String lastname;
// private String streetaddress;
// private String city;
// private String phone;
private String state;
private String country;
private Date birthdate;
// private String zipcode;
private Set usersesForFavoriteuser = new HashSet(0);
private Set recipetipses = new HashSet(0);
private Set recipeses = new HashSet(0);
private Set recipepictureses = new HashSet(0);
private Set onlineuserses = new HashSet(0);
private Set generaltipses = new HashSet(0);
private Set usersesForFollowinguser = new HashSet(0);
private Set recipereviewses = new HashSet(0);
public User() {
}
public User( String username,
String password,
String email,
String firstname,
String lastname,
// String streetaddress,
// String city,
// String phone,
String state,
String country,
Date birthdate )
// String zipcode )
{
this.username = username;
this.password = password;
this.email = email;
this.firstname = firstname;
this.lastname = lastname;
// this.streetaddress = streetaddress;
// this.city = city;
// this.phone = phone;
this.state = state;
this.country = country;
this.birthdate = birthdate;
// this.zipcode = zipcode;
}
public User( String username,
String password,
String email,
String firstname,
String lastname,
// String streetaddress,
// String city,
String phone,
// String state,
// String country,
// String email,
Date birthdate,
// String zipcode,
Set usersesForFavoriteuser,
Set recipetipses,
Set recipeses,
Set recipepictureses,
Set onlineuserses,
Set generaltipses,
Set usersesForFollowinguser,
Set recipereviewses )
{
this.username = username;
this.password = password;
this.email = email;
this.firstname = firstname;
this.lastname = lastname;
// this.streetaddress = streetaddress;
// this.city = city;
// this.phone = phone;
this.state = state;
this.country = country;
this.birthdate = birthdate;
// this.zipcode = zipcode;
this.usersesForFavoriteuser = usersesForFavoriteuser;
this.recipetipses = recipetipses;
this.recipeses = recipeses;
this.recipepictureses = recipepictureses;
this.onlineuserses = onlineuserses;
this.generaltipses = generaltipses;
this.usersesForFollowinguser = usersesForFollowinguser;
this.recipereviewses = recipereviewses;
}
public Integer getUserid() {
return this.userid;
}
public void setUserid(Integer userid) {
this.userid = userid;
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return this.password;
}
public void setPassword(String password) {
this.password = password;
}
public String getFirstname() {
return this.firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getLastname() {
return this.lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
// public String getStreetaddress() {
// return this.streetaddress;
// }
// public void setStreetaddress(String streetaddress) {
// this.streetaddress = streetaddress;
// }
// public String getCity() {
// return this.city;
// }
// public void setCity(String city) {
// this.city = city;
// }
// public String getPhone() {
// return this.phone;
// }
// public void setPhone(String phone) {
// this.phone = phone;
// }
public String getState() {
return this.state;
}
public void setState(String state) {
this.state = state;
}
public String getCountry() {
return this.country;
}
public void setCountry(String country) {
this.country = country;
}
public String getEmail() {
return this.email;
}
public void setEmail(String email) {
this.email = email;
}
public Date getBirthdate() {
return this.birthdate;
}
public void setBirthdate(Date birthdate) {
this.birthdate = birthdate;
}
// public String getZipcode() {
// return this.zipcode;
// }
// public void setZipcode(String zipcode) {
// this.zipcode = zipcode;
// }
public Set getUsersesForFavoriteuser() {
return this.usersesForFavoriteuser;
}
public void setUsersesForFavoriteuser(Set usersesForFavoriteuser) {
this.usersesForFavoriteuser = usersesForFavoriteuser;
}
public Set getRecipetipses() {
return this.recipetipses;
}
public void setRecipetipses(Set recipetipses) {
this.recipetipses = recipetipses;
}
public Set getRecipeses() {
return this.recipeses;
}
public void setRecipeses(Set recipeses) {
this.recipeses = recipeses;
}
public Set getRecipepictureses() {
return this.recipepictureses;
}
public void setRecipepictureses(Set recipepictureses) {
this.recipepictureses = recipepictureses;
}
public Set getOnlineuserses() {
return this.onlineuserses;
}
public void setOnlineuserses(Set onlineuserses) {
this.onlineuserses = onlineuserses;
}
public Set getGeneraltipses() {
return this.generaltipses;
}
public void setGeneraltipses(Set generaltipses) {
this.generaltipses = generaltipses;
}
public Set getUsersesForFollowinguser() {
return this.usersesForFollowinguser;
}
public void setUsersesForFollowinguser(Set usersesForFollowinguser) {
this.usersesForFollowinguser = usersesForFollowinguser;
}
public Set getRecipereviewses() {
return this.recipereviewses;
}
public void setRecipereviewses(Set recipereviewses) {
this.recipereviewses = recipereviewses;
}
}
also userId defined in the .hbm.xml as
<id name="userid" type="java.lang.Integer">
<column name="userid"/>
<generator class="identity"/>
</id>
So we have a table of users and another tables that its FK is userId.
I need to update the code to handle the request with a username - and then retrieve the userId instead of the mentioned code of the webservice.
Please help :)
Yoav
| web-services | hibernate | query | null | null | null | open | Hibernate querying issue
===
I have the following code on the webservice that uses Hibernate
Session session = ICDBHibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
User user = (User) session.load(User.class, userid);
userId is a paramter sent from the client.
User class
package com.icdb.data;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
public class User implements java.io.Serializable {
private Integer userid;
private String username;
private String email;
private String password;
private String firstname;
private String lastname;
// private String streetaddress;
// private String city;
// private String phone;
private String state;
private String country;
private Date birthdate;
// private String zipcode;
private Set usersesForFavoriteuser = new HashSet(0);
private Set recipetipses = new HashSet(0);
private Set recipeses = new HashSet(0);
private Set recipepictureses = new HashSet(0);
private Set onlineuserses = new HashSet(0);
private Set generaltipses = new HashSet(0);
private Set usersesForFollowinguser = new HashSet(0);
private Set recipereviewses = new HashSet(0);
public User() {
}
public User( String username,
String password,
String email,
String firstname,
String lastname,
// String streetaddress,
// String city,
// String phone,
String state,
String country,
Date birthdate )
// String zipcode )
{
this.username = username;
this.password = password;
this.email = email;
this.firstname = firstname;
this.lastname = lastname;
// this.streetaddress = streetaddress;
// this.city = city;
// this.phone = phone;
this.state = state;
this.country = country;
this.birthdate = birthdate;
// this.zipcode = zipcode;
}
public User( String username,
String password,
String email,
String firstname,
String lastname,
// String streetaddress,
// String city,
String phone,
// String state,
// String country,
// String email,
Date birthdate,
// String zipcode,
Set usersesForFavoriteuser,
Set recipetipses,
Set recipeses,
Set recipepictureses,
Set onlineuserses,
Set generaltipses,
Set usersesForFollowinguser,
Set recipereviewses )
{
this.username = username;
this.password = password;
this.email = email;
this.firstname = firstname;
this.lastname = lastname;
// this.streetaddress = streetaddress;
// this.city = city;
// this.phone = phone;
this.state = state;
this.country = country;
this.birthdate = birthdate;
// this.zipcode = zipcode;
this.usersesForFavoriteuser = usersesForFavoriteuser;
this.recipetipses = recipetipses;
this.recipeses = recipeses;
this.recipepictureses = recipepictureses;
this.onlineuserses = onlineuserses;
this.generaltipses = generaltipses;
this.usersesForFollowinguser = usersesForFollowinguser;
this.recipereviewses = recipereviewses;
}
public Integer getUserid() {
return this.userid;
}
public void setUserid(Integer userid) {
this.userid = userid;
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return this.password;
}
public void setPassword(String password) {
this.password = password;
}
public String getFirstname() {
return this.firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getLastname() {
return this.lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
// public String getStreetaddress() {
// return this.streetaddress;
// }
// public void setStreetaddress(String streetaddress) {
// this.streetaddress = streetaddress;
// }
// public String getCity() {
// return this.city;
// }
// public void setCity(String city) {
// this.city = city;
// }
// public String getPhone() {
// return this.phone;
// }
// public void setPhone(String phone) {
// this.phone = phone;
// }
public String getState() {
return this.state;
}
public void setState(String state) {
this.state = state;
}
public String getCountry() {
return this.country;
}
public void setCountry(String country) {
this.country = country;
}
public String getEmail() {
return this.email;
}
public void setEmail(String email) {
this.email = email;
}
public Date getBirthdate() {
return this.birthdate;
}
public void setBirthdate(Date birthdate) {
this.birthdate = birthdate;
}
// public String getZipcode() {
// return this.zipcode;
// }
// public void setZipcode(String zipcode) {
// this.zipcode = zipcode;
// }
public Set getUsersesForFavoriteuser() {
return this.usersesForFavoriteuser;
}
public void setUsersesForFavoriteuser(Set usersesForFavoriteuser) {
this.usersesForFavoriteuser = usersesForFavoriteuser;
}
public Set getRecipetipses() {
return this.recipetipses;
}
public void setRecipetipses(Set recipetipses) {
this.recipetipses = recipetipses;
}
public Set getRecipeses() {
return this.recipeses;
}
public void setRecipeses(Set recipeses) {
this.recipeses = recipeses;
}
public Set getRecipepictureses() {
return this.recipepictureses;
}
public void setRecipepictureses(Set recipepictureses) {
this.recipepictureses = recipepictureses;
}
public Set getOnlineuserses() {
return this.onlineuserses;
}
public void setOnlineuserses(Set onlineuserses) {
this.onlineuserses = onlineuserses;
}
public Set getGeneraltipses() {
return this.generaltipses;
}
public void setGeneraltipses(Set generaltipses) {
this.generaltipses = generaltipses;
}
public Set getUsersesForFollowinguser() {
return this.usersesForFollowinguser;
}
public void setUsersesForFollowinguser(Set usersesForFollowinguser) {
this.usersesForFollowinguser = usersesForFollowinguser;
}
public Set getRecipereviewses() {
return this.recipereviewses;
}
public void setRecipereviewses(Set recipereviewses) {
this.recipereviewses = recipereviewses;
}
}
also userId defined in the .hbm.xml as
<id name="userid" type="java.lang.Integer">
<column name="userid"/>
<generator class="identity"/>
</id>
So we have a table of users and another tables that its FK is userId.
I need to update the code to handle the request with a username - and then retrieve the userId instead of the mentioned code of the webservice.
Please help :)
Yoav
| 0 |
11,347,010 | 07/05/2012 14:57:52 | 1,195,651 | 02/07/2012 20:24:36 | 288 | 0 | looking for a good and correct java implementation of mvc pattern | I'm trying to search on the net some good implementation of java mvc pattern but I found a lot of things and all those things confused me so much.I start from the knowledge of mvc pattern in php language but I don't know how apply on java because I have never done.someone can show me a good and correct implementation? | java | mvc | null | null | null | 07/06/2012 01:06:12 | not a real question | looking for a good and correct java implementation of mvc pattern
===
I'm trying to search on the net some good implementation of java mvc pattern but I found a lot of things and all those things confused me so much.I start from the knowledge of mvc pattern in php language but I don't know how apply on java because I have never done.someone can show me a good and correct implementation? | 1 |
4,868,862 | 02/01/2011 22:49:06 | 239,915 | 12/29/2009 01:52:29 | 509 | 20 | Limiting copas to a particular host: Allowing multiple web servers | I'm trying to limit the host in which copas receives sockets, with the end goal of allowing other web servers to handle requests with other hostnames on the same machine. In this particular case, when I use
copas.addserver(assert(socket.bind("*", 80)),
function(c)
return handler(copas.wrap(c), c:getpeername())
end
)
It correctly handles the request and returns a response as expected. However, when I replace `"*"` with `"localhost"`, my results are mixed. Is this the correct way to go about listening for sockets with a specific hostname (obviously substituting the preferred name in place of localhost)? Will this allow for other web servers to server content alongside it for other hostnames? | sockets | lua | null | null | null | null | open | Limiting copas to a particular host: Allowing multiple web servers
===
I'm trying to limit the host in which copas receives sockets, with the end goal of allowing other web servers to handle requests with other hostnames on the same machine. In this particular case, when I use
copas.addserver(assert(socket.bind("*", 80)),
function(c)
return handler(copas.wrap(c), c:getpeername())
end
)
It correctly handles the request and returns a response as expected. However, when I replace `"*"` with `"localhost"`, my results are mixed. Is this the correct way to go about listening for sockets with a specific hostname (obviously substituting the preferred name in place of localhost)? Will this allow for other web servers to server content alongside it for other hostnames? | 0 |
3,348,307 | 07/27/2010 21:47:52 | 301,860 | 03/25/2010 16:18:35 | 88 | 1 | Non local connections for django project server | I ran the command `python manage.py runserver 0.0.0.0:8000`
It started the server up, but when I navigate to http://myipaddress:8000, my webbroswer doesnt connect. I also tried with my iphone safari brower and got the same thing.
I am using Mac OS X 10.6 and am connect to the the internet through my router.
Any suggestions on how to allow non-local connections so my friends can try out my project?
| django | pinax | django-manage.py | null | null | null | open | Non local connections for django project server
===
I ran the command `python manage.py runserver 0.0.0.0:8000`
It started the server up, but when I navigate to http://myipaddress:8000, my webbroswer doesnt connect. I also tried with my iphone safari brower and got the same thing.
I am using Mac OS X 10.6 and am connect to the the internet through my router.
Any suggestions on how to allow non-local connections so my friends can try out my project?
| 0 |
8,146,167 | 11/16/2011 03:06:00 | 881,703 | 08/06/2011 07:33:09 | 10 | 0 | Get more computation power for developing java application | I'm developing Java application using Eclipse IDE. problem is my PC is every low performance with XP. My company has many PCs free. So is there way to distributed free free computer and get that computer power for my Android application development. | android | eclipse | distributed | null | null | 11/16/2011 06:25:19 | off topic | Get more computation power for developing java application
===
I'm developing Java application using Eclipse IDE. problem is my PC is every low performance with XP. My company has many PCs free. So is there way to distributed free free computer and get that computer power for my Android application development. | 2 |
7,167,216 | 08/23/2011 20:35:09 | 212,246 | 11/16/2009 17:29:52 | 1 | 2 | server bogged and mysql query slow log | i have serious performance problem (all of a sudden) on my server (php+mysql). I enabled mysql slow query log and he started to show some queries that were taking even 25 secs to complete. for example this one takes 15 seconds:
# Time: 110823 2:07:01
# User@Host: ***[***] @ localhost []
# Query_time: 15 Lock_time: 0 Rows_sent: 1 Rows_examined: 1
use ***;
SELECT `users`.*
FROM (`users`)
WHERE `users`.`id` = 4413
ORDER BY `users`.`id` ASC
LIMIT 0, 1;
Point is, on the field Id there is a primary key and if i run the query from phpmyadmin it executes in 0.00008 seconds. This is the explain plan:
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE users const PRIMARY PRIMARY 4 const 1
I am really confused, because the hosting provider it is saying everything is fine and is my database. I checked all the parameters with tuning-primer by Matthew Montgomery and all settings seems fine...
| mysql | performance | query | null | null | null | open | server bogged and mysql query slow log
===
i have serious performance problem (all of a sudden) on my server (php+mysql). I enabled mysql slow query log and he started to show some queries that were taking even 25 secs to complete. for example this one takes 15 seconds:
# Time: 110823 2:07:01
# User@Host: ***[***] @ localhost []
# Query_time: 15 Lock_time: 0 Rows_sent: 1 Rows_examined: 1
use ***;
SELECT `users`.*
FROM (`users`)
WHERE `users`.`id` = 4413
ORDER BY `users`.`id` ASC
LIMIT 0, 1;
Point is, on the field Id there is a primary key and if i run the query from phpmyadmin it executes in 0.00008 seconds. This is the explain plan:
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE users const PRIMARY PRIMARY 4 const 1
I am really confused, because the hosting provider it is saying everything is fine and is my database. I checked all the parameters with tuning-primer by Matthew Montgomery and all settings seems fine...
| 0 |
6,013,978 | 05/16/2011 06:44:07 | 274,299 | 02/16/2010 11:16:32 | 1,457 | 48 | Create muc room programmatically | I need to create multi user chat room from my module. I try to use mod_muc:create/5 -
mod_muc:create_room("conference.localhost", "testroom", "testuser@localhost", "testuser", default).
But when i run client and login, nothing happens. The room doesn't create.
How can i correctly create muc room from my module code? And where i can find in ejabberd mod_muc source code where create_room/5 executes?
Thank you. | erlang | ejabberd | null | null | null | null | open | Create muc room programmatically
===
I need to create multi user chat room from my module. I try to use mod_muc:create/5 -
mod_muc:create_room("conference.localhost", "testroom", "testuser@localhost", "testuser", default).
But when i run client and login, nothing happens. The room doesn't create.
How can i correctly create muc room from my module code? And where i can find in ejabberd mod_muc source code where create_room/5 executes?
Thank you. | 0 |
6,729,133 | 07/18/2011 06:02:14 | 815,186 | 06/25/2011 09:36:14 | 9 | 0 | Fatal error: Uncaught OAuthException: An access token is required to request this resource | I'm accessing the graph api and am getting back an access token , its works fine in Mozilla. but am getting this error in IE:
**Fatal error: Uncaught OAuthException: An access token is required to request this resource**
Thanks in advance!
| php | facebook | api | graph | null | 07/18/2011 20:12:17 | not a real question | Fatal error: Uncaught OAuthException: An access token is required to request this resource
===
I'm accessing the graph api and am getting back an access token , its works fine in Mozilla. but am getting this error in IE:
**Fatal error: Uncaught OAuthException: An access token is required to request this resource**
Thanks in advance!
| 1 |
1,545,715 | 10/09/2009 19:48:27 | 49,684 | 12/29/2008 00:39:20 | 207 | 5 | Flex: Error #2038: File I/O Error | I have a flex app doing multiple file upload, and keep getting this error:
Error #2038: File I/O Error
Flex gives this error, yet it seems to work because the upload does get processed.
This was happening intermittently, now on every attempt. Any ideas on what might be going on here? I've checked that permissions are read/write, google'd something about a trailing slash issue with the url. I'm at a loss as to what could be going on. | flex | upload | null | null | null | 07/24/2012 17:40:55 | too localized | Flex: Error #2038: File I/O Error
===
I have a flex app doing multiple file upload, and keep getting this error:
Error #2038: File I/O Error
Flex gives this error, yet it seems to work because the upload does get processed.
This was happening intermittently, now on every attempt. Any ideas on what might be going on here? I've checked that permissions are read/write, google'd something about a trailing slash issue with the url. I'm at a loss as to what could be going on. | 3 |
11,301,285 | 07/02/2012 21:15:15 | 1,178,191 | 01/30/2012 13:52:56 | 33 | 5 | How to change a view property in CustomAdapter? | I have CustomAdapter extending ArrayAdapter, in which I set some views inside LinearLayout - one row, like this (adapter):
public View getView(int position, View convertView, ViewGroup parent) {
. . .
ImageView statePic = (ImageView) view.findViewById(R.id.state);
statePic.setImageResource(R.drawable.light_green);
return view;
}
This works fine. But now I want to bind a context menu on item in my list, so I have something like this (main activity - listActivity):
public boolean onContextItemSelected(MenuItem item) {
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
switch(item.getItemId()){
case CM_START:
View view = getListAdapter().getView(info.position, null, null);
ImageView statePic = (ImageView)view.findViewById(R.id.state);
// I'm sure this view is the right one
statePic.setImageResource(R.drawable.light_grey);
view.invalidate();
view.refreshDrawableState();
return true;
case CM_STOP:
return true;
}
return super.onContextItemSelected(item);
}
What I want to achieve with this snippet is to change image in that item, but this doesn not work. How can I do that? | android | listview | custom-adapter | null | null | null | open | How to change a view property in CustomAdapter?
===
I have CustomAdapter extending ArrayAdapter, in which I set some views inside LinearLayout - one row, like this (adapter):
public View getView(int position, View convertView, ViewGroup parent) {
. . .
ImageView statePic = (ImageView) view.findViewById(R.id.state);
statePic.setImageResource(R.drawable.light_green);
return view;
}
This works fine. But now I want to bind a context menu on item in my list, so I have something like this (main activity - listActivity):
public boolean onContextItemSelected(MenuItem item) {
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
switch(item.getItemId()){
case CM_START:
View view = getListAdapter().getView(info.position, null, null);
ImageView statePic = (ImageView)view.findViewById(R.id.state);
// I'm sure this view is the right one
statePic.setImageResource(R.drawable.light_grey);
view.invalidate();
view.refreshDrawableState();
return true;
case CM_STOP:
return true;
}
return super.onContextItemSelected(item);
}
What I want to achieve with this snippet is to change image in that item, but this doesn not work. How can I do that? | 0 |
7,412,616 | 09/14/2011 07:19:09 | 245,326 | 01/07/2010 07:08:03 | 337 | 2 | windows phone 7 sms arrival | Is there any way that wp7 application in windows phone
can trace the sms arriving to the windows phone
in which wp7 application is installed in? | c# | .net | windows-phone-7 | null | null | 09/14/2011 13:23:29 | not a real question | windows phone 7 sms arrival
===
Is there any way that wp7 application in windows phone
can trace the sms arriving to the windows phone
in which wp7 application is installed in? | 1 |
11,673,421 | 07/26/2012 16:04:13 | 151,824 | 08/06/2009 14:29:42 | 261 | 14 | regex minify error | I use this [regex][1] to minify my pages. I get the error when there is to much data to handle. (But I only list 186 rows)
If I set the limit in my sql to 20 rows - it works.
My error_log: **child pid 4736 exit signal Segmentation fault (11)**
Is there any idea how to solve this or have someone found a solution?
[1]: http://stackoverflow.com/questions/5312349/minifying-final-html-output-using-regular-expressions-with-codeigniter | php | regex | null | null | null | 07/26/2012 16:53:10 | not a real question | regex minify error
===
I use this [regex][1] to minify my pages. I get the error when there is to much data to handle. (But I only list 186 rows)
If I set the limit in my sql to 20 rows - it works.
My error_log: **child pid 4736 exit signal Segmentation fault (11)**
Is there any idea how to solve this or have someone found a solution?
[1]: http://stackoverflow.com/questions/5312349/minifying-final-html-output-using-regular-expressions-with-codeigniter | 1 |
10,900,776 | 06/05/2012 16:04:13 | 452,058 | 09/19/2010 17:46:15 | 38 | 1 | Templates for phpDoc and PDF | Anyone know where to find some good templates for phpDocumentor2 (phpdoc)?
And also how can I generate PDF through phpdoc?
Thank you in advance for help. | php | php5 | documentation-generation | phpdoc | phpdocumentor | 06/05/2012 16:10:32 | off topic | Templates for phpDoc and PDF
===
Anyone know where to find some good templates for phpDocumentor2 (phpdoc)?
And also how can I generate PDF through phpdoc?
Thank you in advance for help. | 2 |
7,943,287 | 10/30/2011 04:19:41 | 856,088 | 07/21/2011 13:54:12 | 6 | 0 | Auto click on page load | I found a facebook auto like script, its working..
but I want it to work on page load without the visitor need to click.
Is it possible? I have tried jQuery trigger function, but it does not worked. Can anybody tell me how to do it modifying the existing script without adding any new codes or just adding some coded to the existing code?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en" id="ns-sky" xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<title>YourWebsite.com</title>
<script src="jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
var interval;
$(function()
{
interval=setInterval("updateActiveElement();", 50);
});
function updateActiveElement()
{
if ( $(document.activeElement).attr('id')=="fbframe" )
{
clearInterval(interval);
iflag=1;
}
}
</script>
</head>
<body>
Paste your code here....
<!--footer: Paste all codes just above-->
<div style="overflow: hidden; width: 10px; height: 12px; position: absolute; filter:alpha(opacity=0); -moz-opacity:0.0; -khtml-opacity: 0.0; opacity: 0.0;" id="icontainer">
<!--facebook like frame code goes here-->
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fyourwebsite.com%2F&layout=standard&show_faces=false&width=450&action=like&font=tahoma&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:23px;" allowTransparency="true" id="fbframe" name="fbframe"></iframe>
<!--end facebook like frame code-->
</div>
<script>
var iflag = 0;
var icontainer = document.getElementById('icontainer');
var standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
function mouseFollower(e){
/* DO NOT EDIT THIS */
if (window.event)
{ // for IE
icontainer.style.top = (window.event.y-5)+standardbody.scrollTop+'px';
icontainer.style.left = (window.event.x-5)+standardbody.scrollLeft+'px';
}
else
{
icontainer.style.top = (e.pageY-5)+'px';
icontainer.style.left = (e.pageX-5)+'px';
}
}
document.onmousemove = function(e) {
if (iflag == 0) {mouseFollower(e);}
}
</script>
</body>
</html> | javascript | jquery | null | null | null | 10/30/2011 11:51:00 | not constructive | Auto click on page load
===
I found a facebook auto like script, its working..
but I want it to work on page load without the visitor need to click.
Is it possible? I have tried jQuery trigger function, but it does not worked. Can anybody tell me how to do it modifying the existing script without adding any new codes or just adding some coded to the existing code?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en" id="ns-sky" xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<title>YourWebsite.com</title>
<script src="jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
var interval;
$(function()
{
interval=setInterval("updateActiveElement();", 50);
});
function updateActiveElement()
{
if ( $(document.activeElement).attr('id')=="fbframe" )
{
clearInterval(interval);
iflag=1;
}
}
</script>
</head>
<body>
Paste your code here....
<!--footer: Paste all codes just above-->
<div style="overflow: hidden; width: 10px; height: 12px; position: absolute; filter:alpha(opacity=0); -moz-opacity:0.0; -khtml-opacity: 0.0; opacity: 0.0;" id="icontainer">
<!--facebook like frame code goes here-->
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fyourwebsite.com%2F&layout=standard&show_faces=false&width=450&action=like&font=tahoma&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:23px;" allowTransparency="true" id="fbframe" name="fbframe"></iframe>
<!--end facebook like frame code-->
</div>
<script>
var iflag = 0;
var icontainer = document.getElementById('icontainer');
var standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
function mouseFollower(e){
/* DO NOT EDIT THIS */
if (window.event)
{ // for IE
icontainer.style.top = (window.event.y-5)+standardbody.scrollTop+'px';
icontainer.style.left = (window.event.x-5)+standardbody.scrollLeft+'px';
}
else
{
icontainer.style.top = (e.pageY-5)+'px';
icontainer.style.left = (e.pageX-5)+'px';
}
}
document.onmousemove = function(e) {
if (iflag == 0) {mouseFollower(e);}
}
</script>
</body>
</html> | 4 |
8,766,020 | 01/06/2012 23:52:11 | 857,025 | 07/21/2011 23:48:37 | 341 | 11 | What is the average website user's CPU/RAM/GPU? | I'm programming a some sites with javascript/css/dom animation. I'd like to know what computer capabilities I should program to. For example, when laying out a site, I know the average screen size to program for (e.g. the majority of users have at least 1024x768, so that's lowest common denominator), but cannot find anywhere what computer capabilities I should program for. Anyone know? | javascript | dom | optimization | browser | null | 01/06/2012 23:54:17 | off topic | What is the average website user's CPU/RAM/GPU?
===
I'm programming a some sites with javascript/css/dom animation. I'd like to know what computer capabilities I should program to. For example, when laying out a site, I know the average screen size to program for (e.g. the majority of users have at least 1024x768, so that's lowest common denominator), but cannot find anywhere what computer capabilities I should program for. Anyone know? | 2 |
10,646,456 | 05/18/2012 03:49:06 | 768,894 | 05/25/2011 04:41:48 | 494 | 22 | File upload functionality? | I want to implement file upload functionality in my project but the problem is,
<br />
using HTML's <br /><br />`<input type="file">` <br /><br />simply gives a button which allows file upload What I need<br /> is a TextField in front of the button and once I select a file using the button<br /> the full path get displayed in the text box.
Any help?<br><br>
Thanks,<br>
Mohit | javascript | html | clojure | null | null | 05/20/2012 22:53:53 | not a real question | File upload functionality?
===
I want to implement file upload functionality in my project but the problem is,
<br />
using HTML's <br /><br />`<input type="file">` <br /><br />simply gives a button which allows file upload What I need<br /> is a TextField in front of the button and once I select a file using the button<br /> the full path get displayed in the text box.
Any help?<br><br>
Thanks,<br>
Mohit | 1 |
460,136 | 01/20/2009 04:32:12 | 25,915 | 10/07/2008 18:52:13 | 26 | 0 | Windows internet shortcuts: starting with IE maximized? | I have an internet shortcut on my desktop, with the contents looking like this:
[InternetShortcut]
URL=http://www.microsoft.com/isapi/redir.dll?prd=ie&pver=6&ar=IStart
Modified=D03458CE7738C801A2
I was wondering if there are any tweaks I can do to guarantee that the browser starts maximized after someone loads the link.
Thanks! | windows | internet | shortcut | null | null | null | open | Windows internet shortcuts: starting with IE maximized?
===
I have an internet shortcut on my desktop, with the contents looking like this:
[InternetShortcut]
URL=http://www.microsoft.com/isapi/redir.dll?prd=ie&pver=6&ar=IStart
Modified=D03458CE7738C801A2
I was wondering if there are any tweaks I can do to guarantee that the browser starts maximized after someone loads the link.
Thanks! | 0 |
6,593,741 | 07/06/2011 08:46:30 | 823,055 | 06/30/2011 12:44:25 | 1 | 0 | How do I center a 1700px div so that no horizontal scrollbars appear? | I'm building a site with a 1700px wide JS slideshow at the top. When I publish the page, I get horizontal scrollbars since my monitor is on a 1024px resolution. How do I get the site to be centered in the browser with no horizontal scrollbars - and whatever is superfluous on either side simply isn't visible to the user?
Help GREATLY appreciated, thanks!!! | html | css | null | null | null | null | open | How do I center a 1700px div so that no horizontal scrollbars appear?
===
I'm building a site with a 1700px wide JS slideshow at the top. When I publish the page, I get horizontal scrollbars since my monitor is on a 1024px resolution. How do I get the site to be centered in the browser with no horizontal scrollbars - and whatever is superfluous on either side simply isn't visible to the user?
Help GREATLY appreciated, thanks!!! | 0 |
1,908,494 | 12/15/2009 16:08:14 | 109,360 | 05/19/2009 13:09:43 | 1,037 | 64 | c# - combine 2 statements in a catch block into one | Does anybody know if it's possible to write the code in the catch block below as a single statement? I haven't been able to come up with a way, and was just curious if there was one.
IMPORTANT: the stack trace must be preserved.
catch (Exception e)
{
if (e is MyCustomException)
{
// throw original exception
throw;
}
// create custom exception
MyCustomException e2 =
new MyCustomException(
"An error occurred performing the calculation.", e);
throw e2;
}
| c# | exception | null | null | null | null | open | c# - combine 2 statements in a catch block into one
===
Does anybody know if it's possible to write the code in the catch block below as a single statement? I haven't been able to come up with a way, and was just curious if there was one.
IMPORTANT: the stack trace must be preserved.
catch (Exception e)
{
if (e is MyCustomException)
{
// throw original exception
throw;
}
// create custom exception
MyCustomException e2 =
new MyCustomException(
"An error occurred performing the calculation.", e);
throw e2;
}
| 0 |
8,096,437 | 11/11/2011 15:46:52 | 586,840 | 01/24/2011 01:13:24 | 16 | 0 | 'Rare' sorting algorithms? | Our algorithm professor gave us a assignment that requires us to choose a **rare** sorting algorithm (e.g. Introsort, Gnomesort, etc.) and do some research about it.
Wikipedia sure has a plenty of information about this, but it is still not enough for me to do the research in depth.
So I would like to find a book that include discussions of those rare sorting algorithms, since most of the textbooks (like CLRS, the one I am using) only discuss about some basic sorting algorithms (e.g. Bubble Sort, Merge Sort, Insertion Sort.).
Is there a book or website that contains a good amount of those information?
Thanks! | algorithm | sorting | null | null | null | 11/11/2011 23:58:51 | not constructive | 'Rare' sorting algorithms?
===
Our algorithm professor gave us a assignment that requires us to choose a **rare** sorting algorithm (e.g. Introsort, Gnomesort, etc.) and do some research about it.
Wikipedia sure has a plenty of information about this, but it is still not enough for me to do the research in depth.
So I would like to find a book that include discussions of those rare sorting algorithms, since most of the textbooks (like CLRS, the one I am using) only discuss about some basic sorting algorithms (e.g. Bubble Sort, Merge Sort, Insertion Sort.).
Is there a book or website that contains a good amount of those information?
Thanks! | 4 |
7,108,205 | 08/18/2011 13:30:04 | 209,866 | 11/12/2009 19:03:39 | 206 | 6 | How to undo ALTER TABLE in sqlplus i.e. Oracle 10g? | rollback;
doesn't seem to undo alter table changes.
Background:
I'm generating some .sql scripts (based on parsed Hibernate scripts) which are trashing my tables. Importing the full database for testing takes up to 30 minutes (also slowing my machine) and as much as I enjoy taking breaks, i'd prefer to just undo everything with a command such as rollback and try again.
btw this is Oracle 10g Express Edition Release 10.2.0.1.0
Is this even possible? | table | oracle10g | sqlplus | rollback | alter | null | open | How to undo ALTER TABLE in sqlplus i.e. Oracle 10g?
===
rollback;
doesn't seem to undo alter table changes.
Background:
I'm generating some .sql scripts (based on parsed Hibernate scripts) which are trashing my tables. Importing the full database for testing takes up to 30 minutes (also slowing my machine) and as much as I enjoy taking breaks, i'd prefer to just undo everything with a command such as rollback and try again.
btw this is Oracle 10g Express Edition Release 10.2.0.1.0
Is this even possible? | 0 |
8,830,216 | 01/12/2012 04:40:47 | 1,134,982 | 01/06/2012 19:05:20 | 3 | 0 | How to write Generators , list comprehension in python | When i think about any problem , thinking via list comprehension doesn't come naturally.
Whats the best way to think through this?
Regards
Ashish | python | list-comprehension | null | null | null | 01/12/2012 06:33:41 | not a real question | How to write Generators , list comprehension in python
===
When i think about any problem , thinking via list comprehension doesn't come naturally.
Whats the best way to think through this?
Regards
Ashish | 1 |
8,454,359 | 12/10/2011 04:19:14 | 1,090,630 | 12/09/2011 23:21:40 | 3 | 0 | Update XML value in the server with c# | How to update a certain value on a XML file,when xml file is on server?
| c# | xml | null | null | null | 12/10/2011 04:36:25 | not a real question | Update XML value in the server with c#
===
How to update a certain value on a XML file,when xml file is on server?
| 1 |
3,374,437 | 07/30/2010 18:40:04 | 85,178 | 03/31/2009 15:35:26 | 391 | 11 | Where to find ocean and earth data maps usable to simulate water depth level? | Searching on USGS I did not find something easily usable without passing from GIS or similar.
I need only something easy to use, like a high map resolution of the Earth without and with ocean. Have you some hint or advice on how to convert available GIS data? | maps | simulation | generation | null | null | 07/31/2010 02:51:11 | off topic | Where to find ocean and earth data maps usable to simulate water depth level?
===
Searching on USGS I did not find something easily usable without passing from GIS or similar.
I need only something easy to use, like a high map resolution of the Earth without and with ocean. Have you some hint or advice on how to convert available GIS data? | 2 |
3,445,024 | 08/09/2010 23:49:55 | 401,980 | 07/26/2010 06:32:16 | 17 | 1 | jQuery to PHP and back again! | I'd like to pass content back and forth from PHP to jQuery and vice versa. I'm not sure if I fully understand the best way to go about this and am hoping for some best advice and clarification.
Below is an example of something I'm trying to do. The PHP lists the files in a directory (whose path is passed to it from jQuery), stores them in an array, then passes them back to jQuery. I'd like to use the values in that array for various purposes but really I just want to understand passing information back and forth between the two, wether it's from an array, or just a plain variable. *Merci beaucoup!*
**The PHP:**
<?php
$files = array();
$dir = ($_POST['dir']);
$count = 0;
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && strpos($file, '.jpg',1)) {$count++;
$files[$file] = $file;
}
}
closedir($handle);
}
echo json_encode($files);
?>
**The jQuery:**
$(document).ready(function(){
$('a').click( function(e) {
e.preventDefault();
$.post("php.php", 'path/to/directory/',
function(data) {
alert(data);
}, "json");
});
}); | php | jquery | null | null | null | null | open | jQuery to PHP and back again!
===
I'd like to pass content back and forth from PHP to jQuery and vice versa. I'm not sure if I fully understand the best way to go about this and am hoping for some best advice and clarification.
Below is an example of something I'm trying to do. The PHP lists the files in a directory (whose path is passed to it from jQuery), stores them in an array, then passes them back to jQuery. I'd like to use the values in that array for various purposes but really I just want to understand passing information back and forth between the two, wether it's from an array, or just a plain variable. *Merci beaucoup!*
**The PHP:**
<?php
$files = array();
$dir = ($_POST['dir']);
$count = 0;
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && strpos($file, '.jpg',1)) {$count++;
$files[$file] = $file;
}
}
closedir($handle);
}
echo json_encode($files);
?>
**The jQuery:**
$(document).ready(function(){
$('a').click( function(e) {
e.preventDefault();
$.post("php.php", 'path/to/directory/',
function(data) {
alert(data);
}, "json");
});
}); | 0 |
1,798,574 | 11/25/2009 17:26:32 | 181,722 | 09/30/2009 10:21:36 | 36 | 1 | Force WCF to call a method on every request before entering actual function | I have a RESTful WCF service with many different functions. For each function I need to call an authentication method that I have written. I can manually call this method on every request but I was looking for a way to force the WCF engine to call this method before these functions are entered. Does anyone know if this is possible?
Cheers
| wcf | rest | web-services | null | null | null | open | Force WCF to call a method on every request before entering actual function
===
I have a RESTful WCF service with many different functions. For each function I need to call an authentication method that I have written. I can manually call this method on every request but I was looking for a way to force the WCF engine to call this method before these functions are entered. Does anyone know if this is possible?
Cheers
| 0 |
4,985,002 | 02/13/2011 15:31:33 | 563,020 | 01/04/2011 19:16:03 | 46 | 1 | [Android] The method startActivityForResult(Intent, int) is undefined for the type new AdapterView.OnItemClickListener | i'm new to android and i'm trying to code an app which fetches json data off the web, creates a list. if you click on a list item a new activity starts which shows the details of the activity. however i cant seem to start the second activty, i keep getting the error "The method startActivityForResult(Intent, int) is undefined for the type new AdapterView.OnItemClickListener(){}" in eclipse. here is the full source.
any ideas?
public class Main extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
new LongOperation(this).execute();
}
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
new LongOperation(this).execute();
return true;
}
}
class LongOperation extends AsyncTask<String, Void, String> {
private Main longOperationContext = null;
ProgressDialog pd = null;
TextView tv = null;
ListView lv1 = null;
String [] lv_arr;
String [] lv_arr_id;
private static final int ACTIVITY_CREATE = 0;
public LongOperation(Main context) {
longOperationContext = context;
Log.v("LongOper", "Konstuktor");
}
@Override
protected String doInBackground(String... params) {
Log.v("doInBackground", "inside");
try {
URL json = new URL("http://www.ytmusicplayer.com/jsontest.php");
URLConnection tc = json.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(tc.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
JSONArray ja = new JSONArray(line);
Log.v("line = ", " " + ja.length());
lv_arr = new String[ja.length()];
lv_arr_id = new String[ja.length()];
for (int i=0;i<ja.length();i++) {
JSONObject jo = (JSONObject) ja.get(i);
lv_arr[i] = jo.getString("name");
lv_arr_id[i] = jo.getString("id");
}
}
} catch (MalformedURLException e) {
e.printStackTrace();
Log.v("Error", "URL exc");
} catch (IOException e) {
e.printStackTrace();
Log.v("ERROR", "IOEXECPTOIn");
} catch (JSONException e) {
e.printStackTrace();
Log.v("Error", "JsonException");
}
Log.v("Line: ", lv_arr[0] + " - " + lv_arr[1]);
return null;
}
@Override
protected void onPostExecute(String result) {
lv1.setAdapter(new ArrayAdapter<String>(longOperationContext,android.R.layout.simple_list_item_1 , lv_arr));
lv1.setTextFilterEnabled(true);
lv1.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> a, View v, int position, long id) {
Intent i = new Intent(longOperationContext, Details.class);
i.putExtra("id", lv_arr_id[position]);
startActivityForResult(i, ACTIVITY_CREATE);
}
});
pd.hide();
}
protected void onPreExecute() {
lv1 = (ListView)longOperationContext.findViewById(R.id.ListView01);
pd = new ProgressDialog(longOperationContext);
pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);
pd.setMessage("Loading...");
pd.setIndeterminate(true);
pd.setCancelable(false);
pd.show();
}
@Override
protected void onProgressUpdate(Void... values) {
}
}
thanks in advance | android | listview | activity | android-intent | android-asynctask | null | open | [Android] The method startActivityForResult(Intent, int) is undefined for the type new AdapterView.OnItemClickListener
===
i'm new to android and i'm trying to code an app which fetches json data off the web, creates a list. if you click on a list item a new activity starts which shows the details of the activity. however i cant seem to start the second activty, i keep getting the error "The method startActivityForResult(Intent, int) is undefined for the type new AdapterView.OnItemClickListener(){}" in eclipse. here is the full source.
any ideas?
public class Main extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
new LongOperation(this).execute();
}
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
new LongOperation(this).execute();
return true;
}
}
class LongOperation extends AsyncTask<String, Void, String> {
private Main longOperationContext = null;
ProgressDialog pd = null;
TextView tv = null;
ListView lv1 = null;
String [] lv_arr;
String [] lv_arr_id;
private static final int ACTIVITY_CREATE = 0;
public LongOperation(Main context) {
longOperationContext = context;
Log.v("LongOper", "Konstuktor");
}
@Override
protected String doInBackground(String... params) {
Log.v("doInBackground", "inside");
try {
URL json = new URL("http://www.ytmusicplayer.com/jsontest.php");
URLConnection tc = json.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(tc.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
JSONArray ja = new JSONArray(line);
Log.v("line = ", " " + ja.length());
lv_arr = new String[ja.length()];
lv_arr_id = new String[ja.length()];
for (int i=0;i<ja.length();i++) {
JSONObject jo = (JSONObject) ja.get(i);
lv_arr[i] = jo.getString("name");
lv_arr_id[i] = jo.getString("id");
}
}
} catch (MalformedURLException e) {
e.printStackTrace();
Log.v("Error", "URL exc");
} catch (IOException e) {
e.printStackTrace();
Log.v("ERROR", "IOEXECPTOIn");
} catch (JSONException e) {
e.printStackTrace();
Log.v("Error", "JsonException");
}
Log.v("Line: ", lv_arr[0] + " - " + lv_arr[1]);
return null;
}
@Override
protected void onPostExecute(String result) {
lv1.setAdapter(new ArrayAdapter<String>(longOperationContext,android.R.layout.simple_list_item_1 , lv_arr));
lv1.setTextFilterEnabled(true);
lv1.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> a, View v, int position, long id) {
Intent i = new Intent(longOperationContext, Details.class);
i.putExtra("id", lv_arr_id[position]);
startActivityForResult(i, ACTIVITY_CREATE);
}
});
pd.hide();
}
protected void onPreExecute() {
lv1 = (ListView)longOperationContext.findViewById(R.id.ListView01);
pd = new ProgressDialog(longOperationContext);
pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);
pd.setMessage("Loading...");
pd.setIndeterminate(true);
pd.setCancelable(false);
pd.show();
}
@Override
protected void onProgressUpdate(Void... values) {
}
}
thanks in advance | 0 |
7,061,912 | 08/15/2011 05:18:11 | 894,521 | 08/15/2011 05:18:11 | 1 | 0 | How to consume a Web Service in Java | I have a web service I made through Eclipse, the one made with the wizard. It works, though my problem is I don't know how to use that web service in another program. I tried to look for ways in Google but there are too many and some of them I don't even know how to set up.
How should I do it? | java | web-services | null | null | null | 08/15/2011 06:08:35 | not a real question | How to consume a Web Service in Java
===
I have a web service I made through Eclipse, the one made with the wizard. It works, though my problem is I don't know how to use that web service in another program. I tried to look for ways in Google but there are too many and some of them I don't even know how to set up.
How should I do it? | 1 |
11,668,288 | 07/26/2012 11:28:12 | 1,536,682 | 07/19/2012 03:36:38 | 1 | 0 | How to elegantly check if a number is within a range using JAVA? | How can I do this elegantly with JAVA?
For example a number can be between 1 and 100. | java | numbers | null | null | null | 07/27/2012 11:57:28 | not a real question | How to elegantly check if a number is within a range using JAVA?
===
How can I do this elegantly with JAVA?
For example a number can be between 1 and 100. | 1 |
11,705,739 | 07/29/2012 00:30:56 | 1,042,960 | 11/12/2011 09:09:14 | 1 | 0 | EMR - Hive and Java together | I'm using Amazon Elastic-Map-Reduce.
Is it possible to run a HIVE query that uses a java code (using the Transform functionality)?
When I create a new job-flow, I need to select between a custom-jar and a hive program, while I need both ...
Thanks ahead! | java | hive | emr | null | null | null | open | EMR - Hive and Java together
===
I'm using Amazon Elastic-Map-Reduce.
Is it possible to run a HIVE query that uses a java code (using the Transform functionality)?
When I create a new job-flow, I need to select between a custom-jar and a hive program, while I need both ...
Thanks ahead! | 0 |
9,845,817 | 03/23/2012 20:04:08 | 787,960 | 06/07/2011 17:39:28 | 74 | 1 | How to get a reference to a Table in a tab/worksheet that isn't the active one | I have some existing custom Excel workbooks/applications with code-behind C#, which work fine. They do things like referencing Tables defined in the active worksheet, setting their datasources to IEnumerables, etc.
However, now I need to reference a Table which is not in the active sheet. Basically, the active sheet has a button that triggers some C# code-behind, and I need to figure out how to get a reference to a Table on the fourth tab/worksheet in my workbook while inside the code-behind for the first tab/worksheet (the active one).
In my existing code (which works), I can do this on the active sheet:
this.Table1.DataSource = results;
this.Table1.RefreshDataRows();
... so the "Table1" reference is right there and I can access it easily.
However, trying to get a reference to a Table in the other sheet, I run into ComObject errors. For example, I was hoping that this (or something like it) would work:
((Sheet4)Application.Worksheets[3]).Table2.DataSource = results;
((Sheet4)Application.Worksheets[3]).Table2.RefreshDataRows();
... but that throws the error: "Cannot convert type 'System.__ComObject' to ContractStatementClient.Sheet4'". Writing those lines allows Visual Studio to find the Table (Table2) using IntelliSense, but at execution time it fails with the ComObject error I mentioned. "Sheet4" is the name of the class that Visual Studio created for me when I made the new tab.
I can get references to Worksheets that seem to work by doing:
Application.ActiveWorkbook.Worksheets[3]
... but I can't seem to figure out how to get from there to having a handle to a Table (or ListObject), that I can set the DataSource property on, as I've done in the past.
I tried this, but it throws a "NOINTERFACE" COM error during the cast:
Worksheet worksheet = Application.ActiveWorkbook.Worksheets[3];
((Microsoft.Office.Tools.Excel.ListObject) (worksheet.ListObjects[1])).DataSource = results;
Am I missing something obvious? I know next to nothing about COM, so it's tough for me to diagnose what's going on. In the end, I just need to figure out how to set the datasource for the Table/ListObject in the other tab/worksheet (and presumably tell it to refresh itself).
Thanks! Any help is greatly appreciated. | c# | excel | null | null | null | null | open | How to get a reference to a Table in a tab/worksheet that isn't the active one
===
I have some existing custom Excel workbooks/applications with code-behind C#, which work fine. They do things like referencing Tables defined in the active worksheet, setting their datasources to IEnumerables, etc.
However, now I need to reference a Table which is not in the active sheet. Basically, the active sheet has a button that triggers some C# code-behind, and I need to figure out how to get a reference to a Table on the fourth tab/worksheet in my workbook while inside the code-behind for the first tab/worksheet (the active one).
In my existing code (which works), I can do this on the active sheet:
this.Table1.DataSource = results;
this.Table1.RefreshDataRows();
... so the "Table1" reference is right there and I can access it easily.
However, trying to get a reference to a Table in the other sheet, I run into ComObject errors. For example, I was hoping that this (or something like it) would work:
((Sheet4)Application.Worksheets[3]).Table2.DataSource = results;
((Sheet4)Application.Worksheets[3]).Table2.RefreshDataRows();
... but that throws the error: "Cannot convert type 'System.__ComObject' to ContractStatementClient.Sheet4'". Writing those lines allows Visual Studio to find the Table (Table2) using IntelliSense, but at execution time it fails with the ComObject error I mentioned. "Sheet4" is the name of the class that Visual Studio created for me when I made the new tab.
I can get references to Worksheets that seem to work by doing:
Application.ActiveWorkbook.Worksheets[3]
... but I can't seem to figure out how to get from there to having a handle to a Table (or ListObject), that I can set the DataSource property on, as I've done in the past.
I tried this, but it throws a "NOINTERFACE" COM error during the cast:
Worksheet worksheet = Application.ActiveWorkbook.Worksheets[3];
((Microsoft.Office.Tools.Excel.ListObject) (worksheet.ListObjects[1])).DataSource = results;
Am I missing something obvious? I know next to nothing about COM, so it's tough for me to diagnose what's going on. In the end, I just need to figure out how to set the datasource for the Table/ListObject in the other tab/worksheet (and presumably tell it to refresh itself).
Thanks! Any help is greatly appreciated. | 0 |
7,370,339 | 09/10/2011 07:41:44 | 936,544 | 09/09/2011 10:05:24 | 3 | 0 | Which MySQL storage engine should I use? | I don't think innoDB could work because I need to truncate often very large tables (some GB) and i need every bit of disk space. | mysql | engine | null | null | null | 09/10/2011 08:57:03 | not a real question | Which MySQL storage engine should I use?
===
I don't think innoDB could work because I need to truncate often very large tables (some GB) and i need every bit of disk space. | 1 |
130,843 | 09/25/2008 00:40:36 | 18,265 | 09/18/2008 21:23:01 | 11 | 4 | How do I add a <table> using Element with Prototype in IE6? | Using Prototype 1.6's "new Element(...)" I am trying to create a <table> element with both a <thead> and <tbody> but nothing happens in IE6.
var tableProto = new Element('table').update('<thead><tr><th>Situation Task</th><th>Action</th><th>Result</th></tr></thead><tbody><tr><td>a</td><td>b</td><td>c</td></tr></tbody>');
I'm then trying to inject copies of it like this:
$$('div.question').each(function(o) {
Element.insert(o, { after:$(tableProto.cloneNode(true)) });
});
My current workaround is to create a <div> instead of a <table> element, and then "update" it with all of the table HTML.
How does one successfully do this? | javascript | dom | prototype | js | null | 12/31/2008 00:17:14 | off topic | How do I add a <table> using Element with Prototype in IE6?
===
Using Prototype 1.6's "new Element(...)" I am trying to create a <table> element with both a <thead> and <tbody> but nothing happens in IE6.
var tableProto = new Element('table').update('<thead><tr><th>Situation Task</th><th>Action</th><th>Result</th></tr></thead><tbody><tr><td>a</td><td>b</td><td>c</td></tr></tbody>');
I'm then trying to inject copies of it like this:
$$('div.question').each(function(o) {
Element.insert(o, { after:$(tableProto.cloneNode(true)) });
});
My current workaround is to create a <div> instead of a <table> element, and then "update" it with all of the table HTML.
How does one successfully do this? | 2 |
9,338,307 | 02/18/2012 03:39:25 | 1,208,960 | 02/14/2012 11:30:42 | 1 | 0 | how can i do to make position:fixed work well | i have a div,
it's width is 200px ,height is 150px,
i want the style of div's position is fixed
To make it centered horizontally and vertically centered | javascript | null | null | null | null | null | open | how can i do to make position:fixed work well
===
i have a div,
it's width is 200px ,height is 150px,
i want the style of div's position is fixed
To make it centered horizontally and vertically centered | 0 |
10,165,015 | 04/15/2012 18:52:40 | 1,334,803 | 04/15/2012 16:59:56 | 11 | 0 | login error 404 | this my login.php. when i click login then error
> Object not found!
>
> The requested URL was not found on this server. The link on the
> referring page seems to be wrong or outdated. Please inform the author
> of that page about the error.
>
> If you think this is a server error, please contact the webmaster.
>
> Error 404
>
> 127.0.0.1 04/16/12 02:45:12 Apache/2.2.21 (Win32) PHP/5.3.9
login.php
<?php
require("config.php");
require("./lang/lang.admin." . LANGUAGE_CODE . ".php");
require("functions.php");
$action = 'show_form';
# it a pain to have to check before using, but php complains when E_NOTICES on
if (isset($_GET['action'])) {
$action = $_GET['action'];
}
# get month and year to preserve state
$m = (int) $_GET['month'];
$y = (int) $_GET['year'];
# if login, and auth returns true, then refresh month view, and close window
if ($action == "login"
&& auth($_POST['username'], $_POST['password']) ) {
echo "<script language=\"JavaScript\">";
echo "opener.location = \"index.php?month=$m&year=$y\";";
echo "window.setTimeout('window.close()', 500);";
echo "</script>";
} elseif ($action == "logout") {
session_start();
session_destroy();
header ("Location: index.php?month=$m&year=$y");
} else {
?>
<html>
<head>
<script language="JavaScript">
function firstFocus()
{
if (document.forms.length > 0) {
var TForm = document.forms[0];
for (i=0;i<TForm.length;i++) {
if ((TForm.elements[i].type=="text")||
(TForm.elements[i].type=="textarea")||
(TForm.elements[i].type.toString().charAt(0)=="s")) {
document.forms[0].elements[i].focus();
break;
}
}
}
}
</script>
<title><?php echo $lang['logintitle']?></title>
<link rel="stylesheet" type="text/css" href="css/adminpgs.css">
</head>
<body onLoad="firstFocus()">
<?php
if( isset( $_POST['username'] ) ) {
echo "<span class=\"login_auth_fail\">" . $lang['wronglogin'] . "</span><p>\n";
}
?>
<span class="login_header"><?php echo $lang['loginheader']?></span>
<br><img src="images/clear.gif" width="1" height="5"><br>
<table>
<form action="<?php echo $HTTP_SERVER_VARS['PHP_SELF'] ?>?action=login&month=<?php echo $m ?>&year=<?php echo $y ?>" method="post">
<tr>
<td nowrap valign="top" align="right" nowrap>
<span class="login_label"><?php echo $lang['username']?></span></td>
<td><input type="text" name="username" size="29" maxlength="15"></td>
</tr>
<tr>
<td nowrap valign="top" align="right" nowrap>
<span class="login_label"><?php echo $lang['password']?></span></td>
<td><input type="password" name="password" size="29" maxlength="15"></td>
</tr>
<tr><td colspan="2" align="right"><input type="submit" value="<?php echo $lang['login']?>"><td><tr>
</form>
</table>
</body></html>
<?php
}
?>
| php | phpmyadmin | null | null | null | 04/19/2012 14:01:58 | too localized | login error 404
===
this my login.php. when i click login then error
> Object not found!
>
> The requested URL was not found on this server. The link on the
> referring page seems to be wrong or outdated. Please inform the author
> of that page about the error.
>
> If you think this is a server error, please contact the webmaster.
>
> Error 404
>
> 127.0.0.1 04/16/12 02:45:12 Apache/2.2.21 (Win32) PHP/5.3.9
login.php
<?php
require("config.php");
require("./lang/lang.admin." . LANGUAGE_CODE . ".php");
require("functions.php");
$action = 'show_form';
# it a pain to have to check before using, but php complains when E_NOTICES on
if (isset($_GET['action'])) {
$action = $_GET['action'];
}
# get month and year to preserve state
$m = (int) $_GET['month'];
$y = (int) $_GET['year'];
# if login, and auth returns true, then refresh month view, and close window
if ($action == "login"
&& auth($_POST['username'], $_POST['password']) ) {
echo "<script language=\"JavaScript\">";
echo "opener.location = \"index.php?month=$m&year=$y\";";
echo "window.setTimeout('window.close()', 500);";
echo "</script>";
} elseif ($action == "logout") {
session_start();
session_destroy();
header ("Location: index.php?month=$m&year=$y");
} else {
?>
<html>
<head>
<script language="JavaScript">
function firstFocus()
{
if (document.forms.length > 0) {
var TForm = document.forms[0];
for (i=0;i<TForm.length;i++) {
if ((TForm.elements[i].type=="text")||
(TForm.elements[i].type=="textarea")||
(TForm.elements[i].type.toString().charAt(0)=="s")) {
document.forms[0].elements[i].focus();
break;
}
}
}
}
</script>
<title><?php echo $lang['logintitle']?></title>
<link rel="stylesheet" type="text/css" href="css/adminpgs.css">
</head>
<body onLoad="firstFocus()">
<?php
if( isset( $_POST['username'] ) ) {
echo "<span class=\"login_auth_fail\">" . $lang['wronglogin'] . "</span><p>\n";
}
?>
<span class="login_header"><?php echo $lang['loginheader']?></span>
<br><img src="images/clear.gif" width="1" height="5"><br>
<table>
<form action="<?php echo $HTTP_SERVER_VARS['PHP_SELF'] ?>?action=login&month=<?php echo $m ?>&year=<?php echo $y ?>" method="post">
<tr>
<td nowrap valign="top" align="right" nowrap>
<span class="login_label"><?php echo $lang['username']?></span></td>
<td><input type="text" name="username" size="29" maxlength="15"></td>
</tr>
<tr>
<td nowrap valign="top" align="right" nowrap>
<span class="login_label"><?php echo $lang['password']?></span></td>
<td><input type="password" name="password" size="29" maxlength="15"></td>
</tr>
<tr><td colspan="2" align="right"><input type="submit" value="<?php echo $lang['login']?>"><td><tr>
</form>
</table>
</body></html>
<?php
}
?>
| 3 |
11,341,977 | 07/05/2012 09:59:47 | 1,457,986 | 06/15/2012 06:52:50 | 1 | 0 | Would singleton database connection affect performance in a weblogic clustered environment? | I have a J2ee struts web application using a singleton database connection. In the past, there is only one weblogic server, but now, there are two weblogic servers in a cluster.
Session replication have been tested to be working in this cluster. The web application consist of a few links that will open up different forms for the user to fill in. Each form has a dynamic dropdownlist that will populate some values depending on which form is clicked. These dropdownlist values are retrieved from the oracle database.
One unique issue is that the first form that is clicked, might took around 2-5 seconds, and the second form clicked could take forever to load or more than 5 mins. I have checked the codes and happened to know that the issue lies when an attempt to call the one instance of the db connection. Could this be a deadlock?
public static synchronized DataSingleton getDataSingleton()
throws ApplicationException {
if (myDataSingleton == null) {
myDataSingleton = new DataSingleton();
}
return myDataSingleton;
}
Any help in explaining such a scenario would be appreciated.
Thank you | database | java-ee | struts | weblogic | cluster-computing | null | open | Would singleton database connection affect performance in a weblogic clustered environment?
===
I have a J2ee struts web application using a singleton database connection. In the past, there is only one weblogic server, but now, there are two weblogic servers in a cluster.
Session replication have been tested to be working in this cluster. The web application consist of a few links that will open up different forms for the user to fill in. Each form has a dynamic dropdownlist that will populate some values depending on which form is clicked. These dropdownlist values are retrieved from the oracle database.
One unique issue is that the first form that is clicked, might took around 2-5 seconds, and the second form clicked could take forever to load or more than 5 mins. I have checked the codes and happened to know that the issue lies when an attempt to call the one instance of the db connection. Could this be a deadlock?
public static synchronized DataSingleton getDataSingleton()
throws ApplicationException {
if (myDataSingleton == null) {
myDataSingleton = new DataSingleton();
}
return myDataSingleton;
}
Any help in explaining such a scenario would be appreciated.
Thank you | 0 |
7,612,160 | 09/30/2011 14:51:52 | 957,139 | 09/21/2011 14:10:57 | 1 | 0 | Encoding in JSF 2 + Tomcat 7 | I have one fowm with only one single field. When I submit the form, the value of my field becomes strange. The word Extremação becomes Extremação.
So, I already set UTF-8 encoding in every place on my app:
<?xml version="1.0" encoding="UTF-8"?>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<f:view contentType="text/html" encoding="UTF-8">
<h:form id="formParamSupremo" prependId="false" acceptcharset="UTF-8">
I created onde encoding filter too:
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=UTF-8");
And my http header is like this:
host = localhost:8080
user-agent = Mozilla/5.0 (X11; U; Linux x86_64; pt-BR; rv:1.9.2.23) Gecko/20110921
user-agent = Mozilla/5.0 (X11; U; Linux x86_64; pt-BR; rv:1.9.2.23) Gecko/20110921 Ubuntu/10.04 (lucid) Firefox/3.6.23
accept = text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
accept-language = pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
accept-encoding = gzip,deflate
accept-charset = ISO-8859-1,utf-8;q=0.7,*;q=0.7
keep-alive = 115
connection = keep-alive
referer = http://localhost:8080/parametros/view/xhtml/parametrosSupremo.jsf
cookie = JSESSIONID=6DC0C1D4434FB90C3F9271D6C54DC575
content-type = application/x-www-form-urlencoded
content-length = 185
| character-encoding | jsf-2.0 | tomcat7 | content-encoding | null | null | open | Encoding in JSF 2 + Tomcat 7
===
I have one fowm with only one single field. When I submit the form, the value of my field becomes strange. The word Extremação becomes Extremação.
So, I already set UTF-8 encoding in every place on my app:
<?xml version="1.0" encoding="UTF-8"?>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<f:view contentType="text/html" encoding="UTF-8">
<h:form id="formParamSupremo" prependId="false" acceptcharset="UTF-8">
I created onde encoding filter too:
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=UTF-8");
And my http header is like this:
host = localhost:8080
user-agent = Mozilla/5.0 (X11; U; Linux x86_64; pt-BR; rv:1.9.2.23) Gecko/20110921
user-agent = Mozilla/5.0 (X11; U; Linux x86_64; pt-BR; rv:1.9.2.23) Gecko/20110921 Ubuntu/10.04 (lucid) Firefox/3.6.23
accept = text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
accept-language = pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
accept-encoding = gzip,deflate
accept-charset = ISO-8859-1,utf-8;q=0.7,*;q=0.7
keep-alive = 115
connection = keep-alive
referer = http://localhost:8080/parametros/view/xhtml/parametrosSupremo.jsf
cookie = JSESSIONID=6DC0C1D4434FB90C3F9271D6C54DC575
content-type = application/x-www-form-urlencoded
content-length = 185
| 0 |
5,077,926 | 02/22/2011 12:10:02 | 447,156 | 09/14/2010 09:15:07 | 292 | 23 | Gridview All Data is one line | I have `Gridview` but some daha is two or three line. (more than one)
![enter image description here][1]
[1]: http://i.stack.imgur.com/AW4Y1.jpg
How can i show all daha is one line? | asp.net | design | gridview | line | row | null | open | Gridview All Data is one line
===
I have `Gridview` but some daha is two or three line. (more than one)
![enter image description here][1]
[1]: http://i.stack.imgur.com/AW4Y1.jpg
How can i show all daha is one line? | 0 |
7,123,830 | 08/19/2011 15:23:53 | 899,271 | 07/14/2011 12:20:28 | 34 | 0 | Error: An object with a null EntityKey value cannot be attached to an object context | I am trying to delete the record from entity but i got the error like this ....
ERROR : invalidoperationException Was Unhandled....
An object with a null EntityKey value cannot be attached to an object context at this line tsgentity.Attach(pd);
and the code is like this.....
private void btnProdDelete_Click(object sender, EventArgs e)
{
product pd = new product() { product_Id = productid };
tsgentity.Attach(pd);
tsgentity.DeleteObject(pd);
tsgentity.SaveChanges();
}
public partial class ProductDescriptionForm : Form {
public TsgEntities tsgentity;
public ProductDescriptionForm() {
InitializeComponent();
tsgentity = new TSGEntities();
} | c# | .net | linq | entity-framework | linq-to-entities | 08/22/2011 19:32:12 | too localized | Error: An object with a null EntityKey value cannot be attached to an object context
===
I am trying to delete the record from entity but i got the error like this ....
ERROR : invalidoperationException Was Unhandled....
An object with a null EntityKey value cannot be attached to an object context at this line tsgentity.Attach(pd);
and the code is like this.....
private void btnProdDelete_Click(object sender, EventArgs e)
{
product pd = new product() { product_Id = productid };
tsgentity.Attach(pd);
tsgentity.DeleteObject(pd);
tsgentity.SaveChanges();
}
public partial class ProductDescriptionForm : Form {
public TsgEntities tsgentity;
public ProductDescriptionForm() {
InitializeComponent();
tsgentity = new TSGEntities();
} | 3 |
11,736,847 | 07/31/2012 09:18:32 | 1,105,882 | 12/19/2011 12:27:37 | 16 | 0 | Javascript random in order | I hace this :
$(document).ready(function(){
var refreshId = setInterval(function(){
var r=Math.floor(Math.random()*5)
acordeon(+r)
}, 2000);
});
I want show using setInterval show the numbers from 1 to 5 but no random i want show in order but using setInterval and give me result 1 , 2 , 3 , 4 , 5 and when give 5 start other time
Regards , Thank´s !!!
| javascript | arrays | random | numbers | null | 08/01/2012 13:58:33 | not a real question | Javascript random in order
===
I hace this :
$(document).ready(function(){
var refreshId = setInterval(function(){
var r=Math.floor(Math.random()*5)
acordeon(+r)
}, 2000);
});
I want show using setInterval show the numbers from 1 to 5 but no random i want show in order but using setInterval and give me result 1 , 2 , 3 , 4 , 5 and when give 5 start other time
Regards , Thank´s !!!
| 1 |
831,860 | 05/06/2009 21:28:45 | 52,653 | 01/07/2009 22:37:09 | 31 | 3 | Generate BitmapSource from UIElement | I am attempting to generate a BitmapFrame that is based on a UIElement. Here is my function:
private BitmapFrame RenderToBitmap2()
{
RenderTargetBitmap renderBitmap = new RenderTargetBitmap(200, 200, 96, 96, PixelFormats.Pbgra32);
DrawingVisual drawingVisual = new DrawingVisual();
DrawingContext drawingContext = drawingVisual.RenderOpen();
VisualBrush aVisualBrush = new VisualBrush(GenerateTestStackPanel());
drawingContext.DrawRectangle(aVisualBrush, new Pen(Brushes.Green, 2), new Rect(new Size(150, 150)));
drawingContext.Close();
renderBitmap.Render(drawingVisual);
return BitmapFrame.Create(renderBitmap);
}
For testing and debugging purposes, I am using an additional function that creates a simple StackFrame that *should* create a valid visual element that can be represented:
private StackPanel GenerateTestStackPanel()
{
// Create a red Ellipse.
Ellipse myEllipse = new Ellipse();
myEllipse.Fill = Brushes.Green;
myEllipse.StrokeThickness = 2;
myEllipse.Stroke = Brushes.Black;
// Set the width and height of the Ellipse.
myEllipse.Width = 200;
myEllipse.Height = 200;
// Add the Ellipse to the StackPanel.
StackPanel myStackPanel = new StackPanel();
myStackPanel.Children.Add(myEllipse);
return myStackPanel;
}
For some reason, the VisualBrush is not being rendered in the DrawRetangle(...) function. I can see the green border but nothing else. In addition, if I swap out the VisualBrush with a standard brush, it works great:
drawingContext.DrawRectangle(Brushes.Plum, new Pen(Brushes.Green, 2), new Rect(new Size(150, 150)));
Thanks in advance!
-Joel | wpf | c# | drawing | null | null | null | open | Generate BitmapSource from UIElement
===
I am attempting to generate a BitmapFrame that is based on a UIElement. Here is my function:
private BitmapFrame RenderToBitmap2()
{
RenderTargetBitmap renderBitmap = new RenderTargetBitmap(200, 200, 96, 96, PixelFormats.Pbgra32);
DrawingVisual drawingVisual = new DrawingVisual();
DrawingContext drawingContext = drawingVisual.RenderOpen();
VisualBrush aVisualBrush = new VisualBrush(GenerateTestStackPanel());
drawingContext.DrawRectangle(aVisualBrush, new Pen(Brushes.Green, 2), new Rect(new Size(150, 150)));
drawingContext.Close();
renderBitmap.Render(drawingVisual);
return BitmapFrame.Create(renderBitmap);
}
For testing and debugging purposes, I am using an additional function that creates a simple StackFrame that *should* create a valid visual element that can be represented:
private StackPanel GenerateTestStackPanel()
{
// Create a red Ellipse.
Ellipse myEllipse = new Ellipse();
myEllipse.Fill = Brushes.Green;
myEllipse.StrokeThickness = 2;
myEllipse.Stroke = Brushes.Black;
// Set the width and height of the Ellipse.
myEllipse.Width = 200;
myEllipse.Height = 200;
// Add the Ellipse to the StackPanel.
StackPanel myStackPanel = new StackPanel();
myStackPanel.Children.Add(myEllipse);
return myStackPanel;
}
For some reason, the VisualBrush is not being rendered in the DrawRetangle(...) function. I can see the green border but nothing else. In addition, if I swap out the VisualBrush with a standard brush, it works great:
drawingContext.DrawRectangle(Brushes.Plum, new Pen(Brushes.Green, 2), new Rect(new Size(150, 150)));
Thanks in advance!
-Joel | 0 |
1,430,986 | 09/16/2009 04:45:24 | 166,372 | 09/01/2009 04:28:24 | 67 | 3 | How Microsoft certification 70432 helps in career building in MS SQL Server and who should go for it? | How Microsoft certification 70432 helps in career building in MS SQL Server and who should go for it? | sql | sql-server | null | null | null | 01/27/2012 18:47:44 | not constructive | How Microsoft certification 70432 helps in career building in MS SQL Server and who should go for it?
===
How Microsoft certification 70432 helps in career building in MS SQL Server and who should go for it? | 4 |
10,289,970 | 04/23/2012 23:59:01 | 318,752 | 04/16/2010 17:42:06 | 833 | 14 | Add 10 minute cron job to Ubuntu package | I need to install some cron jobs with my Ubuntu installation package. The ones that run every day or hour are easy: I can just create a symlink from `/etc/cron.daily` to my script.
However, I also have a script that I would like to run every 10 minutes. There is no such thing as `/etc/cron.minutely`. Also I am not sure how to edit crontab without using the interactive editor (`crontab -e`). What is the best way to go about this? | linux | ubuntu | cron | debian | crontab | 04/25/2012 11:50:35 | off topic | Add 10 minute cron job to Ubuntu package
===
I need to install some cron jobs with my Ubuntu installation package. The ones that run every day or hour are easy: I can just create a symlink from `/etc/cron.daily` to my script.
However, I also have a script that I would like to run every 10 minutes. There is no such thing as `/etc/cron.minutely`. Also I am not sure how to edit crontab without using the interactive editor (`crontab -e`). What is the best way to go about this? | 2 |
8,242,546 | 11/23/2011 12:56:21 | 1,061,893 | 11/23/2011 12:27:49 | 1 | 0 | Advanced search engine or server for relational database | In my current project we are storing big volume of data in relational database. One of the recent key requirements is to enrich application by adding some advanced search capabilities.
In the Project performance is one of important factors due to very large tables (10+ milions of records) with parent-children relations (for example: multi-level parent-child relationship, where I am looking for all parents with specific children). The search engine should also be able to check these references for hits.
I have found some potential engines on stack overflow, however it looks like that all of them are dedicated rather for text search than relational db and hosted on linux os:
- Lucine
- Solr
- Sphinx
As I understand some of them use documents as a source of searching, but is it possible/ efficient to create programmaticaly documents based on my relational data? As I am not familiar with all of their features/capabilities can anyone please make some recommendations or propose some different solution?
To summarize my requirements:
- framework/engine to search relational database including decendants.
- support for Microsoft SQL Server
- can be used in .NET applications
- preferably hosted on Windows systems
Does any of mentioned above are able to solve my problem? do you know any better solution?
| .net | sql | search | engine | relational | 11/29/2011 02:31:37 | off topic | Advanced search engine or server for relational database
===
In my current project we are storing big volume of data in relational database. One of the recent key requirements is to enrich application by adding some advanced search capabilities.
In the Project performance is one of important factors due to very large tables (10+ milions of records) with parent-children relations (for example: multi-level parent-child relationship, where I am looking for all parents with specific children). The search engine should also be able to check these references for hits.
I have found some potential engines on stack overflow, however it looks like that all of them are dedicated rather for text search than relational db and hosted on linux os:
- Lucine
- Solr
- Sphinx
As I understand some of them use documents as a source of searching, but is it possible/ efficient to create programmaticaly documents based on my relational data? As I am not familiar with all of their features/capabilities can anyone please make some recommendations or propose some different solution?
To summarize my requirements:
- framework/engine to search relational database including decendants.
- support for Microsoft SQL Server
- can be used in .NET applications
- preferably hosted on Windows systems
Does any of mentioned above are able to solve my problem? do you know any better solution?
| 2 |
4,193,104 | 11/16/2010 10:22:34 | 174,614 | 09/16/2009 21:07:49 | 4,345 | 263 | XML replacement | I have a server application that I am rewriting in C++ and this used to use XML to send data to a client/from a client. I have found it to be a real pain to implement XML, even using existing libraries. It seems that it is just counter intuitive at times and the C++ library I've used seems so overly complicated.
I was wondering if anyone knew any better ways to send over data from client to server and back in a simpler and more intuitive way then parsing XML. The data consists mostly of only basic types.
I was thinking maybe just use a struct with the needed data types and just send it over a raw socket.
I have wasted so much time on this, it's unreal. | c++ | xml | data-structures | null | null | null | open | XML replacement
===
I have a server application that I am rewriting in C++ and this used to use XML to send data to a client/from a client. I have found it to be a real pain to implement XML, even using existing libraries. It seems that it is just counter intuitive at times and the C++ library I've used seems so overly complicated.
I was wondering if anyone knew any better ways to send over data from client to server and back in a simpler and more intuitive way then parsing XML. The data consists mostly of only basic types.
I was thinking maybe just use a struct with the needed data types and just send it over a raw socket.
I have wasted so much time on this, it's unreal. | 0 |
9,296,569 | 02/15/2012 15:51:06 | 1,119,936 | 12/28/2011 20:15:24 | 23 | 0 | Installing Linux on a Secondary USB Hard Drive | I want to install Linux on a secondary USB Hard drive on my laptop which runs Windows 7 to have dual boot possibility. Now, my questions are the following:
1. Do I have anything to worry about when I install Linux on a USB hard drive. Do I need to take any precaution other than backing up my files before installing Linux? For example, does this mean that if the USB drive where Linux is installed is not connected, then I would get into trouble with booting just to Windows?
2. I assume Ubuntu is the most popular version to install. Am I correct? I'm almost totally new to Linux.
Thanks for your Help,
Alison | linux | ubuntu | installation | null | null | 03/02/2012 03:35:16 | off topic | Installing Linux on a Secondary USB Hard Drive
===
I want to install Linux on a secondary USB Hard drive on my laptop which runs Windows 7 to have dual boot possibility. Now, my questions are the following:
1. Do I have anything to worry about when I install Linux on a USB hard drive. Do I need to take any precaution other than backing up my files before installing Linux? For example, does this mean that if the USB drive where Linux is installed is not connected, then I would get into trouble with booting just to Windows?
2. I assume Ubuntu is the most popular version to install. Am I correct? I'm almost totally new to Linux.
Thanks for your Help,
Alison | 2 |
5,398,050 | 03/22/2011 21:27:44 | 553,402 | 12/24/2010 15:30:59 | 1 | 0 | C++ Wavelet Transform of analog Signal | after reading pages after pages about FFT, STFT and Wavelet Transform I would like to try out some signal conversions in C++.
Libraries I have found so far are:
Blitzwave, FFTW or FFTW-w32 (windows), Wave++, GSL (C, rather than C++), KissFFT and some further self implemented codes..
Most libraries only show samples about using the transforms for Image Processing and most dont have anything about STFT or Wavelet. Furthermore the documentations are held quite short and implementation is not so easy, for me at least.
Now my question: Does anyone of you have some experience with one of these libraries and using them with analog signal input (non-periodic)?
Thanks for any help or hints to extend this topic as especially finding C++ implementations for all Transforms seems to be not very broadly discussed. | c++ | fft | wavelet | null | null | 03/22/2011 22:40:44 | not a real question | C++ Wavelet Transform of analog Signal
===
after reading pages after pages about FFT, STFT and Wavelet Transform I would like to try out some signal conversions in C++.
Libraries I have found so far are:
Blitzwave, FFTW or FFTW-w32 (windows), Wave++, GSL (C, rather than C++), KissFFT and some further self implemented codes..
Most libraries only show samples about using the transforms for Image Processing and most dont have anything about STFT or Wavelet. Furthermore the documentations are held quite short and implementation is not so easy, for me at least.
Now my question: Does anyone of you have some experience with one of these libraries and using them with analog signal input (non-periodic)?
Thanks for any help or hints to extend this topic as especially finding C++ implementations for all Transforms seems to be not very broadly discussed. | 1 |
7,215,667 | 08/27/2011 16:05:36 | 911,930 | 08/25/2011 11:20:53 | 3 | 0 | Element Align Problem - Negative margins, images etc | I'm trying to make a header that goes outside the borders of my sidebar and has a shadow image that makes it look like it is a book-mark.
Something similar to this: http://inelmo.com/images/img2.png
Right now I tried my best, but it is not looking correct. here is my code for sidebar and header That I think should work to make this effect, but it isn't.
**HTML**
<!-- Sidebar -->
<aside id="sidebar">
<!-- header div -->
<div id="sideProfile">
<!-- Span with image background -->
<span id="sideHshadow"></span>
</div>
</aside>
**CSS**
#sidebar {
padding: 15px;
width: 400px;
}
/*Span with shadow image to make it look like a bookmark */
#SideHshadow {
height: 6px;
width: 12px;
margin: 0 0 -6px 0;
float: right;
background: url("../images/sidebar_header_shadow.png") no-repeat;
}
#sideProfile {
background:#333333;
border-bottom: 1px solid #2d2d2d;
height: 50px;
width: 400px;
margin: 0 -12px 0 0;
box-shadow: 0 1px 2px #77bee6;
-moz-box-shadow: 0 1px 2px #77bee6;
-webkit-box-shadow: 0 1px 2px #77bee6;
-webkit-border-radius: 7px 7px 0 7px;
-khtml-border-radius: 7px 7px 0 7px;
-moz-border-radius: 7px 7px 0 7px;
border-radius: 7px 7px 0 7px;
}
Anyone knows how to make it look like in example? Thnx | html | css | margin | alignment | null | null | open | Element Align Problem - Negative margins, images etc
===
I'm trying to make a header that goes outside the borders of my sidebar and has a shadow image that makes it look like it is a book-mark.
Something similar to this: http://inelmo.com/images/img2.png
Right now I tried my best, but it is not looking correct. here is my code for sidebar and header That I think should work to make this effect, but it isn't.
**HTML**
<!-- Sidebar -->
<aside id="sidebar">
<!-- header div -->
<div id="sideProfile">
<!-- Span with image background -->
<span id="sideHshadow"></span>
</div>
</aside>
**CSS**
#sidebar {
padding: 15px;
width: 400px;
}
/*Span with shadow image to make it look like a bookmark */
#SideHshadow {
height: 6px;
width: 12px;
margin: 0 0 -6px 0;
float: right;
background: url("../images/sidebar_header_shadow.png") no-repeat;
}
#sideProfile {
background:#333333;
border-bottom: 1px solid #2d2d2d;
height: 50px;
width: 400px;
margin: 0 -12px 0 0;
box-shadow: 0 1px 2px #77bee6;
-moz-box-shadow: 0 1px 2px #77bee6;
-webkit-box-shadow: 0 1px 2px #77bee6;
-webkit-border-radius: 7px 7px 0 7px;
-khtml-border-radius: 7px 7px 0 7px;
-moz-border-radius: 7px 7px 0 7px;
border-radius: 7px 7px 0 7px;
}
Anyone knows how to make it look like in example? Thnx | 0 |
6,813,125 | 07/25/2011 07:53:04 | 824,230 | 07/01/2011 04:57:22 | 12 | 0 | Update using $_SESSION['member_id'] | $first_name = $_POST['first_name']; (retrieve data from previous page where user input)
$query = "UPDATE member SET first_name ='$first_name' WHERE member_id='".$_SESSION['member_id']."'";
This set of codes doesn't update the data for me, is there anything I've done wrong. | php | mysql | null | null | null | 07/25/2011 15:52:52 | not a real question | Update using $_SESSION['member_id']
===
$first_name = $_POST['first_name']; (retrieve data from previous page where user input)
$query = "UPDATE member SET first_name ='$first_name' WHERE member_id='".$_SESSION['member_id']."'";
This set of codes doesn't update the data for me, is there anything I've done wrong. | 1 |
3,341,396 | 07/27/2010 07:10:04 | 289,639 | 03/09/2010 12:30:58 | 25 | 0 | Crystal reports | i have small problem. I set generic path in crystal reports after that i deploy the application. deploy application runs corretly but crystal reports not loaded and an exception was occured.
please give me issue
| c# | .net | windows | null | null | 02/10/2011 13:21:49 | not a real question | Crystal reports
===
i have small problem. I set generic path in crystal reports after that i deploy the application. deploy application runs corretly but crystal reports not loaded and an exception was occured.
please give me issue
| 1 |
11,206,923 | 06/26/2012 12:03:43 | 1,480,659 | 06/25/2012 17:30:12 | 1 | 0 | Spotify API - get update on releases released ON Spotify? | Is it possible to get a list with relaeses filtered on genre from the Spotify database, to be used in an external app?
cheers | api | spotify | null | null | null | 06/27/2012 11:45:08 | not a real question | Spotify API - get update on releases released ON Spotify?
===
Is it possible to get a list with relaeses filtered on genre from the Spotify database, to be used in an external app?
cheers | 1 |
11,482,248 | 07/14/2012 08:32:23 | 1,393,837 | 05/14/2012 13:26:52 | 6 | 2 | Most efficient/secure way to get user information - PHP | I'm making a profile system for users on a website. I'm trying to figure out the most efficient and secure way to get and display their info on the profile page. The profiles will be rather large, containing potentially dozens of text fields plus images.
I don't really want to query the database every time the page loads because that seems very inefficient. And I think it would be too much data to store in a session.
So my question is: What methods are available to accomplish this and which do you suggest? | php | data | get | user | store | null | open | Most efficient/secure way to get user information - PHP
===
I'm making a profile system for users on a website. I'm trying to figure out the most efficient and secure way to get and display their info on the profile page. The profiles will be rather large, containing potentially dozens of text fields plus images.
I don't really want to query the database every time the page loads because that seems very inefficient. And I think it would be too much data to store in a session.
So my question is: What methods are available to accomplish this and which do you suggest? | 0 |
9,567,581 | 03/05/2012 13:37:46 | 982,165 | 10/06/2011 12:35:59 | 60 | 1 | Check to see if cronjobs are executing | I am running a cronjob every 15 minutes, and I want to be notified (preferably by email) whenever the job is NOT executing. I have a working email server, so I send emails using mutt.
I am aware that I can check log files manually, but I want this to be an automated check every time cron is supposed to execute a command.
Does cron provide any ways of doing this, or do i need something else? | linux | email | cron | null | null | 03/05/2012 17:16:16 | off topic | Check to see if cronjobs are executing
===
I am running a cronjob every 15 minutes, and I want to be notified (preferably by email) whenever the job is NOT executing. I have a working email server, so I send emails using mutt.
I am aware that I can check log files manually, but I want this to be an automated check every time cron is supposed to execute a command.
Does cron provide any ways of doing this, or do i need something else? | 2 |
2,783,534 | 05/06/2010 18:39:30 | 224,922 | 12/04/2009 16:51:10 | 1,220 | 2 | component based vs full stack framework? | i dont understand what these 2 words mean.
i think symfony is a full-stack framework while yii is a component-based framework.
is this correct?
if so, what are the main differences?
thanks | frameworks | php | null | null | null | null | open | component based vs full stack framework?
===
i dont understand what these 2 words mean.
i think symfony is a full-stack framework while yii is a component-based framework.
is this correct?
if so, what are the main differences?
thanks | 0 |
8,324,840 | 11/30/2011 11:00:55 | 667,206 | 03/19/2011 10:31:42 | 141 | 9 | More functional os.walk | Since I need to do many traversals of directories, which some complex filtering, I thought to create a wrapper around os.walk.
Which is something like this:
def fwalk(root, pred_dir, pred_files, walk_function=walk):
"""Wrapper function around the standard os.walk, that filter out
the directories visited using a filtering predicate
"""
for base, dirs, files in walk_function(root):
# ignore also the root directory when not needed, which is
# actually more important than the subdirectories
dirs = [d for d in dirs if pred_dir(path.join(base, d))]
files = [f for f in files if pred_files(path.join(base, f))]
if _ignore_dirs_predicate(base) and (dirs or files):
yield base, dirs, files
Basically it behaves as os.walk, but takes two predicates to make it a bit nicer to compose in higher-level functions.
For example this will only go through the python modules:
ISA_PY = lambda f: f[-3:] == '.py'
# I can make it a class or maybe even a module if it's better
def walk_py(src):
# should not be in the list
return fwalk(src, _ignore_dirs_predicate, ISA_PY)
It also takes a walk function which for example can be just a dummy walk, used for testing.
def dummy_walk(_):
test_dir = [
('/root/', ['d1, .git'], []),
('/root/d1', [], ['setup.py']),
('/root/test', [], ['test1.py']),
('/root/.git', [], [])
]
# returns a function which skips the parameter and return the iterator
return iter(test_dir)
The problem now is that I find it very hard to trust this function, apart from the some unit testing using the dummy walk is quite hard to make sure it's correct.
Any suggestion about how I can improve this and make it nicer?
| python | null | null | null | null | 12/14/2011 06:46:22 | off topic | More functional os.walk
===
Since I need to do many traversals of directories, which some complex filtering, I thought to create a wrapper around os.walk.
Which is something like this:
def fwalk(root, pred_dir, pred_files, walk_function=walk):
"""Wrapper function around the standard os.walk, that filter out
the directories visited using a filtering predicate
"""
for base, dirs, files in walk_function(root):
# ignore also the root directory when not needed, which is
# actually more important than the subdirectories
dirs = [d for d in dirs if pred_dir(path.join(base, d))]
files = [f for f in files if pred_files(path.join(base, f))]
if _ignore_dirs_predicate(base) and (dirs or files):
yield base, dirs, files
Basically it behaves as os.walk, but takes two predicates to make it a bit nicer to compose in higher-level functions.
For example this will only go through the python modules:
ISA_PY = lambda f: f[-3:] == '.py'
# I can make it a class or maybe even a module if it's better
def walk_py(src):
# should not be in the list
return fwalk(src, _ignore_dirs_predicate, ISA_PY)
It also takes a walk function which for example can be just a dummy walk, used for testing.
def dummy_walk(_):
test_dir = [
('/root/', ['d1, .git'], []),
('/root/d1', [], ['setup.py']),
('/root/test', [], ['test1.py']),
('/root/.git', [], [])
]
# returns a function which skips the parameter and return the iterator
return iter(test_dir)
The problem now is that I find it very hard to trust this function, apart from the some unit testing using the dummy walk is quite hard to make sure it's correct.
Any suggestion about how I can improve this and make it nicer?
| 2 |
7,415,938 | 09/14/2011 11:58:02 | 849,448 | 07/18/2011 06:00:23 | 67 | 12 | How to write fql querry for images of specific album | I need to retrieve src_small images.
NSString *query=[NSString stringWithFormat:@"SELECT pid,src_small,src_big FROM photo WHERE aid IN ( SELECT aid FROM album WHERE owner=%@)",ownerId];
I wrote this querry, and this works fine. But it gives me data of all the albums.
What i want is to retrieve images for specific album only, not for all the albums.
How should i reframe my querry to solve this?
Thanks in advance. | iphone | facebook | facebook-fql | null | null | null | open | How to write fql querry for images of specific album
===
I need to retrieve src_small images.
NSString *query=[NSString stringWithFormat:@"SELECT pid,src_small,src_big FROM photo WHERE aid IN ( SELECT aid FROM album WHERE owner=%@)",ownerId];
I wrote this querry, and this works fine. But it gives me data of all the albums.
What i want is to retrieve images for specific album only, not for all the albums.
How should i reframe my querry to solve this?
Thanks in advance. | 0 |
10,103,982 | 04/11/2012 10:15:42 | 1,297,401 | 03/28/2012 07:03:16 | 9 | 0 | My C# app always queried data from a SQL database on a server, now suddenly it doesnt return data anymore, and everything goes through with no errors? | I have a C# app that queries a SQL database on a server, I have tested it loads of times, but today the query didnt return any data, the app and the database is still the same. No changes. DO you have any idea why this could be? | c# | sql | null | null | null | 04/11/2012 13:21:44 | too localized | My C# app always queried data from a SQL database on a server, now suddenly it doesnt return data anymore, and everything goes through with no errors?
===
I have a C# app that queries a SQL database on a server, I have tested it loads of times, but today the query didnt return any data, the app and the database is still the same. No changes. DO you have any idea why this could be? | 3 |
10,414,558 | 05/02/2012 13:18:00 | 1,370,076 | 05/02/2012 13:06:00 | 1 | 0 | Scrolltop() has max value | I'm working with asp.net & javascript
i want to keep the value of the scroll of a div after post back
It works but stopped at certain positopn and doesn't take it
this is my code:
<div id="Countrydiv" class="cheeckcontainerNtegas" onscroll="javascript:GetCountryScroll();return true;" runat="server">
//div contents
</div>
My script
function GetCountryScroll() {
document.getElementById('<%= HFCountryScroll.ClientID %>').value = document.getElementById('<%= Countrydiv.ClientID %>').scrollTop;
}
function SetCountryScroll() {
document.getElementById('<%= Countrydiv.ClientID %>').scrollTop = document.getElementById('<%= HFCountryScroll.ClientID %>').value;
}
$(document).ready(function () {
SetCountryScroll();
}); | javascript | jquery | c#-4.0 | null | null | null | open | Scrolltop() has max value
===
I'm working with asp.net & javascript
i want to keep the value of the scroll of a div after post back
It works but stopped at certain positopn and doesn't take it
this is my code:
<div id="Countrydiv" class="cheeckcontainerNtegas" onscroll="javascript:GetCountryScroll();return true;" runat="server">
//div contents
</div>
My script
function GetCountryScroll() {
document.getElementById('<%= HFCountryScroll.ClientID %>').value = document.getElementById('<%= Countrydiv.ClientID %>').scrollTop;
}
function SetCountryScroll() {
document.getElementById('<%= Countrydiv.ClientID %>').scrollTop = document.getElementById('<%= HFCountryScroll.ClientID %>').value;
}
$(document).ready(function () {
SetCountryScroll();
}); | 0 |
9,925,087 | 03/29/2012 12:15:04 | 1,081,019 | 12/05/2011 06:28:45 | 8 | 2 | Which Serialization format supported by JSON? |
Which of the following Serialization format is/are supported by JSON ?
1. Recurring Structure
2. Invisible Structure
3. Function
4. None of the above | javascript | json | null | null | null | 03/30/2012 01:41:38 | not a real question | Which Serialization format supported by JSON?
===
Which of the following Serialization format is/are supported by JSON ?
1. Recurring Structure
2. Invisible Structure
3. Function
4. None of the above | 1 |
4,407,531 | 12/10/2010 09:50:37 | 20,446 | 09/22/2008 13:42:55 | 877 | 16 | Twitter-Node Failing to Build Node.js (npm install twitter-node) | I am trying to install "Twitter-Node" (npm install twitter-node). Version .3.2-pre of Node JS.
When I try and install I receive the follow error. Any thoughts on what I may be doing wrong? Seems like a pretty straight forward install to me. I was able successfully install socket-io too...
m ERR! Error: [email protected] preinstall: `./build.sh`
npm ERR! `sh` failed with 1
npm ERR! at ChildProcess.<anonymous> (/usr/local/lib/node/.npm/npm/0.2.12- 1/package/lib/utils/exec.js:25:18)
npm ERR! at ChildProcess.emit (events.js:34:17)
npm ERR! at ChildProcess.onexit (child_process.js:164:12)
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the twitter-node package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./build.sh
| twitter | node.js | null | null | null | null | open | Twitter-Node Failing to Build Node.js (npm install twitter-node)
===
I am trying to install "Twitter-Node" (npm install twitter-node). Version .3.2-pre of Node JS.
When I try and install I receive the follow error. Any thoughts on what I may be doing wrong? Seems like a pretty straight forward install to me. I was able successfully install socket-io too...
m ERR! Error: [email protected] preinstall: `./build.sh`
npm ERR! `sh` failed with 1
npm ERR! at ChildProcess.<anonymous> (/usr/local/lib/node/.npm/npm/0.2.12- 1/package/lib/utils/exec.js:25:18)
npm ERR! at ChildProcess.emit (events.js:34:17)
npm ERR! at ChildProcess.onexit (child_process.js:164:12)
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the twitter-node package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./build.sh
| 0 |
3,573,336 | 08/26/2010 08:27:44 | 158,455 | 08/18/2009 13:24:13 | 395 | 8 | HTML - Recomnended href link sytanx | we can give the href like the following
<a href="images\image.png">
<a href="images/image.png">
<a href=".\images\image.png">
<a href="./images/image.png">
which is the recommended method... which doesnot have problem on any browser and on any web server....
leave the image type... consider the link\paths
and **PLEASE** explain why the specific one
| html | hyperlink | href | location-href | recomendations | 07/31/2012 04:01:27 | not a real question | HTML - Recomnended href link sytanx
===
we can give the href like the following
<a href="images\image.png">
<a href="images/image.png">
<a href=".\images\image.png">
<a href="./images/image.png">
which is the recommended method... which doesnot have problem on any browser and on any web server....
leave the image type... consider the link\paths
and **PLEASE** explain why the specific one
| 1 |
7,391,510 | 09/12/2011 17:19:16 | 935,975 | 09/09/2011 01:20:53 | 1 | 1 | Report user's comments and log-in times in Confluence | I search around on google and I couldn't figure out how to do these following things.
Make a report page of:
- Number of times a a logs into the site
- Number of comments a user posts in a space/subspace/blog section
I'm novice to Confluence. Please help me some points! Very thank! | confluence | atlassian | null | null | null | 09/12/2011 17:48:09 | not a real question | Report user's comments and log-in times in Confluence
===
I search around on google and I couldn't figure out how to do these following things.
Make a report page of:
- Number of times a a logs into the site
- Number of comments a user posts in a space/subspace/blog section
I'm novice to Confluence. Please help me some points! Very thank! | 1 |
33,744 | 08/29/2008 01:15:03 | 2,948 | 08/26/2008 08:39:22 | 229 | 7 | Is Scala the next big thing? | I've been learning <a href="http://scala-lang.org/">Scala</a> recently, and it seems like a very very promising general purpose programming language. It has all the good functional programming features, terse syntax, it runs on JVM and interoperates with Java.
[Some](http://blog.locut.us/2007/12/18/scala-the-best-of-both-ruby-and-java/) [think](http://dlweinreb.wordpress.com/2007/12/25/the-scala-programming-language-my-first-impressions/) it's the Next Big Language. [Others](http://www.weiqigao.com/blog/2008/03/24/scala_still_uncomfortable_after_five_years.html) [aren't](http://stuffthathappens.com/blog/2008/01/02/scala-will-do/) so sure.
Why do you think it is/isn't going to be the next big thing?
| scala | programming-languages | functional-programming | web-development | jvm | 10/05/2011 05:50:44 | not constructive | Is Scala the next big thing?
===
I've been learning <a href="http://scala-lang.org/">Scala</a> recently, and it seems like a very very promising general purpose programming language. It has all the good functional programming features, terse syntax, it runs on JVM and interoperates with Java.
[Some](http://blog.locut.us/2007/12/18/scala-the-best-of-both-ruby-and-java/) [think](http://dlweinreb.wordpress.com/2007/12/25/the-scala-programming-language-my-first-impressions/) it's the Next Big Language. [Others](http://www.weiqigao.com/blog/2008/03/24/scala_still_uncomfortable_after_five_years.html) [aren't](http://stuffthathappens.com/blog/2008/01/02/scala-will-do/) so sure.
Why do you think it is/isn't going to be the next big thing?
| 4 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.