unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
ActiveX Control Automation server can't create object
===
I am trying to create an ActiveX Control to access the client connected devices. I referred a [blog][1] to do the same. When I run the page I get the dialog for Installing the ActiveX control but after I click on Install it throws the script error saying "Automation server can't create the object."
I am not sure where I went wrong.
[1]: http://haseebakhtar.wordpress.com/2011/05/31/creating-an-activex-control-in-net-using-c/ | 0 | [
2,
1348,
396,
569,
23217,
8128,
92,
22,
38,
1600,
3095,
800,
3726,
3726,
31,
589,
749,
20,
1600,
40,
1348,
396,
569,
20,
1381,
14,
6819,
2587,
4690,
9,
31,
1870,
21,
636,
220,
5567,
500,
2558,
165,
500,
20,
107,
14,
205,
9,
76... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Firefox webapi ResourceLockAPI Usage
===
Just noticed [this][1] on the [release notes][2] for 14.0.1 of FF, they've exposed an API to allow developers stop the screen going to screensaver while a tab is active, but (having never used the webapi before, or known of it's existance), I'm a bit confused over how to implement it.
Reading through the [bugzilla report][3] for the request, and grabbing snippets of JS from there, I think this is how it works, but I just wanted to clarify I've understood the usage:
if(navigator.requestWakeLock){
window.myLock = navigator.requestWakeLock("MyLock");
}
This will create a lock around the screen, preventing it from going to screen saver, until I call:
window.myLock.unlock();
Which will then allow the screensaver to take over as per normal? (No, I wouldn't really pollute the global namespace like that, before people comment on it)
[1]: https://wiki.mozilla.org/WebAPI/ResourceLockAPI
[2]: http://www.mozilla.org/en-US/firefox/14.0.1/releasenotes/
[3]: https://bugzilla.mozilla.org/show_bug.cgi?id=697132 | 0 | [
2,
535,
18219,
95,
969,
2159,
6577,
3966,
2552,
49,
7514,
800,
3726,
3726,
114,
2711,
636,
1565,
500,
2558,
165,
500,
27,
14,
636,
15202,
2434,
500,
2558,
135,
500,
26,
513,
9,
387,
9,
165,
16,
13,
2460,
15,
59,
22,
195,
5043,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Verifying br.submit() using Python's Mechanize module
===
Just trying to login to a website using mechanize. When I print "br.form", I can see my credentials entered into my form. But I do not know how to actually submit the form properly.
I use "br.submit" and attempt to verify it has proceeded to the next page by printing the br.title(), but the title appearing is for the login screen, and not the post-login screen.
import mechanize
from time import sleep
def reportDownload():
# Prompt for login credentials
print("We require your credentials.")
Username = raw_input("Please enter your username. ")
Password = raw_input("Please input your password. ").encode('base64')
URL = "https://login.xxxxxxxxx.com/"
br = mechanize.Browser()
br.open(URL)
br.select_form(nr=0)
br['username'] = Username
br['pw'] = Password.decode('base64')
print br.form
# Login
br.submit()
# print page title to confirm proper login
print br.title()
reportDownload() | 0 | [
2,
21012,
68,
3851,
9,
7563,
5130,
5,
6,
568,
20059,
22,
18,
55,
3606,
2952,
12613,
800,
3726,
3726,
114,
749,
20,
6738,
108,
20,
21,
2271,
568,
55,
3606,
2952,
9,
76,
31,
4793,
13,
7,
5145,
9,
4190,
7,
15,
31,
92,
196,
51,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
htaccess 301 redirect rule to remove part of a query string from urls, but leave some of it
===
I'm trying to find a redirect that will remove part of a query string from a url, but leave another query string.
Now I can do this fine via a single url redirect, but there are hundreds of these urls so I'm trying to find a rule that might be able to do for all of them in one fell swoop, so i don't have to make one for each and any new ones will get redirected automatically.
I'm trying to remove 'start=0&' from the urls, here are some examples:
www.xxxxx.co.uk/products.php?start=0&category=Pens%20Ballpens
redirects too:
www.xxxxx.co.uk/products.php?category=Pens%20Ballpens
www.xxxxx.co.uk/products.php?start=0&category=Jackets
redirects too:
hwww.xxxxx.co.uk/products.php?category=Jackets
Thanks for your time | 0 | [
2,
13,
9020,
20604,
13,
18979,
302,
14706,
1828,
20,
4681,
141,
16,
21,
25597,
3724,
37,
13,
911,
7532,
15,
47,
767,
109,
16,
32,
800,
3726,
3726,
31,
22,
79,
749,
20,
477,
21,
302,
14706,
30,
129,
4681,
141,
16,
21,
25597,
37... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
J2ME WebServices
===
I have created J2me application(prototype) and now i have to add web services to it which are written in .net.How to do that?will anyone please let me know the procedure for developing j2me client in which i can pass parameters which are similar as in .net web service? | 0 | [
2,
487,
135,
790,
2741,
11449,
18,
800,
3726,
3726,
31,
57,
679,
487,
135,
790,
3010,
5,
2740,
262,
4474,
6,
17,
130,
31,
57,
20,
3547,
2741,
687,
20,
32,
56,
50,
642,
19,
13,
9,
2328,
9,
1544,
20,
107,
30,
60,
5580,
1276,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
C# regex. Nested tags. Matching spoilers and converting them to bbcode
===
I have the following html code, which have nesting up to level 3:
<div class="sp-body" title="FAQ">
Some text
<div class="sp-body" title="title1"> // Level 2
Text1...
</div>
<div class="sp-body" title="title2"> // Level 2
Text2...
</div>
<div class="sp-body" title="title3"> // Level 2
Text3...
<div class="sp-body" title="title4"> // Level 3
Text4...
</div>
</div>
...
</div>
I need to replace div tags into bbcode and my regular expression work only for not nested spoilers:
Regex.Replace(outstring, @"<div class=""sp-body"" title=""(.*?)"">(.*?)</div>", "[spoiler=$1]$2[/spoiler]", RegexOptions.Singleline); | 0 | [
2,
272,
5910,
7953,
1706,
9,
5618,
69,
3383,
18,
9,
10120,
16340,
445,
17,
19583,
105,
20,
2313,
8355,
800,
3726,
3726,
31,
57,
14,
249,
13,
15895,
1797,
15,
56,
57,
24338,
71,
20,
662,
2635,
13,
1,
12916,
718,
3726,
7,
3401,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
I want to add a sub element to my menu items
===
I created a menu item with jqury and CSS.When I go to a one menu item I want to go for anothe sub menu Item as i shown in below image.How can I do that..?
this is the image
http://i.stack.imgur.com/TesNK.png
here is my html code
<link rel="stylesheet" href="css/style_j.css" type="text/css" media="screen"/>
<div class="content">
<ul id="sdt_menu" class="sdt_menu">
<li>
<a href="#">
<img src="SlideDownBoxMenu2/images/2.jpg" alt=""/>
<span class="sdt_active"></span>
<span class="sdt_wrap">
<span class="sdt_link">Home</span>
<span class="sdt_descr">Home</span>
</span>
</a>
</li>
<li>
<a href="#">
<img src="SlideDownBoxMenu2/images/1.jpg" alt=""/>
<span class="sdt_active"></span>
<span class="sdt_wrap">
<span class="sdt_link">File Managements</span>
<span class="sdt_descr">File Managements</span>
</span>
</a>
<div class="sdt_box">
<a href="#"><img src="SlideDownBoxMenu2/images/1.jpg" alt=""/>
<span class="sdt_active"></span>
<span class="sdt_wrap">
<span class="sdt_link">Retention</span>
<span class="sdt_descr">Retention</span>
</span> </a>
<a href="#">Illustrations</a>
<a href="#">Photography</a>
<div class="sdt_box">
<a href="#">Retentionss </a>
<a href="#">Illustrations</a>
<a href="#">Photography</a>
</div>
</div>
</li>
<li>
<a href="#">
<img src="SlideDownBoxMenu2/images/1.jpg" alt=""/>
<span class="sdt_active"></span>
<span class="sdt_wrap">
<span class="sdt_link">Portfolio</span>
<span class="sdt_descr">My work</span>
</span>
</a>
<div class="sdt_box">
<a href="#">Websites</a>
<a href="#">Illustrations</a>
<a href="#">Photography</a>
</div>
</li>
<li>
<a href="#">
<img src="SlideDownBoxMenu2/images/1.jpg" alt=""/>
<span class="sdt_active"></span>
<span class="sdt_wrap">
<span class="sdt_link">Portfolio</span>
<span class="sdt_descr">My work</span>
</span>
</a>
<div class="sdt_box">
<a href="#">Websites</a>
<a href="#">Illustrations</a>
<a href="#">Photography</a>
</div>
</li>
<li>
<a href="#">
<img src="SlideDownBoxMenu2/images/1.jpg" alt=""/>
<span class="sdt_active"></span>
<span class="sdt_wrap">
<span class="sdt_link">Portfolio</span>
<span class="sdt_descr">My work</span>
</span>
</a>
<div class="sdt_box">
<a href="#">Websites</a>
<a href="#">Illustrations</a>
<a href="#">Photography</a>
</div>
</li>
<li>
<a href="#">
<img src="SlideDownBoxMenu2/images/1.jpg" alt=""/>
<span class="sdt_active"></span>
<span class="sdt_wrap">
<span class="sdt_link">Portfolio</span>
<span class="sdt_descr">My work</span>
</span>
</a>
<div class="sdt_box">
<a href="#">Websites</a>
<a href="#">Illustrations</a>
<a href="#">Photography</a>
</div>
</li>
<li>
<a href="#">
<img src="SlideDownBoxMenu2/images/6.jpg" alt=""/>
<span class="sdt_active"></span>
<span class="sdt_wrap">
<span class="sdt_link">Projects</span>
<span class="sdt_descr">I like to code</span>
</span>
</a>
<div class="sdt_box">
<a href="#">Job Board Website</a>
<a href="#">Shopping Cart</a>
<a href="#">Interactive Maps</a>
</div>
</li>
</ul>
</div>
<div>
<span class="reference">
</span>
</div>
here is my CSS code
ul.sdt_menu{
margin:0;
padding:0;
list-style: none;
font-family:"Myriad Pro", "Trebuchet MS", sans-serif;
font-size:14px;
width:1020px;
}
ul.sdt_menu a{
text-decoration:none;
outline:none;
}
ul.sdt_menu li{
float:left;
width:138px;
height:40px;
position:relative;
cursor:pointer;
}
ul.sdt_menu li > a{
position:absolute;
top:0px;
left:0px;
width:138px;
height:57px;
z-index:12;
-moz-box-shadow:0px 0px 2px #000 inset;
-webkit-box-shadow:0px 0px 2px #000 inset;
box-shadow:0px 0px 2px #000 inset;
}
ul.sdt_menu li a img{
border:none;
position:absolute;
width:0px;
height:0px;
bottom:0px;
left:57px;
z-index:100;
-moz-box-shadow:0px 0px 4px #000;
-webkit-box-shadow:0px 0px 4px #000;
box-shadow:0px 0px 4px #000;
}
ul.sdt_menu li span.sdt_wrap{
position:absolute;
top:20px;
left:0px;
width:138px;
height:57px;
z-index:15;
}
ul.sdt_menu li span.sdt_active{
position:absolute;
background:#111;
top:57px;
width:138px;
height:0px;
left:0px;
z-index:14;
-moz-box-shadow:0px 0px 4px #000 inset;
-webkit-box-shadow:0px 0px 4px #000 inset;
box-shadow:0px 0px 4px #000 inset;
}
ul.sdt_menu li span span.sdt_link,
ul.sdt_menu li span span.sdt_descr,
ul.sdt_menu li div.sdt_box a{
margin-left:10px;
text-transform:uppercase;
text-shadow:1px 1px 1px #000;
margin-top:-10px;
}
ul.sdt_menu li span span.sdt_link{
color:#fff;
font-size:14px;
float:left;
clear:both;
}
ul.sdt_menu li span span.sdt_descr{
color:#0B75AF;
float:left;
clear:both;
width:155px; /*For dumbass IE7*/
font-size:10px;
letter-spacing:0px;
margin-top:0px;
margin-left:-8px;
}
ul.sdt_menu li div.sdt_box{
display:block;
position:absolute;
width:138px;
overflow:hidden;
height:138px;
top:57px;
left:0px;
display:none;
background:#000;
}
ul.sdt_menu li div.sdt_box a{
float:left;
clear:both;
line-height:30px;
color:#0B75AF;
}
ul.sdt_menu li div.sdt_box a:first-child{
margin-top:15px;
}
ul.sdt_menu li div.sdt_box a:hover{
color:#fff;
}
here is my javascript code with jqury
<!-- The JavaScript -->
<script type="text/javascript">
$(function() {
/**
* for each menu element, on mouseenter,
* we enlarge the image, and show both sdt_active span and
* sdt_wrap span. If the element has a sub menu (sdt_box),
* then we slide it - if the element is the last one in the menu
* we slide it to the left, otherwise to the right
*/
$('#sdt_menu > li').bind('mouseenter',function(){
var $elem = $(this);
$elem.find('img')
.stop(true)
.animate({
'width':'138px',
'height':'57px',
'left':'0px'
},400,'easeOutBack')
.andSelf()
.find('.sdt_wrap')
.stop(true)
.animate({'top':'140px'},500,'easeOutBack')
.andSelf()
.find('.sdt_active')
.stop(true)
.animate({'height':'138px'},300,function(){
var $sub_menu = $elem.find('.sdt_box');
if($sub_menu.length){
var left = '138px';
if($elem.parent().children().length == $elem.index()+1)
left = '-138px';
$sub_menu.show().animate({'left':left},200);
}
});
}).bind('mouseleave',function(){
var $elem = $(this);
var $sub_menu = $elem.find('.sdt_box');
if($sub_menu.length)
$sub_menu.hide().css('left','0px');
$elem.find('.sdt_active')
.stop(true)
.animate({'height':'0px'},300)
.andSelf().find('img')
.stop(true)
.animate({
'width':'0px',
'height':'0px',
'left':'85px'},400)
.andSelf()
.find('.sdt_wrap')
.stop(true)
.animate({'top':'25px'},500);
});
});
</script>
| 1 | [
2,
31,
259,
20,
3547,
21,
972,
4520,
20,
51,
11379,
3755,
800,
3726,
3726,
31,
679,
21,
11379,
9101,
29,
487,
5495,
622,
17,
272,
18,
18,
9,
3185,
31,
162,
20,
21,
53,
11379,
9101,
31,
259,
20,
162,
26,
21,
251,
124,
972,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I test if a user is logged in to facebook and has authenticated my app, without the facebook javscript SDK
===
I'm using this excelent general-purpose oauth-library:
https://github.com/andreassolberg/jso/
How would I best test if the user is authenticated with facebook? | 0 | [
2,
184,
107,
31,
1289,
100,
21,
4155,
25,
13,
19287,
19,
20,
9090,
17,
63,
14351,
1669,
51,
4865,
15,
366,
14,
9090,
3009,
710,
8741,
13,
18,
43,
197,
800,
3726,
3726,
31,
22,
79,
568,
48,
20700,
2291,
297,
8,
12060,
635,
1346... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Adding zerofill to existing table
===
I'm trying to add ZEROFILL to an auto-incremented primary ID field in a MySQL database. Here is the code (auto-generated by MySQL Workbench):
ALTER TABLE `database`.`table` CHANGE COLUMN `id` `id` INT(11) ZEROFILL NOT NULL AUTO_INCREMENT
This is the error I get:
Error Code: 1025. Error on rename of './database/#sql-2c8_cb' to './database/table' (errno: 150)
It appears that a temp table has been created and when the error occurs when the temp table is renamed with the original table name.
Any help would be great! | 0 | [
2,
4721,
4606,
19971,
20,
3149,
859,
800,
3726,
3726,
31,
22,
79,
749,
20,
3547,
4606,
19971,
20,
40,
3108,
8,
28461,
69,
1256,
4924,
575,
19,
21,
51,
18,
22402,
6018,
9,
235,
25,
14,
1797,
13,
5,
18042,
8,
25314,
34,
51,
18,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I reference an external LaTeX chapter using reftex in Emacs?
===
I'm editing a chapter that is part of a larger LaTeX project that includes multiple chapters, and I'm trying to use C-c ) to put in a cross reference, but reftex finds only the labels in the current buffer (chapter). According to the [reftex manual][1], pressing `x` will tell reftex to look in an external document, but that works only if you use the xr package, which I do not need for my document.
Suggestions?
[1]: http://www.gnu.org/software/auctex/manual/reftex/reftex_23.html#SEC25 | 0 | [
2,
184,
92,
31,
2801,
40,
4886,
456,
396,
1260,
568,
302,
3072,
1706,
19,
13,
62,
6893,
18,
60,
800,
3726,
3726,
31,
22,
79,
9510,
21,
1260,
30,
25,
141,
16,
21,
1662,
456,
396,
669,
30,
1103,
1886,
10722,
15,
17,
31,
22,
79... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
MySQL trigger on RDS
===
I am trying to create a MySQL trigger that will invoke a php script. I have a MySQL server instance running in RDS and would like to use the php script to send a message to my SQS messaging system.
1. Where do I save the php scripts?
2. Do i need to install the PHP SDK for SQS on my EC2 instance?
Thanks | 0 | [
2,
51,
18,
22402,
7286,
27,
13,
897,
18,
800,
3726,
3726,
31,
589,
749,
20,
1600,
21,
51,
18,
22402,
7286,
30,
129,
28371,
21,
13,
26120,
3884,
9,
31,
57,
21,
51,
18,
22402,
8128,
4851,
946,
19,
13,
897,
18,
17,
83,
101,
20,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I initialize a model table w/RSpec so external processes can see the contents of the table?
===
I'm writing a Rails system that ingests data from external sources by spawning multiple processes to fetch the data and updating a single db table. I want to write RSpec tests that spawn multiple processes that emulate the fetch/write process to look for concurrency issues.
### short question
How can I initialize a table in an RSpec test so that an external process can see the contents of the table? (At least, I think that's the right question. Read on for details...)
### longer form
The general structure of my RSpec test is:
it 'external task should update the correct records' do
initialize_my_model_table_with_some_records
spawn_external_task_to_update_records
validate_results
end
But the external process always sees the model table as empty (verified by debug printing). Subsequently, attempts to update the table fail.
I'm pretty sure this is because RSpec is holding the table under a lock so it can do a rollback after the test completes.
So (to repeat the short question): How can I initialize a table in an RSpec test so that an external process can see the initialized contents of the table?
### environment
* Ruby version 1.9.3 (x86_64-darwin10.8.0)
* pg (0.13.2)
* rails (3.2.1)
* rspec (2.9.0)
* rspec-rails (2.9.0)
| 0 | [
2,
184,
107,
31,
2104,
2952,
21,
1061,
859,
619,
118,
1224,
12610,
86,
4886,
5102,
92,
196,
14,
8478,
16,
14,
859,
60,
800,
3726,
3726,
31,
22,
79,
1174,
21,
2240,
18,
329,
30,
19,
14288,
18,
1054,
37,
4886,
2662,
34,
27487,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
desktop flv player to retrieve subtitle and caption information from a flv file
===
Just watched a nice video of "[Learning to love javascript](http://www.youtube.com/watch?v=seX7jYI96GE)" from Alex (Google developer) on Youtube, I have downloaded the flv file. Now when i watched the video inside the youtube player live on the youtube site I was able to turn the captions ON and see the English text of the audio but now when I see the video in my "Applian FLV player" I don't see the captions and the tool doesn't have any option also to turn that on.
My question - Is there any desktop tool available which provides this option to turn the caption on if the flv has that information inside it or is there any other alternative way which makes it possible to see those captions offline by any way.
Thanks in advance !! | 0 | [
2,
17404,
398,
8916,
517,
20,
11917,
19442,
17,
26622,
676,
37,
21,
398,
8916,
3893,
800,
3726,
3726,
114,
1634,
21,
2210,
763,
16,
13,
7,
2558,
26001,
20,
339,
8247,
8741,
500,
5,
21127,
6903,
6483,
9,
245,
19302,
9,
960,
118,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Get generic type of one class to create another generic class
===
I seem to have gotten myself into a joyous twist. I have a situation something like the following:
public class Parameter<T> {
public Parameter(String value, Verifier<T> verif){
//stuff, lots of stuff!
}
}
public interface Verifier<T>{
//definition
}
public enum StringVerif implements Verifiier<String>{
INSTANCE;
//some static functions on my singleton
}
public abstract class ParamFactory{
private static ArrayDeque<Verifier<?>> verifList...
...
for(Verifier<?> ver : verifList){
if(ver.isapplicable(someData){
//now I'm stuck!
}
}
}
In short what I need to do is create the right typed Parameter based on the type of the Verifier that passes the test. These Parameters will then get sent to another collection<?>. In essence it's an extensible factory with verifier and processor modules that can parse different type parameters depending on need. The problem is I not only have to get the generic type by reflection, but also to create a generic type from this type.
Any ideas on where to start to do this? It's been a long time since I dealt this deeply with generics
| 0 | [
2,
164,
12733,
1001,
16,
53,
718,
20,
1600,
226,
12733,
718,
800,
3726,
3726,
31,
2260,
20,
57,
4094,
992,
77,
21,
4512,
1291,
7844,
9,
31,
57,
21,
1858,
301,
101,
14,
249,
45,
317,
718,
18906,
1,
38,
1,
13,
1,
317,
18906,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Asp button not working in a jquery dialog box
===
Asp button is not working in a jquery dialog box:
<script type="txt/js">$(function () {$('#<%= ButtonEmail.UniqueID %>').button();});</script>
<div id="dialog-modal" title="Cadastro">
<p>Digite seu email para que eviemos o link do cadastro para ele:</p>
<p><asp:TextBox ID="TextBoxEmail" CssClass="ui-corner-all" runat="server"></asp:TextBox>
<asp:Button ID="ButtonEmail" runat="server" Text="Enviar Link" onclick="ButtonEmail_Click" /></p>
<div><asp:Label ID="LabelEmail" runat="server" Text="teste"></asp:Label></div>
</div>
c# code:
protected void ButtonEmail_Click(object sender, EventArgs e)
{
...
} | 0 | [
2,
28,
306,
5167,
52,
638,
19,
21,
487,
8190,
93,
28223,
1649,
800,
3726,
3726,
28,
306,
5167,
25,
52,
638,
19,
21,
487,
8190,
93,
28223,
1649,
45,
13,
1,
8741,
1001,
3726,
7,
38,
396,
38,
118,
728,
18,
7,
1,
4403,
5,
22359,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Django "set_password()" function not working
===
Upon changing the password of a user on a site using Django's "set_password()" function, the password will be changed to an encrypted string. However, the user cannot log on to the site with the new password, or old - there is no previously entered password that works. Here's the snippet of code that takes the password -
if request.POST:
password = request.POST['password'].encode('ascii','replace')
confirm_password = request.POST['confirm_password'].encode('ascii','replace')
if password == confirm_password:
user.set_password(confirm_password)
user.save()
return HttpResponseRedirect('/reset/thanks/')
else:
return HttpResponseRedirect('/reset/' + user.get_profile().forgotpasswordcode + "/" + user.email + "/")
Even when the account has the password changed to the same password that it has, the encrypted password changes and the user cannot log on.
Is there anyway to fix this? Thanks. | 0 | [
2,
3857,
14541,
13,
7,
3554,
1,
6201,
9587,
5,
6,
7,
1990,
52,
638,
800,
3726,
3726,
685,
4226,
14,
20884,
16,
21,
4155,
27,
21,
689,
568,
3857,
14541,
22,
18,
13,
7,
3554,
1,
6201,
9587,
5,
6,
7,
1990,
15,
14,
20884,
129,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I get ActiveX to stop restricting embedded media in my homepage?
===
Recently, I was messing around with HTML and CSS to make my own homepage. I decided that I wanted to be able to play music when I logged in, but whenever I try embedding windows media player or youtube videos in the HTML file and go to my homepage, a message pops up saying that "Internet Explorer restricted this webpage from running scripts or ActiveX controls. I just want to be able to have the music play automatically, without all the hassle. | 0 | [
2,
184,
107,
31,
164,
1348,
396,
20,
747,
15436,
68,
12138,
941,
19,
51,
213,
6486,
60,
800,
3726,
3726,
1989,
15,
31,
23,
3957,
68,
140,
29,
13,
15895,
17,
272,
18,
18,
20,
233,
51,
258,
213,
6486,
9,
31,
868,
30,
31,
417,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to sort a random div order in jQuery?
===
On page load, I am randomizing the order of the children divs with this Code:
function reorder() {
var grp = $("#team-posts").children();
var cnt = grp.length;
var temp, x;
for (var i = 0; i < cnt; i++) {
temp = grp[i];
x = Math.floor(Math.random() * cnt);
grp[i] = grp[x];
grp[x] = temp;
}
$(grp).remove();
$("#team-posts").append($(grp));
}
I cannot seem to figure out how to get the posts back in the original order. Here's the demo of my current code http://jsfiddle.net/JsJs2/ | 0 | [
2,
184,
20,
2058,
21,
5477,
13,
12916,
389,
19,
487,
8190,
93,
60,
800,
3726,
3726,
27,
2478,
6305,
15,
31,
589,
5477,
3335,
14,
389,
16,
14,
391,
13,
12916,
18,
29,
48,
1797,
45,
1990,
302,
7861,
5,
6,
13,
1,
4033,
7711,
30... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Raise event in specified time C#
===
Can somebody give me a code, how to raise event when specified time is passed.
For example i have this times:
> 08:00 12:00 20:30 23:00
How can i subscribe to event which raising in these times?
Thanks! | 0 | [
2,
3972,
807,
19,
9931,
85,
272,
5910,
800,
3726,
3726,
92,
8861,
590,
55,
21,
1797,
15,
184,
20,
3972,
807,
76,
9931,
85,
25,
1100,
9,
26,
823,
31,
57,
48,
436,
45,
13,
1,
13,
3099,
45,
2032,
137,
21319,
434,
45,
1762,
1137... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Retreive images from wordpress using redstone java api?
===
I'm using Redstone Wordpress java-api. i need to retrieve all the images from Wordpress library and display it in my JSP page. Can anyone plz help me on this?
Thanks in advance,
Sreeraj
| 1 | [
2,
13,
6239,
99,
1284,
3502,
37,
833,
5890,
568,
402,
2426,
8247,
21,
2159,
60,
800,
3726,
3726,
31,
22,
79,
568,
402,
2426,
833,
5890,
8247,
8,
2552,
49,
9,
31,
376,
20,
11917,
65,
14,
3502,
37,
833,
5890,
1248,
17,
3042,
32,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How Make a Correct Sql Structure?
===
I work on C# project.
i want to make sql db for my program.
in my program i have many section for each person such as Gender , Department , Education , Bank Name and etc.
For Control Rows In Each Section if i make Tables for each section is correct?
for example make a table for Department With 4 rows . And Make Another Table For Education with 10 rows And ... . Or Make One Table With Many Column And Place All Of this section Together.
Which Way is Better? | 4 | [
2,
184,
233,
21,
4456,
4444,
255,
1411,
60,
800,
3726,
3726,
31,
170,
27,
272,
5910,
669,
9,
31,
259,
20,
233,
4444,
255,
13,
9007,
26,
51,
625,
9,
19,
51,
625,
31,
57,
151,
1050,
26,
206,
840,
145,
28,
4552,
13,
15,
604,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Derive LinkedIn profile URL from user ID?
===
Is it possible to derive a linkedin profile url (public OR private) from the user ID? | 0 | [
2,
20576,
4727,
108,
5296,
287,
6362,
37,
4155,
4924,
60,
800,
3726,
3726,
25,
32,
938,
20,
20576,
21,
4727,
108,
5296,
287,
6362,
13,
5,
12259,
54,
932,
6,
37,
14,
4155,
4924,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Should C++/CLI data members be handles or values?
===
I'm new to C++/CLI and I'm wondering what is "best practice" regarding managed type data members. Declaring as handle:
public ref class A {
public:
A() : myList(gcnew List<int>()) {}
private:
List<int>^ myList;
};
or as a value:
public ref class B {
private:
List<int> myList;
};
Can't seem to find definitive advice on this. | 0 | [
2,
378,
272,
20512,
118,
150,
1210,
1054,
443,
44,
3053,
18,
54,
4070,
60,
800,
3726,
3726,
31,
22,
79,
78,
20,
272,
20512,
118,
150,
1210,
17,
31,
22,
79,
5712,
98,
25,
13,
7,
4936,
1345,
7,
3467,
1471,
1001,
1054,
443,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Magento Error - Call to a member function options() on a non-object in JS.php
===
I'm seeing this error in my PHP error log:
2012/07/02 15:40:34 [error] 9963#0: *140 FastCGI sent in stderr: "PHP Fatal error: Call to a member function options() on a non-object in "/htdocs/app/code/local/Mana/Core/Helper/Js.php on line 35" while reading response header from upstream, client: xx.xxx.x.xxx, server: xxx.xxx.xxx.x, request: "GET /category/subcategory?___SID=U HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fcgi-xxxxxxx.com.sock:", host: "xxx.xxx.xxx.x", referrer: "http://xxx.xxx.xxx.x/category/subcategory"
I have never edited the JS.php file so can't see why this could be happening. The error occurs when an item is added to the cart. Everything seems to actually be working but the page takes 60 seconds to load (way too long) which I guess is the script timeout period. Once an item is in the cart, every page on the site takes 60 seconds to load, making the entire site unusable.
Does anybody have any suggestions? I'd really appreciate the help as the site just isn't usable like this and I can't find the cause anywhere. | 0 | [
2,
4723,
17050,
7019,
13,
8,
645,
20,
21,
322,
1990,
6368,
5,
6,
27,
21,
538,
8,
23793,
19,
487,
18,
9,
26120,
800,
3726,
3726,
31,
22,
79,
2078,
48,
7019,
19,
51,
13,
26120,
7019,
6738,
45,
563,
118,
2984,
118,
3564,
357,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
duplicate javascript code -
===
I have a javascript that I downloaded off the net. This works great. My problem is I now require to use this same script but on three instances on the page? how can I duplicate or edit this javascript code in order to acheive this.
To give you a background, I have a dropdown list, that onchange calls the below function to populate a table with mysql data without page refresh. the script shows info from another page, getpersonsformedical.php.
I now have two other pages that I want to show on the same page using the same javascript. namely
getjobsformedical.php and getrisksformedical.php.
Any help would be appreciated. (apologies my javascript is not that great).
Can I just duplicate the code in another script tag? but then how do I call multiple onchange events for a single tag onclick. All three of these pages must be called from the single onclick.
<SELECT NAME=medcondition3 id=medcondition3 onchange="showUser(1, this.value)">
The script being used is:
<script type="text/javascript">
function showUser(userNumber, str)
{
if (str=="")
{
document.getElementById("txtHint" + userNumber).innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint" + userNumber).innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","getpersonsformedical.php?q="+str,true);
xmlhttp.send();
}
</script>
I understand that there are other ways of doing this but if we could stivck to this methodology it would be appreciated.
Thanks and Regards,
Ryan | 0 | [
2,
19429,
8247,
8741,
1797,
13,
8,
800,
3726,
3726,
31,
57,
21,
8247,
8741,
30,
31,
23887,
168,
14,
4275,
9,
48,
693,
374,
9,
51,
1448,
25,
31,
130,
4077,
20,
275,
48,
205,
3884,
47,
27,
132,
13946,
27,
14,
2478,
60,
184,
92... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Fatal error: Cannot redeclare (PHP/Apache Setup)
===
I am running an Apache2/PHP5 web server on my Mac (Mountain Lion). When I upgraded from Lion to Mountain Lion, I lost my dev environment/configs. Whilst trying to set everything up, I have somehow borked my httpd or php.ini configuration (I think, anyway)... when I point my browser to my localhost, I get the infamous PHP error:
Fatal error: Cannot redeclare (some random function).
Regardless of the page I point it to, I get this. Prior to the loss of my web server settings, this was not happening, so I am confident that the files are okay and all syntax is good (the whole site consistently uses include_once and require_once also).
I think it has to do with my virtual host setup or working directory setup... I've tried a number of things, but no joy so far.
I am happy to provide any/all info that would be useful... I'm at my wit's end on this. Any help or suggestions would be greatly appreciated. | 0 | [
2,
8773,
7019,
45,
1967,
402,
62,
7232,
99,
13,
5,
26120,
118,
7738,
2569,
18161,
6,
800,
3726,
3726,
31,
589,
946,
40,
17140,
9298,
26120,
264,
2741,
8128,
27,
51,
1572,
13,
5,
23741,
6023,
6,
9,
76,
31,
9958,
37,
6023,
20,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to avoid if/elif/else when one value corresponds with another?
===
What's a concise way to express a direct correlation between (apple, banana) and (red, yellow). Although it gets the result I need, I'm just not happy with this...
if value == apple:
result = red
elif value == banana:
result = yellow
else:
result = None
Tough to search for, or even work out what to title this question, but I'm sure it's a basic exercise. Isn't it?
| 0 | [
2,
184,
20,
2658,
100,
118,
532,
821,
118,
6798,
62,
76,
53,
1923,
17016,
29,
226,
60,
800,
3726,
3726,
98,
22,
18,
21,
29455,
161,
20,
2999,
21,
1744,
16881,
128,
13,
5,
24212,
15,
13635,
6,
17,
13,
5,
2095,
15,
2019,
6,
9,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Callbacks in Sammy
===
I have this peice of code - I just need to add a class on a DOM element which will be rendered in the template. However, this fails to work!
this.get('#/:post_id', function(context){
context.app.swap('');
this.load('/post/' + this.params['post_id'])
.then(function(candidates){
$.each(candidates[1], function(i, candidate){
context.render("static/templates/candidate.template", {candidate:candidate})
.appendTo(context.$element());
});
})
.then(function(){
$('h3').addClass('custom_class');
});
Candidate.template:
<div>
<h3>Name : <%= candidate.name %> </h3>
...
...
</div> | 0 | [
2,
645,
1958,
18,
19,
17570,
800,
3726,
3726,
31,
57,
48,
3560,
3568,
16,
1797,
13,
8,
31,
114,
376,
20,
3547,
21,
718,
27,
21,
11859,
4520,
56,
129,
44,
10877,
19,
14,
22894,
9,
207,
15,
48,
13614,
20,
170,
187,
48,
9,
3060... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Twitter Data Model
===
I'm looking to snapshot a twitter user every night. I would like to track the users friends and followers. I would like to be able to say on date X show the friends and followers. I would like to be able to select a particular friend/follower and see when they became followed or unfollowed the user. I would also like to be able to generate a timelime of follows and unfollows (similiar to the [connect page][1] on the twitter web app.
What kinda of data model/data structures would be best to achieve this?
[1]: https://twitter.com/i/connect | 0 | [
2,
10623,
1054,
1061,
800,
3726,
3726,
31,
22,
79,
699,
20,
29946,
21,
10623,
4155,
352,
343,
9,
31,
83,
101,
20,
792,
14,
3878,
954,
17,
8518,
9,
31,
83,
101,
20,
44,
777,
20,
395,
27,
1231,
993,
298,
14,
954,
17,
8518,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why does the matrix generated by Android's frustumM differ from the Redbook's?
===
Something seems funny about the way that Android's frustumM works. If I check the OpenGL red book, the matrix generated looks like this:<br/>
<img src="http://www.glprogramming.com/red/images/Image23.gif"></img><br/>
Songho.ca seems to agree with this:<br/>
<img src="http://www.songho.ca/opengl/files/gl_projectionmatrix_eq16.png"></img><br/>
However, one component is multiplied by 2 with Android's frustumM, and not in the other example matrices. Here's what it seems to be doing:<br/>
<img src="http://i.imgur.com/vhtcg.png"></img><br/>
Everything seems to functionally match up, *except* the first row, third column. Why is that being multiplied by two? Here's the lines of code from android.opengl.Matrix's frustumM method that generate the first three elements of the third column:
final float A = 2.0f * ((right + left) * r_width);
final float B = (top + bottom) * r_height;
final float C = (far + near) * r_depth;
With r_width, r_height, r_depth defined as:
final float r_width = 1.0f / (right - left);
final float r_height = 1.0f / (top - bottom);
final float r_depth = 1.0f / (near - far);
Is this a mistake in Android's code, or am I just missing something? I know that the term cancels out if the frustum is symmetrical. When running the code with an asymmetrical frustum, the generated matrices actually are different and so are the resulting vectors when the same vector is multiplied with those differing matrices.
Thanks! | 0 | [
2,
483,
630,
14,
8187,
6756,
34,
13005,
22,
18,
13394,
18,
5633,
79,
11394,
37,
14,
402,
5199,
22,
18,
60,
800,
3726,
3726,
301,
2206,
5066,
88,
14,
161,
30,
13005,
22,
18,
13394,
18,
5633,
79,
693,
9,
100,
31,
2631,
14,
368,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I create this Popup and check to see if user has Allowed App?
===
How would I create a popup on my website that shows up (that blocks the website's content) only if the user hasn't yet allowed my Facebook app? The popup should not come up if the user has already allowed the app, and the popup should have a button for users to allow the application and then go away when the user does allow the application.
For an example, see http://ow.ly/cyLNS
How hard is this to do?
Thanks so much!
Dan | 0 | [
2,
184,
107,
31,
1600,
48,
1675,
576,
17,
2631,
20,
196,
100,
4155,
63,
1159,
4865,
60,
800,
3726,
3726,
184,
83,
31,
1600,
21,
1675,
576,
27,
51,
2271,
30,
1285,
71,
13,
5,
887,
5198,
14,
2271,
22,
18,
2331,
6,
104,
100,
14... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CLLoaction Manager `startUpdatingLocation` not working
===
I'm trying to get the user location and zoom into that location but `[locationManager startUpdatingLocation]` isn't firing the second method. Am I doing this wrong? I've tried to set breakpoints in the second method, but none of them catch. It seems as though it's obviously not being used.
- (void)viewDidLoad {
[super viewDidLoad];
mapView=[[MKMapView alloc] initWithFrame:self.view.frame];
mapView.showsUserLocation=TRUE;
mapView.delegate=self;
[self.view insertSubview:mapView atIndex:0];
CLLocationManager *locationManager=[[CLLocationManager alloc] init];
locationManager.delegate=self;
locationManager.desiredAccuracy=kCLLocationAccuracyNearestTenMeters;
[locationManager startUpdatingLocation];
}
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation{
mStoreLocationButton.hidden=FALSE;
location=newLocation.coordinate;
MKCoordinateRegion region;
region.center=location;
MKCoordinateSpan span;
span.latitudeDelta=0.01;
span.longitudeDelta=0.01;
region.span=span;
[mapView setRegion:region animated:TRUE];
}
Is this set up properly? Is `[locationManager startUpdatingLocation]` supposed to fire the next method?
| 0 | [
2,
272,
6880,
8645,
1382,
13,
1,
13680,
576,
43,
1880,
19032,
1,
52,
638,
800,
3726,
3726,
31,
22,
79,
749,
20,
164,
14,
4155,
1474,
17,
19469,
77,
30,
1474,
47,
13,
1,
2558,
19032,
22256,
20205,
43,
1880,
19032,
500,
1,
2532,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
C#: how do I determine type of an interface variable?
===
I have a interface variable IAction nextAction.
I want to see if the nextAction is of a concrete implementation, but was unsuccessful when I tried the following:
IAction = GetNextAction();
if (nextAction.GetType() != type(LastAction)) {
// do something...
}
any ideas on how I can determine the concrete type of the IAction variable? | 0 | [
2,
272,
5910,
45,
184,
107,
31,
3746,
1001,
16,
40,
6573,
7612,
60,
800,
3726,
3726,
31,
57,
21,
6573,
7612,
31,
8645,
328,
8645,
9,
31,
259,
20,
196,
100,
14,
328,
8645,
25,
16,
21,
4105,
6123,
15,
47,
23,
7225,
76,
31,
794... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Understanding Brown tags
===
I was reading about linguistics in relation to Natural Language Processing, but the Brown tags are confusing me.
Can you help me explaining the following tags (if you can add an example, much better)? All of them are related to [interrogative pronouns and interrogative determiners][1].
WDT (wh-determiner: what, which)
WP$ (possessive wh-pronoun: whose)
WPO (objective wh-pronoun: whom, which, that)
WPS (nominative wh-pronoun: who, which, that)
For example, a determiner should be **the** in **The dog** because as it's defined, it describes the reference of a noun in a context. But what about a wh-determiner? What purpose does it serve? Asking about the reference of a noun or in which way should I interpret these forms?
Thanks a lot
[1]: http://en.wikipedia.org/wiki/Interrogative_pronoun | 0 | [
2,
3260,
886,
3383,
18,
800,
3726,
3726,
31,
23,
1876,
88,
18165,
19,
5827,
20,
1112,
816,
5511,
15,
47,
14,
886,
3383,
18,
50,
18084,
55,
9,
92,
42,
448,
55,
10225,
14,
249,
3383,
18,
13,
5,
821,
42,
92,
3547,
40,
823,
15,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Cassandra: Query with where clause containing greather- or lesser-than (< and >)
===
currently I'm trying to convert a rdbms application to cassandra. In my rdbms application I have following talbe:
|Col1|Col2|Col3|Col4|
1. Col1: String (primary key)
2. Col2: String (primary key)
3. Col3: Bigint (index)
4. Col4: Bigint
This table counts over 200.000.000 records. Mostly used query is something like:
Select * from table where col3 < 100 and col3 > 50;
In Cassandra I used following statement to create the table:
Create table table1 (primary_key varchar, col1 varchar, col2 varchar, col3 bigint, col4 bigint, primary key (primary_key));
Create index on table1(col3);
I changed the primary key to an extra column (I calculate the key inside my application).
After importing a few records I tried to execute following cql:
Select * from table1 where col3 < 100 and col3 > 50;
This result in:
Bad Request: No indexed columns present in by-columns clause with Equal operator
The Query *select col1,col2,col3,col4 from table1 where col3 = 67* works
Google said there is no way to execute that kind of queries. Is that right? Any advice how to create such a query?
Regards
WM
P.S. I'm using Cassandra 1.1.2
| 0 | [
2,
17825,
45,
25597,
29,
113,
9040,
3503,
374,
1694,
8,
54,
8051,
8,
7230,
13,
5,
1,
17,
13,
1,
6,
800,
3726,
3726,
871,
31,
22,
79,
749,
20,
8406,
21,
13,
897,
13178,
18,
3010,
20,
17825,
9,
19,
51,
13,
897,
13178,
18,
30... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to pass a variable from one page to another in php
===
Does anybody of you know what's wrong here that I cannot print in File2.php the variable $myusername from File1.php i have.
I simply wanna print the variable $myusername, or if you know any other way of how to pass that variable that would be very helpful for me.
Here is my example:
File1.php
<?php
$myusername=$_POST['myusername'];
function getusername()
{
return $myusername;
}
?>
File2.php
<?php
require_once('File1.php');
getusername();
?> | 0 | [
2,
184,
20,
1477,
21,
7612,
37,
53,
2478,
20,
226,
19,
13,
26120,
800,
3726,
3726,
630,
11181,
16,
42,
143,
98,
22,
18,
1389,
235,
30,
31,
1967,
4793,
19,
3893,
135,
9,
26120,
14,
7612,
5579,
915,
16704,
7259,
37,
3893,
165,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Hibernate c3p0 and DBCP connection pooling mechanism
===
If you don't specify settings in hibernate.cfg.xml what will be default connection pooler and how do you change it?
here is hibernate config
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/POM_IVR</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">XXX</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
<mapping resource="com/SurveyResults.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Questions
1. Does c3p0 jar come with hibernate3?
2.If you don't specify c3p0 , does hibernate use it's default connection pooler( how do you know it is not using default, is there a parameter) or DBCP?
3.How do I modify the DCBP paramater for my web application do I have to change the context file conf/catalina/locahost/Applicationame.xml in catalina or hibernate configuration, what do I have to change/add to it do I have to specify the username and password or just parameter?
4.Can someone explain how this works, hibernate request a connection and tomcat will get a connection from pool? if you specify c3p0 does DBCP get by-passed?
5.What if I have 2 web application using the same table/username/password? what is commandeered should they have their own DBCP , c3p0 jar? if conf/context.xml is applied to all application can you specify global parameter for DBCP for application to use?
This is all related to 8 hours connection timeout for mysql, I don't want to change the DB parameters.
| 0 | [
2,
4148,
2102,
8820,
272,
240,
306,
387,
17,
13,
9007,
7439,
2760,
3067,
68,
6534,
800,
3726,
3726,
100,
42,
221,
22,
38,
19077,
12410,
19,
4148,
2102,
8820,
9,
8940,
263,
9,
396,
8184,
98,
129,
44,
12838,
2760,
3067,
106,
17,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ACCESS_VIOLATION when use Hook Engine
===
I have a problem using this hook engine http://www.codeproject.com/Articles/21414/Powerful-x86-x64-Mini-Hook-Engine
Function is hooked correctly, but when i try to call real function(original), error ACCESS_VIOLATION is raising.
My code
typedef int (__stdcall *MyCloseSocket) (SOCKET s);
MyCloseSocket pTrampolineCloseSocket = NULL;
int main()
{
//...
HookFunction((ULONG_PTR) GetProcAddress(LoadLibrary(dll), "closesocket"), (ULONG_PTR) &OwnCloseSocket);
pTrampolineCloseSocket = (MyCloseSocket) GetOriginalFunction((ULONG_PTR) OwnCloseSocket);
}
int OwnCloseSocket(SOCKET fd)
{
// here successfully. Function is hooked
return pTrampolineCloseSocket(fd); // but here ACCESS_VIOLATION
}
What i'm doing wrong? Thanks! | 0 | [
2,
1381,
1,
13327,
10832,
76,
275,
5559,
1406,
800,
3726,
3726,
31,
57,
21,
1448,
568,
48,
5559,
1406,
7775,
6903,
6483,
9,
9375,
21011,
9,
960,
118,
20360,
18,
15718,
14919,
12918,
5484,
1566,
8,
396,
3274,
8,
396,
3470,
8,
6840,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Model Relationships
===
So I am building this ruby on rails webapp. I have two models: Courses and lessons. Courses has many lessons and lesson belongs to course. I have the forms running just fine but what i want to do is pass the :course_id to the lesson form to be able to keep track of what course the lesson belongs to. ( I have included a course_id value in the lesson table.
Basically, my question is how can i pass the :id of the course onto the lesson form? | 0 | [
2,
1061,
5833,
800,
3726,
3726,
86,
31,
589,
353,
48,
10811,
27,
2240,
18,
2741,
7753,
9,
31,
57,
81,
2761,
45,
4392,
17,
7870,
9,
4392,
63,
151,
7870,
17,
11404,
7034,
20,
674,
9,
31,
57,
14,
1997,
946,
114,
1123,
47,
98,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Render PartialView within View on Demand
===
the page has 2 DropDownLists + a Textbox + a Submit Button.
On Submit it's supposed to choose and fill a partial view depending on what value is selected in the first DropDownList. I got it somewhat working; however, it will always return the pv in a new window instead of rendering it in the main view's div.
I am using MVC 3 + Telerik.
The most Important parts of the code:
**VIEW**
<script type="text/javascript">
function onMainDDL1Change(e) {
var combo = $("#SubDDL1").data("tComboBox");
combo.value("");
combo.reload();
}
function onSubDDL1DataBinding(e) {
var combo = $("#MainDDL1").data("tComboBox");
e.data = $.extend({}, e.data, { mainDDL1ID: combo.value() });
}
function updatePlaceholder(context) {
// the HTML output of the partial view
var html = context.get_data();
// the DOM element representing the placeholder
var placeholder = context.get_updateTarget();
// use jQuery to update the placeholder. It will execute any JavaScript statements
$(placeholder).html(html);
// return false to prevent the automatic update of the placeholder
return false;
}
</script>
<table>
<tr>
<td>
@(Html.Telerik().ComboBox()
.Name("MainDDL1")
.AutoFill(true)
.DataBinding(binding => binding.Ajax().Select("LoadMainDDL", "DataSearch"))
.HighlightFirstMatch(true)
.ClientEvents(events => events.OnChange("onMainDDL1Change"))
)
</td>
</tr>
<tr>
<td>
@(Html.Telerik().ComboBox()
.Name("SubDDL1")
.DataBinding(binding => binding.Ajax().Select("LoadSubDDL1", "DataSearch"))
.HighlightFirstMatch(true)
.ClientEvents(events => events.OnDataBinding("onSubDDL1DataBinding"))
)
</td>
<tr>
<td>
@Html.TextBoxFor(o => o.sSearch1)
</td>
</tr>
<tr align="center">
<td colspan="4">
@(Ajax.ActionLink("Load partial view", "PartialGrid", new AjaxOptions
{
OnSuccess = "updatePlaceholder", UpdateTargetId = "result"
}))
</td>
</tr>
</table>
<div id="result">
</div>
**Controller**
//PartialView
public ActionResult PartialGrid(DataSearchModel voModel)
{
voModel.dtResultSet1 = DLA.DataSearchContext.getResultSet1(voModel.MainDDL1, voModel.SubDDL1, voModel.sSearch1);
return PartialView("_TPRCL", voModel);
}
//Initial View
public ViewResult DataSearch(string text)
{
DataSearchModel oModel = new DataSearchModel();
oModel.alMainDDL = DLA.DataSearchContext.getMainDDL();
return View(oModel);
}
| 0 | [
2,
16535,
7284,
4725,
363,
1418,
27,
3888,
800,
3726,
3726,
14,
2478,
63,
172,
2804,
2968,
5739,
18,
2754,
21,
1854,
5309,
2754,
21,
12298,
5167,
9,
27,
12298,
32,
22,
18,
2293,
20,
3538,
17,
3509,
21,
7284,
1418,
4758,
27,
98,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Pandas bar plot with specific colors and legend location?
===
I have a pandas DataFrame and I want to plot a bar chart that includes a legend.
import pylab as pl
from Pandas import *
x = DataFrame({"Alpha": Series({1: 1, 2: 3, 3:2.5}), "Beta": Series({1: 2, 2: 2, 3:3.5})})
If I call plot directly, then it puts the legend above the plot:
x.plot(kind="bar")
If I turn of the legend in the plot and try to add it later, then it doesn't retain the colors associated with the two columns in the DataFrame:
x.plot(kind="bar", legend=False)
l = pl.legend(('Alpha','Beta'), loc='best')
What's the right way to include a legend in a matplotlib plot from a Pandas DataFrame?
| 0 | [
2,
16982,
18,
748,
3798,
29,
1903,
5268,
17,
4393,
1474,
60,
800,
3726,
3726,
31,
57,
21,
16982,
18,
1054,
8361,
17,
31,
259,
20,
3798,
21,
748,
1795,
30,
1103,
21,
4393,
9,
9010,
7103,
9086,
28,
12443,
37,
16982,
18,
9010,
1637... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Honeycomb Calendar Access
===
I am developing an app, that inserts weekly reminders in the Android calendar. The application has been tested an can update the calendar on Android 2.3.* and 4.0 devices.
I am aware that Android 4.0 formalised the calendar provider API, and that in versions prior to this the solution was 'unofficial'. For this reason I have developed two implementations one for ICS and above, and one for <ICS.
My code works fine on Android 2.3.* and >= 4.0 devices. However,I am experiencing difficulties with Honeycomb tablets. With those I am getting a 'Failed to find provider info for calendar'.
Could anyone who knows please point out the differences between 2.3 and Honeycomb with respect to accessing the calendar so I can have my app working on Honeycomb? | 0 | [
2,
29806,
7036,
1381,
800,
3726,
3726,
31,
589,
3561,
40,
4865,
15,
30,
14692,
18,
3481,
14973,
18,
19,
14,
13005,
7036,
9,
14,
3010,
63,
74,
7631,
40,
92,
11100,
14,
7036,
27,
13005,
172,
9,
240,
9,
2483,
17,
268,
9,
387,
469... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to get values from array returned from xml iterator
===
i'm using code for xml iterator and i got output like this
Array
(
[RESPONSE] => Array
(
[url] => http://www.greencart.com/paynetz/epi/fts
[param] => Array
(
[0] => NBFundTransfer
[1] => 153837
[2] => AiHLuf2uZJXyyQ6ZHPR0MvqxcmzhK64ODSoomLi701Q%3D
[3] => 1
)
)
)
Now how to extract values from it for so that i want to convert it into url like this
http://www.greencart.com/paynetz/epi/fts?ttype=NBFundTransfer&tempTxnId=153837&token=AiHLuf2uZJXyyQ6ZHPR0MvqxcmzhK64ODSoomLi701Q%3D&txnStage=1 | 0 | [
2,
184,
20,
164,
4070,
37,
7718,
587,
37,
23504,
32,
106,
3457,
800,
3726,
3726,
31,
22,
79,
568,
1797,
26,
23504,
32,
106,
3457,
17,
31,
330,
5196,
101,
48,
7718,
13,
5,
636,
99,
18,
8782,
870,
500,
800,
1,
7718,
13,
5,
636... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WPF MVVM Controls incorrectly sharing ViewModel
===
I have a control:
DailyHours. That has a collection of custom TimeEdit controls I created. Each control is supposed to bind to the DailyHours view-model class. Instead it tries to find the values I bind to in the TimeEdit control.
An example of a TimeEdit control binding:
<bc:TimeEdit Time="{Binding CurrentOperatingHours.MondayClose}" ></bc:TimeEdit>
The TimeEdit control has its own internal values for hour and minute that are bound to Hour and Minute properties. For this reason the DataContext for the TimeEdit control is itself.
public TimeEdit()
{
InitializeComponent();
this.DataContext = this;
}
However this causes the DailyHours control to incorrectly bind the time value. It looks for the CurrentOperatingHours property in the TimeEdit control instead of its own view-model.
How do I get my TimeEdit control to bind correctly with internal values without disturbing binding on its parent container?
| 0 | [
2,
619,
7721,
17967,
20147,
8671,
22870,
6126,
1418,
13998,
800,
3726,
3726,
31,
57,
21,
569,
45,
1954,
4754,
18,
9,
30,
63,
21,
1206,
16,
5816,
85,
69,
242,
8671,
31,
679,
9,
206,
569,
25,
2293,
20,
10193,
20,
14,
1954,
4754,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Image and text with opacity background in the same DIV
===
Am trying to make an image and text with an opacity![enter image description here][1] background appear in the same div without using the image as background. How can i make this work?
Kindly see image attached.
[1]: http://i.stack.imgur.com/nSzlv.jpg | 0 | [
2,
1961,
17,
1854,
29,
13,
11490,
5788,
2395,
19,
14,
205,
13,
12916,
800,
3726,
3726,
589,
749,
20,
233,
40,
1961,
17,
1854,
29,
40,
13,
11490,
5788,
187,
2558,
13679,
1961,
5318,
235,
500,
2558,
165,
500,
2395,
1893,
19,
14,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Making a tuple hold either a const reference or a const value
===
I'm trying to make a `std::tuple` that ends up holding either `const` references, or a value that was either copied or moved as appropriate where taking a reference wouldn't be sensible (e.g. temporaries).
So far I've got:
#include <functional>
#include <iostream>
template <typename ...Args>
struct foo {
const std::tuple<Args...> values;
};
template <typename T1, typename T2>
foo<T1, T2> make2(T1&& v1, T2&& v2) {
return foo<T1,T2>{std::tuple<T1, T2>(std::forward<T1>(v1),std::forward<T2>(v2))};
}
int main() {
double d1=1000;
double& d2 = d1;
auto f = make2(d2, 0);
std::cout << std::get<0>(f.values) << ", " << std::get<1>(f.values) << "\n";
d1 = -666;
std::get<0>(f.values)=0; // Allowed - how can I inject some more constness into references?
//std::get<1>(f.values) = -1; // Prohibited because values is const
std::cout << std::get<0>(f.values) << ", " << std::get<1>(f.values) << "\n";
}
Which is close, but not quite `const` enough for what I was hoping - I end up with a `const std::tuple<double&, int>` which of course allows me to modify the double that the tuple refers to.
I tried sprinkling some more `const`ness into `make2`:
template <typename T1, typename T2>
foo<T1 const, T2 const> make2(T1&& v1, T2&& v2) {
return foo<T1 const,T2 const>{std::tuple<T1 const, T2 const>(std::forward<T1>(v1),std::forward<T2>(v2))};
}
That succeeded in making the `int` (i.e. non-reference) tuple member `const` (not terribly exciting given I can make the whole tuple `const` easily enough), but did nothing to the `double&` member. Why? How can I add that extra `const`ness? | 0 | [
2,
544,
21,
2289,
5106,
1027,
694,
21,
11608,
38,
2801,
54,
21,
11608,
38,
1923,
800,
3726,
3726,
31,
22,
79,
749,
20,
233,
21,
13,
1,
384,
43,
45,
45,
2473,
5106,
1,
30,
3451,
71,
1337,
694,
13,
1,
12124,
38,
1,
7231,
15,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Error in redirect_url OAuth
===
With this url:
https://www.facebook.com/dialog/oauth?client_id=440155532683152&scope=photo_upload,publish_stream&redirect_uri=https://www.facebook.com/TheStyleSymbol/app_440155532683152
i get this error:
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: Invalid redirect_uri: L'URL inserito non è compatibile con la configurazione dell'applicazione.
The application link is:
https://www.facebook.com/TheStyleSymbol/app_440155532683152
Do you know why? o.O Thanks!
| 0 | [
2,
7019,
19,
302,
14706,
1,
911,
255,
635,
1346,
96,
800,
3726,
3726,
29,
48,
287,
6362,
45,
7775,
18,
6903,
6483,
9,
6413,
5199,
9,
960,
118,
4286,
5567,
118,
111,
1346,
96,
60,
150,
18513,
38,
1,
1340,
3726,
16403,
11055,
4022... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Listview & Checkboxes - Binding issue when using relative source.
===
I have a listview with two columns, one contains a textbox and the other a checkbox. These are bound to an ObservableCollection of a custom object containing a string for the textbox and a boolean for the checkbox.
All was working well until I tried having the check event of the checkbox highlight it's the row in the listview as in [this article][1].
My problem is that checkbox no longer binds to the ObservableCollection. The textbox binds okay, but changing the checbox declaration from:
<CheckBox IsChecked="{Binding RestrictedEdit}"/>
to this:
<CheckBox IsChecked="{Binding RestrictedEdit, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListViewItem}}}"/>
stops the checkbox binding and the listview is displayed with the checkboxes all unchecked irrespectivate of status of the boolean. What am I doing wrong?
[1]: http://stackoverflow.com/questions/2608187/wpf-listview-selecteditem-is-null/2608315#2608315 | 0 | [
2,
968,
4725,
279,
2631,
5309,
160,
13,
8,
8728,
1513,
76,
568,
4543,
1267,
9,
800,
3726,
3726,
31,
57,
21,
968,
4725,
29,
81,
7498,
15,
53,
1588,
21,
1854,
5309,
17,
14,
89,
21,
2631,
5309,
9,
158,
50,
4138,
20,
40,
5122,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to save xml file from html page
===
i have requirement to save xml document which is displayed in html page .
scenario is like this :
i am sending search request to the server and in return i am getting xml file but displayed in html page what i want that file which is displayed in the form of html to save at client side with .xml extension programmatically either using java script or asp.net-C# .
please see this link(server return file like this)
http://www.w3schools.com/dom/books.xml
Thanks | 0 | [
2,
184,
20,
2079,
23504,
3893,
37,
13,
15895,
2478,
800,
3726,
3726,
31,
57,
8981,
20,
2079,
23504,
4492,
56,
25,
6115,
19,
13,
15895,
2478,
13,
9,
12705,
25,
101,
48,
13,
45,
31,
589,
4907,
2122,
3772,
20,
14,
8128,
17,
19,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Trying to use the not operator in Perl and it doesn't seem to be working - how do I get it to work?
===
I'm trying to match all src attributes that do not begin with http. If they don't begin with http, they get prefixed with [perl]$PATH_BLAH[/perl]/, and attributes that have a leading slash don't get an extra slash
Here's what I have so far. The not operator in Perl doesn't seem to be working though. It still matches http.
find: src="(/)?(.+?)(^http)"<BR><BR>
replace: src="[perl]$PATH_BLAH[/perl]/\3"
Any help? Thanks! | 1 | [
2,
749,
20,
275,
14,
52,
6022,
19,
416,
255,
17,
32,
1437,
22,
38,
2260,
20,
44,
638,
13,
8,
184,
107,
31,
164,
32,
20,
170,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
730,
65,
13,
18,
5453,
13422,
30,
107,
52,
2348,
29,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SherlockActionBar crashes if exported
===
i implemented sherlockactionbar in my project and it works great, but i don't know why when i export my project with eclipse into an apk to finally publish it it doesn't even open! if i run it from eclipse it works perfectly...
this is the log:
06-28 15:54:24.050: E/AndroidRuntime(3707): Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: <init> [class android.app.Activity, int]
06-28 15:54:24.050: E/AndroidRuntime(3707): at com.actionbarsherlock.app.SherlockActivity.a(Unknown Source)
06-28 15:54:24.050: E/AndroidRuntime(3707): at com.actionbarsherlock.app.SherlockActivity.setContentView(Unknown Source)
it crashes during the setContentView(..) method.
what's the difference between exporting and running (not in debug) from eclipse? sholdn't they be the same code with different key?
| 0 | [
2,
22815,
8645,
1850,
21563,
100,
18011,
800,
3726,
3726,
31,
6807,
22815,
8645,
1850,
19,
51,
669,
17,
32,
693,
374,
15,
47,
31,
221,
22,
38,
143,
483,
76,
31,
7487,
51,
669,
29,
11652,
77,
40,
21,
17244,
20,
722,
10824,
32,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to match "upper" part of website dynamically to browser viewport - example link inside
===
http://www.sixt.de/<br>
The orange background always matches automatically on different monitors/screen resolutions.<br>
Scroll down for more content.
Thank you!
| 0 | [
2,
184,
20,
730,
13,
7,
18959,
7,
141,
16,
2271,
7782,
1326,
20,
16495,
1418,
1993,
13,
8,
823,
3508,
572,
800,
3726,
3726,
7775,
6903,
6483,
9,
6742,
38,
9,
546,
118,
1,
5145,
1,
14,
2987,
2395,
550,
1717,
7499,
27,
421,
1852... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Combine 5min Video and MonkeySee APIs in to One Gallery
===
I'm looking for a way to combine a feed from 5min video's api and a feed from MonkeySee's api in to one gallery. Is there a way to pull videos from both sources and set them to randomly display amongst one another?
Thanks! | 0 | [
2,
12287,
331,
2160,
763,
17,
11861,
1798,
21,
8954,
19,
20,
53,
2246,
800,
3726,
3726,
31,
22,
79,
699,
26,
21,
161,
20,
12287,
21,
4063,
37,
331,
2160,
763,
22,
18,
21,
2159,
17,
21,
4063,
37,
11861,
1798,
22,
18,
21,
2159,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android NoSuchField error in R.java after process is killed
===
I've hit a very frustrating issue with one of my apps.
I have a splashscreen activity which loads up some initial data for my app then launches the main activity and finishes itself.
Once main activity is running, I background the app by pressing the home key and then kill the process for my app.
When I relaunch my app, the splashscreen tries to run but fails as soon as I try to access any of the fields in my R.java file:
For example, I immediately try to set the text of a textview like so:
((TextView)findViewById(R.id.splash_tv_1)).setText(application.getLanguage().pleasewait);
This throws the following exception:
06-29 11:18:14.661: ERROR/AndroidRuntime(21427): java.lang.NoSuchFieldError: com.pagesuite.android.reader.framework.R$id.splash_tv_1
Then when I launch it again it's fine.
I get the same behaviour if I kill the app using a TaskKiller tool (something I know a lot of users will be naively using I suspect) or if the OS kills my process.
Any ideas?
| 0 | [
2,
13005,
90,
4289,
1109,
7019,
19,
761,
9,
1004,
1385,
75,
953,
25,
841,
800,
3726,
3726,
31,
22,
195,
770,
21,
253,
25568,
1513,
29,
53,
16,
51,
4865,
18,
9,
31,
57,
21,
13873,
7187,
2358,
56,
19069,
71,
109,
2104,
1054,
26,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Oracle database connection in drupal 7
===
I want to retrieve a list of products from an external oracle database and show it in my drupal site as a catalog. But the problem is that, how can I make the connection to oracle db from a drupal 7 site. Please any suggestion on how to perform this operation is highly welcome. Thanks!
| 0 | [
2,
15759,
6018,
2760,
19,
15708,
6720,
453,
800,
3726,
3726,
31,
259,
20,
11917,
21,
968,
16,
1985,
37,
40,
4886,
15759,
6018,
17,
298,
32,
19,
51,
15708,
6720,
689,
28,
21,
10594,
9,
47,
14,
1448,
25,
30,
15,
184,
92,
31,
233... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
update in codeigniter works but displays an error message
===
i was just wondering what could be the problem with a working code yet displays an error message such as this:
A PHP Error was encountered
Severity: Notice
Message: Array to string conversion
Filename: database/DB_active_rec.php
Line Number: 1407
im trying to update fields in my database. I have this code and every tutorial are just the same for batch upload. It works anyway but the thing is it display such an error.
this what i have in my model:
function update2($data){
$this->db->update_batch('users',$data, "id");
}
This what i have in my controller:
public function updateValues(){
$this->load->model('get_db');
$newRow = array(
array(
'id' => '3',
'firstname' => 'Rapphie'
),
array(
'id' => '2',
'firstname' => 'Charmie'
)
);
$this->get_db->update2($newRow);
echo "it has been updated";
}
please help. | 0 | [
2,
11100,
19,
1797,
9693,
242,
106,
693,
47,
9412,
40,
7019,
2802,
800,
3726,
3726,
31,
23,
114,
5712,
98,
110,
44,
14,
1448,
29,
21,
638,
1797,
768,
9412,
40,
7019,
2802,
145,
28,
48,
45,
21,
13,
26120,
7019,
23,
8208,
21671,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
PhoneGap/Cordova. childBrowser plugin giving starnge URL (iOS)
===
I am having a great deal of difficulty getting the childBrowser plugin to work
Currently when I click my link it does nothing on my iOS simulator and when I click it using a browser I get a Web Page Not Found error with the web address looking something like:
file://myapp/www/%C3%A2%E2%82%AC%C2%9D#ᅢᄁ¬ツᆲᅡン
I am really stuck for ideas on whats going on and what is causing this, any advice would be greatly appreciated.
My code is:
<script type="text/javascript" charset="utf-8" src="js/ChildBrowser.js"></script>
<script>
function onDeviceReady() {
childbrowser = ChildBrowser.install();
var root = this;
cb = window.plugins.childBrowser;
if(cb != null) {
cb.onLocationChange = function(loc){ root.locChanged(loc); };
cb.onClose = function(){root.onCloseBrowser(); };
cb.onOpenExternal = function(){root.onOpenExternal(); };
//cb.showWebPage(“http://google.com”);
}
}
function onCloseBrowser() {
console.log(“onCloseBrowser!”);
}
function locChanged(loc) {
console.log(“locChanged!”);
}
function onOpenExternal() {
alert(“onOpenExternal!”);
}
</script>
<body onLoad=”onBodyLoad()”>
<a href=”#” onclick=’cb.showWebPage(“http://www.google.com”);’>Click Me</a>
| 0 | [
2,
1132,
1136,
306,
118,
17213,
3496,
9,
850,
25699,
4104,
10922,
108,
1438,
778,
103,
834,
287,
6362,
13,
5,
7760,
6,
800,
3726,
3726,
31,
589,
452,
21,
374,
1183,
16,
6967,
1017,
14,
850,
25699,
4104,
10922,
108,
20,
170,
871,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ruby on rails delajed_job failing with rvm
===
I have delayed_job installed and I start the daemon to run the jobs with this ruby script
require 'rubygems'
require 'daemon_spawn'
$: << '.'
RAILS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
class DelayedJobWorker < DaemonSpawn::Base
def start(args)
ENV['RAILS_ENV'] ||= args.first || 'development'
Dir.chdir RAILS_ROOT
require File.join('config', 'environment')
Delayed::Worker.new.start
end
def stop
system("kill `cat #{RAILS_ROOT}/tmp/pids/delayed_job.pid`")
end
end
DelayedJobWorker.spawn!(:log_file => File.join(RAILS_ROOT, "log", "delayed_job.log"),
:pid_file => File.join(RAILS_ROOT, 'tmp', 'pids', 'delayed_job.pid'),
:sync_log => true,
:working_dir => RAILS_ROOT)
If I run the command with rvmsudo it works perfectly
If I simply use the ruby command without rvm it fails and this is the output, but I have no idea why this happens. Could you give me some clue?
Thank you
user@mysystem:~/redeal.it/application$ ruby script/delayed_job start production
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:16:in `kill': Operation not permitted (Errno::EPERM)
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:16:in `alive?'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:125:in `alive?'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:176:in `block in start'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:176:in `select'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:176:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/daemon-spawn-0.4.2/lib/daemon_spawn.rb:165:in `spawn!'
from script/delayed_job:37:in `<main>'
| 0 | [
2,
10811,
27,
2240,
18,
1506,
6881,
69,
1,
1636,
220,
7250,
29,
13,
10359,
79,
800,
3726,
3726,
31,
57,
8241,
1,
1636,
220,
4066,
17,
31,
799,
14,
13127,
20,
485,
14,
4844,
29,
48,
10811,
3884,
4077,
13,
22,
1820,
779,
20231,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is there faster Facebook API requests for a large amount of information?
===
<!-- language-all: lang-php -->
I am working on an Facebook application in PHP that fetches the location information of the user's friends. The application gets increasingly slow as the number of friends of the users increases. But the more friends' information I retrieve, the more accurate is the result.
I have tried to use the following ways to speed up the query:
$facebook->api('/locations?ids=uid1,uid2,uid3,...')
And I used this together with [batched requests](http://developers.facebook.com/docs/reference/api/batch/):
$batched_request = array(
array('method' => 'GET', 'relative_url' => '/locations?ids=uid1,uid2,uid3,...'),
array('method' => 'GET', 'relative_url' => '/locations?ids=uid11,uid12,uid13,...'),
array('method' => 'GET', 'relative_url' => '/locations?ids=uid21,uid22,uid23,...'),
...
);
$batch = $facebook->api('/?batch='.json_encode($batched_request), 'POST');
But still it takes at least **20 seconds** to get the location information from a random set of 100 friends of the user.
Actual Code Used
----------------
This part is fine. It gets done in just a few seconds.
$number_of_friends = "100"; // Set the maximum number of friends from which their location information is retrieved
$number_of_friends_per_request = 10; // Set the number of friends per request in the batch
$access_token = $facebook->getAccessToken();
// This is the excerpt of another batched request to get the friend ids
$request = '[{"method":"POST","relative_url":"method/fql.query?query=SELECT+uid,+name+FROM+user+WHERE+uid+IN(SELECT+uid2+FROM+friend+WHERE+uid1+=+me()+order+by+rand()+limit+'.$number_of_friends.')"}]';
$post_url = "https://graph.facebook.com/" . "?batch=" . urlencode($request) . "&access_token=" . $access_token . "&method=post";
$post = file_get_contents($post_url);
$decoded_response = json_decode($post, true);
$friends_json = $decoded_response[0]['body'];
$friends_data = json_decode($friends_json, true);
if (is_array($friends_data)) {
foreach ($friends_data as $friend) {
$selected_friend_ids[] = number_format($friend["uid"], 0, '.', ''); // Since there are exceptionally large id numbers
}
}
But this is problematic. It takes too long to receive a response from Facebook.
// Retrieve the locations of the user's friends using batched request
$i = 0;
$batched_request = array();
while ($i < ($number_of_friends/$number_of_friends_per_request)) {
$i++;
$friend_ids_variable_name = 'friend_ids_part_'.$i;
$$friend_ids_variable_name = array_slice($selected_friend_ids, ($i-1)*$number_of_friends_per_request, $number_of_friends_per_request);
if (!empty($$friend_ids_variable_name)) {
$api_string_ids_variable_name = 'api_string_ids_'.$i;
$$api_string_ids_variable_name = implode(',', $$friend_ids_variable_name);
$batched_request[] = array('method' => 'GET', 'relative_url' => '/locations?ids='.$$api_string_ids_variable_name);
}
}
$batch = $facebook->api('/?batch='.json_encode($batched_request), 'POST');
foreach ($batch as $batch_item) {
$body = $batch_item["body"];
$partial_friends_locations = json_decode($body, true);
foreach ($partial_friends_locations as $friend_id => $friend_locations_data) {
$friend_locations = $friend_locations_data["data"];
foreach ($friend_locations as $friend_location) {
// Process location information...
}
}
}
}
Is there a way to make the above request faster? I placed some codes to check the response time of the request and it is pretty slow.
- For 100 friends, it takes > 20 seconds on average.
- For 200 friends, it takes > 40 seconds on average.
- For 400 friends, it takes > 80 seconds on average, and I sometimes receive an error message: "Error Code: 1 Message: An unknown error occurred" | 0 | [
2,
25,
80,
4233,
9090,
21,
2159,
12279,
26,
21,
370,
2006,
16,
676,
60,
800,
3726,
3726,
13,
1,
187,
8,
8,
816,
8,
1233,
45,
4544,
8,
26120,
13,
8,
8,
1,
31,
589,
638,
27,
40,
9090,
3010,
19,
13,
26120,
30,
18312,
160,
14,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Naive Bayes matlab, row classification
===
How do you classify a row of seperate cells in matlab?
Atm I can classify single coloums like so:
training = [1;0;-1;-2;4;0;1]; % this is the sample data.
target_class = ['posi';'zero';'negi';'negi';'posi';'zero';'posi'];
% target_class are the different target classes for the training data; here 'positive' and 'negetive' are the two classes for the given training data
% Training and Testing the classifier (between positive and negative)
test = 10*randn(25, 1); % this is for testing. I am generating random numbers.
class = classify(test,training, target_class, 'diaglinear') % This command classifies the test data depening on the given training data using a Naive Bayes classifier
Unlike the above im looking at wanting to classify:
A B C
Row A | 1 | 1 | 1 = a house
Row B | 1 | 2 | 1 = a garden
Can anyone help? | 0 | [
2,
16288,
899,
160,
4277,
9086,
15,
3131,
4039,
800,
3726,
3726,
184,
107,
42,
25117,
21,
3131,
16,
10332,
106,
1373,
2934,
19,
4277,
9086,
60,
35,
79,
31,
92,
25117,
345,
13,
12805,
723,
18,
101,
86,
45,
838,
800,
636,
165,
73,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
printing python Post request
===
I am trying to print the POST request that I am doing using my python script. I was wondering if there is a way to print the post request so as to see how the parameters are passed through the script which I wish to compare it with the browser. I read through the urllib2 api but was not able to find a function that could help me in printing my POST request. Any pointers on this is greatly appreciated | 0 | [
2,
7312,
20059,
678,
3772,
800,
3726,
3726,
31,
589,
749,
20,
4793,
14,
678,
3772,
30,
31,
589,
845,
568,
51,
20059,
3884,
9,
31,
23,
5712,
100,
80,
25,
21,
161,
20,
4793,
14,
678,
3772,
86,
28,
20,
196,
184,
14,
12905,
50,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
OSX 10.8 mountain lion PEAR / PHPUnit not working
===
I have installed Mountain Lion and I can't get phpunit to work.
$ pear config-get bin_dir
/Users/greg/pear/bin
$cd /Users/greg/pear/bin
$ls
pear*
peardev*
pecl*
phpunit*
$phpunit
-bash: phpunit: command not found | 0 | [
2,
13,
759,
396,
332,
9,
457,
1286,
6023,
16619,
13,
118,
13,
26120,
15464,
52,
638,
800,
3726,
3726,
31,
57,
4066,
1286,
6023,
17,
31,
92,
22,
38,
164,
13,
26120,
15464,
20,
170,
9,
5579,
16619,
13,
14093,
2816,
8,
3060,
4511,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
The best way to get Facebook + twitter + GooglePlus status, with there api?
===
I need to code a PHP set of classes which can get and manipulate status of a member who has connected his facebook, twitter and Google plus account. I only need, for this step in my project, all status with there date of publication.
So, there's many ways :
- list libraries. One library per social network. (so many of it. and I can code one of my own)
- use a complex php framework (but with the need to learn the framework, but with no nee to learn a lot of each social network api)
...or something else ?
What do you think about that, and what do you know about that ?
... all cues are welcome. | 1 | [
2,
14,
246,
161,
20,
164,
9090,
2754,
10623,
2754,
8144,
13349,
1782,
15,
29,
80,
21,
2159,
60,
800,
3726,
3726,
31,
376,
20,
1797,
21,
13,
26120,
309,
16,
2684,
56,
92,
164,
17,
18468,
1782,
16,
21,
322,
72,
63,
2587,
33,
909... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Check if each element in a list match with a string in Python?
===
I am writing a simple if else loop to check if a string match with multiple words like this:
if "word1" in data or "word2" in data or "word3" in data:
....
I am not sure if we have a more comprehensive way to process this kind of comparison ?
Thank you very much | 0 | [
2,
2631,
100,
206,
4520,
19,
21,
968,
730,
29,
21,
3724,
19,
20059,
60,
800,
3726,
3726,
31,
589,
1174,
21,
1935,
100,
962,
5293,
20,
2631,
100,
21,
3724,
730,
29,
1886,
715,
101,
48,
45,
100,
13,
7,
9587,
165,
7,
19,
1054,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to get fixed quantization table from jpeg images snapped from a same camera
===
I am trying to extract Quantization Table values in c# from different camera images , the Quantization table values are supposed to same for a particular camera model , but what i found is that the Quantization tables are different for a same camera model . Can any body tell me the process of extracting QTables .
Thanks and Regards
Somu | 0 | [
2,
184,
20,
164,
3535,
9836,
38,
1829,
859,
37,
487,
20427,
3502,
4853,
37,
21,
205,
3336,
800,
3726,
3726,
31,
589,
749,
20,
10962,
9836,
38,
1829,
859,
4070,
19,
272,
5910,
37,
421,
3336,
3502,
13,
15,
14,
9836,
38,
1829,
859,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Apache POI only last cell is saved to a newly created file
===
So I am pulling data from select cells from sheets in an excel file and then trying to write it to another file. The data is being carried over fine inside the vatAdata array and from what I can tell its being written to the cell in the for loop because it prints out each cell after inserting into (just for debugging purposes). But when I open the file later only the last cell has data in it and all other cells are null. Any idea what is causing this issue?
for(int i=0;i<vatAdata.length;i++){
Cell cellInsert=sheet.createRow(rowIndex).createCell(colIndex+i);
cellInsert.setCellType(vatAtype[i]);
// System.out.println(cellInsert.);
if(vatAtype[i]==0){
cellInsert.setCellValue(Double.parseDouble(vatAdata[i]));
System.out.println(cellInsert.getNumericCellValue()+" written");
}
else{
cellInsert.setCellValue(vatAdata[i]);
System.out.println(cellInsert.getStringCellValue()+" written");
}
}
FileOutputStream out=new FileOutputStream("/home/chris/Documents/test.xlsx");
wb.write(out);
out.close(); | 0 | [
2,
17140,
2353,
49,
104,
236,
1667,
25,
4377,
20,
21,
2771,
679,
3893,
800,
3726,
3726,
86,
31,
589,
3303,
1054,
37,
5407,
2934,
37,
8801,
19,
40,
20700,
3893,
17,
94,
749,
20,
2757,
32,
20,
226,
3893,
9,
14,
1054,
25,
142,
15... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
find and replace whole line python
===
I have a file like this..
xxxxxxxxxxxxxxx
xxxxxxxxxxxxxxx
xxxxxxxxxxxxxxx
a b c invalid #seperated by tab
xxxxxxxxxxxxxxx
xxxxxxxxxxxxxxx
I need to replace `a b c invalid` to `a b reviewed rd # separated by tab`
Basically any line that ends with invalid, I need to replace that line with `reviewed rd // separated by tab` but I have to keep the first and second words on that line (only replace 3rd and 4th).
I have started doing something like this, but this won't exactly do what I want.
f1 = open('fileInput', 'r')
f2 = open('fileInput+".tmp"', 'w')
for line in f1:
f2.write(line.replace('invalid', ' reviewed'+\t+'rd'))
f1.close()
f2.close()
`regex` can be an option but I'm not that good with it yet. Can someone help.
| 0 | [
2,
477,
17,
3934,
979,
293,
20059,
800,
3726,
3726,
31,
57,
21,
3893,
101,
48,
9,
9,
13,
13290,
13290,
13290,
13290,
13290,
13,
13290,
13290,
13290,
13290,
13290,
13,
13290,
13290,
13290,
13290,
13290,
21,
334,
272,
16671,
6926,
870,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Bootstrap Dropdown Button within HoverCard
===
I'm using [hovercard][1] to display a small profile card of a user. Within this hovercard I am attempting to include a Twitter Bootstrap dropdown button.
The button is being included in the html and the css is working fine (along with the actual javascript to open the dropdown). The problem is that the dropdown's menu cannot be seen.
Take a look at the image for a better explanation:
![example problem][2]
The 2nd example hovercard is the default result. As you can see, a small portion of the dropdown menu is being shown, but for some reason it is being hidden by the bounds of the hovercard box.
In the 1st example, I've removed the default bootstrap css position option and the dropdown inherits a position of static. When static is used, the menu can be seen but it increases the size of the hovercard box.
What I need to have happen, is when the carrot is clicked have the dropdown box/list open "on top" of the hovercard and not expand the hovercard's dimensions but instead have the dropdown act as it's own object with its own dimensions.
As an aside - I have checked both z-index's of the hovercard and the dropdown and the dropdown's z-index is higher so that should not be the issue.
[1]: http://designwithpc.com/Plugins/Hovercard/
[2]: http://i.stack.imgur.com/ylHHQ.jpg | 0 | [
2,
5894,
16514,
2804,
2968,
5167,
363,
21350,
6648,
800,
3726,
3726,
31,
22,
79,
568,
636,
252,
2549,
6648,
500,
2558,
165,
500,
20,
3042,
21,
284,
5296,
2056,
16,
21,
4155,
9,
363,
48,
21350,
6648,
31,
589,
6314,
20,
468,
21,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Handle a big list of controls (dynamically remove and create new instance depending of the range view)
===
I need to implement a way to handle alot of controls in a panel without busting the capacity and only make one or no loading if possible.
I would like to have your opinion and your view about my solution and it's feasibility.
Does it possible to make a thread that actually dispose the control that are not in the range view and create new instance of one being in the range.
I'm thinking of a thread because i don't want the UI to be blocked. I just want to "Stream the control".
What is the best way of doing this ??
Thanks!! | 0 | [
2,
3053,
21,
580,
968,
16,
8671,
13,
5,
20985,
1326,
4681,
17,
1600,
78,
4851,
4758,
16,
14,
978,
1418,
6,
800,
3726,
3726,
31,
376,
20,
8713,
21,
161,
20,
3053,
21,
5639,
16,
8671,
19,
21,
4113,
366,
6943,
68,
14,
2301,
17,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
XML Schema Error: Required white space was missing
===
I have been searching on this for hours and can not figure out the issue. Could someone please help me with this? I am getting the above error when Executing a SQLXMLBULKLOAD in VB.NET 2010. I have attempted changing my xml declaration, my schema attributes, on and on and can not get past this error. It seems to be trivial but I can not figure it out. Please help
<?xml version="1.0" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xsd:element name="Employees" sql:is-constant="1">
<xsd:complexType>
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="Employee" sql:relation="the_Employees">
<xsd:complexType>
<xsd:sequence maxOccurs="unbounded">
<!--<xsd:element name="id" type="xsd:integer" />-->
<xsd:element name="EmployeeID"sql:field="EmpNo">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="FirstName"sql:field="FirstName">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LastName" sql:field="LastName">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="MiddleName" sql:field="MiddleName">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Empl_Status" sql:field="Status">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AccountName" sql:field="DomainLogin">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Email" sql:field="Email">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="JobCode" sql:field="JobCode">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="JobDescription" sql:field="JobDescription">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="HireDate" sql:field="HireDate" sql:datatype="dateTime" />
<xsd:element name="LastFiveSSN" sql:field="LastFiveSSN">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
<xsd:pattern value="[0-9][0-9][0-9][0-9][0-9]"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="BirthDate" sql:field="BirthDate" sql:datatype="dateTime" />
<xsd:element name="ManagerEmployeeID" sql:field="mgrEmpNo">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ManagerFirstName" sql:field="mgrFirstName">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ManagerLastName" sql:field="mgrLastName">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ManagerEmail" sql:field="mgrRmail">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="BU_Number" sql:field="SiteNumber">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="BU_Name" sql:field="SiteName">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="DepartmentNumber" sql:field="deptNumber">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="DepartmentName" sql:field="deptName">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="BU_Phone" sql:field="SitePhone">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="BU_SpeedDial" sql:field="SiteSpeedDial">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="CellPhone" sql:field="CellPhone">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="DivisionName" sql:field="DivisionName">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="RegionName" sql:field="RegionName">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="RDO_FirstName" sql:field="rdoFirstName">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="RDO_LastName" sql:field="rdoLastName">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="DDOS_FirstName" sql:field="ddosFirstName">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="DDOS_LastName" sql:field="ddosLastName">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:whiteSpace value="collapse"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema> | 0 | [
2,
23504,
23874,
7019,
45,
1390,
359,
726,
23,
2863,
800,
3726,
3726,
31,
57,
74,
5792,
27,
48,
26,
974,
17,
92,
52,
1465,
70,
14,
1513,
9,
110,
737,
2247,
448,
55,
29,
48,
60,
31,
589,
1017,
14,
784,
7019,
76,
25836,
21,
44... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Programmatically scrolling a Windows edit control
===
Is there any way to programmatically scroll a single-line edit control in Windows?
For example, if the text in an edit control is too large to display at once, then the default behavior when the edit control gets the focus is to select all text and show the end of the text. I'd like to instead show the beginning of the text (while still leaving all text selected). | 0 | [
2,
625,
6732,
1326,
13,
28166,
21,
1936,
9392,
569,
800,
3726,
3726,
25,
80,
186,
161,
20,
625,
6732,
1326,
12159,
21,
345,
8,
1143,
9392,
569,
19,
1936,
60,
26,
823,
15,
100,
14,
1854,
19,
40,
9392,
569,
25,
266,
370,
20,
304... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Get random value from array - PHP
===
I have an array that outputs the following:
Array ( [roi_data] => Array ( [0] => Array ( [title] => Test ROI ) [1] => Array ( [title] => Another ROI ) ) )
I'd like to combine all the keys with title into one array and then echo a random value out of it.
I have tried using array_rand but I just get the word Array appear.
Thanks.
| 3 | [
2,
164,
5477,
1923,
37,
7718,
13,
8,
13,
26120,
800,
3726,
3726,
31,
57,
40,
7718,
30,
5196,
18,
14,
249,
45,
7718,
13,
5,
636,
661,
49,
1,
18768,
500,
800,
1,
7718,
13,
5,
636,
387,
500,
800,
1,
7718,
13,
5,
636,
22235,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to check if an object is not a native type in Ruby?
===
In Ruby, what's the best way to determine if an object belongs to a user or gem-defined class, as opposed to a native type (such as Object, String, Hash, Numeric, etc.)? | 0 | [
2,
184,
20,
2631,
100,
40,
3095,
25,
52,
21,
1275,
1001,
19,
10811,
60,
800,
3726,
3726,
19,
10811,
15,
98,
22,
18,
14,
246,
161,
20,
3746,
100,
40,
3095,
7034,
20,
21,
4155,
54,
8551,
8,
13439,
718,
15,
28,
3499,
20,
21,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Executing a shell command within PHP
===
On the terminal, I run this successfully within the web application's directory:
pdftohtml -c -noframes "documents/document1.pdf"
Now I want to do this through PHP, so I wrote a ``shell.sh`` file that looks like this:
sudo pdftohtml -c -noframes "documents/$file"
exit 0
Then I wrote this in php:
$output = shell_exec("file='document1.pdf' shell.sh");
It doesn't work, I expect to see html files generated, but I get some empty html files..since the command worked fine through the terminal, then I think the problem is in the way I execute it from php
echoing $output doesn't show anything.. what do I do wrong? | 0 | [
2,
25836,
21,
3593,
1202,
363,
13,
26120,
800,
3726,
3726,
27,
14,
3855,
15,
31,
485,
48,
3673,
363,
14,
2741,
3010,
22,
18,
16755,
45,
13,
11124,
262,
15895,
13,
8,
150,
13,
8,
251,
8361,
18,
13,
7,
28132,
18,
118,
28132,
165... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Link latest file on Bitbucket Git repository
===
I have a public Git repository on Bitbucket. I want to link the latest version of a Read-Me file. Here's the link to a revision/commit:
[https://bitbucket.org/wordless/thofu-interpreter/raw/5bfc37864c5d/ThoFu%20Interpreter/ReadMe.txt][1]
I tried to replace the revision number with **tip** and **default**, but it didn't work. **Is there any way to get a permanent link to my latest files?**
[1]: https://bitbucket.org/wordless/thofu-interpreter/raw/5bfc37864c5d/ThoFu%20Interpreter/ReadMe.txt | 0 | [
2,
3508,
5736,
3893,
27,
1142,
11925,
1198,
13,
10404,
24869,
800,
3726,
3726,
31,
57,
21,
317,
13,
10404,
24869,
27,
1142,
11925,
1198,
9,
31,
259,
20,
3508,
14,
5736,
615,
16,
21,
1302,
8,
790,
3893,
9,
235,
22,
18,
14,
3508,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Sharepoint 2010 - webpart treeview is not working
===
Hi I am using sharepoint 2010 and am creating a tree view in a webpart to display items from a document library. This code isn't working for me, its displaying everything in the same web...
I would like to be able to specify which document library to use.
Also it puts in duplicate nodes in, so if I go to editpage, it adds a duplicate, if I leave edit mode it adds another duplicate.![enter image description here][1]
Can anyone help?
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;
using System.Web;
using System.IO;
namespace VisualWebPartProject1.VisualWebPart1
{
public partial class VisualWebPart1UserControl : UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
SPWeb thisWeb = null;
TreeNode node;
using (thisWeb = SPContext.Current.Web)
{
//Add the Web's title as the display text for the tree node, and add the URL as the NavigateUri.
node = new TreeNode(thisWeb.Title, null, null, thisWeb.Url, "_self");
//The Visual Web Part has a treeview control called siteStructure.
siteStructure.Nodes.Add(node);
//Get a reference to the current node, so child nodes can be added in the correct position.
TreeNode parentNode = node;
//Iterate through the Lists collection of the Web.
/*
foreach (SPListItem item in myList.Items)
{
SPFieldUrlValue data = item["Url"] as SPFieldUrlValue;
// now you have data.Description, data.Url
node = new TreeNode(Path.GetFileName(data.Url), null, null, data.Url, "_self");
parentNode.ChildNodes.Add(node);
}
*/
foreach (SPList list in thisWeb.Lists)
{
if (!list.Hidden)
{
node = new TreeNode(list.Title, null, null, list.DefaultViewUrl, "_self");
parentNode.ChildNodes.Add(node);
}
}
foreach (SPWeb childWeb in thisWeb.Webs)
{
//Call our own helper function for adding each child Web to the tree.
addWebs(childWeb, parentNode);
childWeb.Dispose();
}
siteStructure.CollapseAll();
}
}
void addWebs(SPWeb web, TreeNode parentNode)
{
TreeNode node;
node = new TreeNode(web.Title, null, null, web.Url, "_self");
parentNode.ChildNodes.Add(node);
parentNode = node;
foreach (SPList list in web.Lists)
{
if (!list.Hidden)
{
node = new TreeNode(list.Title, null, null, list.DefaultViewUrl, "_self");
parentNode.ChildNodes.Add(node);
}
}
foreach (SPWeb childWeb in web.Webs)
{
//Call the addWebs() function from itself (i.e. recursively)
//to add all child Webs until there are no more to add.
addWebs(childWeb, parentNode);
childWeb.Dispose();
}
}
}
}
[1]: http://i.stack.imgur.com/eefFB.jpg | 0 | [
2,
1891,
3132,
498,
13,
8,
2741,
3091,
1541,
4725,
25,
52,
638,
800,
3726,
3726,
4148,
31,
589,
568,
1891,
3132,
498,
17,
589,
2936,
21,
1541,
1418,
19,
21,
2741,
3091,
20,
3042,
3755,
37,
21,
4492,
1248,
9,
48,
1797,
2532,
22,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
run async task again after cancelling, is there a way?
===
What happens is, I am fetching the data from web service. Simultaneously 6 async tasks are running to get 6 different things. The problem is When first async task starts executing and I log out, and when I log in with different user, the first async task doesn't execute again. Am i forgetting something or it is this way only. How can I make the first async task execute again.? | 0 | [
2,
485,
21,
9507,
150,
3005,
188,
75,
14815,
802,
15,
25,
80,
21,
161,
60,
800,
3726,
3726,
98,
5531,
25,
15,
31,
589,
18312,
68,
14,
1054,
37,
2741,
365,
9,
6888,
400,
21,
9507,
150,
8674,
50,
946,
20,
164,
400,
421,
564,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Multiple HTTP Connections (Segmented/Swarm Downloading) to download the same file in Android
===
I'm currently working on creating a Download Manager for Android. In order to optimize the download I need to download the same file using multiple connections to the server. (ie. the same technique used in Internet Download Manager used in Windows.)
The thing is I don't know how to create several HTTP connections and download the same file. I hope you can help me.. Thanks in advance! | 0 | [
2,
1886,
7775,
6760,
13,
5,
28857,
69,
118,
18,
1885,
79,
7121,
68,
6,
20,
7121,
14,
205,
3893,
19,
13005,
800,
3726,
3726,
31,
22,
79,
871,
638,
27,
2936,
21,
7121,
1382,
26,
13005,
9,
19,
389,
20,
22864,
14,
7121,
31,
376,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Pase (extract) content from a html page using .net
===
I need to parse/extract information from an html page.
Basically what I'm doing is loading the page as a string using System.Net.WebClient and using HTML Agility Pack to get content inside html tags (forms, labels, imputs and so on).
However, some content is inside a javascript code like this:
<script type="text/javascript">
//<![CDATA[
var itemCol = new Array();
itemCol[0] = {
pid: "01010101",
Desc: "Some desc",
avail: "Available",
price: "$10.00"
};
itemCol[1] = {
pid: "01010101",
Desc: "Some desc",
avail: "Available",
price: "$10.00"
};
//]]>
</script>
So, how could I parse it to a collection in .NET? Does HTML Agility Pack can help with that?
I really appreciate any help;
Thanks in advance.
| 0 | [
2,
5750,
62,
13,
5,
1706,
19915,
6,
2331,
37,
21,
13,
15895,
2478,
568,
13,
9,
2328,
800,
3726,
3726,
31,
376,
20,
2017,
870,
118,
1706,
19915,
676,
37,
40,
13,
15895,
2478,
9,
11374,
98,
31,
22,
79,
845,
25,
12797,
14,
2478,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Return all matching relationships in cypher
===
I want to retrieve a set of nodes who share an common node in between using difference relationships that can have matching properties. The query I think will look something like this:
start
n1=node(8)
match
n1-[r1]->value<-[r2]-object
where
all(x in relationship(r1)
where all(y in relationship(r2) where x.name==y.name))
return
object
but cypher returns `SyntaxException: unknown function` when I run this. Is there any way this type of query can be done? | 0 | [
2,
788,
65,
10120,
5833,
19,
18619,
1694,
800,
3726,
3726,
31,
259,
20,
11917,
21,
309,
16,
16272,
72,
1891,
40,
757,
15421,
19,
128,
568,
2841,
5833,
30,
92,
57,
10120,
3704,
9,
14,
25597,
31,
277,
129,
361,
301,
101,
48,
45,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
c:forEach construct and array
===
I use .xhtml in seam with jstl jsf and richfaces things.
In one .xhtml file I display some buttons over my page using c:forEach constructor.
Data are taken from a bean.
<c:forEach items="#{myBean.getSkds()}" var="skd">
<a4j:commandLink value="#{skd.getLabel()}" ... />
</c:forEach>
In another piece of the page I change the skds of myBean and rerender all the page.
<a4j:commandButton action="#{myBean.changeSkds()}"
image="/img/ico_change.gif"
reRender="allPanels"
/>
The strange thing I see is:
1st call display is all correct with my 4 buttons (commandLink).
2nd call must display 10 buttons, but I see the 4 of before and only 6 new buttons.
1st ->>> a b c d
2nd ->>> a b c d 5 6 7 8 9 10
instead of:
2nd ->>> 1 2 3 4 5 6 7 8 9 10
How can I do this?
I tryed using ui:repeat constructor, but I see in second call "a b c d", that's the same of the first call. | 0 | [
2,
272,
45,
1106,
14322,
6960,
17,
7718,
800,
3726,
3726,
31,
275,
13,
9,
396,
15895,
19,
13927,
29,
487,
18,
7786,
487,
18,
410,
17,
2042,
6413,
18,
564,
9,
19,
53,
13,
9,
396,
15895,
3893,
31,
3042,
109,
12861,
84,
51,
2478,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
can the value being calculated in a particular query be used in another query?
===
I am calculating one parameter(X) this way:
<?php
$link=mysql_connect("localhost","root","");
mysql_select_db("hand");
$result = mysql_query("select * from sessions",$link);
$num_calls = mysql_num_rows($result);
echo '<br/>'."\n Total X :\n $num_calls ".'<br/>';
?>
I am calculating another parameter(Y) this way:
<?php
mysql_connect("localhost","root","");
mysql_select_db("hand");
$result = mysql_query("SELECT * FROM cars WHERE start_at > TIMESTAMPADD(WEEK, -4, CURDATE()) AND TIMESTAMPDIFF(MINUTE, start_at, end_at) > 5");
$num_rows = mysql_num_rows($result);
echo '<br/>'."\n Total Y :\n $num_rows ".'<br/>';
?>
At another place I need the to calculate the ration X/Y. How do I do that as it need to be done in another field in the same html page.
| 0 | [
2,
92,
14,
1923,
142,
10785,
19,
21,
1498,
25597,
44,
147,
19,
226,
25597,
60,
800,
3726,
3726,
31,
589,
22937,
53,
18906,
5,
396,
6,
48,
161,
45,
13,
1,
60,
26120,
5579,
6258,
3726,
915,
18,
22402,
1,
25996,
5,
7,
15580,
1169... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Converting an XElement to Datatable .Cannot get it right
===
Cannot seem to loop through the XElement and build a datatable.
My XElement will be built at runtime so I dont know what the look like in advance
I am trying to convert whatever is in a XElement to a datatable so that I can bind it to a datagriview.
Any ideas what I am doing wrong?
static void Main()
{
//at runtime could be any object
const string testXElement = @"<MyObject xmlns=""http://www.test.com/"">
<code>Test</code>
<Date>2012-06-24T00:00:00+01:00</Date>
<Name>John</Name>
</MyObject>";
XElement element = XElement.Parse(testXElement);
var dgv=new DataGridView();
//Build dataTable from it or
var dt=new DataTable();
XNamespace ns = "http://www.test.com/";
foreach (var x in element.Elements(ns + "MyObject"))
{
// I am never stepping into this one.
DataColumn dc=new DataColumn();
dc.ColumnName = x.Name.ToString();
DataRow row = dt.NewRow();
row[dc] = x.Value;
}
dgv.DataSource = dt;
}
| 0 | [
2,
19583,
40,
993,
27567,
20,
1054,
5924,
13,
9,
1245,
1270,
164,
32,
193,
800,
3726,
3726,
1967,
2260,
20,
5293,
120,
14,
993,
27567,
17,
1895,
21,
1054,
5924,
9,
51,
993,
27567,
129,
44,
392,
35,
485,
891,
86,
31,
1049,
143,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Jquery Mobile - IPad types text boxes
===
If you look at links like:
http://www.google.com/imgres?q=ipad+text+box&um=1&hl=en&sa=N&biw=995&bih=507&tbm=isch&tbnid=F3QIWenNGlDtsM:&imgrefurl=http://www.uwec.edu/Help/email/Apple-Mobile-Devices.htm&docid=3QJ1DqCNFL0dPM&imgurl=http://www.uwec.edu/Help/General/images/Exchangeinfo_2.PNG&w=503&h=340&ei=68roT-eILOGW2QWZ-9yNCw&zoom=1
you will see an ipad type of text boxes.Notice how the label is actually inside of the button. I was wondering if there is something similar in JQuery Mobile as I have not seen how to do this. | 0 | [
2,
487,
8190,
93,
3241,
13,
8,
31,
8240,
2551,
1854,
8120,
800,
3726,
3726,
100,
42,
361,
35,
6271,
101,
45,
7775,
6903,
6483,
9,
16111,
4875,
9,
960,
118,
1660,
6879,
18,
60,
1251,
3726,
49,
8240,
2430,
11969,
2430,
5309,
1569,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Will expressions break if it is unnecessary to continue?
===
Lets say I have
if (textbox.Text != null && textbox.Text.Length > someNum)
{
//some code
}
If textbox.Text is null, will it crash because null.Length doesn't work or will it break after the first expression because the operator is && and there's no point continuing? | 0 | [
2,
129,
13832,
1442,
100,
32,
25,
16435,
20,
1816,
60,
800,
3726,
3726,
6884,
395,
31,
57,
100,
13,
5,
11969,
5309,
9,
11969,
13,
187,
3726,
16203,
279,
1569,
1854,
5309,
9,
11969,
9,
6325,
13,
1,
109,
6336,
6,
13,
1,
12894,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Apace Error log. Log only for part of server
===
I'm running debian on a VPS server, and have both the development and production code and database on the same server.
Is it possible to get the server to log only the errors for the development part of the server, and not the production. Right now, there are so many errors being logged from the production side, which makes it hard to get to the development errors.
Thanks in advance | 0 | [
2,
21,
10055,
62,
7019,
6738,
9,
6738,
104,
26,
141,
16,
8128,
800,
3726,
3726,
31,
22,
79,
946,
121,
10035,
27,
21,
13,
10924,
18,
8128,
15,
17,
57,
156,
14,
522,
17,
637,
1797,
17,
6018,
27,
14,
205,
8128,
9,
25,
32,
938,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why doesn't the EDMX update not null to nullable and vice versa?
===
Always happens -- using EF 4.3.1 (really it goes back to 4.0 anyway) -- say, when I change a column in SQL Server to not null, and then do an Update model in the edmx, it never updates or removes the Nullable attribute so have to do it manually. Wonder why it was like this: is it a bug or just a feature that no one bothered to fix due to perhaps XML parsing problems or what? Inquiring minds want to know.
I can see elsewhere here that there's a quick way: just delete the table and then re-adding it via update model -- but -- for 55 tables? ;-) | 0 | [
2,
483,
1437,
22,
38,
14,
13,
69,
79,
396,
11100,
52,
16203,
20,
16203,
579,
17,
1821,
18596,
60,
800,
3726,
3726,
550,
5531,
13,
8,
8,
568,
11599,
268,
9,
240,
9,
165,
13,
5,
15257,
32,
1852,
97,
20,
268,
9,
387,
2774,
6,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Creating Dynamic Objects With No User Input
===
I have a program that creates a random amount of points interspersed throughout the program. While it runs, I would also like to create an object for each point and store it in a vector. I have created a Point class with various attributes but I have no idea on how to implement the above. When looking at other questions that deal with similar, yet nonidentical problems, pointers are used, but again, I have no idea on how to implement them. | 0 | [
2,
2936,
7782,
3916,
29,
90,
4155,
6367,
800,
3726,
3726,
31,
57,
21,
625,
30,
9695,
21,
5477,
2006,
16,
819,
27320,
892,
14,
625,
9,
133,
32,
1461,
15,
31,
83,
67,
101,
20,
1600,
40,
3095,
26,
206,
454,
17,
1718,
32,
19,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Handlebars helpers naming convention
===
On my server side Handlebars implementation (Handlebars.java) I can reference partials directory style, e.g.
{{> /common/header}}
However, in my front end Handlebars implementation (YUI), where I have to register partials explicitly, this results in an exception because the partial name contains separator chars. I'm wondering which one is "right" and what is the accepted convention to work with partials, assuming you want to be able to have some kind of directory structure. | 0 | [
2,
3053,
1850,
18,
448,
445,
10929,
3087,
800,
3726,
3726,
27,
51,
8128,
270,
3053,
1850,
18,
6123,
13,
5,
3203,
413,
1850,
18,
9,
1004,
1385,
6,
31,
92,
2801,
7284,
18,
16755,
1034,
15,
13,
62,
9,
263,
9,
13,
1,
13,
118,
17... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Ckeditor with autocomplete?
===
Is it possible to implement jquery autocomplete somehow into ckeditor? Creating a button is not that hard, but is it possible to hardwire that to autocomplete, so the next word that is being typed until the button is pressed again...?
Anyone, who did remotely something like that, please let me know. Or if that's not possible, a popup window of an autocomplete search, and then on click/select it'd add that selected item to ckeditor textarea/current cursor position (maybe as a link...)?
Trying not to overreach of course :) | 0 | [
2,
13,
2601,
13401,
29,
3108,
15990,
60,
800,
3726,
3726,
25,
32,
938,
20,
8713,
487,
8190,
93,
3108,
15990,
3625,
77,
13,
2601,
13401,
60,
2936,
21,
5167,
25,
52,
30,
552,
15,
47,
25,
32,
938,
20,
552,
13482,
30,
20,
3108,
15... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
calculating elapsed time in vb.net
===
`main()
{
clock_t start, end;
double elapsed;
start = clock();
/* some function */
end = clock();
elapsed = ((double) (end - start)) / CLOCKS_PER_SEC;
}`
calculating elapsed time in vb.net. I have no idea of vb.net, i need the following c program in vb.net. please convert the following c program to vb.net and i want the elapsed time to show no of days when the elapsed time exceeds 24 hours. Thank you so much | 1 | [
2,
22937,
13,
62,
17057,
43,
85,
19,
13,
20468,
9,
2328,
800,
3726,
3726,
13,
1,
6232,
5,
6,
13,
1,
4229,
1,
38,
799,
15,
241,
73,
1494,
13,
62,
17057,
43,
73,
799,
800,
4229,
5,
6,
73,
13,
118,
2483,
109,
1990,
1637,
118,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Xcode how do I go to a specific view in the view did load if the application was not shutdown completely
===
I searched around the internet but found nothing that helped..
I have an app with multiple views. I would like to have it so if the user is on a specific view other than the start view and he/she presses the "Home Button" and then open the application again it would automatically go to the start view instead of where he left off.
Anything would be greatly appreciated
- Philip | 0 | [
2,
993,
9375,
184,
107,
31,
162,
20,
21,
1903,
1418,
19,
14,
1418,
144,
6305,
100,
14,
3010,
23,
52,
28450,
1524,
800,
3726,
3726,
31,
9036,
140,
14,
2620,
47,
216,
626,
30,
1456,
9,
9,
31,
57,
40,
4865,
29,
1886,
4146,
9,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
NullPointerException when i call a class from an android service
===
This is my first Android App. I'm trying to call a function in a service from a different class i am using foursquare API. I tried this function earlier in an activity and it worked perfectly but in a service im getting a NullPointerException.
This is the code i am using:
public class GuideMeService extends Service implements LocationListener {
LocationManager locationManager;
Geocoder geocoder;
// private CalendarContentResolver Calendar;
public FoursquareApp mFsqApp;
public ArrayList<FsqVenue> mNearbyList;
private static String TAG = "Service Class";
double lat;
double lng;
public static final String[] FIELDS = { CalendarContract.Calendars.NAME,
CalendarContract.Calendars.CALENDAR_DISPLAY_NAME,
CalendarContract.Calendars.CALENDAR_COLOR,
CalendarContract.Calendars.VISIBLE };
public static ArrayList<String> Events = new ArrayList<String>();
public static final Uri CALENDAR_URI = Uri
.parse("content://com.android.calendar/calendars");
public static final Uri EVENTS_URI = Uri
.parse("content://com.android.calendar/events");
private static final long MINIMUM_DISTANCE_CHANGE_FOR_UPDATES = 1; // in Meters
private static final long MINIMUM_TIME_BETWEEN_UPDATES = 1000; // in Milliseconds
public static String query = "";
Set<String> calendars = new HashSet<String>();
@Override
public IBinder onBind(Intent arg0) {
return null;
}
@Override
public void onStart(Intent intent, int startId) {
super.onStart(intent, startId);
Log.d(TAG, "GuideMe Servise started");
//this.stopSelf();
locationManager = (LocationManager)this.getSystemService(LOCATION_SERVICE);
locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER,
MINIMUM_TIME_BETWEEN_UPDATES,
MINIMUM_DISTANCE_CHANGE_FOR_UPDATES,
new MyLocationListener()
);
Events = readCalendarEvent(getApplicationContext());
for(int i = 0 ; i < Events.size() ; i++){
query += Events.toArray()[i].toString() + " ";
}
Thread thread = new Thread()
{
@Override
public void run() {
try {
Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
mNearbyList = mFsqApp.SearchBykeyword(location.getLatitude(), location.getLongitude(), query);
}catch (Exception e) {
e.printStackTrace();
}
}
};
thread.start();
}
Im getting The error on this line :
mNearbyList = mFsqApp.SearchBykeyword(location.getLatitude(), location.getLongitude(), query);
And this is the function i'm calling in the mFsqApp class:
public ArrayList<FsqVenue> SearchBykeyword(double latitude, double longitude, String query) throws Exception {
ArrayList<FsqVenue> venueList = new ArrayList<FsqVenue>();
try {
String ll = String.valueOf(latitude) + "," + String.valueOf(longitude);
URL url = new URL(API_URL + "/venues/search?ll=" + ll + "&query=" + query + "&radius=" + 50 + "&oauth_token=" + mAccessToken + "&v=20120610");
Log.d(TAG, "Opening URL " + url.toString());
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setRequestMethod("GET");
urlConnection.setDoInput(true);
//urlConnection.setDoOutput(true);
urlConnection.connect();
String response = streamToString(urlConnection.getInputStream());
JSONObject jsonObj = (JSONObject) new JSONTokener(response).nextValue();
JSONArray groups = (JSONArray) jsonObj.getJSONObject("response").getJSONArray("groups");
int length = groups.length();
if (length > 0) {
for (int i = 0; i < length; i++) {
JSONObject group = (JSONObject) groups.get(i);
JSONArray items = (JSONArray) group.getJSONArray("items");
int ilength = items.length();
for (int j = 0; j < ilength; j++) {
JSONObject item = (JSONObject) items.get(j);
FsqVenue venue = new FsqVenue();
venue.id = item.getString("id");
venue.name = item.getString("name");
JSONObject location = (JSONObject) item.getJSONObject("location");
Location loc = new Location(LocationManager.GPS_PROVIDER);
loc.setLatitude(Double.valueOf(location.getString("lat")));
loc.setLongitude(Double.valueOf(location.getString("lng")));
venue.location = loc;
//venue.address = location.getString("address");
venue.distance = location.getInt("distance");
//venue.herenow = item.getJSONObject("hereNow").getInt("count");
venue.type = group.getString("type");
venueList.add(venue);
}
}
}
} catch (Exception ex) {
throw ex;
}
return venueList;
} | 0 | [
2,
16203,
3132,
106,
10066,
872,
76,
31,
645,
21,
718,
37,
40,
13005,
365,
800,
3726,
3726,
48,
25,
51,
64,
13005,
4865,
9,
31,
22,
79,
749,
20,
645,
21,
1990,
19,
21,
365,
37,
21,
421,
718,
31,
589,
568,
222,
12300,
21,
215... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can i specified global varieble in module's name scope?
===
I have file f.py:
def func():
if 'x' not in globals():
setattr(f, 'x', 0)
global x
x += 10
print x
I am in interactive session:
>>> import f
>>> f.func()
Traceback (most recent call last):
[...]
NameError: global name 'x' is not defined
How function `func` should look like to specified 'x' variable if it is not defined?
| 0 | [
2,
184,
92,
31,
9931,
2062,
4033,
660,
2854,
19,
12613,
22,
18,
204,
9914,
60,
800,
3726,
3726,
31,
57,
3893,
398,
9,
6448,
45,
6312,
2414,
150,
5,
6,
45,
100,
13,
22,
396,
22,
52,
19,
2062,
18,
5,
6,
45,
309,
10303,
139,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
cvCapture and directshow
===
I need to read an avi file and process data from it in OpenCV.
Should I use cvCapture or directshow?
What are the criterions?
What are the advantages of each?
Thanks | 0 | [
2,
13,
12732,
4666,
6418,
17,
1744,
9303,
800,
3726,
3726,
31,
376,
20,
1302,
40,
13,
5271,
3893,
17,
953,
1054,
37,
32,
19,
368,
12732,
9,
378,
31,
275,
13,
12732,
4666,
6418,
54,
1744,
9303,
60,
98,
50,
14,
21991,
18,
60,
98... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Converting Lookup<TKey, TElement> into other data structers C#
===
I have a Lookup<TKey, TElement>, where the TElement refers to a string of words. I want to convert Lookup <TKey, TElement> into some other data structure such as: Dictionary<int ,string []> or List<List<string>>? I have read some articles about using the Lookup<TKey, TElement>, but it wasn't enough for me to understand. Thanks in advance. | 0 | [
2,
19583,
361,
576,
1,
38,
4237,
15,
4338,
1130,
1,
77,
89,
1054,
13,
10346,
445,
272,
5910,
800,
3726,
3726,
31,
57,
21,
361,
576,
1,
38,
4237,
15,
4338,
1130,
1,
15,
113,
14,
4338,
1130,
3806,
20,
21,
3724,
16,
715,
9,
31,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
implemented compare but got exception when calling Arrays.sort
===
Here is my class:
public static class __9_7_Person implements Comparator<__9_7_Person> {
private int height;
private int weight;
public __9_7_Person(int height, int weight) {
this.height = height;
this.weight = weight;
}
public int compare(__9_7_Person p1, __9_7_Person p2) {
if (p1.height != p2.height) {
return p1.height - p2.height;
}
else {
return p1.weight - p2.weight;
}
}
}
I then created an array like this:
__9_7_Person p[] = {new __9_7_Person(60, 100),
new __9_7_Person(70, 150),
new __9_7_Person(56, 90),
new __9_7_Person(75, 190),
new __9_7_Person(60, 95),
new __9_7_Person(68, 110),
};
But got exception when I called Arrays.sort(p): "Exception in thread "main" java.lang.ClassCastException: ch_9$__9_7_Person cannot be cast to java.lang.Comparable" | 0 | [
2,
6807,
11590,
47,
330,
5391,
76,
2555,
7718,
18,
9,
22843,
800,
3726,
3726,
235,
25,
51,
718,
45,
317,
12038,
718,
13,
1,
518,
1,
465,
1,
7276,
8713,
18,
6479,
512,
3457,
1,
518,
1,
465,
1,
7276,
1,
13,
1,
932,
19,
38,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Java library for detecting list items on webpages
===
Most of the webpages now-a-days contain lists of things, or chunks of html patterns that repeat a lot.
For example:
1. Facebook status messages on homepages.
2. Digg/Hacker News
3. StackOverflow homepage
Is there a Java library for detecting such lists. It will involve some amount of pattern matching and intelligence. Thanks. | 0 | [
2,
8247,
1248,
26,
9092,
68,
968,
3755,
27,
2741,
6486,
18,
800,
3726,
3726,
127,
16,
14,
2741,
6486,
18,
130,
8,
58,
8,
1185,
18,
3717,
7227,
16,
564,
15,
54,
15009,
18,
16,
13,
15895,
6282,
30,
6830,
21,
865,
9,
26,
823,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
IE8 Favicon Issues
===
So, I have been asked to fix an issue where a favicon isn't appearing in IE8 at work, but can't seem to figure out why it isn't working. I've even read the official Microsoft documentation on the subject, but haven't managed to get anywhere with this.
I have included the following in head of the site template, where $sitebase is set to http://www.slinkynote.com/ in the config file. The favicon image is a 32px by 32px .ico file.
<link href="<?php echo $site_base;?>favicon.ico" rel="shortcut icon" type="image/x-icon"/>
<link href="<?php echo $site_base;?>favicon.ico" rel="icon" type="image/vnd.microsoft.icon" />
Does anyone have any experience with this issue? It appears fine in FF and Chrome.
Thanks,
Dan. | 0 | [
2,
13,
660,
457,
1399,
6199,
218,
1549,
800,
3726,
3726,
86,
15,
31,
57,
74,
411,
20,
6098,
40,
1513,
113,
21,
1399,
6199,
218,
2532,
22,
38,
4870,
19,
13,
660,
457,
35,
170,
15,
47,
92,
22,
38,
2260,
20,
1465,
70,
483,
32,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
what is style="display:none" in wml
===
I have a pixel tracking.
For xhtml format it looks like
<img src="someurl" height="1" width="1" style="display:none"/>
How can i set the same style in wml format.
Since now my wml is not working with display:none style | 0 | [
2,
98,
25,
1034,
3726,
7,
2906,
5438,
45,
15746,
7,
19,
619,
8184,
800,
3726,
3726,
31,
57,
21,
18146,
10353,
9,
26,
993,
15895,
2595,
32,
1879,
101,
13,
1,
1660,
263,
13,
18,
5453,
3726,
7,
3220,
911,
255,
7,
2947,
3726,
7,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.