PostId
int64 4
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 1
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -55
461k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
21.5k
| Title
stringlengths 3
250
| BodyMarkdown
stringlengths 5
30k
⌀ | Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 32
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,261,906 | 06/29/2012 12:36:46 | 1,033,619 | 11/07/2011 11:16:15 | 15 | 0 | Problems voting (liking) posts through the disqus api | I am trying to vote +1 (liking) to a post through the disqus web api on windows phone.
I am using RestSharp for the web request.
RestClient client = new RestClient("https://disqus.com/api/3.0/posts/vote.json");
RestRequest request = new RestRequest(Method.POST);
request.AddParameter("access_token", ACCESS_TOKEN);
request.AddParameter("post", postID);
request.AddParameter("api_key", API_KEY);
request.AddParameter("vote", "1");
request.AddHeader("Referer", articleID);
client.ExecuteAsync(request, response =>
{
Debug.WriteLine("Content: " + response.Content);
Debug.WriteLine("Error:" + response.ErrorMessage);
});
Im not sure if the Header: Referer, articleID is correct, but i've tried with and without it: With it i get an error (but i it doesnt contain anything), without it i recieve:
"{"code": 11, "response": "Your API key is not valid on this domain"}"
| c# | windows-phone-7 | http | disqus | web-api | null | open | Problems voting (liking) posts through the disqus api
===
I am trying to vote +1 (liking) to a post through the disqus web api on windows phone.
I am using RestSharp for the web request.
RestClient client = new RestClient("https://disqus.com/api/3.0/posts/vote.json");
RestRequest request = new RestRequest(Method.POST);
request.AddParameter("access_token", ACCESS_TOKEN);
request.AddParameter("post", postID);
request.AddParameter("api_key", API_KEY);
request.AddParameter("vote", "1");
request.AddHeader("Referer", articleID);
client.ExecuteAsync(request, response =>
{
Debug.WriteLine("Content: " + response.Content);
Debug.WriteLine("Error:" + response.ErrorMessage);
});
Im not sure if the Header: Referer, articleID is correct, but i've tried with and without it: With it i get an error (but i it doesnt contain anything), without it i recieve:
"{"code": 11, "response": "Your API key is not valid on this domain"}"
| 0 |
11,261,908 | 06/29/2012 12:36:59 | 414,828 | 08/09/2010 08:07:04 | 98 | 10 | regex to match vars | I really stuck here not at all because i suck at regular expression.. So i'm asking for help.
my problem
foo = "bar"
$bar = foo
foo()
$foo = bar;
bar = foo() {}
$foo = array();
should match:
foo = "bar" -> match foo not bar
$bar = foo -> match foo not bar
foo() -> no match
$foo = bar; -> match bar not foo
bar = foo() {} -> match bar not foo
$foo = array(); -> no match
It just should match all words A-Za-z0-9_ that are not quotet and do not begin with a $ or end with a (
Thanks alot for every help!
Regards Mario
| regex | null | null | null | null | null | open | regex to match vars
===
I really stuck here not at all because i suck at regular expression.. So i'm asking for help.
my problem
foo = "bar"
$bar = foo
foo()
$foo = bar;
bar = foo() {}
$foo = array();
should match:
foo = "bar" -> match foo not bar
$bar = foo -> match foo not bar
foo() -> no match
$foo = bar; -> match bar not foo
bar = foo() {} -> match bar not foo
$foo = array(); -> no match
It just should match all words A-Za-z0-9_ that are not quotet and do not begin with a $ or end with a (
Thanks alot for every help!
Regards Mario
| 0 |
11,261,988 | 06/29/2012 12:42:32 | 134,064 | 07/07/2009 06:03:47 | 310 | 1 | Typo3 - HMTL RTE fronend renduring is not working | i hav the latest installation of typo3, and the data i entered in the RTE are not rendering properly in the frond end (in site).
So for example `<p>asdf</p>` will show as it is in frond end
i googled it and tried with some RTE default configuration changes , but dont work well
Please help me to solve this issue | typo3 | typoscript | html-rendering | null | null | null | open | Typo3 - HMTL RTE fronend renduring is not working
===
i hav the latest installation of typo3, and the data i entered in the RTE are not rendering properly in the frond end (in site).
So for example `<p>asdf</p>` will show as it is in frond end
i googled it and tried with some RTE default configuration changes , but dont work well
Please help me to solve this issue | 0 |
11,261,989 | 06/29/2012 12:42:33 | 1,466,267 | 06/19/2012 11:29:46 | 1 | 2 | Eclipse Sonar Plugin - exclude test sources from analysis | Is there a possibility in eclipse to exclude the test sources of a maven project from the sonar analysis when running a local analysis?
Test code uses a lot more hard coded values than production code. So there are plenty of warnings, which say a constant should be used instead. But always using constants is in many cases redundant in test sources. I don't want to remove the rule, because this is necessary for production code. | eclipse | maven | sonar | null | null | null | open | Eclipse Sonar Plugin - exclude test sources from analysis
===
Is there a possibility in eclipse to exclude the test sources of a maven project from the sonar analysis when running a local analysis?
Test code uses a lot more hard coded values than production code. So there are plenty of warnings, which say a constant should be used instead. But always using constants is in many cases redundant in test sources. I don't want to remove the rule, because this is necessary for production code. | 0 |
11,261,990 | 06/29/2012 12:42:35 | 1,460,744 | 06/16/2012 14:24:27 | 1 | 0 | Full text search - keyword to keyword (input field>database column) | <em>Can anyone help me get my desired code?<br/>
I have an input field, where multiple keywords will be written.</em>
>example: opel corsa car
<em>I have tag entries in my database, separated by comma:</em>
> 1. opel, corsa
> 2. car, opel
> 3. juice
> 4. car
<em>What I want to do is, implement full text search, but based on keyword to keyword search, meaning that I want to list out all the results containing any of the keywords.
However I want to trim those search words by 2 letters, in case someone searches for corsoa, or corsae instead of corsa.</em>
<em>what I got so far is:</em>
$input = $_GET["tag"];
$input = mb_strtolower($input,'UTF-8');
$tag = explode(" ", $input);
$tagCheck = '(tags LIKE "%'.implode('%") OR (tags LIKE "%', $tag).'%")';
<em>and in query</em>
$dbq = $dbco->prepare("SELECT name FROM table WHERE ".$tagCheck." HAVING MAX(price) < 50000");
<em>thanks...</em> | mysql | script | pdo | full-text-search | null | null | open | Full text search - keyword to keyword (input field>database column)
===
<em>Can anyone help me get my desired code?<br/>
I have an input field, where multiple keywords will be written.</em>
>example: opel corsa car
<em>I have tag entries in my database, separated by comma:</em>
> 1. opel, corsa
> 2. car, opel
> 3. juice
> 4. car
<em>What I want to do is, implement full text search, but based on keyword to keyword search, meaning that I want to list out all the results containing any of the keywords.
However I want to trim those search words by 2 letters, in case someone searches for corsoa, or corsae instead of corsa.</em>
<em>what I got so far is:</em>
$input = $_GET["tag"];
$input = mb_strtolower($input,'UTF-8');
$tag = explode(" ", $input);
$tagCheck = '(tags LIKE "%'.implode('%") OR (tags LIKE "%', $tag).'%")';
<em>and in query</em>
$dbq = $dbco->prepare("SELECT name FROM table WHERE ".$tagCheck." HAVING MAX(price) < 50000");
<em>thanks...</em> | 0 |
11,261,995 | 06/29/2012 12:43:03 | 331,160 | 05/03/2010 06:02:49 | 80 | 0 | Apache Webserver Configuration shared by 2 applications with same context root | I am using Apache Webserver version 2.2 with a single application.The application has the **/** itself as the context root.
There is redirection currently configured with regards to application as given below.
**First Configuration**
Redirect permanent /example http://www.dummy.com/en_UK/page1.jsp
Now, I need to configure a second application on the same webserver with **/example** as the context root.
I have added the below configuration on the websrever.
**Second Configuration**
<Location /example/*action* >
SetHandler weblogic-handler
WebLogicCluster 127.100.100.1:9101
WLLogFile /home/webserver.log
</Location>
While trying to access the url http://www.dummy.com/example/test.action the request is getting redirected to the http://www.dummy.com/en_UK/page1.jsp//test.action.
If I comment the first configuration changes, the second configuration works for the new application (second one).
Is there any way that both the rules can co-exist on the same webserver without causing issues ??
| apache | webserver | null | null | null | null | open | Apache Webserver Configuration shared by 2 applications with same context root
===
I am using Apache Webserver version 2.2 with a single application.The application has the **/** itself as the context root.
There is redirection currently configured with regards to application as given below.
**First Configuration**
Redirect permanent /example http://www.dummy.com/en_UK/page1.jsp
Now, I need to configure a second application on the same webserver with **/example** as the context root.
I have added the below configuration on the websrever.
**Second Configuration**
<Location /example/*action* >
SetHandler weblogic-handler
WebLogicCluster 127.100.100.1:9101
WLLogFile /home/webserver.log
</Location>
While trying to access the url http://www.dummy.com/example/test.action the request is getting redirected to the http://www.dummy.com/en_UK/page1.jsp//test.action.
If I comment the first configuration changes, the second configuration works for the new application (second one).
Is there any way that both the rules can co-exist on the same webserver without causing issues ??
| 0 |
11,261,284 | 06/29/2012 11:52:21 | 1,046,010 | 11/14/2011 16:55:25 | 1,102 | 52 | Open Base Directory Cross Domain | Changing the `open_basedir` directive to work with subdomains works absolutely fine on my server by simply setting the directive to:
`C:\Inetpub\vhosts\domain.net\subdomains\beta\httpdocs\;C:\Inetpub\vhosts\domain.net\httpdocs\`
However, when I try to do the same from one hostname to another, the open base directory does not work. This is what I am setting:
`C:\Inetpub\vhosts\domainOne.net\httpdocs\;C:\Inetpub\vhosts\domainTwo.net\httpdocs\`
I know that this can be quite challenging to achieve with FastCGI and PHP, but surely there is an easy fix?
I have tried giving permissions to the user of the current site, on the other sites folder but this has not worked.
The error being returned (as expected) is the following:
> Warning: include(): open_basedir restriction in effect.
> File(C:\Inetpub\vhosts\domainOne.net\httpdocs\_snippets\_global\paths.php)
> is not within the allowed path(s):
> (C:\Inetpub\vhosts\domainTwo.com\httpdocs\;C:\Inetpub\vhosts\domainOne.net\httpdocs\)
> in C:\Inetpub\vhosts\domainTwo.com\httpdocs\index.php on line 3
> Warning:
> include(C:\Inetpub\vhosts\domainOne.net\httpdocs\_snippets\_global\paths.php):
> failed to open stream: Operation not permitted in
> C:\Inetpub\vhosts\domainTwo.com\httpdocs\index.php on line 3
**So my question is, how do I open the base directory cross domain on a Windows Server running IIS 7, Plesk 11 and PHP 5.3 running as FastCGI Application?**
Thanks in advance | php | iis | include | fastcgi | open-basedir | null | open | Open Base Directory Cross Domain
===
Changing the `open_basedir` directive to work with subdomains works absolutely fine on my server by simply setting the directive to:
`C:\Inetpub\vhosts\domain.net\subdomains\beta\httpdocs\;C:\Inetpub\vhosts\domain.net\httpdocs\`
However, when I try to do the same from one hostname to another, the open base directory does not work. This is what I am setting:
`C:\Inetpub\vhosts\domainOne.net\httpdocs\;C:\Inetpub\vhosts\domainTwo.net\httpdocs\`
I know that this can be quite challenging to achieve with FastCGI and PHP, but surely there is an easy fix?
I have tried giving permissions to the user of the current site, on the other sites folder but this has not worked.
The error being returned (as expected) is the following:
> Warning: include(): open_basedir restriction in effect.
> File(C:\Inetpub\vhosts\domainOne.net\httpdocs\_snippets\_global\paths.php)
> is not within the allowed path(s):
> (C:\Inetpub\vhosts\domainTwo.com\httpdocs\;C:\Inetpub\vhosts\domainOne.net\httpdocs\)
> in C:\Inetpub\vhosts\domainTwo.com\httpdocs\index.php on line 3
> Warning:
> include(C:\Inetpub\vhosts\domainOne.net\httpdocs\_snippets\_global\paths.php):
> failed to open stream: Operation not permitted in
> C:\Inetpub\vhosts\domainTwo.com\httpdocs\index.php on line 3
**So my question is, how do I open the base directory cross domain on a Windows Server running IIS 7, Plesk 11 and PHP 5.3 running as FastCGI Application?**
Thanks in advance | 0 |
11,262,004 | 06/29/2012 12:43:40 | 1,029,147 | 11/04/2011 06:06:32 | 17 | 4 | How to add video object tag in the inside of rapheal layer | Kindly tell me how to display the video on the rapheal layer(SVG) with example. | svg | null | null | null | null | null | open | How to add video object tag in the inside of rapheal layer
===
Kindly tell me how to display the video on the rapheal layer(SVG) with example. | 0 |
11,297,991 | 07/02/2012 16:57:13 | 1,496,625 | 07/02/2012 16:30:26 | 1 | 0 | Dynamic combobox, textbox in a dynamic field using js (ASP.NET) | My purpose is to create dynamic textbox and combobox in a dynamic field (this field includes two file upload and a button to add dynamic textbox and combobox).
Everything works fine, but when I try to remove the dynamic tb and cb, it just works at the first field (and doesn't work at the next field). So please help me to fix it!!!!
And how can I fill data from database to the dynamic combobox???
I have the following codes:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type = "text/javascript">
var counter = 2;
function AddFileUpload() {
var div = document.createElement('DIV');
div.setAttribute("id", "FileUploadContainer");
var nextcounter = counter + 1;
var input1 = document.createElement("input");
input1.setAttribute("id", "file" + counter);
input1.setAttribute("name", "file" + counter);
input1.setAttribute("type", "file");
div.appendChild(input1);
var input2 = document.createElement("input");
input2.setAttribute("id", "file" + nextcounter);
input2.setAttribute("name", "file" + nextcounter);
input2.setAttribute("type", "file");
div.appendChild(input2);
var button = document.createElement("input");
button.setAttribute("id", "remove");
button.setAttribute("type", "button");
button.setAttribute("value", "Remove");
button.setAttribute("onclick", "RemoveFileUpload(this)");
div.appendChild(button);
var button1 = document.createElement("input");
button1.setAttribute("id", "add");
button1.setAttribute("type", "button");
button1.setAttribute("value", "Add");
button1.setAttribute("onclick", "AddCombobox(this)");
div.appendChild(button1);
document.getElementById("dynamicForm").appendChild(div);
counter+=2;
}
function RemoveFileUpload(obj) {
document.getElementById("dynamicForm").removeChild(obj.parentNode);
}
</script>
<script type = "text/javascript">
var cbcounter = 1;
function AddCombobox(obj) {
var div = document.createElement('DIV');
div.setAttribute("id", "ComboboxContainer");
var select = document.createElement("select");
select.setAttribute("name", "sl" + cbcounter);
select.setAttribute("runat", "server");
var option1 = document.createElement("option");
var text = document.createTextNode(cbcounter.toString());
option1.appendChild(text);
select.appendChild(option1);
var option2 = document.createElement("option");
text = document.createTextNode((cbcounter + 1).toString());
option2.appendChild(text);
select.appendChild(option2);
div.appendChild(select);
var textbox = document.createElement("input")
textbox.setAttribute("name", "txt" + cbcounter);
textbox.setAttribute("type", "text");
div.appendChild(textbox);
var button = document.createElement("input");
button.setAttribute("id", "removecb");
button.setAttribute("type", "button");
button.setAttribute("onclick", "RemoveCombobox(this)");
div.appendChild(button);
obj.parentNode.appendChild(div);
cbcounter++;
}
function RemoveCombobox(obj) {
document.getElementById("FileUploadContainer").removeChild(obj.parentNode);
}
</script>
</head>
<body>
<form id="form1" runat="server" enctype="multipart/form-data" method = "post">
<span style ="font-family:Arial">Click to add files</span>
<input id="Button1" type="button" value="add field" onclick = "AddFileUpload()" />
<br /><br />
<div id = "FileUploadContainer">
<input id="file0" name = "file0" type="file" runat="server" />
<input id="file1" name = "file1" type="file" runat="server" />
<input id="addcb" type="button" value="add" onclick = "AddCombobox(this)" />
<div id="ComboboxContainer" runat="server">
<select id="sl0" runat="server">
<option value="0"></option>
<option value="1"></option>
</select>
<input type="text" name="txt0" value="txt0" />
</div>
</div>
<br />
<span id="dynamicForm">
</span>
<asp:Button ID="btnUpload" runat="server" Text="Upload" />
</form>
</body>
</html>
i'm very appreciated for your help!!! | dynamic-content | null | null | null | null | null | open | Dynamic combobox, textbox in a dynamic field using js (ASP.NET)
===
My purpose is to create dynamic textbox and combobox in a dynamic field (this field includes two file upload and a button to add dynamic textbox and combobox).
Everything works fine, but when I try to remove the dynamic tb and cb, it just works at the first field (and doesn't work at the next field). So please help me to fix it!!!!
And how can I fill data from database to the dynamic combobox???
I have the following codes:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type = "text/javascript">
var counter = 2;
function AddFileUpload() {
var div = document.createElement('DIV');
div.setAttribute("id", "FileUploadContainer");
var nextcounter = counter + 1;
var input1 = document.createElement("input");
input1.setAttribute("id", "file" + counter);
input1.setAttribute("name", "file" + counter);
input1.setAttribute("type", "file");
div.appendChild(input1);
var input2 = document.createElement("input");
input2.setAttribute("id", "file" + nextcounter);
input2.setAttribute("name", "file" + nextcounter);
input2.setAttribute("type", "file");
div.appendChild(input2);
var button = document.createElement("input");
button.setAttribute("id", "remove");
button.setAttribute("type", "button");
button.setAttribute("value", "Remove");
button.setAttribute("onclick", "RemoveFileUpload(this)");
div.appendChild(button);
var button1 = document.createElement("input");
button1.setAttribute("id", "add");
button1.setAttribute("type", "button");
button1.setAttribute("value", "Add");
button1.setAttribute("onclick", "AddCombobox(this)");
div.appendChild(button1);
document.getElementById("dynamicForm").appendChild(div);
counter+=2;
}
function RemoveFileUpload(obj) {
document.getElementById("dynamicForm").removeChild(obj.parentNode);
}
</script>
<script type = "text/javascript">
var cbcounter = 1;
function AddCombobox(obj) {
var div = document.createElement('DIV');
div.setAttribute("id", "ComboboxContainer");
var select = document.createElement("select");
select.setAttribute("name", "sl" + cbcounter);
select.setAttribute("runat", "server");
var option1 = document.createElement("option");
var text = document.createTextNode(cbcounter.toString());
option1.appendChild(text);
select.appendChild(option1);
var option2 = document.createElement("option");
text = document.createTextNode((cbcounter + 1).toString());
option2.appendChild(text);
select.appendChild(option2);
div.appendChild(select);
var textbox = document.createElement("input")
textbox.setAttribute("name", "txt" + cbcounter);
textbox.setAttribute("type", "text");
div.appendChild(textbox);
var button = document.createElement("input");
button.setAttribute("id", "removecb");
button.setAttribute("type", "button");
button.setAttribute("onclick", "RemoveCombobox(this)");
div.appendChild(button);
obj.parentNode.appendChild(div);
cbcounter++;
}
function RemoveCombobox(obj) {
document.getElementById("FileUploadContainer").removeChild(obj.parentNode);
}
</script>
</head>
<body>
<form id="form1" runat="server" enctype="multipart/form-data" method = "post">
<span style ="font-family:Arial">Click to add files</span>
<input id="Button1" type="button" value="add field" onclick = "AddFileUpload()" />
<br /><br />
<div id = "FileUploadContainer">
<input id="file0" name = "file0" type="file" runat="server" />
<input id="file1" name = "file1" type="file" runat="server" />
<input id="addcb" type="button" value="add" onclick = "AddCombobox(this)" />
<div id="ComboboxContainer" runat="server">
<select id="sl0" runat="server">
<option value="0"></option>
<option value="1"></option>
</select>
<input type="text" name="txt0" value="txt0" />
</div>
</div>
<br />
<span id="dynamicForm">
</span>
<asp:Button ID="btnUpload" runat="server" Text="Upload" />
</form>
</body>
</html>
i'm very appreciated for your help!!! | 0 |
11,297,996 | 07/02/2012 16:57:19 | 1,496,575 | 07/02/2012 16:12:06 | 1 | 1 | JQuery: Way to add HTML code to a div? | So I have this code
if ($(this).is(".item")){
$("#hoverdiv").text("This div has the Item class<br>Test").show();
}
and I have found out the hard way that using .text won't make HTML codes parse. Is there some sort of work around to this? | jquery | html | parsing | tags | null | null | open | JQuery: Way to add HTML code to a div?
===
So I have this code
if ($(this).is(".item")){
$("#hoverdiv").text("This div has the Item class<br>Test").show();
}
and I have found out the hard way that using .text won't make HTML codes parse. Is there some sort of work around to this? | 0 |
11,297,997 | 07/02/2012 16:57:19 | 1,023,866 | 11/01/2011 14:16:18 | 138 | 7 | how to remove physics shape in Xcode simulator | how to remove physics shape in Xcode simulator.when i run my test app in Xcode simulator i get following shapes combined, how to remove it.
![enter image description here][1]
[1]: http://i.stack.imgur.com/zKnna.png | iphone | ios | xcode | null | null | 07/03/2012 02:47:48 | not a real question | how to remove physics shape in Xcode simulator
===
how to remove physics shape in Xcode simulator.when i run my test app in Xcode simulator i get following shapes combined, how to remove it.
![enter image description here][1]
[1]: http://i.stack.imgur.com/zKnna.png | 1 |
11,298,004 | 07/02/2012 16:57:40 | 170,792 | 09/09/2009 11:47:11 | 8,521 | 189 | How to knit2html with UTF-8 encoding? | My `.Rmd` file contains multilingual text. When I load the html page produced by `knit2html` to my joomla site the multilingual text has been replaced by squares.
Do you know of a way to request a `utf-8` encoded html page, or any other way to overcome the problem? | windows | r | utf-8 | knitr | null | null | open | How to knit2html with UTF-8 encoding?
===
My `.Rmd` file contains multilingual text. When I load the html page produced by `knit2html` to my joomla site the multilingual text has been replaced by squares.
Do you know of a way to request a `utf-8` encoded html page, or any other way to overcome the problem? | 0 |
11,297,969 | 07/02/2012 16:55:53 | 625,594 | 02/20/2011 20:14:41 | 4,439 | 209 | Twitter-Bootstrap: Two dropdown-toggle buttons side by side not working properly | **Intro:** One of the parts of my website requires a small toolbar featuring two dropdown menus side-by side. I tried to achieve this by the following code (simplified):
<div class="btn-group">
<button class="btn btn-mini dropdown-toggle" data-toggle="dropdown">
<span id="unique_id">Item1</span> <span class="caret"></span>
</button>
<ul class="dropdown-menu">
@foreach(var obj in collection)
{
<li><a onclick="javascript:someFunction()">@obj.title</a></li>
}
</ul>
<button class="btn btn-mini dropdown-toggle" data-toggle="dropdown">
<span id="unique_id2">Item2</span> <span class="caret"></span>
</button>
<ul class="dropdown-menu">
@foreach(var obj in collection)
{
<li><a onclick="javascript:someOtherFunction()">@obj.title</a></li>
}
</ul>
</div>
I'd like to get a nice-looking two-buttons toolbar with rounded corners only on outer sides of the toolbar.
**Problem:**
When I click on either button, both buttons are displayed as "pressed" and I can not visually distinguish which one I have just clicked. All the other functionality is working OK - i.e. a menu is shown correctly and with correct options.
Is there any way to make those buttons changing their styles separately?
| asp.net-mvc-3 | twitter-bootstrap | null | null | null | null | open | Twitter-Bootstrap: Two dropdown-toggle buttons side by side not working properly
===
**Intro:** One of the parts of my website requires a small toolbar featuring two dropdown menus side-by side. I tried to achieve this by the following code (simplified):
<div class="btn-group">
<button class="btn btn-mini dropdown-toggle" data-toggle="dropdown">
<span id="unique_id">Item1</span> <span class="caret"></span>
</button>
<ul class="dropdown-menu">
@foreach(var obj in collection)
{
<li><a onclick="javascript:someFunction()">@obj.title</a></li>
}
</ul>
<button class="btn btn-mini dropdown-toggle" data-toggle="dropdown">
<span id="unique_id2">Item2</span> <span class="caret"></span>
</button>
<ul class="dropdown-menu">
@foreach(var obj in collection)
{
<li><a onclick="javascript:someOtherFunction()">@obj.title</a></li>
}
</ul>
</div>
I'd like to get a nice-looking two-buttons toolbar with rounded corners only on outer sides of the toolbar.
**Problem:**
When I click on either button, both buttons are displayed as "pressed" and I can not visually distinguish which one I have just clicked. All the other functionality is working OK - i.e. a menu is shown correctly and with correct options.
Is there any way to make those buttons changing their styles separately?
| 0 |
11,297,972 | 07/02/2012 16:56:04 | 620,761 | 02/17/2011 04:40:54 | 562 | 39 | Integrating Google Calendar API Into An Application? | Is it possible to integrate Google Calendar into an Application for say iPhone or Android powered devices?
If so, where would I get started? Becuase, I have read the entire Google Calendar API Documentation and seem to be quite lost on where to start.
Thank you! | ios | api | google | application | calendar | null | open | Integrating Google Calendar API Into An Application?
===
Is it possible to integrate Google Calendar into an Application for say iPhone or Android powered devices?
If so, where would I get started? Becuase, I have read the entire Google Calendar API Documentation and seem to be quite lost on where to start.
Thank you! | 0 |
11,298,008 | 07/02/2012 16:57:50 | 58,681 | 01/24/2009 22:02:59 | 120 | 3 | Installing only 64 bit packages via the R command line | I recently upgraded to R 2.15.1 and ma having trouble installing packages from the command line.
I tried using: R --arch x86_64 CMD INSTALL package_1.0.tar.gz
But R tries to install the i386 version - and then that requires a 32 bit version of a dependent package that I do not have installed. However the 64 bit version of the package *is* available - yet, the entire install process fails.
I would've thought that specifying the architecture would prevent R from trying to install a 32 bit version. Am I missing something obvious? (This was not an issue on 2.14) | r | install | package | null | null | null | open | Installing only 64 bit packages via the R command line
===
I recently upgraded to R 2.15.1 and ma having trouble installing packages from the command line.
I tried using: R --arch x86_64 CMD INSTALL package_1.0.tar.gz
But R tries to install the i386 version - and then that requires a 32 bit version of a dependent package that I do not have installed. However the 64 bit version of the package *is* available - yet, the entire install process fails.
I would've thought that specifying the architecture would prevent R from trying to install a 32 bit version. Am I missing something obvious? (This was not an issue on 2.14) | 0 |
11,297,714 | 07/02/2012 16:37:25 | 1,496,435 | 07/02/2012 15:11:13 | 1 | 0 | robotic simulator | I am looking for a robotic arm simulator or a humanoid simulator which has haptic, proprioceptive, force/torque, joint sensors or even more sensors in the arm. Is there any free option? | simulator | robotics | null | null | null | null | open | robotic simulator
===
I am looking for a robotic arm simulator or a humanoid simulator which has haptic, proprioceptive, force/torque, joint sensors or even more sensors in the arm. Is there any free option? | 0 |
11,692,955 | 07/27/2012 17:43:30 | 1,434,869 | 06/04/2012 10:00:12 | 31 | 0 | How to check any check box is checked inside only in a perticular form? | I created a jquery function to check check box checked like this
if ($('input:checkbox:checked').length > 0){ }
But I have two set of check boxes in two form tags. When I use above code It check for checkboxes in both form tags.But I want the if condition only for a one form.How can I achieve it? | php | javascript | jquery | null | null | null | open | How to check any check box is checked inside only in a perticular form?
===
I created a jquery function to check check box checked like this
if ($('input:checkbox:checked').length > 0){ }
But I have two set of check boxes in two form tags. When I use above code It check for checkboxes in both form tags.But I want the if condition only for a one form.How can I achieve it? | 0 |
11,692,957 | 07/27/2012 17:43:38 | 481,484 | 10/20/2010 09:22:13 | 57 | 1 | Using a .where IN clause with .includes down and up many nested levels to look up a group of IDs in Rails 3.1 | I would like to filter a list of parent emails addresses by a classroom of students.
Here is a simplification of my models:
Class District
has_many :schools
has_many :families
has_many :children, :through => :families
has_many :parents, :through => :families
has_many :enrollments, :through => :children
Class Enrollments
belongs_to :child
belongs_to :classroom
The email address is associated with the parent record and I would like to filter emails by an array of classroom IDs.
I can get this to work:
idees = [49, 50]
current_district = District.first
@emails = current_district.parents.includes(:family => { :children => { :enrollments => {:classroom => { :program => :location }}}}).where("family_id IN (?)", idees)
# Returns parents with ID 49 and 50
But I cannot get anything like this to work
idees = [49, 50]
current_district = District.first
@emails = current_district.parents.includes(:family => { :children => { :enrollments => {:classroom => { :program => :location }}}}).where("family.children.enrollments.classroom_id IN (?)", idees)
# Returns: PGError: ERROR: cross-database references are not implemented: family.children.enrollment.classroom_id
What am I doing wrong or is there another, better way to write this query? | postgresql | ruby-on-rails-3.1 | null | null | null | null | open | Using a .where IN clause with .includes down and up many nested levels to look up a group of IDs in Rails 3.1
===
I would like to filter a list of parent emails addresses by a classroom of students.
Here is a simplification of my models:
Class District
has_many :schools
has_many :families
has_many :children, :through => :families
has_many :parents, :through => :families
has_many :enrollments, :through => :children
Class Enrollments
belongs_to :child
belongs_to :classroom
The email address is associated with the parent record and I would like to filter emails by an array of classroom IDs.
I can get this to work:
idees = [49, 50]
current_district = District.first
@emails = current_district.parents.includes(:family => { :children => { :enrollments => {:classroom => { :program => :location }}}}).where("family_id IN (?)", idees)
# Returns parents with ID 49 and 50
But I cannot get anything like this to work
idees = [49, 50]
current_district = District.first
@emails = current_district.parents.includes(:family => { :children => { :enrollments => {:classroom => { :program => :location }}}}).where("family.children.enrollments.classroom_id IN (?)", idees)
# Returns: PGError: ERROR: cross-database references are not implemented: family.children.enrollment.classroom_id
What am I doing wrong or is there another, better way to write this query? | 0 |
11,692,985 | 07/27/2012 17:45:21 | 255,365 | 01/20/2010 23:35:08 | 122 | 15 | extending global c variable array with swig and python | I have a global variable array in c that I'd like to pull into python. And I'm having difficulties with `varout` typemap:
/* example.c */
int foo[] = {0, 1};
And here is the very vanilla interface:
/* example.i */
%module example
%{
extern int foo[2];
%}
%typemap(varout) int foo[] {
int i;
//$1, $1_dim0, $1_dim1
$result = PyList_New($1_dim0);
for (i = 0; i < $1_dim0; i++) {
PyObject *o = PyInt_FromLong((double) $1[i]);
PyList_SetItem($result,i,o);
}
}
%include "example.c"
When I try to build it with the following SConstruct:
import distutils.sysconfig
env = Environment(SWIGFLAGS='-python -shadow -Wall'.split(),
CPPPATH=[distutils.sysconfig.get_python_inc()],
SHLIBPREFIX="")
env.SharedLibrary('_example.so', ['example.c', 'example.i'])
`$1_dim0` special variable is not populated, resulting in the following non-compilable code in `example_wrap.c`:
SWIGINTERN PyObject *Swig_var_foo_get(void) {
PyObject *pyobj = 0;
{
int i;
//foo, , foo_dim1
pyobj = PyList_New();
for (i = 0; i < ; i++) {
PyObject *o = PyInt_FromLong((double) foo[i]);
PyList_SetItem(pyobj,i,o);
}
}
return pyobj;
}
So clearly the typemap match has happened, but dimensionality of array is missing. What am I missing? Hard coding the dimension does works.
**In general, is there any way to extend global `cvar` variables with swig?**
$ swig -version
SWIG Version 2.0.4
Compiled with g++ [i686-pc-linux-gnu]
Configured options: +pcre
Please see http://www.swig.org for reporting bugs and further information
| python | arrays | global-variables | swig | extend | null | open | extending global c variable array with swig and python
===
I have a global variable array in c that I'd like to pull into python. And I'm having difficulties with `varout` typemap:
/* example.c */
int foo[] = {0, 1};
And here is the very vanilla interface:
/* example.i */
%module example
%{
extern int foo[2];
%}
%typemap(varout) int foo[] {
int i;
//$1, $1_dim0, $1_dim1
$result = PyList_New($1_dim0);
for (i = 0; i < $1_dim0; i++) {
PyObject *o = PyInt_FromLong((double) $1[i]);
PyList_SetItem($result,i,o);
}
}
%include "example.c"
When I try to build it with the following SConstruct:
import distutils.sysconfig
env = Environment(SWIGFLAGS='-python -shadow -Wall'.split(),
CPPPATH=[distutils.sysconfig.get_python_inc()],
SHLIBPREFIX="")
env.SharedLibrary('_example.so', ['example.c', 'example.i'])
`$1_dim0` special variable is not populated, resulting in the following non-compilable code in `example_wrap.c`:
SWIGINTERN PyObject *Swig_var_foo_get(void) {
PyObject *pyobj = 0;
{
int i;
//foo, , foo_dim1
pyobj = PyList_New();
for (i = 0; i < ; i++) {
PyObject *o = PyInt_FromLong((double) foo[i]);
PyList_SetItem(pyobj,i,o);
}
}
return pyobj;
}
So clearly the typemap match has happened, but dimensionality of array is missing. What am I missing? Hard coding the dimension does works.
**In general, is there any way to extend global `cvar` variables with swig?**
$ swig -version
SWIG Version 2.0.4
Compiled with g++ [i686-pc-linux-gnu]
Configured options: +pcre
Please see http://www.swig.org for reporting bugs and further information
| 0 |
11,692,999 | 07/27/2012 17:46:16 | 577,001 | 01/15/2011 20:04:47 | 191 | 6 | Reading resource files from different project on Qt Designer | I'm building multiple projects using Qt where I want to store `resources` in only 1 of them (common project), which integrates `resources` files into `.so` file. From other projects, I know how to refer to those `resources` files via `.so`, but don't know if/how it's possible on Qt Designer.
I imported the folder in the common prj that contains `.qrc` file and also the sub folders that contain resource files, by New File or Project --> Qt --> Qt Resource File. Still nothing shown from "Choose Resource" dialog.
| qt | qt4 | qt-creator | qt-designer | null | null | open | Reading resource files from different project on Qt Designer
===
I'm building multiple projects using Qt where I want to store `resources` in only 1 of them (common project), which integrates `resources` files into `.so` file. From other projects, I know how to refer to those `resources` files via `.so`, but don't know if/how it's possible on Qt Designer.
I imported the folder in the common prj that contains `.qrc` file and also the sub folders that contain resource files, by New File or Project --> Qt --> Qt Resource File. Still nothing shown from "Choose Resource" dialog.
| 0 |
11,693,001 | 07/27/2012 17:46:19 | 309,213 | 04/05/2010 13:20:40 | 23 | 1 | Delphi XE2 DataSnap Live-cycle with Android connection | I have a DataSnap Server with DSServerClass.LiveCycle=Session (exposes a descent class of TDSServerModule).
When the client connects the TDSServerModule, is created and remains in memory as long as session was, - this made a datasnap connection (tunneling) - thats ok.
When connect by a Android (Mobile connected), and the TDSServerModule is created/destroyed by call (instance).. This makes a REST connection...
I have a small demo with this.
Any idea to resolve this problem...
Thanks in advance,
Pedro Lopes | android | session | delphi-xe2 | datasnap | null | null | open | Delphi XE2 DataSnap Live-cycle with Android connection
===
I have a DataSnap Server with DSServerClass.LiveCycle=Session (exposes a descent class of TDSServerModule).
When the client connects the TDSServerModule, is created and remains in memory as long as session was, - this made a datasnap connection (tunneling) - thats ok.
When connect by a Android (Mobile connected), and the TDSServerModule is created/destroyed by call (instance).. This makes a REST connection...
I have a small demo with this.
Any idea to resolve this problem...
Thanks in advance,
Pedro Lopes | 0 |
11,693,003 | 07/27/2012 17:46:40 | 1,558,339 | 07/27/2012 17:24:26 | 1 | 0 | How can i find a value in another sheet in Excel and in the active sheet using a form? | Well, here is my problem so far, i have a form in VB in this form the user put a number what i want to do is that excel search in Sheet2 If i get this number (if is buyed), and in the active sheet "Data" if is already captured, finally put it in the last empty A row in Sheet1.
I have this so far.
Private Sub CommandButton1_Click()
Me.TextBox1.Text = ""
Me.TextBox2.Text = ""
End Sub
Private Sub CommandButton2_Click()
Dim lastrow As Double
Dim frange As Range
lastrow = ActiveSheet.UsedRange.Row - 1 + ActiveSheet.UsedRange.Rows.Count
If TextBox1.Text = TextBox2.Text Then
Sheets("Sheet2").Activate
ActiveSheet.Range("A2").Select
If Range("A2:A200").Find(What:=TextBox2.Value _
, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate Then
Sheets("Datos").Activate
If Range("A3:A200").Find(What:=TextBox2.Value _
, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate Then
MsgBox ("This number is already registred")
Else
Cells(lastrow + 1, 1) = TextBox2.Value
End If
Else
MsgBox ("The number has not been buyed")
End If
Else
MsgBox ("The number are not the same")
End If
End Sub
I really hope someone you can help me because i am stuck and i do not see the answer.
Thanks
Sorry for my english
| excel | vba | excel-vba | null | null | null | open | How can i find a value in another sheet in Excel and in the active sheet using a form?
===
Well, here is my problem so far, i have a form in VB in this form the user put a number what i want to do is that excel search in Sheet2 If i get this number (if is buyed), and in the active sheet "Data" if is already captured, finally put it in the last empty A row in Sheet1.
I have this so far.
Private Sub CommandButton1_Click()
Me.TextBox1.Text = ""
Me.TextBox2.Text = ""
End Sub
Private Sub CommandButton2_Click()
Dim lastrow As Double
Dim frange As Range
lastrow = ActiveSheet.UsedRange.Row - 1 + ActiveSheet.UsedRange.Rows.Count
If TextBox1.Text = TextBox2.Text Then
Sheets("Sheet2").Activate
ActiveSheet.Range("A2").Select
If Range("A2:A200").Find(What:=TextBox2.Value _
, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate Then
Sheets("Datos").Activate
If Range("A3:A200").Find(What:=TextBox2.Value _
, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate Then
MsgBox ("This number is already registred")
Else
Cells(lastrow + 1, 1) = TextBox2.Value
End If
Else
MsgBox ("The number has not been buyed")
End If
Else
MsgBox ("The number are not the same")
End If
End Sub
I really hope someone you can help me because i am stuck and i do not see the answer.
Thanks
Sorry for my english
| 0 |
11,693,004 | 07/27/2012 17:46:51 | 495,927 | 11/03/2010 12:57:16 | 43 | 1 | Qemu configure throws zlib check failed even though it is present | I have been trying to get my qemu version running on a new machine. I installed zlib1g-dev, zlib-bin etc. When I do a whereis zlib, I get
zlib: /usr/include/zlib.h /usr/share/man/man3/zlib.3.gz
I tried compiling and installing zlib from source too, but the same issue was present.
The exact error I get is
big/little test failed
Error: zlib check failed
Make sure to have the zlib libs and headers installed.
| qemu | kvm | null | null | null | null | open | Qemu configure throws zlib check failed even though it is present
===
I have been trying to get my qemu version running on a new machine. I installed zlib1g-dev, zlib-bin etc. When I do a whereis zlib, I get
zlib: /usr/include/zlib.h /usr/share/man/man3/zlib.3.gz
I tried compiling and installing zlib from source too, but the same issue was present.
The exact error I get is
big/little test failed
Error: zlib check failed
Make sure to have the zlib libs and headers installed.
| 0 |
11,693,005 | 07/27/2012 17:46:51 | 301,159 | 03/24/2010 19:33:13 | 414 | 0 | [NEW ]How to pass variable in mysqli_multi_query? | well, i asked a similar question [here][1] but i realized that the example doesn't suffice my needs. Here is my new question:
i'm trying to set a variable `number` from a mysqli query. And use the variable in the next query. I tried the following query, but in vain. What is the right way?
mysqli_multi_query($mysqli, "COUNT(fruits) FROM eatables as num SET @number= num; UPDATE fruits SET fruits = @number") or die('</br>mySqli Error</br>');
here is the sample sql database:
table eatables:
#fruits #numbers
apple null
apple null
grapes null
mango null
pears null
grapes null
after the query, it should be
#fruits #numbers
apple 3
apple 3
grapes 2
mango 1
pears 1
grapes 2
[1]: http://stackoverflow.com/questions/11692586/how-to-pass-variable-in-mysqli-multi-query
| mysql | mysqli | null | null | null | null | open | [NEW ]How to pass variable in mysqli_multi_query?
===
well, i asked a similar question [here][1] but i realized that the example doesn't suffice my needs. Here is my new question:
i'm trying to set a variable `number` from a mysqli query. And use the variable in the next query. I tried the following query, but in vain. What is the right way?
mysqli_multi_query($mysqli, "COUNT(fruits) FROM eatables as num SET @number= num; UPDATE fruits SET fruits = @number") or die('</br>mySqli Error</br>');
here is the sample sql database:
table eatables:
#fruits #numbers
apple null
apple null
grapes null
mango null
pears null
grapes null
after the query, it should be
#fruits #numbers
apple 3
apple 3
grapes 2
mango 1
pears 1
grapes 2
[1]: http://stackoverflow.com/questions/11692586/how-to-pass-variable-in-mysqli-multi-query
| 0 |
11,728,111 | 07/30/2012 19:18:00 | 1,385,361 | 05/09/2012 18:21:22 | 18 | 2 | How to create basic authentication, login system for a web tool made in node.js and socket.io, without using express | I have a web tool developed, which uses node.js and socket.io. it's a one page website and uses node.js for getting data from social media website and display on the same page. I would like to add a site specific login system for the website but don't want to use '[Express][1]' or '[Passport][2]' as it adds lots of overload to the website while it is not needed.
I am newbie with node.js and would like to know if I need to have a login system made with node.js to maintain session of the logged in user?
Note: I need to maintain session to log user data such as login time, search query and may be heatmap.
Thanks in advance. If needed I can explain specific part of the question in detail.
[1]: http://expressjs.com/
[2]: http://passportjs.org/ | javascript | node.js | null | null | null | null | open | How to create basic authentication, login system for a web tool made in node.js and socket.io, without using express
===
I have a web tool developed, which uses node.js and socket.io. it's a one page website and uses node.js for getting data from social media website and display on the same page. I would like to add a site specific login system for the website but don't want to use '[Express][1]' or '[Passport][2]' as it adds lots of overload to the website while it is not needed.
I am newbie with node.js and would like to know if I need to have a login system made with node.js to maintain session of the logged in user?
Note: I need to maintain session to log user data such as login time, search query and may be heatmap.
Thanks in advance. If needed I can explain specific part of the question in detail.
[1]: http://expressjs.com/
[2]: http://passportjs.org/ | 0 |
11,728,120 | 07/30/2012 19:18:36 | 536,607 | 12/09/2010 15:14:36 | 1,193 | 6 | Marshaling and undefined attributes/classes | I am using ruby marshaling to send data between two clients. Each client has a set of class definitions which they will use to help load the marshaled data. The definitions are stored in an external ruby file which they can load anytime they want (but usually when they start up)
A simple use case would be
* Client A marshal dumps the data and sends it to client B
* Client B marshal loads the data and then writes it out to a file
However, sometimes one client is sending data that contains objects that isn't defined in the other client's definitions, in which case the other client should update its definitions accordingly.
It might be a new instance variable that should be added to the definition of class `xyz` or it might be a new class completely.
`Marshal#Load` currently just throws an exception when it runs into an undefined variable (eg: undefined class/method `abc`).
Is there a way for me to take this exception and update the definitions accordingly so that the client can happily read the data and write it out? | ruby | null | null | null | null | null | open | Marshaling and undefined attributes/classes
===
I am using ruby marshaling to send data between two clients. Each client has a set of class definitions which they will use to help load the marshaled data. The definitions are stored in an external ruby file which they can load anytime they want (but usually when they start up)
A simple use case would be
* Client A marshal dumps the data and sends it to client B
* Client B marshal loads the data and then writes it out to a file
However, sometimes one client is sending data that contains objects that isn't defined in the other client's definitions, in which case the other client should update its definitions accordingly.
It might be a new instance variable that should be added to the definition of class `xyz` or it might be a new class completely.
`Marshal#Load` currently just throws an exception when it runs into an undefined variable (eg: undefined class/method `abc`).
Is there a way for me to take this exception and update the definitions accordingly so that the client can happily read the data and write it out? | 0 |
11,728,125 | 07/30/2012 19:18:56 | 1,073,400 | 11/30/2011 13:08:20 | 122 | 0 | Why do I get "sticky" magneticNorth values with this code? | The following code returns the device's deviation from the magnetic North. However, once I stop moving the device around the z-axis, if I try to restart moving it around, the values won't change immediately and I'll have to give the device a sudden shake or simply move it around for some "time" before they start "flowing" again. What am I doing wrong here?
Game.h
#import <Foundation/Foundation.h>
#import "CoreLocation.h"
@interface Game : NSObject
<CLLocationManagerDelegate>
@property BOOL stopButtonPressed;
-(void) play;
@end
Game.m
@implementation Game
- (id) init
{
self = [super init];
self.stopButtonPressed = NO;
CLLocationManager *locationManager;
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
return self;
}
-(void) play
{
[locationManager startUpdatingHeading];
while(!self.stopButtonPressed)
{
double degrees = locationManager.heading.magneticHeading;
int degreesRounded = (int)degrees;
NSLog(@"Degrees : %i", degreesRounded);
}
}
@end
MyViewController.m
@interface MyViewController()
{
Game *game;
}
@end
@implementation MyViewController
-(void) viewDidLoad
{
game = [[Game alloc] init];
}
- (IBAction)playPressed:(UIButton *)sender
{
[game performSelectorInBackground:@selector(play) withObject:nil];
}
- (IBAction)stopPressed:(UIButton *)sender
{
game.stopButtonPressed = YES;
}
@end | objective-c | ios | magnetometer | null | null | null | open | Why do I get "sticky" magneticNorth values with this code?
===
The following code returns the device's deviation from the magnetic North. However, once I stop moving the device around the z-axis, if I try to restart moving it around, the values won't change immediately and I'll have to give the device a sudden shake or simply move it around for some "time" before they start "flowing" again. What am I doing wrong here?
Game.h
#import <Foundation/Foundation.h>
#import "CoreLocation.h"
@interface Game : NSObject
<CLLocationManagerDelegate>
@property BOOL stopButtonPressed;
-(void) play;
@end
Game.m
@implementation Game
- (id) init
{
self = [super init];
self.stopButtonPressed = NO;
CLLocationManager *locationManager;
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
return self;
}
-(void) play
{
[locationManager startUpdatingHeading];
while(!self.stopButtonPressed)
{
double degrees = locationManager.heading.magneticHeading;
int degreesRounded = (int)degrees;
NSLog(@"Degrees : %i", degreesRounded);
}
}
@end
MyViewController.m
@interface MyViewController()
{
Game *game;
}
@end
@implementation MyViewController
-(void) viewDidLoad
{
game = [[Game alloc] init];
}
- (IBAction)playPressed:(UIButton *)sender
{
[game performSelectorInBackground:@selector(play) withObject:nil];
}
- (IBAction)stopPressed:(UIButton *)sender
{
game.stopButtonPressed = YES;
}
@end | 0 |
11,728,128 | 07/30/2012 19:19:01 | 702,948 | 04/11/2011 20:59:45 | 1,191 | 44 | embedding lua code in c | I am attempting to follow the besic guide given [here][1] on embedding lua into C. I copied the code verbatim into my own embed.c file and executed the exact compiler command listed:
cc -o embed embed.c \
-I/usr/local/include \
-L/usr/local/lib \
-llua -llualib
I get the error:
embed.c:19:14: error: invalid storage class for function ‘openlualibs’
After which I moved the functions outside of `main`, compiled again, and got:
/usr/bin/ld: cannot find -llualib
I am at a loss for why I cannot compile this. lua is installed properly. has anyone else encountered these problems? If this is a bad tutorial, please feel free to simply direct me to a batter one.
[1]: http://heavycoder.com/tutorials/lua_embed.php | c | lua | embedded | null | null | null | open | embedding lua code in c
===
I am attempting to follow the besic guide given [here][1] on embedding lua into C. I copied the code verbatim into my own embed.c file and executed the exact compiler command listed:
cc -o embed embed.c \
-I/usr/local/include \
-L/usr/local/lib \
-llua -llualib
I get the error:
embed.c:19:14: error: invalid storage class for function ‘openlualibs’
After which I moved the functions outside of `main`, compiled again, and got:
/usr/bin/ld: cannot find -llualib
I am at a loss for why I cannot compile this. lua is installed properly. has anyone else encountered these problems? If this is a bad tutorial, please feel free to simply direct me to a batter one.
[1]: http://heavycoder.com/tutorials/lua_embed.php | 0 |
11,728,146 | 07/30/2012 19:20:03 | 887,191 | 08/10/2011 04:44:37 | 8 | 0 | My first Jasmine test, it's a basic one, why is it failing? | Here is the source:
https://gist.github.com/699bd63d5e4d43bc2cdf
Am I missing an actual? I thought 'foo' was the actual. | javascript | jasmine | null | null | null | 08/01/2012 13:23:57 | not a real question | My first Jasmine test, it's a basic one, why is it failing?
===
Here is the source:
https://gist.github.com/699bd63d5e4d43bc2cdf
Am I missing an actual? I thought 'foo' was the actual. | 1 |
11,728,147 | 07/30/2012 19:20:16 | 1,563,896 | 07/30/2012 19:06:39 | 1 | 0 | Transferring data from gae datastore to a google docs spreadsheet | My gae application collects large amounts of numerical data. Instead of having users download it, is it possible to create a google docs spreadsheet and save the outgoing bandwidth?
The idea is to create a google docs spreadsheet with the data which the user can then access and if he downloads the data to his computer, it would not count as bandwidth used by my application. | google-app-engine | gae-datastore | google-docs | null | null | null | open | Transferring data from gae datastore to a google docs spreadsheet
===
My gae application collects large amounts of numerical data. Instead of having users download it, is it possible to create a google docs spreadsheet and save the outgoing bandwidth?
The idea is to create a google docs spreadsheet with the data which the user can then access and if he downloads the data to his computer, it would not count as bandwidth used by my application. | 0 |
11,386,832 | 07/08/2012 21:24:03 | 1,397,097 | 09/28/2009 16:04:47 | 120 | 4 | Is there a way to slow down the loading of assets in development? | does anyone now how I could artificially slow the speed of assets (images, js, etc) as if my local site was loading over the internet? Someway of saying "load the site as if it was loading over a 756kbps" or something like that. This could possibly be a browser plugin as well. | ruby-on-rails | browser | null | null | null | null | open | Is there a way to slow down the loading of assets in development?
===
does anyone now how I could artificially slow the speed of assets (images, js, etc) as if my local site was loading over the internet? Someway of saying "load the site as if it was loading over a 756kbps" or something like that. This could possibly be a browser plugin as well. | 0 |
11,386,836 | 07/08/2012 21:24:38 | 686,654 | 03/31/2011 22:55:13 | 96 | 3 | PHP SDK to access photos on Facebook, Flickr, Picasa | I'm looking for an SDK that allows me to access the APIs for Facebook, Flickr and Picasa, preferably in PHP. It should be able to:
- login to each site
- show all photo albums
- show all photos in selected album
- retrieve photo information for a selected photo (url, title, description, etc).
[http://slidechute.com][1] is an example of how it should work (click the "select photos" button).
[1]: http://slidechute.com/ | php | facebook | sdk | photo | flickr | 07/09/2012 01:26:02 | not constructive | PHP SDK to access photos on Facebook, Flickr, Picasa
===
I'm looking for an SDK that allows me to access the APIs for Facebook, Flickr and Picasa, preferably in PHP. It should be able to:
- login to each site
- show all photo albums
- show all photos in selected album
- retrieve photo information for a selected photo (url, title, description, etc).
[http://slidechute.com][1] is an example of how it should work (click the "select photos" button).
[1]: http://slidechute.com/ | 4 |
9,464,646 | 02/27/2012 11:57:55 | 1,121,108 | 12/29/2011 12:04:11 | 51 | 0 | Spring : java.lang.ClassNotFoundException: java/lang.Class | I'm creating beans with the following property
<property name="classe">
<value type="java.lang.Class">foo.bar.SomeClass</value>
</property>
The property "classe" is of type Class.
just like someone hinted on the following question : http://stackoverflow.com/questions/1601015/spring-syntax-for-setting-a-class-object
The problem is that I'm having this exception when deploying my application :
java.lang.ClassNotFoundException: java/lang.Class
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:280)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:253)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:177)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:229)
at org.springframework.beans.factory.config.TypedStringValue.resolveTargetType(TypedStringValue.java:154)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveTargetType(BeanDefinitionValueResolver.java:196)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:163)
It looks like Steve B. in the question I linked had the same problem and it was related to some spring configuration. I'm ***very*** new to spring and dont really know how to fix this.
Thanks in advance for your answers.
| spring | class | configuration | classnotfoundexception | java.lang.class | null | open | Spring : java.lang.ClassNotFoundException: java/lang.Class
===
I'm creating beans with the following property
<property name="classe">
<value type="java.lang.Class">foo.bar.SomeClass</value>
</property>
The property "classe" is of type Class.
just like someone hinted on the following question : http://stackoverflow.com/questions/1601015/spring-syntax-for-setting-a-class-object
The problem is that I'm having this exception when deploying my application :
java.lang.ClassNotFoundException: java/lang.Class
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:280)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:253)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:177)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:229)
at org.springframework.beans.factory.config.TypedStringValue.resolveTargetType(TypedStringValue.java:154)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveTargetType(BeanDefinitionValueResolver.java:196)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:163)
It looks like Steve B. in the question I linked had the same problem and it was related to some spring configuration. I'm ***very*** new to spring and dont really know how to fix this.
Thanks in advance for your answers.
| 0 |
11,226,408 | 06/27/2012 12:38:12 | 1,477,886 | 06/24/2012 09:44:48 | 19 | 0 | How to load methods of a controller from another one? | I have the following controller:
class Tests extends CI_Controller {
public function update_record_test()
{
//some methods
}
}
?>
But I need to execute Method1 method from Controller1 controller. How can I do it? | php | codeigniter | null | null | null | null | open | How to load methods of a controller from another one?
===
I have the following controller:
class Tests extends CI_Controller {
public function update_record_test()
{
//some methods
}
}
?>
But I need to execute Method1 method from Controller1 controller. How can I do it? | 0 |
11,226,411 | 06/27/2012 12:38:20 | 1,485,599 | 06/27/2012 12:16:32 | 1 | 0 | Google Apps Script Server Error Occurred clicking submit - occurs suddenly without script changes | Our spreadsheet scripts have not changed in 3 months. As of yesterday we get the error "Error encountered: we're sorry a server error occurred Please wait a bit and try again" when clicking the submit button on a particular function that has worked flawlessly for 3 months. Nothing has changed, and this was verified by viewing the script revision history. In addition, other functions are giving problems, like, "Cannot find function trim() in object...." - again, this has always worked fine.
The only thing that has changed was that, for the documents in question, we had removed 1 user and readded a user (gmail address) yesterday morning and shortly after users began reporting this issue. I don't believe I had ever removed a shared user before yesterday, by the way.
Is my only recourse to recreate the sheets??? Again, there have been no changes to this script and it worked flawlessly until I removed a user from sharing.
Thanks. | google | script | apps | null | null | null | open | Google Apps Script Server Error Occurred clicking submit - occurs suddenly without script changes
===
Our spreadsheet scripts have not changed in 3 months. As of yesterday we get the error "Error encountered: we're sorry a server error occurred Please wait a bit and try again" when clicking the submit button on a particular function that has worked flawlessly for 3 months. Nothing has changed, and this was verified by viewing the script revision history. In addition, other functions are giving problems, like, "Cannot find function trim() in object...." - again, this has always worked fine.
The only thing that has changed was that, for the documents in question, we had removed 1 user and readded a user (gmail address) yesterday morning and shortly after users began reporting this issue. I don't believe I had ever removed a shared user before yesterday, by the way.
Is my only recourse to recreate the sheets??? Again, there have been no changes to this script and it worked flawlessly until I removed a user from sharing.
Thanks. | 0 |
11,226,413 | 06/27/2012 12:38:37 | 608,220 | 02/08/2011 13:50:46 | 637 | 18 | ASP.NET MVC AJAX calls without static Controller URLs (magic strings) | **Question:**
What is a clear, safe and systematic way to call my MVC controllers/actions from JavaScript, but keep the related URLs in a central place for updating when controllers change? Or to dynamically generate the URLs at run-time? Or to get compile-time checking for AJAX controller linkage?
**Research/Past Attempts:**
I've recently plugged in T4MVC to my MVC project. Great! Compile-time checking for controller linkage in my views - but I still have controller URLs littered all over my JavaScript. Worse, I have evolved how I do it over the project lifetime, so I do it multiple ways that I'm still not satisfied with.
----------
1) One way:
locationAutoComplete = new AjaxQueue({
Controller: "Utilities", // null for current controller
Action: "GetMatchingLocations",
DataModel: null, // null for raw JSON, or a local model to populate
MaxQueuedRequests: 0
});
----------
2) Another way:
locationAutoComplete = function (location) {
return $.ajaxPost(resolveUrl("~/Utilities/GetMatchingLocations"));
}
----------
3) Both 1 and 2 above make use of a project root defined in a Master/Layout JavaScript snippet, but still use unchecked URL strings. So now I've started benefiting from T4MVC by simply defining controller strings in my .CSHTML view:
var locationLookupController = @Url.Action(MVC.Utilities.GetMatchingLocations());
----------
4) The SO article ( http://stackoverflow.com/questions/9988634/ajax-call-into-mvc-controller-url-issue ) addresses this a little. It talks about method 3, but also suggests using the AjaxHelper namespace. Since I make heavy use of jQuery AJAX with some pretty customized interactions (e.g. loading results into a local data model, not at a click event but at a timed interval), I don't think it will help me much. Today I don't even include the MS AJAX JavaScript code on any of my pages.
Thanks!
| ajax | asp.net-mvc | null | null | null | null | open | ASP.NET MVC AJAX calls without static Controller URLs (magic strings)
===
**Question:**
What is a clear, safe and systematic way to call my MVC controllers/actions from JavaScript, but keep the related URLs in a central place for updating when controllers change? Or to dynamically generate the URLs at run-time? Or to get compile-time checking for AJAX controller linkage?
**Research/Past Attempts:**
I've recently plugged in T4MVC to my MVC project. Great! Compile-time checking for controller linkage in my views - but I still have controller URLs littered all over my JavaScript. Worse, I have evolved how I do it over the project lifetime, so I do it multiple ways that I'm still not satisfied with.
----------
1) One way:
locationAutoComplete = new AjaxQueue({
Controller: "Utilities", // null for current controller
Action: "GetMatchingLocations",
DataModel: null, // null for raw JSON, or a local model to populate
MaxQueuedRequests: 0
});
----------
2) Another way:
locationAutoComplete = function (location) {
return $.ajaxPost(resolveUrl("~/Utilities/GetMatchingLocations"));
}
----------
3) Both 1 and 2 above make use of a project root defined in a Master/Layout JavaScript snippet, but still use unchecked URL strings. So now I've started benefiting from T4MVC by simply defining controller strings in my .CSHTML view:
var locationLookupController = @Url.Action(MVC.Utilities.GetMatchingLocations());
----------
4) The SO article ( http://stackoverflow.com/questions/9988634/ajax-call-into-mvc-controller-url-issue ) addresses this a little. It talks about method 3, but also suggests using the AjaxHelper namespace. Since I make heavy use of jQuery AJAX with some pretty customized interactions (e.g. loading results into a local data model, not at a click event but at a timed interval), I don't think it will help me much. Today I don't even include the MS AJAX JavaScript code on any of my pages.
Thanks!
| 0 |
11,226,414 | 06/27/2012 12:38:38 | 1,298,483 | 03/28/2012 14:46:50 | 41 | 0 | RoR Implementation of airline/airport data parser | In a travel based application I'm working on in Ruby on Rails I'm trying to build a few methods that parse a string and return the correct airport. Also, another method that parses a string and returns the correct airline.
Example:
Method accepts strings such as "Midway", "CHI-MIDWAY,IL" and returns "MDW"
Method accepts string such as "AMERICAN AIRLINES", "AMERICAN" and returns "AA"
How would you implement this? Would you build a static hash that has an array of strings pointing to the correct string code to return?
Anyone know of an airline/airport gem that already has this implemented? | ruby-on-rails | airport | null | null | null | null | open | RoR Implementation of airline/airport data parser
===
In a travel based application I'm working on in Ruby on Rails I'm trying to build a few methods that parse a string and return the correct airport. Also, another method that parses a string and returns the correct airline.
Example:
Method accepts strings such as "Midway", "CHI-MIDWAY,IL" and returns "MDW"
Method accepts string such as "AMERICAN AIRLINES", "AMERICAN" and returns "AA"
How would you implement this? Would you build a static hash that has an array of strings pointing to the correct string code to return?
Anyone know of an airline/airport gem that already has this implemented? | 0 |
11,226,418 | 06/27/2012 12:38:54 | 957,618 | 09/21/2011 18:30:13 | 52 | 0 | Iterator behavior in Java | I have a question regarding the iterator behavior in Java.
I have a call like this:
*myIterable.iterator().hasNext()*
If this call returns true, can I be sure that the collection has at least two elements?
From the Java API specification, I could only find out that true means there is one more element to go which can be reached by next(). But what happens if the pointer is at the very beginning (meaning whether the hasNext() can recognize the first element separately)
http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Iterator.html
it says true if the iteration has more elements. But more element could also mean the very first one?
Thx!
| java | iterator | iterable | null | null | null | open | Iterator behavior in Java
===
I have a question regarding the iterator behavior in Java.
I have a call like this:
*myIterable.iterator().hasNext()*
If this call returns true, can I be sure that the collection has at least two elements?
From the Java API specification, I could only find out that true means there is one more element to go which can be reached by next(). But what happens if the pointer is at the very beginning (meaning whether the hasNext() can recognize the first element separately)
http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Iterator.html
it says true if the iteration has more elements. But more element could also mean the very first one?
Thx!
| 0 |
11,226,420 | 06/27/2012 12:38:57 | 1,485,655 | 06/27/2012 12:37:10 | 1 | 0 | Issue while creating subfolder in Azure cloud |
I am using the Azure Api provided by microsoft for cloud storage...I am facing an unusual bug while creating the sub folder..
i.e when i create a subfolder within any container it is created easily within seconds ...but when i try to create a subfolder again with different name it takes more time as compared to the previous one..
Again i try it is created easily....
It means the sub folder no. 1 , 3 ,5 ,7 and so on are created easily and the even no. such as 2, 4 etc sub folders are created with delay..
i.e
"Alternate sub folder creation is taking too much time"
Please let me know if there is any solution for this bug... | azure | windows-azure-storage | null | null | null | null | open | Issue while creating subfolder in Azure cloud
===
I am using the Azure Api provided by microsoft for cloud storage...I am facing an unusual bug while creating the sub folder..
i.e when i create a subfolder within any container it is created easily within seconds ...but when i try to create a subfolder again with different name it takes more time as compared to the previous one..
Again i try it is created easily....
It means the sub folder no. 1 , 3 ,5 ,7 and so on are created easily and the even no. such as 2, 4 etc sub folders are created with delay..
i.e
"Alternate sub folder creation is taking too much time"
Please let me know if there is any solution for this bug... | 0 |
11,226,313 | 06/27/2012 12:33:40 | 1,260,020 | 03/09/2012 19:05:52 | 66 | 8 | How to skip variable in sublime text 2 snippet? | I have a sublime text 2 snippet like this:
on('${1:click}', ${2:'$3', }function (e) {
$0
return false;
});
If I trigger the snippet first is highlighted `click`, next is highlighted `'',` and here I have an option to either enter a value with the next tab hit or just delete the selected text if I don't want to use this highlighted block at all.
The problem is if I hit Delete to delete the highlighted text I want with the next tab hit to jump to the next var which in this case is $0. But instead I get a blank tab hit for the $3 var which is inside of the deleted block of var $2.
For example the way E-texteditor work is: If I delete some var which contains another var inside of it then I hit tab again I jump directly to the next after the deleted var not inside of it.
**Is this possible to achieve with Sublime Text 2?**
I hope you understand my question, here is the entire snippet code:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>m2k-on</string>
<key>uuid</key>
<string>6D67B0C4-96B1-4986-902B-2F6ACC17403F</string>
<key>tabTrigger</key>
<string>on</string>
<key>content</key>
<string>on('${1:click}', ${2:'$3', }function (e) {
$0
return false;
});</string>
</dict>
</plist>
Copy paste it in new snippet file to test it. | textmate | code-snippets | sublimetext | textmatebundles | sublimetext2 | null | open | How to skip variable in sublime text 2 snippet?
===
I have a sublime text 2 snippet like this:
on('${1:click}', ${2:'$3', }function (e) {
$0
return false;
});
If I trigger the snippet first is highlighted `click`, next is highlighted `'',` and here I have an option to either enter a value with the next tab hit or just delete the selected text if I don't want to use this highlighted block at all.
The problem is if I hit Delete to delete the highlighted text I want with the next tab hit to jump to the next var which in this case is $0. But instead I get a blank tab hit for the $3 var which is inside of the deleted block of var $2.
For example the way E-texteditor work is: If I delete some var which contains another var inside of it then I hit tab again I jump directly to the next after the deleted var not inside of it.
**Is this possible to achieve with Sublime Text 2?**
I hope you understand my question, here is the entire snippet code:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>m2k-on</string>
<key>uuid</key>
<string>6D67B0C4-96B1-4986-902B-2F6ACC17403F</string>
<key>tabTrigger</key>
<string>on</string>
<key>content</key>
<string>on('${1:click}', ${2:'$3', }function (e) {
$0
return false;
});</string>
</dict>
</plist>
Copy paste it in new snippet file to test it. | 0 |
11,226,428 | 06/27/2012 12:39:40 | 886,104 | 08/09/2011 14:12:52 | 15 | 0 | MapView's Overlay's onTap to call a method in the activity | I would like to have a Spinner updated upon an onTap event in my overlay items.
What is the best practice in this situation? Should I pass the Spinner to the overlay items? The method to update the Spinner is currently in the MapActivity, is there a way to invoke it from the onTap event?
Thanks | android | overlay | android-mapview | null | null | null | open | MapView's Overlay's onTap to call a method in the activity
===
I would like to have a Spinner updated upon an onTap event in my overlay items.
What is the best practice in this situation? Should I pass the Spinner to the overlay items? The method to update the Spinner is currently in the MapActivity, is there a way to invoke it from the onTap event?
Thanks | 0 |
11,226,429 | 06/27/2012 12:39:42 | 1,217,696 | 02/18/2012 06:31:48 | 36 | 3 | Logger Error in Glassfish server | our project in jetty server and work completely then this project deploy in Glassfish server, but here some error.
like logger and some thing etc.
Error ::
[#|2012-06-27T17:14:18.710+0530|SEVERE|glassfish3.1.2|org.apache.catalina.core.ContainerBase|_ThreadID=52;_ThreadName=AutoDeployer;|ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: java.lang.ExceptionInInitializerError
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5332)
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2018)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:353)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:145)
at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:575)
at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:461)
at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:389)
at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:380)
at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:220)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Caused by: java.lang.IllegalArgumentException: javax.servlet.ServletException: java.lang.ExceptionInInitializerError
at org.apache.catalina.core.StandardContext.addListener(StandardContext.java:2743)
at org.apache.catalina.core.StandardContext.addApplicationListener(StandardContext.java:1966)
at com.sun.enterprise.web.TomcatDeploymentConfig.configureApplicationListener(TomcatDeploymentConfig.java:235)
at com.sun.enterprise.web.TomcatDeploymentConfig.configureWebModule(TomcatDeploymentConfig.java:94)
at com.sun.enterprise.web.WebModuleContextConfig.start(WebModuleContextConfig.java:274)
at com.sun.enterprise.web.WebModuleContextConfig.lifecycleEvent(WebModuleContextConfig.java:172)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:149)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5329)
... 26 more
Caused by: javax.servlet.ServletException: java.lang.ExceptionInInitializerError
at org.apache.catalina.core.StandardContext.createListener(StandardContext.java:2853)
at org.apache.catalina.core.StandardContext.loadListener(StandardContext.java:4806)
at com.sun.enterprise.web.WebModule.loadListener(WebModule.java:1599)
at org.apache.catalina.core.StandardContext.addListener(StandardContext.java:2740)
... 33 more
Caused by: java.lang.ExceptionInInitializerError
at org.apache.log4j.Logger.getLogger(Logger.java:118)
at mwp.slktechlabs.web.SessionListener.<clinit>(SessionListener.java:35)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:307)
at com.sun.enterprise.web.WebContainer.createListenerInstance(WebContainer.java:761)
at com.sun.enterprise.web.WebModule.createListenerInstance(WebModule.java:1987)
at org.apache.catalina.core.StandardContext.createListener(StandardContext.java:2851)
... 36 more
Caused by: java.lang.SecurityException: Access to default session denied
at javax.mail.Session.getDefaultInstance(Session.java:320)
at mwp.slktechlabs.log.SMTPSSLAppender.createSession(SMTPSSLAppender.java:31)
at org.apache.log4j.net.SMTPAppender.activateOptions(SMTPAppender.java:121)
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:257)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:133)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:97)
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:689)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:647)
at org.apache.log4j.PropertyConfigurator.parseCatsAndRenderers(PropertyConfigurator.java:568)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:442)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:476)
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:471)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:125)
... 46 more
|#]
there mwp is our project and logger error .
Caused by: java.lang.ExceptionInInitializerError
at org.apache.log4j.Logger.getLogger(Logger.java:118)
at mwp.slktechlabs.web.SessionListener.<clinit>(SessionListener.java:35)
and line no : 35 is
private static final Logger logger = Logger.getLogger(SessionListener.class);
in mwp.slktechlabs.web.SessionListener.java file .
So please help , how to remove this error ?
Thanks,
kamlesh
| java | java-ee | glassfish | jetty | java-server | null | open | Logger Error in Glassfish server
===
our project in jetty server and work completely then this project deploy in Glassfish server, but here some error.
like logger and some thing etc.
Error ::
[#|2012-06-27T17:14:18.710+0530|SEVERE|glassfish3.1.2|org.apache.catalina.core.ContainerBase|_ThreadID=52;_ThreadName=AutoDeployer;|ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: java.lang.ExceptionInInitializerError
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5332)
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2018)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:353)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:145)
at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:575)
at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:461)
at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:389)
at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:380)
at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:220)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Caused by: java.lang.IllegalArgumentException: javax.servlet.ServletException: java.lang.ExceptionInInitializerError
at org.apache.catalina.core.StandardContext.addListener(StandardContext.java:2743)
at org.apache.catalina.core.StandardContext.addApplicationListener(StandardContext.java:1966)
at com.sun.enterprise.web.TomcatDeploymentConfig.configureApplicationListener(TomcatDeploymentConfig.java:235)
at com.sun.enterprise.web.TomcatDeploymentConfig.configureWebModule(TomcatDeploymentConfig.java:94)
at com.sun.enterprise.web.WebModuleContextConfig.start(WebModuleContextConfig.java:274)
at com.sun.enterprise.web.WebModuleContextConfig.lifecycleEvent(WebModuleContextConfig.java:172)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:149)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5329)
... 26 more
Caused by: javax.servlet.ServletException: java.lang.ExceptionInInitializerError
at org.apache.catalina.core.StandardContext.createListener(StandardContext.java:2853)
at org.apache.catalina.core.StandardContext.loadListener(StandardContext.java:4806)
at com.sun.enterprise.web.WebModule.loadListener(WebModule.java:1599)
at org.apache.catalina.core.StandardContext.addListener(StandardContext.java:2740)
... 33 more
Caused by: java.lang.ExceptionInInitializerError
at org.apache.log4j.Logger.getLogger(Logger.java:118)
at mwp.slktechlabs.web.SessionListener.<clinit>(SessionListener.java:35)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:307)
at com.sun.enterprise.web.WebContainer.createListenerInstance(WebContainer.java:761)
at com.sun.enterprise.web.WebModule.createListenerInstance(WebModule.java:1987)
at org.apache.catalina.core.StandardContext.createListener(StandardContext.java:2851)
... 36 more
Caused by: java.lang.SecurityException: Access to default session denied
at javax.mail.Session.getDefaultInstance(Session.java:320)
at mwp.slktechlabs.log.SMTPSSLAppender.createSession(SMTPSSLAppender.java:31)
at org.apache.log4j.net.SMTPAppender.activateOptions(SMTPAppender.java:121)
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:257)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:133)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:97)
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:689)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:647)
at org.apache.log4j.PropertyConfigurator.parseCatsAndRenderers(PropertyConfigurator.java:568)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:442)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:476)
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:471)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:125)
... 46 more
|#]
there mwp is our project and logger error .
Caused by: java.lang.ExceptionInInitializerError
at org.apache.log4j.Logger.getLogger(Logger.java:118)
at mwp.slktechlabs.web.SessionListener.<clinit>(SessionListener.java:35)
and line no : 35 is
private static final Logger logger = Logger.getLogger(SessionListener.class);
in mwp.slktechlabs.web.SessionListener.java file .
So please help , how to remove this error ?
Thanks,
kamlesh
| 0 |
10,877,375 | 06/04/2012 06:52:38 | 1,434,535 | 06/04/2012 06:49:04 | 1 | 0 | Kalman Filter with OpenCL | I'm a new OpenCL programmer, just got into GPGPU computing, i'm using an Nvidia Quadro 600.
I'm making a research work based on GPU programming, my aim is to write a simple Kalman Filter kernel for OpenCL using a SIMT approach. I found <a href="http://www.gsi.de/informationen/wti/library/scientificreport2008/PAPERS/FAIR-EXPERIMENTS-38.pdf">this</a> document which describes the principle by how it could be done with CUDA, i think it's a similar approach for OpenCL.
The basic operations done by Kalman Filter on a linear system are three equations, each one involving matrix manipulation, which computes the Kalman Gain matrix (K), the state estimation (x~), and updates the Error Covariance matrix (P) for the next state estimation. These three steps are iterated for each measurement taken from a real system.
Considering the SIMT approach, I thought to execute one iteration of the kalman filter on each gpu thread within a thread block, i send to each thread values needed to compute the iteration (input and output from the the real system measurement, linear system matrices).
There is some better design i could consider for this algorithm to be done with OpenCL?
It is possible (and useful) to make matrix operations on a separate kernel with a parallel manner?
Another question: assume we have k iteration, for each iteration k we calculate P for the step k+1, taking as input the P for step k from iteration k-1... Since each tread compute one iteration, it is possible to synchronize thread k to wait the P matrix from thread k-1? | filter | opencl | kalman | null | null | null | open | Kalman Filter with OpenCL
===
I'm a new OpenCL programmer, just got into GPGPU computing, i'm using an Nvidia Quadro 600.
I'm making a research work based on GPU programming, my aim is to write a simple Kalman Filter kernel for OpenCL using a SIMT approach. I found <a href="http://www.gsi.de/informationen/wti/library/scientificreport2008/PAPERS/FAIR-EXPERIMENTS-38.pdf">this</a> document which describes the principle by how it could be done with CUDA, i think it's a similar approach for OpenCL.
The basic operations done by Kalman Filter on a linear system are three equations, each one involving matrix manipulation, which computes the Kalman Gain matrix (K), the state estimation (x~), and updates the Error Covariance matrix (P) for the next state estimation. These three steps are iterated for each measurement taken from a real system.
Considering the SIMT approach, I thought to execute one iteration of the kalman filter on each gpu thread within a thread block, i send to each thread values needed to compute the iteration (input and output from the the real system measurement, linear system matrices).
There is some better design i could consider for this algorithm to be done with OpenCL?
It is possible (and useful) to make matrix operations on a separate kernel with a parallel manner?
Another question: assume we have k iteration, for each iteration k we calculate P for the step k+1, taking as input the P for step k from iteration k-1... Since each tread compute one iteration, it is possible to synchronize thread k to wait the P matrix from thread k-1? | 0 |
11,541,295 | 07/18/2012 12:24:43 | 310,146 | 04/06/2010 15:04:50 | 8 | 0 | Render HTML to a String from MVC Controller | I read this very helpful post: [how to render html to a string][1] instead of to the screen in MVC3.
I've created a function that does just that in my controller. I would now like to be able to call this method from class in another project so that I can offer this function as a service. The code looks like this:
using (var sw = new StringWriter())
{
var viewResult = ViewEngines.Engines.FindPartialView(ControllerContext, viewName);
var viewContext = new ViewContext(ControllerContext, viewResult.View, ViewData, TempData, sw);
viewResult.View.Render(viewContext, sw);
viewResult.ViewEngine.ReleaseView(ControllerContext, viewResult.View);
return sw.GetStringBuilder().ToString();
}
I'd like to call this class directly and not via the IIS. But then the ControllerContext is null. Can I specify the View on disc somehow?
[1]: http://stackoverflow.com/questions/483091/render-a-view-as-a-string | c# | mvc | controller | null | null | null | open | Render HTML to a String from MVC Controller
===
I read this very helpful post: [how to render html to a string][1] instead of to the screen in MVC3.
I've created a function that does just that in my controller. I would now like to be able to call this method from class in another project so that I can offer this function as a service. The code looks like this:
using (var sw = new StringWriter())
{
var viewResult = ViewEngines.Engines.FindPartialView(ControllerContext, viewName);
var viewContext = new ViewContext(ControllerContext, viewResult.View, ViewData, TempData, sw);
viewResult.View.Render(viewContext, sw);
viewResult.ViewEngine.ReleaseView(ControllerContext, viewResult.View);
return sw.GetStringBuilder().ToString();
}
I'd like to call this class directly and not via the IIS. But then the ControllerContext is null. Can I specify the View on disc somehow?
[1]: http://stackoverflow.com/questions/483091/render-a-view-as-a-string | 0 |
11,541,303 | 07/18/2012 12:25:10 | 1,278,731 | 03/19/2012 14:08:06 | 19 | 0 | How to create animation for text view | <?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView android:text="Name" android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<TextView android:text="Age" android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<TextView android:text="Sex" android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<TextView android:text="Address" android:id="@+id/textView4" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
</LinearLayout>
The above is my code .What i want is the Text field must come from left end of the screen as if it comes
from the side of the mobile and occupy the left most end of the screen asking the user to enter the details.
| android | null | null | null | null | null | open | How to create animation for text view
===
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView android:text="Name" android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<TextView android:text="Age" android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<TextView android:text="Sex" android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<TextView android:text="Address" android:id="@+id/textView4" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
</LinearLayout>
The above is my code .What i want is the Text field must come from left end of the screen as if it comes
from the side of the mobile and occupy the left most end of the screen asking the user to enter the details.
| 0 |
11,541,308 | 07/18/2012 12:25:34 | 986,089 | 10/09/2011 05:33:18 | 143 | 6 | Style element when button is clicked | I have items and buttons that are created dynamically and I want to show user what is happening by styling them with jquery (i am using AJAX). each item is like the following:
<li class="items">
<div class="itemheading">
<div class="controls">
<span class="votes">1</span>
<form class="actions" method="POST">
<input type="submit" class="button plus" value="+1" data-plus="123">
</form>
<form class="actions" method="POST">
<input type="submit" class="button minus" value="-1" data-minus="123">
</form>
<form class="actions" method="POST">
<input type="submit" class="button delete" value="X" data-del="123">
</form></div><span class="title">Item title</span>
</div>
<span class="infotext">Item Description</span>
</li>
When a button is clicked I want the style of the item to be updated. for instance if the +1 button is clicked the items border should fade in green then fade back to nothing in the space of a few seconds to show that, that item has been voted up.
What I have thought of so far is the following:
$(".plus").live('click', function() {
$(this).css("background", "#fff");
This does not work though. I thought I could use `$(this)` to reference the button that was clicked because I am using this already to get the data- tag value of the button:
var plus = $(this).data('plus');
The other problem is that even if it did work it would style the buttons border and I need to somehow style the `<div class="itemheading">`. I could just say style the .itemheading element but since I will have multiple items with that class I need to find another method. Perhaps there is a way to reference the parent of an element and then I could get the parent of that?
Thanks. Any help is really appreciated. | jquery | css | null | null | null | null | open | Style element when button is clicked
===
I have items and buttons that are created dynamically and I want to show user what is happening by styling them with jquery (i am using AJAX). each item is like the following:
<li class="items">
<div class="itemheading">
<div class="controls">
<span class="votes">1</span>
<form class="actions" method="POST">
<input type="submit" class="button plus" value="+1" data-plus="123">
</form>
<form class="actions" method="POST">
<input type="submit" class="button minus" value="-1" data-minus="123">
</form>
<form class="actions" method="POST">
<input type="submit" class="button delete" value="X" data-del="123">
</form></div><span class="title">Item title</span>
</div>
<span class="infotext">Item Description</span>
</li>
When a button is clicked I want the style of the item to be updated. for instance if the +1 button is clicked the items border should fade in green then fade back to nothing in the space of a few seconds to show that, that item has been voted up.
What I have thought of so far is the following:
$(".plus").live('click', function() {
$(this).css("background", "#fff");
This does not work though. I thought I could use `$(this)` to reference the button that was clicked because I am using this already to get the data- tag value of the button:
var plus = $(this).data('plus');
The other problem is that even if it did work it would style the buttons border and I need to somehow style the `<div class="itemheading">`. I could just say style the .itemheading element but since I will have multiple items with that class I need to find another method. Perhaps there is a way to reference the parent of an element and then I could get the parent of that?
Thanks. Any help is really appreciated. | 0 |
11,541,310 | 07/18/2012 12:25:38 | 604,613 | 02/05/2011 18:30:13 | 1,359 | 63 | XAML resource handling slowly driving me crazy | I am working with loose XAMLs (Build Action None, but always copy to output directory). Also i have a "root" xaml that is a resource dictionary which references some merged dictionaries which are located in a subfolder. This is my folder structure:
<root>\Root.xaml
<root>\SubFolder1\MergedDict1.xaml
<root>\SubFolder1\MergedDict2.xaml
<root>\SubFolder2\MergedDict3.xaml
<root>\SubFolder2\MergedDict4.xaml
I need to be able to add additional xaml files to the folders without recompiling, that is why i need to work with loose xamls.
In the application i load the root xaml, but always get the exception that the merged dictionaries cannot be found. I have tried a lot of different variants of assigning relative path as a source. Some of those include:
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="<root>/SubFolder1/MergedDict1.xaml" />
<ResourceDictionary Source="/SubFolder1/MergedDict1.xaml" />
<ResourceDictionary Source="SubFolder1/MergedDict1.xaml" />
<ResourceDictionary Source="./SubFolder1/MergedDict1.xaml" />
<ResourceDictionary Source="../SubFolder1/MergedDict1.xaml" />
...
To my surprise (and ongoing horror) none of them have worked.
I started questioning my sanity so i have even written a small test application to generate the relative path for me, using URIs:
System.Uri uri2 = new Uri(@"C:\<root>\SubFolder1\MergedDict1.xaml");
System.Uri uri1 = new Uri(@"C:\<root>");
var r = uri1.MakeRelativeUri(uri2).ToString();
The generated relative path was, as expected, SubFolder1/MergedDict1.xaml, did also not work. Who can teach me the black magic involved in getting the correct relative path? | c# | wpf | uri | resourcedictionary | mergeddictionaries | null | open | XAML resource handling slowly driving me crazy
===
I am working with loose XAMLs (Build Action None, but always copy to output directory). Also i have a "root" xaml that is a resource dictionary which references some merged dictionaries which are located in a subfolder. This is my folder structure:
<root>\Root.xaml
<root>\SubFolder1\MergedDict1.xaml
<root>\SubFolder1\MergedDict2.xaml
<root>\SubFolder2\MergedDict3.xaml
<root>\SubFolder2\MergedDict4.xaml
I need to be able to add additional xaml files to the folders without recompiling, that is why i need to work with loose xamls.
In the application i load the root xaml, but always get the exception that the merged dictionaries cannot be found. I have tried a lot of different variants of assigning relative path as a source. Some of those include:
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="<root>/SubFolder1/MergedDict1.xaml" />
<ResourceDictionary Source="/SubFolder1/MergedDict1.xaml" />
<ResourceDictionary Source="SubFolder1/MergedDict1.xaml" />
<ResourceDictionary Source="./SubFolder1/MergedDict1.xaml" />
<ResourceDictionary Source="../SubFolder1/MergedDict1.xaml" />
...
To my surprise (and ongoing horror) none of them have worked.
I started questioning my sanity so i have even written a small test application to generate the relative path for me, using URIs:
System.Uri uri2 = new Uri(@"C:\<root>\SubFolder1\MergedDict1.xaml");
System.Uri uri1 = new Uri(@"C:\<root>");
var r = uri1.MakeRelativeUri(uri2).ToString();
The generated relative path was, as expected, SubFolder1/MergedDict1.xaml, did also not work. Who can teach me the black magic involved in getting the correct relative path? | 0 |
11,541,312 | 07/18/2012 12:25:39 | 746,572 | 05/10/2011 09:47:36 | 16 | 0 | Is there a framework in Java to setup up persistence layer? | I try to write unit tests for the persistence layer of a Java web application. I use JUnit for testing the service layer and I want to use it for the persistence layer, too.
Because the application is highly customizable, the persistence layer can be changed by configuration to use JDBC-enabled databases (MySQL, Postgres, Oracle) and embedded databases (sqljet). Is there a framework, that helps me to define a data set used for testing and setting up the data storage with it? My goal is, to write one set of tests and use it for all implementations of the persistence layer. DbUnit is not an option, because I have non-JDBC versions of the persistence layer (sqljet).
Thanks in advance,
Markus
| java | unit-testing | persistence | dao | null | null | open | Is there a framework in Java to setup up persistence layer?
===
I try to write unit tests for the persistence layer of a Java web application. I use JUnit for testing the service layer and I want to use it for the persistence layer, too.
Because the application is highly customizable, the persistence layer can be changed by configuration to use JDBC-enabled databases (MySQL, Postgres, Oracle) and embedded databases (sqljet). Is there a framework, that helps me to define a data set used for testing and setting up the data storage with it? My goal is, to write one set of tests and use it for all implementations of the persistence layer. DbUnit is not an option, because I have non-JDBC versions of the persistence layer (sqljet).
Thanks in advance,
Markus
| 0 |
11,540,283 | 07/18/2012 11:29:05 | 1,174,343 | 01/27/2012 20:33:42 | 36 | 0 | enum in struct: dereferencing pointer to incomplete type | I'm not sure if I am just blind but i get this dereferencing pointer to incomplete type in following code:
header:
enum foo {stuff1, stuff2, stuff3};
struct bar {
enum foo e;
int x;
int y;
}
file in which header is included:
void func(struct bar *b) {
switch(b->e) {
...
}
}
The error occures in the switch line, also code completion on b only offers me the ints x and y but not the enum.
When reading other people's problems with this error I always see them using something at a point where it was not declared yet. But this is not the case here. So why does this code not compile?
| c | enums | struct | null | null | null | open | enum in struct: dereferencing pointer to incomplete type
===
I'm not sure if I am just blind but i get this dereferencing pointer to incomplete type in following code:
header:
enum foo {stuff1, stuff2, stuff3};
struct bar {
enum foo e;
int x;
int y;
}
file in which header is included:
void func(struct bar *b) {
switch(b->e) {
...
}
}
The error occures in the switch line, also code completion on b only offers me the ints x and y but not the enum.
When reading other people's problems with this error I always see them using something at a point where it was not declared yet. But this is not the case here. So why does this code not compile?
| 0 |
11,540,284 | 07/18/2012 11:29:11 | 1,487,608 | 06/28/2012 06:03:36 | 1 | 0 | Connect an Ipad to a controller | I need to run an application in my ipad which has to talk wirelessly to a controller. The controller communicates on serial as well as RS485 port. It doesn't have a wifi adapter.
What are the options for me to do this ?
One thought is, I have to buy a wifi to RS485 adapter which I will attach to my controller and then my ipad can connect to the controller through the wifi adapter. Is this feasible? My doubts are because, I am not sure whether Ipad has the capability to open a raw socket connection to the remote wifi adapter (on the controller).
If not, then what are the other options which are available for me ? | ipad | wifi | rs485 | null | null | null | open | Connect an Ipad to a controller
===
I need to run an application in my ipad which has to talk wirelessly to a controller. The controller communicates on serial as well as RS485 port. It doesn't have a wifi adapter.
What are the options for me to do this ?
One thought is, I have to buy a wifi to RS485 adapter which I will attach to my controller and then my ipad can connect to the controller through the wifi adapter. Is this feasible? My doubts are because, I am not sure whether Ipad has the capability to open a raw socket connection to the remote wifi adapter (on the controller).
If not, then what are the other options which are available for me ? | 0 |
11,540,285 | 07/18/2012 11:29:12 | 904,412 | 08/21/2011 07:50:35 | 155 | 20 | Sim Info from android devices | I want to know the sim information like phone number,Registered name..etc from android devices throgh programatically.I go through [this](http://stackoverflow.com/questions/2372757/access-the-sim-card-with-an-android-application) but did not get any success. Can anyone Please provide some help...
Thanks in advance !!
| android | telephonymanager | null | null | null | null | open | Sim Info from android devices
===
I want to know the sim information like phone number,Registered name..etc from android devices throgh programatically.I go through [this](http://stackoverflow.com/questions/2372757/access-the-sim-card-with-an-android-application) but did not get any success. Can anyone Please provide some help...
Thanks in advance !!
| 0 |
11,541,318 | 07/18/2012 12:26:14 | 1,534,209 | 07/18/2012 08:56:11 | 1 | 0 | All browser support script for onerror handler for image please | i have write a script for on error event of an image tag its working with chrome and IE and some older version of Firefox but not working with latest version of Firefox
function handle(element,type,state) {
try {
var nopreview = "/images/nopreview.png";
if (element && state === 'fail') {
element.onerror = "";
if (type == 'author') {
nopreview = "/images/nopreview-author.png";
}
else if (type == 'product-detail') {
nopreview = "/images/nopreview-product.png";
}
else if (type == 'review') {
nopreview = "/images/nopreview-staffreview.png";
}
element.src = nopreview;
}
} catch (ex) { app.logger.log("Exception in UltraLearn.HandleThumbnailError():");
app.logger.error(ex.message); }
};
i have use it with image tag as
<asp:Image ID="Thumbnail" runat="server" SkinID="Thumbnail" onerror="handle(this,'','fail');"
ImageUrl='<%#GetThumbnailUrl(Eval("ThumbnailUrl"))%>' AlternateText='<%#Eval("ThumbnailAltText")%>' /></asp:HyperLink>
please help me out i have working on it for too long
thanks in advance
| javascript | javascript-events | event-handling | cross-browser | null | null | open | All browser support script for onerror handler for image please
===
i have write a script for on error event of an image tag its working with chrome and IE and some older version of Firefox but not working with latest version of Firefox
function handle(element,type,state) {
try {
var nopreview = "/images/nopreview.png";
if (element && state === 'fail') {
element.onerror = "";
if (type == 'author') {
nopreview = "/images/nopreview-author.png";
}
else if (type == 'product-detail') {
nopreview = "/images/nopreview-product.png";
}
else if (type == 'review') {
nopreview = "/images/nopreview-staffreview.png";
}
element.src = nopreview;
}
} catch (ex) { app.logger.log("Exception in UltraLearn.HandleThumbnailError():");
app.logger.error(ex.message); }
};
i have use it with image tag as
<asp:Image ID="Thumbnail" runat="server" SkinID="Thumbnail" onerror="handle(this,'','fail');"
ImageUrl='<%#GetThumbnailUrl(Eval("ThumbnailUrl"))%>' AlternateText='<%#Eval("ThumbnailAltText")%>' /></asp:HyperLink>
please help me out i have working on it for too long
thanks in advance
| 0 |
11,410,190 | 07/10/2012 09:17:12 | 1,501,794 | 07/04/2012 14:02:55 | 1 | 0 | How to access httpapplicationcontext variable from aspx page? | I have created a Application variable to in my Global.asax.cs file with the below code:-
protected void Application_Start(Object sender, EventArgs e)
{
Application["Visitors"] = 0;
}
protected void Session_Start(Object sender, EventArgs e)
{
Application.Lock();
Application["Visitors"] = Convert.ToInt32(Application["Visitors"]) + 1;
Application.UnLock();
}
protected void Session_End(Object sender, EventArgs e)
{
Application["Visitors"] = Convert.ToInt32(Application["Visitors"]) - 1;
}
Now I want to use this Application["Visitor"] variable in my Classic aspx page. I am writing belwo code for this but it is giving me error:-
Sub window_onLoad ()
dim i
i= Application["Visitors"].ToString()
End sub
Could you please help me in using this variable on different aspx pages? | asp.net | vb.net | c#-4.0 | asp-classic | null | null | open | How to access httpapplicationcontext variable from aspx page?
===
I have created a Application variable to in my Global.asax.cs file with the below code:-
protected void Application_Start(Object sender, EventArgs e)
{
Application["Visitors"] = 0;
}
protected void Session_Start(Object sender, EventArgs e)
{
Application.Lock();
Application["Visitors"] = Convert.ToInt32(Application["Visitors"]) + 1;
Application.UnLock();
}
protected void Session_End(Object sender, EventArgs e)
{
Application["Visitors"] = Convert.ToInt32(Application["Visitors"]) - 1;
}
Now I want to use this Application["Visitor"] variable in my Classic aspx page. I am writing belwo code for this but it is giving me error:-
Sub window_onLoad ()
dim i
i= Application["Visitors"].ToString()
End sub
Could you please help me in using this variable on different aspx pages? | 0 |
11,409,157 | 07/10/2012 08:12:01 | 549,487 | 12/21/2010 04:30:18 | 26 | 4 | When I define a member in Obj-C with out @property, what's the action when deliver a value to the member? | @interface ClassA : UITableViewController {
NSString *member;
}
@end
The member is declare like above.
if I use
NSString * astring = [[NSString alloc] initWithString:@"???"];
member = astring;
Will the member retain the astring? | objective-c | ios | memory | retain | null | null | open | When I define a member in Obj-C with out @property, what's the action when deliver a value to the member?
===
@interface ClassA : UITableViewController {
NSString *member;
}
@end
The member is declare like above.
if I use
NSString * astring = [[NSString alloc] initWithString:@"???"];
member = astring;
Will the member retain the astring? | 0 |
11,409,158 | 07/10/2012 08:12:07 | 1,514,077 | 07/10/2012 07:55:44 | 1 | 0 | parallel.invoke behaving differently in Winform and Console Application | I recently built a prototype c# console application to read in measurements from four instruments in parallel(On the same TimeStamp), I used the parallel.invoke command to do so, The results were quite good every single time. Later i tried to implement the same concept in Winforms using backgroundworker. So in my DoWork i call this parallel.invoke to run the four functions to get readings, but the results are returned after so long and they are not on the same time stamp, I did try it without background worker but i have the same results. Any one has idea why parallel.invoke is behaving so?. That it works fine in console application and not in winform?. Also is there is a way to make sure that multiple async procces execution is run in parallel?. I am having a hard time understanding this, Please help me out here. Any comments would be appriciated! | c# | winforms | parallel-processing | console | backgroundworker | null | open | parallel.invoke behaving differently in Winform and Console Application
===
I recently built a prototype c# console application to read in measurements from four instruments in parallel(On the same TimeStamp), I used the parallel.invoke command to do so, The results were quite good every single time. Later i tried to implement the same concept in Winforms using backgroundworker. So in my DoWork i call this parallel.invoke to run the four functions to get readings, but the results are returned after so long and they are not on the same time stamp, I did try it without background worker but i have the same results. Any one has idea why parallel.invoke is behaving so?. That it works fine in console application and not in winform?. Also is there is a way to make sure that multiple async procces execution is run in parallel?. I am having a hard time understanding this, Please help me out here. Any comments would be appriciated! | 0 |
11,410,196 | 07/10/2012 09:17:25 | 1,168,255 | 01/25/2012 00:09:13 | 13 | 1 | Searching strategies (set-at-a-time, tuple-at-a-time) | I'm reading about search strategies (breadth first, depth first). I get some new concepts: set-at-a-time, tuple-at-a-time. Does anyone know the different between set-at-a-time and tuple-at-a-time.
Thanks in advance. | data-structures | graph | search-engine | null | null | null | open | Searching strategies (set-at-a-time, tuple-at-a-time)
===
I'm reading about search strategies (breadth first, depth first). I get some new concepts: set-at-a-time, tuple-at-a-time. Does anyone know the different between set-at-a-time and tuple-at-a-time.
Thanks in advance. | 0 |
11,409,596 | 07/10/2012 08:41:05 | 771,469 | 05/26/2011 14:19:44 | 1,185 | 82 | How to use list and array to instanciate fields in a class? | I would like to instanciate every field of my PHP class at the same time. So far, I have tried using `list`. Here is my code below (which doesn't work). Any help would be gladly accepted.
class Test {
private $x;
private $y;
private $z;
public function Test() {
$fields = array($this->x, $this->y, $this->z);
// I need $fields to be an array here.
list($fields) = array(1, 2, 3); // It would work if $fields wasn't an array.
echo 'x = ' . $this->x . '<br />y = ' . $this->y . '<br />z = ' . $this->z;
}
}
new Test(); | php | arrays | list | null | null | null | open | How to use list and array to instanciate fields in a class?
===
I would like to instanciate every field of my PHP class at the same time. So far, I have tried using `list`. Here is my code below (which doesn't work). Any help would be gladly accepted.
class Test {
private $x;
private $y;
private $z;
public function Test() {
$fields = array($this->x, $this->y, $this->z);
// I need $fields to be an array here.
list($fields) = array(1, 2, 3); // It would work if $fields wasn't an array.
echo 'x = ' . $this->x . '<br />y = ' . $this->y . '<br />z = ' . $this->z;
}
}
new Test(); | 0 |
11,409,599 | 07/10/2012 08:41:17 | 296,635 | 03/18/2010 15:08:29 | 392 | 0 | Written to a log file managed by java from a procedure Oracle | Can be written to a log file managed by java from a procedure Oracle PL / SQL
Thx. | java | oracle | logging | null | null | 07/10/2012 10:43:44 | not a real question | Written to a log file managed by java from a procedure Oracle
===
Can be written to a log file managed by java from a procedure Oracle PL / SQL
Thx. | 1 |
11,410,201 | 07/10/2012 09:17:51 | 236,555 | 12/22/2009 03:53:46 | 607 | 3 | Replacing combo box with table widget item in a QTableWidget | I have a combo box widget in one of the cells of a QTableWidget in my application. After a user selects an option in the combo box, I want to set the selected text as a QTableWidgetItem in the same cell (in which the combo box was present). So I want to replace the existing combo box with a table widget item. Calling removeCellWidget of table widget seems to delete the combo box. How can I achieve this effect without actually deleting the combo box object?
Thanks,
Rakesh. | qt | null | null | null | null | null | open | Replacing combo box with table widget item in a QTableWidget
===
I have a combo box widget in one of the cells of a QTableWidget in my application. After a user selects an option in the combo box, I want to set the selected text as a QTableWidgetItem in the same cell (in which the combo box was present). So I want to replace the existing combo box with a table widget item. Calling removeCellWidget of table widget seems to delete the combo box. How can I achieve this effect without actually deleting the combo box object?
Thanks,
Rakesh. | 0 |
11,410,202 | 07/10/2012 09:17:54 | 1,319,374 | 04/07/2012 17:09:48 | 298 | 4 | Do I have to drop the table before creating it in Sqlite? | When I initialize my Sqlite Database I make it as follows:
var db = window.openDatabase("Database", "1.0", "Cordova Demo", 20000);
db.transaction(populateDB, errorCB, successCB);
function populateDB(tx) {
tx.executeSql('DROP TABLE IF EXISTS TimeTable');
tx.executeSql('CREATE TABLE IF NOT EXISTS TimeTable (id INTEGER PRIMARY KEY AUTOINCREMENT, Day, Subject, StartingTime, EndingTime)');}
Now, I don't want the table to be dropped every time I call this function.
But when I remove this line:
tx.executeSql('DROP TABLE IF EXISTS TimeTable');
An error shows:
[INFO] Error processing SQL: 1
Is there a solution for this ?
| javascript | sql | sqlite | phonegap | cordova | null | open | Do I have to drop the table before creating it in Sqlite?
===
When I initialize my Sqlite Database I make it as follows:
var db = window.openDatabase("Database", "1.0", "Cordova Demo", 20000);
db.transaction(populateDB, errorCB, successCB);
function populateDB(tx) {
tx.executeSql('DROP TABLE IF EXISTS TimeTable');
tx.executeSql('CREATE TABLE IF NOT EXISTS TimeTable (id INTEGER PRIMARY KEY AUTOINCREMENT, Day, Subject, StartingTime, EndingTime)');}
Now, I don't want the table to be dropped every time I call this function.
But when I remove this line:
tx.executeSql('DROP TABLE IF EXISTS TimeTable');
An error shows:
[INFO] Error processing SQL: 1
Is there a solution for this ?
| 0 |
11,410,203 | 07/10/2012 09:17:56 | 1,476,759 | 06/23/2012 12:13:24 | 37 | 2 | Memory Warning error from Cache Images | i am stored high resolution images in iPhone cache .i will get Memory waring and the app will be crash how to handle. | iphone | null | null | null | null | null | open | Memory Warning error from Cache Images
===
i am stored high resolution images in iPhone cache .i will get Memory waring and the app will be crash how to handle. | 0 |
11,499,610 | 07/16/2012 07:11:11 | 1,025,142 | 11/02/2011 07:18:14 | 80 | 3 | Creating class library project from winform | I have a winform project (from a different person, I didn't build it), that uses a web reference. I want to create a new project - class library project - based on the winform project (without GUI).
I tried to copy some of the files but I can't copy this web reference, I don't even have a directory "Web References" in my new project.
When I click on the web reference that I want, I see on the properties
"Url Behaviour - Dynamic" and "Web reference" - a url in my computer that does not exist (but the old project works!).
When I enter to the web reference directory on my file explorer I can see files there but no dll so I can't add it to the new project..
What's I'm doing wrong? | c# | dll | class-library | web-reference | null | null | open | Creating class library project from winform
===
I have a winform project (from a different person, I didn't build it), that uses a web reference. I want to create a new project - class library project - based on the winform project (without GUI).
I tried to copy some of the files but I can't copy this web reference, I don't even have a directory "Web References" in my new project.
When I click on the web reference that I want, I see on the properties
"Url Behaviour - Dynamic" and "Web reference" - a url in my computer that does not exist (but the old project works!).
When I enter to the web reference directory on my file explorer I can see files there but no dll so I can't add it to the new project..
What's I'm doing wrong? | 0 |
11,499,611 | 07/16/2012 07:11:10 | 1,514,206 | 07/10/2012 08:40:30 | 6 | 0 | how to retrieve data from sqlite database and store it into spinner? | I need to be able to retrieve data and store it into spinner. I only know how to store the values into database. the values of the spinner are just for testing to store into database.
Below are the codes.
InfoDBAdapter.java
package main.page;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Bundle;
import android.provider.BaseColumns;
import android.util.Log;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.Toast;
public class InfoDBAdapter
{
public static final String KEY_ROWID = "_id";
public static final String KEY_NAME = "name";
public static final String KEY_DATE = "date";
public static final String KEY_TYPE = "type";
public static final String KEY_LIKES = "likes";
public static final String KEY_DISLIKES = "dislikes";
private static final String TAG = "InfoDBAdapter";
private static final String DATABASE_NAME = "Anniversary";
private static final String DATABASE_TABLE = "friends";
private static final int DATABASE_VERSION = 2;
private static final String DATABASE_CREATE = "create table friends (_id integer primary key autoincrement, "
+ "name text not null, date text not null, type text not null, likes text not null, dislikes text not null);";
private final Context context;
private DatabaseHelper DBHelper;
private SQLiteDatabase db;
public InfoDBAdapter(Context ctx)
{
this.context = ctx;
DBHelper = new DatabaseHelper(context);
}
private static class DatabaseHelper extends SQLiteOpenHelper
{
DatabaseHelper(Context context)
{
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db)
{
try
{
db.execSQL(DATABASE_CREATE);
} catch (SQLException e)
{
e.printStackTrace();
}
}// end onCreate()
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
{
Log.w(TAG, "Upgrading database from version " + oldVersion + " to "
+ newVersion + ", which will destroy all old data");
db.execSQL("DROP TABLE IF EXISTS friends");
onCreate(db);
}// end onUpgrade()
}//end DatabaseHelper class
public InfoDBAdapter open() throws SQLException
{
db = DBHelper.getWritableDatabase();
return this;
}// end open()
public void close()
{
DBHelper.close();
}// end close()
public long insertContact(String name, String date, String type, String likes, String dislikes)
{
ContentValues initialValues = new ContentValues();
initialValues.put(KEY_NAME, name);
initialValues.put(KEY_DATE, date);
initialValues.put(KEY_TYPE, type);
initialValues.put(KEY_LIKES, likes);
initialValues.put(KEY_DISLIKES, dislikes);
return db.insert(DATABASE_TABLE, null, initialValues);
}//end insertContact()
public boolean deleteContact(long rowId)
{
return db.delete(DATABASE_TABLE, KEY_ROWID + "=" + rowId, null) > 0;
}// end deleteContact()
public Cursor getAllContacts()
{
return db.query(DATABASE_TABLE, new String[]
{ KEY_ROWID, KEY_NAME, KEY_DATE, KEY_TYPE, KEY_LIKES, KEY_DISLIKES }, null, null, null, null, null);
}// end getAllContacts()
public Cursor getContact(long rowId) throws SQLException
{
Cursor mCursor = db.query(true, DATABASE_TABLE, new String[] {
KEY_ROWID, KEY_NAME, KEY_DATE, KEY_TYPE, KEY_LIKES, KEY_DISLIKES }, KEY_ROWID + "=" + rowId,
null, null, null, null, null);
if (mCursor != null)
{
mCursor.moveToFirst();
}
return mCursor;
}// end getContact()
public boolean updateContact(long rowId, String name, String date, String type, String likes, String dislikes)
{
ContentValues args = new ContentValues();
args.put(KEY_NAME, name);
args.put(KEY_DATE, date);
args.put(KEY_TYPE, type);
args.put(KEY_LIKES, likes);
args.put(KEY_DISLIKES, dislikes);
return db.update(DATABASE_TABLE, args, KEY_ROWID + "=" + rowId, null) > 0;
}//end updateContact()
}//end DBAdapter
PersonalInfo
package main.page;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;
public class PersonalInfo extends Activity
{
Button btnSave, btnBack;
EditText txtDate, txtType, txtLikes, txtDislikes;
Spinner nameSpinner;
ArrayAdapter<String> adapter;
String friends[] = {"Kanak Priya", "Joanne Liew", "Melissa Haiting", "Michelle Lam", "Teo Kin Hua", "David Yeo"};
InfoDBAdapter infoDB = new InfoDBAdapter(this);
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.info);
nameSpinner = (Spinner) findViewById(R.id.nameSpinner);
adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, friends);
nameSpinner.setAdapter(adapter);
btnSave = (Button) findViewById(R.id.btnSave);
btnSave.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
infoDB.open();
long id;
Spinner nameSpinner = (Spinner) findViewById(R.id.nameSpinner);
String NameValue = nameSpinner.getSelectedItem().toString();
EditText txtDate = (EditText) findViewById(R.id.txtDate);
String DateValue = txtDate.getText().toString();
EditText txtType = (EditText) findViewById(R.id.txtType);
String TypeValue = txtType.getText().toString();
EditText txtLikes = (EditText) findViewById(R.id.txtLikes);
String LikesValue = txtLikes.getText().toString();
EditText txtDislikes = (EditText) findViewById(R.id.txtDislikes);
String DislikesValue = txtDislikes.getText().toString();
id = infoDB.insertContact(NameValue, DateValue, TypeValue, LikesValue, DislikesValue);
infoDB.close();
}
});
btnBack = (Button) findViewById(R.id.btnMain);
btnBack.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
finish();
}
});
}// end onCreate()
}
Please help me. Thankss =) | android | data | android-spinner | retrieve | sqlitedatabase | null | open | how to retrieve data from sqlite database and store it into spinner?
===
I need to be able to retrieve data and store it into spinner. I only know how to store the values into database. the values of the spinner are just for testing to store into database.
Below are the codes.
InfoDBAdapter.java
package main.page;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Bundle;
import android.provider.BaseColumns;
import android.util.Log;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.Toast;
public class InfoDBAdapter
{
public static final String KEY_ROWID = "_id";
public static final String KEY_NAME = "name";
public static final String KEY_DATE = "date";
public static final String KEY_TYPE = "type";
public static final String KEY_LIKES = "likes";
public static final String KEY_DISLIKES = "dislikes";
private static final String TAG = "InfoDBAdapter";
private static final String DATABASE_NAME = "Anniversary";
private static final String DATABASE_TABLE = "friends";
private static final int DATABASE_VERSION = 2;
private static final String DATABASE_CREATE = "create table friends (_id integer primary key autoincrement, "
+ "name text not null, date text not null, type text not null, likes text not null, dislikes text not null);";
private final Context context;
private DatabaseHelper DBHelper;
private SQLiteDatabase db;
public InfoDBAdapter(Context ctx)
{
this.context = ctx;
DBHelper = new DatabaseHelper(context);
}
private static class DatabaseHelper extends SQLiteOpenHelper
{
DatabaseHelper(Context context)
{
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db)
{
try
{
db.execSQL(DATABASE_CREATE);
} catch (SQLException e)
{
e.printStackTrace();
}
}// end onCreate()
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
{
Log.w(TAG, "Upgrading database from version " + oldVersion + " to "
+ newVersion + ", which will destroy all old data");
db.execSQL("DROP TABLE IF EXISTS friends");
onCreate(db);
}// end onUpgrade()
}//end DatabaseHelper class
public InfoDBAdapter open() throws SQLException
{
db = DBHelper.getWritableDatabase();
return this;
}// end open()
public void close()
{
DBHelper.close();
}// end close()
public long insertContact(String name, String date, String type, String likes, String dislikes)
{
ContentValues initialValues = new ContentValues();
initialValues.put(KEY_NAME, name);
initialValues.put(KEY_DATE, date);
initialValues.put(KEY_TYPE, type);
initialValues.put(KEY_LIKES, likes);
initialValues.put(KEY_DISLIKES, dislikes);
return db.insert(DATABASE_TABLE, null, initialValues);
}//end insertContact()
public boolean deleteContact(long rowId)
{
return db.delete(DATABASE_TABLE, KEY_ROWID + "=" + rowId, null) > 0;
}// end deleteContact()
public Cursor getAllContacts()
{
return db.query(DATABASE_TABLE, new String[]
{ KEY_ROWID, KEY_NAME, KEY_DATE, KEY_TYPE, KEY_LIKES, KEY_DISLIKES }, null, null, null, null, null);
}// end getAllContacts()
public Cursor getContact(long rowId) throws SQLException
{
Cursor mCursor = db.query(true, DATABASE_TABLE, new String[] {
KEY_ROWID, KEY_NAME, KEY_DATE, KEY_TYPE, KEY_LIKES, KEY_DISLIKES }, KEY_ROWID + "=" + rowId,
null, null, null, null, null);
if (mCursor != null)
{
mCursor.moveToFirst();
}
return mCursor;
}// end getContact()
public boolean updateContact(long rowId, String name, String date, String type, String likes, String dislikes)
{
ContentValues args = new ContentValues();
args.put(KEY_NAME, name);
args.put(KEY_DATE, date);
args.put(KEY_TYPE, type);
args.put(KEY_LIKES, likes);
args.put(KEY_DISLIKES, dislikes);
return db.update(DATABASE_TABLE, args, KEY_ROWID + "=" + rowId, null) > 0;
}//end updateContact()
}//end DBAdapter
PersonalInfo
package main.page;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;
public class PersonalInfo extends Activity
{
Button btnSave, btnBack;
EditText txtDate, txtType, txtLikes, txtDislikes;
Spinner nameSpinner;
ArrayAdapter<String> adapter;
String friends[] = {"Kanak Priya", "Joanne Liew", "Melissa Haiting", "Michelle Lam", "Teo Kin Hua", "David Yeo"};
InfoDBAdapter infoDB = new InfoDBAdapter(this);
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.info);
nameSpinner = (Spinner) findViewById(R.id.nameSpinner);
adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, friends);
nameSpinner.setAdapter(adapter);
btnSave = (Button) findViewById(R.id.btnSave);
btnSave.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
infoDB.open();
long id;
Spinner nameSpinner = (Spinner) findViewById(R.id.nameSpinner);
String NameValue = nameSpinner.getSelectedItem().toString();
EditText txtDate = (EditText) findViewById(R.id.txtDate);
String DateValue = txtDate.getText().toString();
EditText txtType = (EditText) findViewById(R.id.txtType);
String TypeValue = txtType.getText().toString();
EditText txtLikes = (EditText) findViewById(R.id.txtLikes);
String LikesValue = txtLikes.getText().toString();
EditText txtDislikes = (EditText) findViewById(R.id.txtDislikes);
String DislikesValue = txtDislikes.getText().toString();
id = infoDB.insertContact(NameValue, DateValue, TypeValue, LikesValue, DislikesValue);
infoDB.close();
}
});
btnBack = (Button) findViewById(R.id.btnMain);
btnBack.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
finish();
}
});
}// end onCreate()
}
Please help me. Thankss =) | 0 |
11,499,615 | 07/16/2012 07:11:14 | 1,528,096 | 07/16/2012 06:45:10 | 1 | 0 | I am having trouble with my php download code | I am making a website where users can upload, read and download pdf files. THe upload is working well they can read the pdf file online and can also download it using the adobe reader plugin. But the download code i wrote is giving me a hard time. It downloads the file but the file doesnt open in the adobe reader. It gives an error "Adobe Reader could not open file because it is either not a supported file type or because the file has been damaged"
here is my code:
<pre><code>`
if ($fd = fopen ($fullPath, "r")) {
$fsize = filesize($fullPath);
$path_parts = pathinfo($fullPath);
$ext = strtolower($path_parts["extension"]);
echo "<br>$fullPath<br>";
switch ($ext) {
case "pdf": header("Content-type: application/pdf");
header("Content-Disposition: attachment; filename='$fullPath'");
break;
default: header("Content-type: application/octet-stream");
header("Content-Disposition: filename=\"".$name."\"");
}
header("Content-length: $fsize");
header("Cache-control: private"); //use this to open files directly
while(!feof($fd)) {
$buffer = fread($fd, 2048);
echo $buffer;
}
}
fclose ($fd);
exit; `
</code></pre>
could some one help me out with it. Thanks in advance.
| php | file-download | adobe-reader | null | null | null | open | I am having trouble with my php download code
===
I am making a website where users can upload, read and download pdf files. THe upload is working well they can read the pdf file online and can also download it using the adobe reader plugin. But the download code i wrote is giving me a hard time. It downloads the file but the file doesnt open in the adobe reader. It gives an error "Adobe Reader could not open file because it is either not a supported file type or because the file has been damaged"
here is my code:
<pre><code>`
if ($fd = fopen ($fullPath, "r")) {
$fsize = filesize($fullPath);
$path_parts = pathinfo($fullPath);
$ext = strtolower($path_parts["extension"]);
echo "<br>$fullPath<br>";
switch ($ext) {
case "pdf": header("Content-type: application/pdf");
header("Content-Disposition: attachment; filename='$fullPath'");
break;
default: header("Content-type: application/octet-stream");
header("Content-Disposition: filename=\"".$name."\"");
}
header("Content-length: $fsize");
header("Cache-control: private"); //use this to open files directly
while(!feof($fd)) {
$buffer = fread($fd, 2048);
echo $buffer;
}
}
fclose ($fd);
exit; `
</code></pre>
could some one help me out with it. Thanks in advance.
| 0 |
11,499,622 | 07/16/2012 07:11:48 | 1,136,108 | 01/07/2012 15:52:13 | 79 | 0 | Facebook FQL -- very slow | $access_token = $facebook->getAccessToken();
$query = "SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me())";
$query = urlencode($query);
$fql_query_url = 'https://graph.facebook.com/'. 'fql?q='.$query. '&access_token=' . $access_token;
$fql_query_result = file_get_contents($fql_query_url);
$fql_query_obj = json_decode($fql_query_result, true);
This is the query. It works me faster because I have limited friends. But some app users say that it is very very slow for them if they have about 2000+ friends. They said it took 30 seconds to minutes too.
Why it is very slower? Is there any wrong in this request? | php | facebook | facebook-graph-api | null | null | null | open | Facebook FQL -- very slow
===
$access_token = $facebook->getAccessToken();
$query = "SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me())";
$query = urlencode($query);
$fql_query_url = 'https://graph.facebook.com/'. 'fql?q='.$query. '&access_token=' . $access_token;
$fql_query_result = file_get_contents($fql_query_url);
$fql_query_obj = json_decode($fql_query_result, true);
This is the query. It works me faster because I have limited friends. But some app users say that it is very very slow for them if they have about 2000+ friends. They said it took 30 seconds to minutes too.
Why it is very slower? Is there any wrong in this request? | 0 |
11,499,624 | 07/16/2012 07:11:50 | 1,008,437 | 10/22/2011 10:49:23 | 12 | 0 | Same qemu process made higher cpu usage when the number of them got larger | Environment:
CPU: Intel E7-4807 [4*6(core)*2(thread) 1840MHZ]
RAM: 96GB
While i run small number(1-20,eg) of virtual machines on this server, every qemu-kvm process for them used just <10% CPU(seen from top);
But when the number got larger, those same qemu-kvm process made very high cpu usage, about 80% each.
Each qemu-kvm process is for one windows7 idle virtual machine.
Who can point out some possible reason about this problem.
any help is appreciated.
Thanks advance. | linux-kernel | virtualization | virtual-machine | qemu | cgroups | null | open | Same qemu process made higher cpu usage when the number of them got larger
===
Environment:
CPU: Intel E7-4807 [4*6(core)*2(thread) 1840MHZ]
RAM: 96GB
While i run small number(1-20,eg) of virtual machines on this server, every qemu-kvm process for them used just <10% CPU(seen from top);
But when the number got larger, those same qemu-kvm process made very high cpu usage, about 80% each.
Each qemu-kvm process is for one windows7 idle virtual machine.
Who can point out some possible reason about this problem.
any help is appreciated.
Thanks advance. | 0 |
11,499,627 | 07/16/2012 07:12:07 | 843,366 | 07/13/2011 19:08:35 | 1,614 | 85 | Core Data two entitites of the same class | I'd like to have a `NSManagedObject` subclass `Food` representing food. Now I'd like to have two entities (or lists stored separately), i.e. `EatenFood` and `FoodInTheFridge` using core data. Both lists contain the same objects `Food` but i'd like to have them disjoint and kept separately(so `Food` can either be eaten of in the fridge).
How can I achieve this using core data? | iphone | ios | core-data | null | null | null | open | Core Data two entitites of the same class
===
I'd like to have a `NSManagedObject` subclass `Food` representing food. Now I'd like to have two entities (or lists stored separately), i.e. `EatenFood` and `FoodInTheFridge` using core data. Both lists contain the same objects `Food` but i'd like to have them disjoint and kept separately(so `Food` can either be eaten of in the fridge).
How can I achieve this using core data? | 0 |
11,499,631 | 07/16/2012 07:12:36 | 957,225 | 09/21/2011 14:52:28 | 688 | 2 | scrollsToTop on UIScrollView did not work | I've set up scrollTopTop property in my UIScrollView to YES however, when I tap on my status bar it didn't work. Why is this?
I have a UIViewController called A and inside A I have a UIViewController B, which has the UIScrollView. Is this the reason why it's not working? | iphone | objective-c | ios | ipad | null | null | open | scrollsToTop on UIScrollView did not work
===
I've set up scrollTopTop property in my UIScrollView to YES however, when I tap on my status bar it didn't work. Why is this?
I have a UIViewController called A and inside A I have a UIViewController B, which has the UIScrollView. Is this the reason why it's not working? | 0 |
11,499,632 | 07/16/2012 07:12:46 | 1,528,133 | 07/16/2012 07:07:21 | 1 | 0 | Facebook $facebook->getUser() always returs 0 | I am facing an issue based on a facebook app script. It always returning 0, even if the user is login to facebook. I have take a look at the old discussions , but I could not find out the solution . Please take a look at the code.
<?php
require "config/database.class.php";
require 'fbook/src/facebook.php';
require "core/corefunction.php";
$facebook = new Facebook(array(
'appId' => 'xxxxxxx',
'secret' => 'xxxxxxxxx',
));
$user = $facebook->getUser();
if ($user) {
try {
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}
if ($user) {
echo "Yes";exit;
}
else{
$urlf= $facebook->getLoginUrl(array('scope' => 'user_status,publish_stream'));
?>
<script language="javascript" type="text/javascript">
document.location.href="<?php echo $urlf; ?>";
</script>
<?php
exit;
}
?> | facebook | application | null | null | null | null | open | Facebook $facebook->getUser() always returs 0
===
I am facing an issue based on a facebook app script. It always returning 0, even if the user is login to facebook. I have take a look at the old discussions , but I could not find out the solution . Please take a look at the code.
<?php
require "config/database.class.php";
require 'fbook/src/facebook.php';
require "core/corefunction.php";
$facebook = new Facebook(array(
'appId' => 'xxxxxxx',
'secret' => 'xxxxxxxxx',
));
$user = $facebook->getUser();
if ($user) {
try {
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}
if ($user) {
echo "Yes";exit;
}
else{
$urlf= $facebook->getLoginUrl(array('scope' => 'user_status,publish_stream'));
?>
<script language="javascript" type="text/javascript">
document.location.href="<?php echo $urlf; ?>";
</script>
<?php
exit;
}
?> | 0 |
11,499,638 | 07/16/2012 07:13:17 | 1,071,339 | 11/29/2011 13:07:12 | 142 | 1 | call jquery function wordpress | Below code is jquery function
$(document).ready(function () {
$('#access').accordion({
create: function (event, ui) {
$('div#access> div').each(function () {
var id = $(this).attr('id');
$(this).load(id+'.html', function () {
$('#access').accordion('resize');
});
});
}
});
});
where **access** is the div id i have used for menu items in header.
below code is header.php page code
<div id="access" >
<ul>
<?php wp_list_pages('depth=1&title_li=');?>
</ul>
</div>
what i want is onclick of the menu item the javascript function should be called..
how to call function from php file?
| php | jquery | wordpress | null | null | null | open | call jquery function wordpress
===
Below code is jquery function
$(document).ready(function () {
$('#access').accordion({
create: function (event, ui) {
$('div#access> div').each(function () {
var id = $(this).attr('id');
$(this).load(id+'.html', function () {
$('#access').accordion('resize');
});
});
}
});
});
where **access** is the div id i have used for menu items in header.
below code is header.php page code
<div id="access" >
<ul>
<?php wp_list_pages('depth=1&title_li=');?>
</ul>
</div>
what i want is onclick of the menu item the javascript function should be called..
how to call function from php file?
| 0 |
11,499,641 | 07/16/2012 07:13:22 | 1,523,103 | 07/13/2012 09:05:19 | 1 | 0 | JQuery Set Caret Position when Mouse Move (Dragging UI) | I am trying to use JQuery Dragging to move a content to TinyMce, I want when the cursor move, the caret in tinymce go with, how can i do it.
Thanks ! | tinymce | null | null | null | null | null | open | JQuery Set Caret Position when Mouse Move (Dragging UI)
===
I am trying to use JQuery Dragging to move a content to TinyMce, I want when the cursor move, the caret in tinymce go with, how can i do it.
Thanks ! | 0 |
11,298,017 | 07/02/2012 16:58:43 | 1,027,161 | 11/03/2011 07:44:09 | 6 | 0 | Integrating Magento with a C# application | It's me with another problem. Well basically what I'm trying to do is integrate a Magento shop with an C# application. The point is, I dont wan't the full magento page to appear, I only want the products to appear in my application and not the full page with the full menus. So my question here is: is there any way, I can "extract" somehow the magento code, so only a certain part of the site is showed on my C# application?
Thanks in advance!
P.S: Sorry for the bad english. | c# | php | html | visual-studio-2010 | magento | null | open | Integrating Magento with a C# application
===
It's me with another problem. Well basically what I'm trying to do is integrate a Magento shop with an C# application. The point is, I dont wan't the full magento page to appear, I only want the products to appear in my application and not the full page with the full menus. So my question here is: is there any way, I can "extract" somehow the magento code, so only a certain part of the site is showed on my C# application?
Thanks in advance!
P.S: Sorry for the bad english. | 0 |
11,297,999 | 07/02/2012 16:57:20 | 1,434,158 | 06/03/2012 23:43:39 | 18 | 0 | FindBugs unchecked / unconfirmed cast using generics multiple bounds | The following code raises a critical violation using Sonar + FindBugs:
public static <P extends ComponentContainer & AlignmentHandler> void addComponentAligned(P parent, Component child, Alignment alignment) {
parent.addComponent(child);
parent.setComponentAlignment(child, alignment);
}
Any ideas of how should I avoid this violation? | java | generics | findbugs | null | null | null | open | FindBugs unchecked / unconfirmed cast using generics multiple bounds
===
The following code raises a critical violation using Sonar + FindBugs:
public static <P extends ComponentContainer & AlignmentHandler> void addComponentAligned(P parent, Component child, Alignment alignment) {
parent.addComponent(child);
parent.setComponentAlignment(child, alignment);
}
Any ideas of how should I avoid this violation? | 0 |
11,298,021 | 07/02/2012 16:59:09 | 806,440 | 06/20/2011 10:16:08 | 842 | 46 | insert into table with multiple records from multiple tables | I have to insert into a table some records based on multiple records from 2 different tables..
Tables:
**Target**: `player_list_items`
**Source1**: `list_items`
**Source2**: `map_details`
A player is supposed to play a list which contains a list of items; A list needs to be played over a map.
The map contains placeholders with their certain X and Y positions and I need to place list_items behind those placeholders. for that I have created the target table that will contain the list_items positioned randomly behind the placeholders.
Below is the query in which I was able to dump the list_items for a user into the target table but, now the problem is that how to get X and Y positions randomly for each list_items from the source2 table.
INSERT INTO player_list_items
(player_list_list_id, player_list_player_id, player_list_item_id, player_list_item_cellX, player_list_item_cellY)
SELECT li.list_item_list_id, 584488596, li.list_item_item_id, 2, 5
FROM list_items li
WHERE li.list_item_list_id = 2
either an `insert with multiple selects` or `even another query {update}` after this would work for me because this would run only once for a user per list.
**Each list contains multiple items so the above query returns multiple items and its working fine, what needs to be considered is that the map_details table also contains multiple place holders and they would be more than the # of list_items for sure.**
**The required query is supposed to get all positions X and Y from the map_details table and assign then randomly to each individual item, positions for every item must be unique.**
I have seen examples of multiple selects for insert but they are for single row insertion and my problem is multiple rows from multiple tables and random too.
`I have a Stored Procedure for this case` because it has lots of other stuff thats working fine so, if anyone here want to give answer using SP that would be useful and not a problem for me to use.
Hope the above stuff is making sense and clarify my point.
Regards
| mysql | sql | query | null | null | null | open | insert into table with multiple records from multiple tables
===
I have to insert into a table some records based on multiple records from 2 different tables..
Tables:
**Target**: `player_list_items`
**Source1**: `list_items`
**Source2**: `map_details`
A player is supposed to play a list which contains a list of items; A list needs to be played over a map.
The map contains placeholders with their certain X and Y positions and I need to place list_items behind those placeholders. for that I have created the target table that will contain the list_items positioned randomly behind the placeholders.
Below is the query in which I was able to dump the list_items for a user into the target table but, now the problem is that how to get X and Y positions randomly for each list_items from the source2 table.
INSERT INTO player_list_items
(player_list_list_id, player_list_player_id, player_list_item_id, player_list_item_cellX, player_list_item_cellY)
SELECT li.list_item_list_id, 584488596, li.list_item_item_id, 2, 5
FROM list_items li
WHERE li.list_item_list_id = 2
either an `insert with multiple selects` or `even another query {update}` after this would work for me because this would run only once for a user per list.
**Each list contains multiple items so the above query returns multiple items and its working fine, what needs to be considered is that the map_details table also contains multiple place holders and they would be more than the # of list_items for sure.**
**The required query is supposed to get all positions X and Y from the map_details table and assign then randomly to each individual item, positions for every item must be unique.**
I have seen examples of multiple selects for insert but they are for single row insertion and my problem is multiple rows from multiple tables and random too.
`I have a Stored Procedure for this case` because it has lots of other stuff thats working fine so, if anyone here want to give answer using SP that would be useful and not a problem for me to use.
Hope the above stuff is making sense and clarify my point.
Regards
| 0 |
11,298,028 | 07/02/2012 16:59:37 | 1,493,927 | 07/01/2012 06:22:36 | 18 | 0 | Regarding dopost() similiar functionality observed in spring | I have one query as in servlets we have do get () and do post() methods, but do post() is more dynamic and even it hides the long query string parameters of the address bar of the browser , does spring have any thing much kike him to offer , i also want to hide the parameters of the browser as the dopost() observes..! | spring | null | null | null | null | null | open | Regarding dopost() similiar functionality observed in spring
===
I have one query as in servlets we have do get () and do post() methods, but do post() is more dynamic and even it hides the long query string parameters of the address bar of the browser , does spring have any thing much kike him to offer , i also want to hide the parameters of the browser as the dopost() observes..! | 0 |
11,297,953 | 07/02/2012 16:54:11 | 242,189 | 01/02/2010 05:39:28 | 636 | 14 | Generalizing a new operator over many types | I am using Unquote and did not see any approximate comprison.
So I decided to write one.
let inline (=~=) x y = abs x-y < 1.E-10
However the operator is not mapped onto, say Lists
let test = [1;2] =~= [1;2] //---> error
Is it possible to declare this operator to flow like `(=)` ?
Or would it require to define a new traits like 'StructuralEquality-ishness"?
Is it better to define a new operator with, say, http://code.google.com/p/fsharp-typeclasses/ ?
| f# | typeclass | functor | generic-programming | null | null | open | Generalizing a new operator over many types
===
I am using Unquote and did not see any approximate comprison.
So I decided to write one.
let inline (=~=) x y = abs x-y < 1.E-10
However the operator is not mapped onto, say Lists
let test = [1;2] =~= [1;2] //---> error
Is it possible to declare this operator to flow like `(=)` ?
Or would it require to define a new traits like 'StructuralEquality-ishness"?
Is it better to define a new operator with, say, http://code.google.com/p/fsharp-typeclasses/ ?
| 0 |
11,297,954 | 07/02/2012 16:54:13 | 494,143 | 11/01/2010 23:01:19 | 2,724 | 64 | Can the browser execute 2 JavaScript functions concurrently | We are using WatiN from C# to interact with a browser.
Some of WatiN's methods are a simple wrapper that sends an "onchanged()" and "onclick()" to certain web elements.
WatiN also provides a fire-and-forget version for this, which basically provides a non blocking version.
My question is, does the browser also 2 JS functions to execute at the same time?
For example, assume the following code:
// Uses FireEventAsync("onchanged")
SelectList.SelectNoWait()
SelectList.FireEventAsync("onclick")
Can both JS functions onclick and onchanged execute at once?
I believe we are experiencing a similar issue, where an onchanged() function is still executing while we fire another event, i was wondering if that is technically possible. | c# | javascript | .net | browser | javascript-events | null | open | Can the browser execute 2 JavaScript functions concurrently
===
We are using WatiN from C# to interact with a browser.
Some of WatiN's methods are a simple wrapper that sends an "onchanged()" and "onclick()" to certain web elements.
WatiN also provides a fire-and-forget version for this, which basically provides a non blocking version.
My question is, does the browser also 2 JS functions to execute at the same time?
For example, assume the following code:
// Uses FireEventAsync("onchanged")
SelectList.SelectNoWait()
SelectList.FireEventAsync("onclick")
Can both JS functions onclick and onchanged execute at once?
I believe we are experiencing a similar issue, where an onchanged() function is still executing while we fire another event, i was wondering if that is technically possible. | 0 |
11,298,036 | 07/02/2012 17:00:10 | 1,496,632 | 07/02/2012 16:33:07 | 1 | 0 | Where to listen to changes on SharedPreferences? | I started writing some little Android Apps in the past. So I have some basic knowledge there, but I feel that I still lack some "good practices" and some general design principles. So maybe that helps understanding my background.
What I'm currently working on is something like an alarm app. Imagine there is just a very simple activity, from where you can access some preference screens to (amongst others) set a date and time. Whenever one of the settings changes, I have to set/update an alarm using an AlarmManager. I'm also listening to "android.intent.action.BOOT_COMPLETED" broadcasts to re-register alarms after reboot.
So the question is, what is the right point to listen to any preference changes? I'd like to register a SharedPreferences.OnSharedPreferenceChangeListener, but I'm a bit afraid that whatever (e.g.) activity I use, that this object might not exist anymore when it really comes to a change. But for the App it's very important not to miss any update of the alarm. All examples I found in the internet didn't help me, because all of them assumed that the listening activity uses the preferences itself to update the UI for example. Sure, if the object doesn't exist, it's not important to miss the change events.
So is there any object that is guaranteed to exist? And should I listen with any activity or is it recommended to use a service for such scenarios? I'm not sure if it's worth implementing a service which only sets up a new alarm occasionally.
I would appreciate some helpful hints. Thanks in advance!
Regards,
BlackDroid | android | sharedpreferences | null | null | null | null | open | Where to listen to changes on SharedPreferences?
===
I started writing some little Android Apps in the past. So I have some basic knowledge there, but I feel that I still lack some "good practices" and some general design principles. So maybe that helps understanding my background.
What I'm currently working on is something like an alarm app. Imagine there is just a very simple activity, from where you can access some preference screens to (amongst others) set a date and time. Whenever one of the settings changes, I have to set/update an alarm using an AlarmManager. I'm also listening to "android.intent.action.BOOT_COMPLETED" broadcasts to re-register alarms after reboot.
So the question is, what is the right point to listen to any preference changes? I'd like to register a SharedPreferences.OnSharedPreferenceChangeListener, but I'm a bit afraid that whatever (e.g.) activity I use, that this object might not exist anymore when it really comes to a change. But for the App it's very important not to miss any update of the alarm. All examples I found in the internet didn't help me, because all of them assumed that the listening activity uses the preferences itself to update the UI for example. Sure, if the object doesn't exist, it's not important to miss the change events.
So is there any object that is guaranteed to exist? And should I listen with any activity or is it recommended to use a service for such scenarios? I'm not sure if it's worth implementing a service which only sets up a new alarm occasionally.
I would appreciate some helpful hints. Thanks in advance!
Regards,
BlackDroid | 0 |
11,298,038 | 07/02/2012 17:00:19 | 478,319 | 10/17/2010 03:17:13 | 646 | 18 | Is there a way to make contents of a grid cell move while editing WPF Column info in design view? | I've got a WPF grid with some rows and columns, with things in the respective grids, each aligned in various ways (left, right, center, etc). What I'd like to be able to do is move a column (or row) around and have everything realign, but instead all of the controls stay where they are and get Margin values added in their xaml. If I edit column size in xaml directly then everything realigns fine. So basically what I want is, is there a way for me to edit grid columns and rows without the designer changing around the margin info of the controls? Is there some way I can change this? | wpf | vb.net | visual-studio-2010 | null | null | null | open | Is there a way to make contents of a grid cell move while editing WPF Column info in design view?
===
I've got a WPF grid with some rows and columns, with things in the respective grids, each aligned in various ways (left, right, center, etc). What I'd like to be able to do is move a column (or row) around and have everything realign, but instead all of the controls stay where they are and get Margin values added in their xaml. If I edit column size in xaml directly then everything realigns fine. So basically what I want is, is there a way for me to edit grid columns and rows without the designer changing around the margin info of the controls? Is there some way I can change this? | 0 |
11,298,016 | 07/02/2012 16:58:41 | 903,943 | 08/20/2011 17:54:37 | 4,432 | 144 | emacs 24 themes and inherit attribute | I'm using zenburn from here:
https://github.com/djcb/elisp/blob/master/themes/zenburn-theme.el
It uses a lot of ":inherit" settings. However, I'm noticing that when I switch to another theme x and then back, x's foreground would remain along with zenburn's :inherit.
What to do? | emacs | elisp | null | null | null | null | open | emacs 24 themes and inherit attribute
===
I'm using zenburn from here:
https://github.com/djcb/elisp/blob/master/themes/zenburn-theme.el
It uses a lot of ":inherit" settings. However, I'm noticing that when I switch to another theme x and then back, x's foreground would remain along with zenburn's :inherit.
What to do? | 0 |
11,471,168 | 07/13/2012 13:09:25 | 804,128 | 06/18/2011 00:46:58 | 855 | 6 | Forms not closing properly if terminated due to program exit / main form close | On the form called "Dev" I have the following OnFormClosing function to make sure a thread is closed properly when a user closes the form.
protected override void OnFormClosing(FormClosingEventArgs e)
{
base.OnFormClosing(e);
dev.stopMultipleColorsWatcher();
}
Works fine if I close the "Dev" form directly. But if the "Dev" form closes because the main form ("Form1") was closed (which causes the program to exit) the `OnFormClosing()` function in "Dev" is never called, so the thread keeps on running and the program' process needs to be killed via task manager.
How do I fix this? I realise I could add an `OnFormClosing()` function to "Form1" which then calls the `OnFormClosing()` function in "Dev", but I was hoping for something a bit more clean. | c# | null | null | null | null | null | open | Forms not closing properly if terminated due to program exit / main form close
===
On the form called "Dev" I have the following OnFormClosing function to make sure a thread is closed properly when a user closes the form.
protected override void OnFormClosing(FormClosingEventArgs e)
{
base.OnFormClosing(e);
dev.stopMultipleColorsWatcher();
}
Works fine if I close the "Dev" form directly. But if the "Dev" form closes because the main form ("Form1") was closed (which causes the program to exit) the `OnFormClosing()` function in "Dev" is never called, so the thread keeps on running and the program' process needs to be killed via task manager.
How do I fix this? I realise I could add an `OnFormClosing()` function to "Form1" which then calls the `OnFormClosing()` function in "Dev", but I was hoping for something a bit more clean. | 0 |
11,468,608 | 07/13/2012 10:23:51 | 1,523,213 | 07/13/2012 09:51:23 | 1 | 0 | design time setting of custom web service data source in BIRT | I am trying to create a custom data source that links to a web service.
I have searched all over the web but cannot figure out how, after running through the wizards, to hard code into the src where to look for the web service.
I believe it may be something similar to this:
http://stackoverflow.com/questions/10692288/setting-birt-datasource-through-its-api
but with web services rather than JDBC.
Thanks a lot, | birt | null | null | null | null | null | open | design time setting of custom web service data source in BIRT
===
I am trying to create a custom data source that links to a web service.
I have searched all over the web but cannot figure out how, after running through the wizards, to hard code into the src where to look for the web service.
I believe it may be something similar to this:
http://stackoverflow.com/questions/10692288/setting-birt-datasource-through-its-api
but with web services rather than JDBC.
Thanks a lot, | 0 |
11,471,317 | 07/13/2012 13:18:41 | 685,834 | 03/31/2011 13:37:21 | 23 | 2 | Python design - cross imports | I'm in a corner right now with imports and don't know how to solve this.
I have 3 modules: 1. R88_8.py, 2. module_configuration.py, 3. modules/__init__.py.
I'll make diagram of dependencies:
modules/__init__.py IMPORTS > R88_8 IMPORTS > module_configuration.py IMPORTS > modules/__init__.py
So as you can see, we have cross import there.
Now how can I solve it, if modules/__init__.py keeps dict of class definitions (class like R88_8). R88_8 class makes instance of ModuleConfiguration in its constructor, and ModuleConfiguration needs dict of classes from modules/__init__.py. | python | design-patterns | import | null | null | null | open | Python design - cross imports
===
I'm in a corner right now with imports and don't know how to solve this.
I have 3 modules: 1. R88_8.py, 2. module_configuration.py, 3. modules/__init__.py.
I'll make diagram of dependencies:
modules/__init__.py IMPORTS > R88_8 IMPORTS > module_configuration.py IMPORTS > modules/__init__.py
So as you can see, we have cross import there.
Now how can I solve it, if modules/__init__.py keeps dict of class definitions (class like R88_8). R88_8 class makes instance of ModuleConfiguration in its constructor, and ModuleConfiguration needs dict of classes from modules/__init__.py. | 0 |
11,471,449 | 07/13/2012 13:26:39 | 1,464,110 | 06/18/2012 15:30:48 | 11 | 0 | Moving thumbnails with zoom | Is there a jquery script like on this page: http://hellomonday.com/ ?
I need a 4 rows with thumbnails (that i can move right/left) and when i click them it will zoom and show me big images with some description. | jquery | zoom | move | thumbnails | null | null | open | Moving thumbnails with zoom
===
Is there a jquery script like on this page: http://hellomonday.com/ ?
I need a 4 rows with thumbnails (that i can move right/left) and when i click them it will zoom and show me big images with some description. | 0 |
11,468,198 | 07/13/2012 09:56:38 | 1,425,322 | 05/30/2012 06:36:44 | 34 | 1 | Strip attributes in HTML tag span | I'm fetching data through CURL request and while parsing the HTML I'm some spans having attributes are not being parsed neatly.
Snippet of HTML code
<div class="ftlt" style="width:250px;">
<div class="tdiv"><span class="prop_price_img"></span><span class="property_price">PROPERTY_PRICE</span></div>
<p class="adPrice">AREA</p>
<h4>
<p style="float:left;width:251px;font-family:Arial, Helvetica, sans-serif;font-size:13px;padding:2px 10px 10px 0px;"><a href="some link" title="title">TITLE</a>,
<span style="color:#666;"> CITY_NAME.</span>
<a title="title, Sale" style="color:#3266CC;font-size:12px;text-decoration:underline;">View on map</a></p>
</h4>
<p style="font-weight:bold;color:#666;">
Premium
</p>
<div class="clr"></div>
</div>
I have to access the CITY_NAME element neatly.
I have been able to fetch that node through HTML DOM as
$spans = $html->find(div.ftlt span);
$city_value=strip_tags($spans[2]);
This $city_value is getting morphed.
I've tried removeAttribute method.Maybe I'm not doing it properly.
If regex can be applied, I want to know how?
| php | parsing | attributes | strip-tags | html-dom | null | open | Strip attributes in HTML tag span
===
I'm fetching data through CURL request and while parsing the HTML I'm some spans having attributes are not being parsed neatly.
Snippet of HTML code
<div class="ftlt" style="width:250px;">
<div class="tdiv"><span class="prop_price_img"></span><span class="property_price">PROPERTY_PRICE</span></div>
<p class="adPrice">AREA</p>
<h4>
<p style="float:left;width:251px;font-family:Arial, Helvetica, sans-serif;font-size:13px;padding:2px 10px 10px 0px;"><a href="some link" title="title">TITLE</a>,
<span style="color:#666;"> CITY_NAME.</span>
<a title="title, Sale" style="color:#3266CC;font-size:12px;text-decoration:underline;">View on map</a></p>
</h4>
<p style="font-weight:bold;color:#666;">
Premium
</p>
<div class="clr"></div>
</div>
I have to access the CITY_NAME element neatly.
I have been able to fetch that node through HTML DOM as
$spans = $html->find(div.ftlt span);
$city_value=strip_tags($spans[2]);
This $city_value is getting morphed.
I've tried removeAttribute method.Maybe I'm not doing it properly.
If regex can be applied, I want to know how?
| 0 |
11,460,611 | 07/12/2012 21:01:43 | 441,063 | 09/07/2010 03:26:38 | 38 | 7 | Restlet Can't parse payload of a GET request | I am using Restlet in java as a simple client to make calls to a RESTful service.
I am monitoring the payload through tcpmon and I am seeing the following payload get returned however i can't get at the data in the payload.
Client calls
ClientResource resource = new ClientResource("http://localhost/someplace/");
String rep = resource.get(String.class);
Payload
HTTP/1.0 200 OK
Date: Thu, 12 Jul 2012 20:22:12 GMT
Server: WSGIServer/0.1 Python/2.7.1
Vary: Cookie
Content-Type: application/json; charset=utf-8
Set-Cookie: sessionid=63c5ea23113073e489cb8920819f37d; expires=Thu, 26-Jul-2012 20:22:12 GMT; httponly; Max-Age=1209600; Path=/
{"jsonData": "someData"}
When i debug into restlet i notice that the InboundWay.createEntity(..) is setting the data to EmptyRepresentation due to the lack of length, chunkEncoding, or connection headers. Why is this? Why can't I just stream the data?
Does any one know why this is happening? Is there a better client? So far tried jersey and Resteasy with limited success. (jeresy has a bug where it is trying to mark and reset a autoCloseSteam, and resteasy was just a pain to use as a client) I was hoping not to have to write an HTTPClient. | java | rest | restlet | null | null | null | open | Restlet Can't parse payload of a GET request
===
I am using Restlet in java as a simple client to make calls to a RESTful service.
I am monitoring the payload through tcpmon and I am seeing the following payload get returned however i can't get at the data in the payload.
Client calls
ClientResource resource = new ClientResource("http://localhost/someplace/");
String rep = resource.get(String.class);
Payload
HTTP/1.0 200 OK
Date: Thu, 12 Jul 2012 20:22:12 GMT
Server: WSGIServer/0.1 Python/2.7.1
Vary: Cookie
Content-Type: application/json; charset=utf-8
Set-Cookie: sessionid=63c5ea23113073e489cb8920819f37d; expires=Thu, 26-Jul-2012 20:22:12 GMT; httponly; Max-Age=1209600; Path=/
{"jsonData": "someData"}
When i debug into restlet i notice that the InboundWay.createEntity(..) is setting the data to EmptyRepresentation due to the lack of length, chunkEncoding, or connection headers. Why is this? Why can't I just stream the data?
Does any one know why this is happening? Is there a better client? So far tried jersey and Resteasy with limited success. (jeresy has a bug where it is trying to mark and reset a autoCloseSteam, and resteasy was just a pain to use as a client) I was hoping not to have to write an HTTPClient. | 0 |
11,452,177 | 07/12/2012 12:46:49 | 1,221,032 | 02/20/2012 12:27:59 | 1,227 | 27 | Date/DateTime object type in AmbientDataFramework | I'm having a bit of an issue with the Date (java) / DateTime (.net) type when using the Ambient Data Framework in SDL Tridion 2009.
I'm setting a claim value in java like this:
Date myDate = rs.getDate("DATE_FIELD_IN_DB");
store.put(CLAIM_URI_DATE, myDate);
This is great and life is fantastic :)
In my web application (which is .net) I need to get this value from the claim store, when I try to do so, it fails:
My code is:
if (_store.Contains(new Uri("taf:claim:company:date"))) {
DateTime claimdata = _store.Get<DateTime>("taf:claim:cipd:memberstatus:surveydate");
Response.Write(claimdata.ToString());
}
And the error message is:
> [RuntimeException] Codemesh.JuggerNET.NTypeValue.Throw(Int64 inst)
> +373 Codemesh.JuggerNET.JavaClass.ThrowTypedException(Int64 inst) +1365 Codemesh.JuggerNET.JavaMethod.CallInt(JavaProxy jpo) +233 Tridion.ContentDelivery.AmbientData.JuggerNetTypeHelper.FromProxyObject(Object
> proxyObject) +738
> Tridion.ContentDelivery.AmbientData.ClaimStore.Get(Uri claimUri) +109
I've also tried obtaining as an object, which i then cast to DateTime. I'm obviously making a really basic error here, any help would be greatly appreciated.
Thanks
John
| tridion | null | null | null | null | null | open | Date/DateTime object type in AmbientDataFramework
===
I'm having a bit of an issue with the Date (java) / DateTime (.net) type when using the Ambient Data Framework in SDL Tridion 2009.
I'm setting a claim value in java like this:
Date myDate = rs.getDate("DATE_FIELD_IN_DB");
store.put(CLAIM_URI_DATE, myDate);
This is great and life is fantastic :)
In my web application (which is .net) I need to get this value from the claim store, when I try to do so, it fails:
My code is:
if (_store.Contains(new Uri("taf:claim:company:date"))) {
DateTime claimdata = _store.Get<DateTime>("taf:claim:cipd:memberstatus:surveydate");
Response.Write(claimdata.ToString());
}
And the error message is:
> [RuntimeException] Codemesh.JuggerNET.NTypeValue.Throw(Int64 inst)
> +373 Codemesh.JuggerNET.JavaClass.ThrowTypedException(Int64 inst) +1365 Codemesh.JuggerNET.JavaMethod.CallInt(JavaProxy jpo) +233 Tridion.ContentDelivery.AmbientData.JuggerNetTypeHelper.FromProxyObject(Object
> proxyObject) +738
> Tridion.ContentDelivery.AmbientData.ClaimStore.Get(Uri claimUri) +109
I've also tried obtaining as an object, which i then cast to DateTime. I'm obviously making a really basic error here, any help would be greatly appreciated.
Thanks
John
| 0 |
11,423,338 | 07/10/2012 23:11:25 | 630,866 | 02/23/2011 18:50:47 | 317 | 10 | Same output for htonl() and ntohl() on an integer | I ran the following program on little-endian [LE] machine [Linux, Intel processor]. I am unable to explain the 3 outputs in below code snippet. Since machine is LE, the value of `a` is stored as `0x78563412`. When printing, it is displaying its actual value. Since its an LE machine, I expect `ntohl()` to be a no-op and display `0x78563412`, which it is doing. However, I expect `0x12345678` for 2nd print statement containing `htonl()`. Can someone please help me understand why they are same?
int main()
{
int a = 0x12345678;
printf("Original - 0x%x\n", (a));
printf("Network - 0x%x\n", htonl(a));
printf("Host - 0x%x\n", ntohl(a));
return 0;
}
Output:
Original - 0x12345678
Network - 0x78563412
Host - 0x78563412 | c | endianness | null | null | null | null | open | Same output for htonl() and ntohl() on an integer
===
I ran the following program on little-endian [LE] machine [Linux, Intel processor]. I am unable to explain the 3 outputs in below code snippet. Since machine is LE, the value of `a` is stored as `0x78563412`. When printing, it is displaying its actual value. Since its an LE machine, I expect `ntohl()` to be a no-op and display `0x78563412`, which it is doing. However, I expect `0x12345678` for 2nd print statement containing `htonl()`. Can someone please help me understand why they are same?
int main()
{
int a = 0x12345678;
printf("Original - 0x%x\n", (a));
printf("Network - 0x%x\n", htonl(a));
printf("Host - 0x%x\n", ntohl(a));
return 0;
}
Output:
Original - 0x12345678
Network - 0x78563412
Host - 0x78563412 | 0 |
11,423,340 | 07/10/2012 23:11:27 | 1,461,972 | 06/17/2012 15:04:53 | 30 | 0 | Sending ghostscript output file directly into ruby executable | i'm trying to convert on windows 7 stdin to pdf using ghostscript, and instead of generating a local file, i want to send this file directly to my exe file.
I'm doing this
C:\Programas\gs\gs9.05\bin\gswin64c.exe -IC:\Programas\gs\gs9.05\lib;C:\Programas\gs\fonts -sDEVICE=pdfwrite -r300 -dNOPAUSE -dSAFER -sPAPERSIZE=a4 -sOutputFile=%%pipe%%"C:\Projectos\Online File Manager\Codigo\Ruby\shoes apps\FileCreate7.exe"
(I've meanwhile put the exe inside a cmd file)
I'm getting the error :
GPL Ghostscript 9.05: **** Could not open the file %pipe%c:\tempRep\filecreate.cmd .
Unrecoverable error: ioerror in setdevice
Operand stack:
--nostringval--
Any suggestions ? | exe | stdin | convert | ghostscript | null | null | open | Sending ghostscript output file directly into ruby executable
===
i'm trying to convert on windows 7 stdin to pdf using ghostscript, and instead of generating a local file, i want to send this file directly to my exe file.
I'm doing this
C:\Programas\gs\gs9.05\bin\gswin64c.exe -IC:\Programas\gs\gs9.05\lib;C:\Programas\gs\fonts -sDEVICE=pdfwrite -r300 -dNOPAUSE -dSAFER -sPAPERSIZE=a4 -sOutputFile=%%pipe%%"C:\Projectos\Online File Manager\Codigo\Ruby\shoes apps\FileCreate7.exe"
(I've meanwhile put the exe inside a cmd file)
I'm getting the error :
GPL Ghostscript 9.05: **** Could not open the file %pipe%c:\tempRep\filecreate.cmd .
Unrecoverable error: ioerror in setdevice
Operand stack:
--nostringval--
Any suggestions ? | 0 |
11,423,341 | 07/10/2012 23:11:28 | 216,363 | 11/22/2009 05:41:57 | 1,000 | 11 | Basic Sunspot :with filter improperly processed | I have a very basic Sunspot search:
company_search = Sunspot.search(Company) do
with(:can_have_barcodes, true)
fulltext search_term, :minimum_match => 1
end
The problem is that the `with(:can_have_barcodes, true)` isn't working. It will return NO hits, if I search this way, but if I remove the `with` line, it will return several results, all of which have :can_have_barcodes set to true.
The `company_search` variable comes out looking like this:
=> <Sunspot::Search:{:mm=>1, :rows=>30, :q=>"Red", :defType=>"dismax", :start=>0, :fl=>"* score", :qf=>"name_text name_first_words_text", :fq=>["type:Company", "can_have_barcodes_b:true"]}>
Any help is greatly appreciated. Thanks | ruby-on-rails | ruby-on-rails-3 | solr | sunspot | null | null | open | Basic Sunspot :with filter improperly processed
===
I have a very basic Sunspot search:
company_search = Sunspot.search(Company) do
with(:can_have_barcodes, true)
fulltext search_term, :minimum_match => 1
end
The problem is that the `with(:can_have_barcodes, true)` isn't working. It will return NO hits, if I search this way, but if I remove the `with` line, it will return several results, all of which have :can_have_barcodes set to true.
The `company_search` variable comes out looking like this:
=> <Sunspot::Search:{:mm=>1, :rows=>30, :q=>"Red", :defType=>"dismax", :start=>0, :fl=>"* score", :qf=>"name_text name_first_words_text", :fq=>["type:Company", "can_have_barcodes_b:true"]}>
Any help is greatly appreciated. Thanks | 0 |
11,423,347 | 07/10/2012 23:12:33 | 1,373,708 | 05/03/2012 22:08:53 | 1 | 0 | datediff (minute, '23:30','24:00') error | In SQL 2008 why do I get an error when I do this:
select datediff (minute, '23:30','24:00')
The error is :
Msg 241, Level 16, State 1, Line 1
Conversion failed when converting date and/or time from character string.
Even if I were to change '24:00' to '00:00' why does the result say -1410?
What are the alternatives that I could use for this please?
Harish | sql | null | null | null | null | null | open | datediff (minute, '23:30','24:00') error
===
In SQL 2008 why do I get an error when I do this:
select datediff (minute, '23:30','24:00')
The error is :
Msg 241, Level 16, State 1, Line 1
Conversion failed when converting date and/or time from character string.
Even if I were to change '24:00' to '00:00' why does the result say -1410?
What are the alternatives that I could use for this please?
Harish | 0 |
11,423,348 | 07/10/2012 23:12:54 | 1,487,045 | 06/27/2012 22:20:45 | 1 | 1 | jQuery checkboxes+ hidden id in jqgrid | I'm attempting to access hidden ids inside jqgrid, if a checkbox of the row is checked. Seems like a simple operation, but so far I had no success. Here is what I have:
function addUsers(){
$("#users_grid").find('input[type=checkbox]').each(function() {
if( $(this).is(':checked')) {
alert('HERE:'+this.id);
}
});
}
Any help will be much appreciated! | jqgrid | checkbox | null | null | null | null | open | jQuery checkboxes+ hidden id in jqgrid
===
I'm attempting to access hidden ids inside jqgrid, if a checkbox of the row is checked. Seems like a simple operation, but so far I had no success. Here is what I have:
function addUsers(){
$("#users_grid").find('input[type=checkbox]').each(function() {
if( $(this).is(':checked')) {
alert('HERE:'+this.id);
}
});
}
Any help will be much appreciated! | 0 |
11,262,009 | 06/29/2012 12:43:58 | 1,168,475 | 01/25/2012 04:50:43 | 10 | 0 | "Done" button in MPMoviePlayerController doesn't work when full screen mode | Well, I could find many questions about the same or similar questions and answers... However, nothing could help me. Only when I don't use the property "controlStyle" as "MPMovieControlStyleFullscreen", "done" button works. I tried this way..
MPMoviePlayerController *mpMoviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:@"https://dl.dropbox.com/u/14218997/thxq.mp4"]];
mpMoviePlayerController.controlStyle = MPMovieControlStyleNone;
[mpMoviePlayerController setUseApplicationAudioSession:NO];
[mpMoviePlayerController setScalingMode:MPMovieScalingModeAspectFit];
[mpMoviePlayerController setFullscreen:YES animated:YES];
[mpMoviePlayerController.view setFrame:CGRectMake(0, 0, 1024, 768)];
[[globalSingleton paintingView] addSubview:mpMoviePlayerController.view];
[mpMoviePlayerController prepareToPlay];
[mpMoviePlayerController play];
mpMoviePlayerController.controlStyle = MPMovieControlStyleFullscreen;
or this way..
MPMoviePlayerController *mp;
MPMoviePlayerViewController *mpVC = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:@"https://dl.dropbox.com/u/14218997/thxq.mp4"]];
mp = [mpVC moviePlayer];
mp.controlStyle = MPMovieControlStyleFullscreen;
mp.fullscreen = NO;
mp.useApplicationAudioSession = NO;
mp.view.frame = CGRectMake(0, 0, 1024, 768);
[[globalSingleton paintingView] addSubview:mp.view];
([globalSingleton paintingView] is just for representing main view. I already checked there's no problem on it.)
Please share what u know about this problem. Thx in advance! | ios | ipad | mpmovieplayercontroller | null | null | null | open | "Done" button in MPMoviePlayerController doesn't work when full screen mode
===
Well, I could find many questions about the same or similar questions and answers... However, nothing could help me. Only when I don't use the property "controlStyle" as "MPMovieControlStyleFullscreen", "done" button works. I tried this way..
MPMoviePlayerController *mpMoviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:@"https://dl.dropbox.com/u/14218997/thxq.mp4"]];
mpMoviePlayerController.controlStyle = MPMovieControlStyleNone;
[mpMoviePlayerController setUseApplicationAudioSession:NO];
[mpMoviePlayerController setScalingMode:MPMovieScalingModeAspectFit];
[mpMoviePlayerController setFullscreen:YES animated:YES];
[mpMoviePlayerController.view setFrame:CGRectMake(0, 0, 1024, 768)];
[[globalSingleton paintingView] addSubview:mpMoviePlayerController.view];
[mpMoviePlayerController prepareToPlay];
[mpMoviePlayerController play];
mpMoviePlayerController.controlStyle = MPMovieControlStyleFullscreen;
or this way..
MPMoviePlayerController *mp;
MPMoviePlayerViewController *mpVC = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:@"https://dl.dropbox.com/u/14218997/thxq.mp4"]];
mp = [mpVC moviePlayer];
mp.controlStyle = MPMovieControlStyleFullscreen;
mp.fullscreen = NO;
mp.useApplicationAudioSession = NO;
mp.view.frame = CGRectMake(0, 0, 1024, 768);
[[globalSingleton paintingView] addSubview:mp.view];
([globalSingleton paintingView] is just for representing main view. I already checked there's no problem on it.)
Please share what u know about this problem. Thx in advance! | 0 |
11,262,014 | 06/29/2012 12:44:23 | 936,790 | 09/09/2011 12:55:21 | 43 | 0 | Sum a Sum & Count column in 1 query or use PHP? | Good afternoon, really struggling to make this work, or know if it can work, any advice either way would be appreciated. Have my pages in php with mysql backend, I have created master/detail pages but need to perfom some calculations, usually would be a sum or % in table footer of all the data in a column.
Think my problem is I am trying to sum a count in the same query, could this be achieved in php to avoid this? The Records column displays count of records while the Costs sums the costs, this works great but I would like to then peform a sum of both these columns to show a grand total?
Select
tblcontacts.ContactFullName As Name,
Count(tblcases.CaseID)As Records,
Sum(tblcases.CaseCommission) As Costs
From
tblcontacts Inner Join
tblcases On tblcontacts.ContactID =
tblcases.ContactAssignedTo
Group By
tblcontacts.ContactFullName
Any advice much appreciated as I am stuck. | php | mysql | null | null | null | null | open | Sum a Sum & Count column in 1 query or use PHP?
===
Good afternoon, really struggling to make this work, or know if it can work, any advice either way would be appreciated. Have my pages in php with mysql backend, I have created master/detail pages but need to perfom some calculations, usually would be a sum or % in table footer of all the data in a column.
Think my problem is I am trying to sum a count in the same query, could this be achieved in php to avoid this? The Records column displays count of records while the Costs sums the costs, this works great but I would like to then peform a sum of both these columns to show a grand total?
Select
tblcontacts.ContactFullName As Name,
Count(tblcases.CaseID)As Records,
Sum(tblcases.CaseCommission) As Costs
From
tblcontacts Inner Join
tblcases On tblcontacts.ContactID =
tblcases.ContactAssignedTo
Group By
tblcontacts.ContactFullName
Any advice much appreciated as I am stuck. | 0 |
11,262,016 | 06/29/2012 12:44:26 | 1,146,430 | 01/12/2012 21:05:27 | 46 | 0 | IE8 li:hover, hover is triggered on margin between li items? | Here's the affected page: http://justfnlift.com/ksc/
The first menu item has a dropdown submenu that is supposed to display on li:hover. For some reason though, hovering on the margins between ANY of the li's is causing the submenu to display and I can't figure out why. It works in Chrome and IE in compatibility mode, but not IE8.
Here's the line of CSS that displays the submenu:
.menu li:hover ul {
display: block;
position: absolute;
margin: 0;
padding: 0;
}
To me, that reads that whenever you hover an li, style any of it's children ul's with the following style. Why would this be getting triggered on margins between li's that don't have nested ul's?
Here's the entire CSS for the menu just in case:
.menu {
font-weight: normal;
font-size: 1.1em;
margin-top: 5px;
padding: 5px 0 0 0;
font-family: OswaldLight;
display: table;
margin: 0 auto;
}
.menu li {
list-style: none;
float: left;
margin-right: 10px;
}
.menu li a {
display: block;
text-decoration: none;
padding:5px;
color:@navbar-text;
background:@navbar;
text-decoration:none;
}
.menu li ul {
display: none;
background-color: @navbar;
}
.menu li ul li {
margin: 0;
}
.menu li a:hover {
color: @navbar-text-highlight;
background-color: @navbar-highlight;
}
.menu li:hover ul {
display: block;
position: absolute;
margin: 0;
padding: 0;
}
.menu li:hover li {
float: none;
}
.menu li:hover li a {
background-color: @navbar;
color: @navbar-text;
}
.menu li li a:hover {
color: @navbar-text-highlight;
background-color: @navbar-highlight;
}
| css | internet-explorer-8 | hover | null | null | null | open | IE8 li:hover, hover is triggered on margin between li items?
===
Here's the affected page: http://justfnlift.com/ksc/
The first menu item has a dropdown submenu that is supposed to display on li:hover. For some reason though, hovering on the margins between ANY of the li's is causing the submenu to display and I can't figure out why. It works in Chrome and IE in compatibility mode, but not IE8.
Here's the line of CSS that displays the submenu:
.menu li:hover ul {
display: block;
position: absolute;
margin: 0;
padding: 0;
}
To me, that reads that whenever you hover an li, style any of it's children ul's with the following style. Why would this be getting triggered on margins between li's that don't have nested ul's?
Here's the entire CSS for the menu just in case:
.menu {
font-weight: normal;
font-size: 1.1em;
margin-top: 5px;
padding: 5px 0 0 0;
font-family: OswaldLight;
display: table;
margin: 0 auto;
}
.menu li {
list-style: none;
float: left;
margin-right: 10px;
}
.menu li a {
display: block;
text-decoration: none;
padding:5px;
color:@navbar-text;
background:@navbar;
text-decoration:none;
}
.menu li ul {
display: none;
background-color: @navbar;
}
.menu li ul li {
margin: 0;
}
.menu li a:hover {
color: @navbar-text-highlight;
background-color: @navbar-highlight;
}
.menu li:hover ul {
display: block;
position: absolute;
margin: 0;
padding: 0;
}
.menu li:hover li {
float: none;
}
.menu li:hover li a {
background-color: @navbar;
color: @navbar-text;
}
.menu li li a:hover {
color: @navbar-text-highlight;
background-color: @navbar-highlight;
}
| 0 |
11,262,018 | 06/29/2012 12:44:33 | 600,953 | 02/03/2011 03:01:02 | 3,271 | 136 | knockoutjs anchor click causing page scroll to top if response is array | I'm seeing some very strange behavior. I have two anchor tags and both have data-bound click events, both make ajax requests. In one case, if the response is an array the click will cause the page to scroll to the top. In the other case, if response is NOT an array the click will not cause the page to scroll at all.
Here are my 2 cases
<a data-bind="click: click1">click 1</a> # scrolls to top
<a data-bind="click: click2">click 2</a> # does not scroll
# javascript
function ViewModel() {
var self = this;
self.click1 = function(data, event) {
$.ajax({
url: "/movies", // returns array of movies, scrolls to top
dataType: 'json',
success: function(data, status, xhr) {
movie_list = JSON.parse(xhr.responseText);
self.movies(movie_list);
}
}
self.click2 = function(data, event) {
$.ajax({
url: "/movies/1", // returns just one movie, does not scroll
dataType: 'json',
success: function(data, status, xhr) {
movie_details = JSON.parse(xhr.responseText);
self.movies(movie_details);
}
}
}
ko.applyBindings(new ViewModel());
Any idea how to stop the first case from causing the page to scroll to the top? | jquery | ruby-on-rails | ruby-on-rails-3 | knockout.js | null | null | open | knockoutjs anchor click causing page scroll to top if response is array
===
I'm seeing some very strange behavior. I have two anchor tags and both have data-bound click events, both make ajax requests. In one case, if the response is an array the click will cause the page to scroll to the top. In the other case, if response is NOT an array the click will not cause the page to scroll at all.
Here are my 2 cases
<a data-bind="click: click1">click 1</a> # scrolls to top
<a data-bind="click: click2">click 2</a> # does not scroll
# javascript
function ViewModel() {
var self = this;
self.click1 = function(data, event) {
$.ajax({
url: "/movies", // returns array of movies, scrolls to top
dataType: 'json',
success: function(data, status, xhr) {
movie_list = JSON.parse(xhr.responseText);
self.movies(movie_list);
}
}
self.click2 = function(data, event) {
$.ajax({
url: "/movies/1", // returns just one movie, does not scroll
dataType: 'json',
success: function(data, status, xhr) {
movie_details = JSON.parse(xhr.responseText);
self.movies(movie_details);
}
}
}
ko.applyBindings(new ViewModel());
Any idea how to stop the first case from causing the page to scroll to the top? | 0 |
11,262,019 | 06/29/2012 12:44:35 | 1,168,628 | 01/25/2012 06:56:54 | 25 | 4 | Excel double Click autofill - dynamic based on adjacent cell | Any VBA guru's out there. i need to do the following.
![Excel Autofill][1]
OK, i am using the normal auto-fill function in excel ( double click the dot on the side of a cell) to copy the contents to the sub cells...
so in this case... clicking the dot in Cell A1 will do this...
![enter image description here][2]
I need a script that will repeat the process down the entire column, until there are no more values in the adjacent cell...
any ideas?
I am going to try to develop it now.. so if nobody else has done something like this.. i will post a solution in the near future!...
Thanks!
[1]: http://i.stack.imgur.com/eechc.jpg
[2]: http://i.stack.imgur.com/T7fbg.jpg | excel | vba | null | null | null | null | open | Excel double Click autofill - dynamic based on adjacent cell
===
Any VBA guru's out there. i need to do the following.
![Excel Autofill][1]
OK, i am using the normal auto-fill function in excel ( double click the dot on the side of a cell) to copy the contents to the sub cells...
so in this case... clicking the dot in Cell A1 will do this...
![enter image description here][2]
I need a script that will repeat the process down the entire column, until there are no more values in the adjacent cell...
any ideas?
I am going to try to develop it now.. so if nobody else has done something like this.. i will post a solution in the near future!...
Thanks!
[1]: http://i.stack.imgur.com/eechc.jpg
[2]: http://i.stack.imgur.com/T7fbg.jpg | 0 |
11,262,026 | 06/29/2012 12:44:52 | 1,472,593 | 06/21/2012 15:24:41 | 5 | 0 | Array values sum and passed as click argument | I've got an array of values that i'm using to create list items that I then append to an ordered list.
What i want to to is create a click function that passes the sum of those values based on the order of the items in the list (ie if you click on the 3rd item in the list it totals all the preceeding values and passes that sum to a variable.
var jList = $("#bargraph ul").attr('class', 'bars');
$.each(datas,function(intIndex, objValue){
jList.append($("<li>"+"</li>").attr('class','bar'+intIndex).css('height', objValue));
});
the above is the code ive got to create the list items based on the array "datas". If anyone can shed some light on my issue it would be much appreciated.
| jquery | null | null | null | null | null | open | Array values sum and passed as click argument
===
I've got an array of values that i'm using to create list items that I then append to an ordered list.
What i want to to is create a click function that passes the sum of those values based on the order of the items in the list (ie if you click on the 3rd item in the list it totals all the preceeding values and passes that sum to a variable.
var jList = $("#bargraph ul").attr('class', 'bars');
$.each(datas,function(intIndex, objValue){
jList.append($("<li>"+"</li>").attr('class','bar'+intIndex).css('height', objValue));
});
the above is the code ive got to create the list items based on the array "datas". If anyone can shed some light on my issue it would be much appreciated.
| 0 |
11,262,027 | 06/29/2012 12:44:54 | 1,458,620 | 06/15/2012 12:12:56 | 11 | 0 | XCode 4.3 and SVN | I'm new to iOS developing, I haven't used earlier versions of XCode.
Yet I have stored my project on my local hd. Now I want to use some online subversion service.
I cannot seem to find the appropriate options in XCode. The hints that I googled all refer to a menu called SCM which I don't seem to have.
I created a new and empty repository online (webbased) and tried to configure XCode to use it by selecting the "Connect to a repository" menu when xcode starts. After some tweeking in the command line this "connect to a repository" succeeded but afterwards XCode simply closed itself again.
I tried copying the files that belong to my project to the path that I set up to be used with SVN manually. I opened the project in XCode from that path and after adding another file wanted to commit that change but couldn't find how to do that from within XCode.
Now I found that in XCode / Organizer / Repositories / MyProject is listed but has the type "GIT", which is wrong.
Do I have to change the repository type to SVN instead of GIT? If so, how can I?
| xcode | git | svn | repository | null | null | open | XCode 4.3 and SVN
===
I'm new to iOS developing, I haven't used earlier versions of XCode.
Yet I have stored my project on my local hd. Now I want to use some online subversion service.
I cannot seem to find the appropriate options in XCode. The hints that I googled all refer to a menu called SCM which I don't seem to have.
I created a new and empty repository online (webbased) and tried to configure XCode to use it by selecting the "Connect to a repository" menu when xcode starts. After some tweeking in the command line this "connect to a repository" succeeded but afterwards XCode simply closed itself again.
I tried copying the files that belong to my project to the path that I set up to be used with SVN manually. I opened the project in XCode from that path and after adding another file wanted to commit that change but couldn't find how to do that from within XCode.
Now I found that in XCode / Organizer / Repositories / MyProject is listed but has the type "GIT", which is wrong.
Do I have to change the repository type to SVN instead of GIT? If so, how can I?
| 0 |
11,327,274 | 07/04/2012 10:29:31 | 6,632 | 09/15/2008 12:23:48 | 144 | 7 | JavaScript image zoome and pan (drag) | Any recommendations on zooming a large image and panning around? ideally inline on the page.
I've been using PanoJS (aka GSV2), but now more people are using iPhone/iPad/Android type devices, this library is either too slow, or the older versions do not support dragging (the one I'm using at the moment).
http://code.google.com/p/panojs/
http://www.dimin.net/software/panojs/
My current thought is that using the tiled images approach is too much for these little processors (at maximum zoom trying to drag 144 individual images, from a 3000 x 3000px original image, where each tile is 250x250px).
So probably looking more at loading the original image in an <img> with a set width/height... and either writing my own JS to zoom/drag, or using another library (which I can't seem to find at the moment)... then there is the question of using jQuery (with jQuery UI for draggable support), or just writing the raw JS myself to keep the amount of code down. | javascript | jquery | jquery-ui | null | null | null | open | JavaScript image zoome and pan (drag)
===
Any recommendations on zooming a large image and panning around? ideally inline on the page.
I've been using PanoJS (aka GSV2), but now more people are using iPhone/iPad/Android type devices, this library is either too slow, or the older versions do not support dragging (the one I'm using at the moment).
http://code.google.com/p/panojs/
http://www.dimin.net/software/panojs/
My current thought is that using the tiled images approach is too much for these little processors (at maximum zoom trying to drag 144 individual images, from a 3000 x 3000px original image, where each tile is 250x250px).
So probably looking more at loading the original image in an <img> with a set width/height... and either writing my own JS to zoom/drag, or using another library (which I can't seem to find at the moment)... then there is the question of using jQuery (with jQuery UI for draggable support), or just writing the raw JS myself to keep the amount of code down. | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.