unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Entity Framework Code First: NULL values inserted in database
===
I am using Entity Framework Code First Approach. I have following code to insert data into PaymentComponent and Payment tables. The data getting inserted into PaymentComponent table is not proper. It has NULL values in two columns (for one record) even though the corresponding properties in the domain objects are not null. What need to be changed in order to make it working?
![enter image description here][1]
static void Main(string[] args)
{
string connectionstring = "Data Source=.;Initial Catalog=NerdDinners;Integrated Security=True;Connect Timeout=30";
using (var db = new NerdDinners(connectionstring))
{
GiftCouponPayment giftCouponPayment = new GiftCouponPayment();
giftCouponPayment.MyValue=250;
giftCouponPayment.MyType = "GiftCouponPayment";
ClubCardPayment clubCardPayment = new ClubCardPayment();
clubCardPayment.MyValue = 5000;
clubCardPayment.MyType = "ClubCardPayment";
List<PaymentComponent> comps = new List<PaymentComponent>();
comps.Add(giftCouponPayment);
comps.Add(clubCardPayment);
var payment = new Payment { PaymentComponents = comps, PayedTime=DateTime.Now };
db.Payments.Add(payment);
int recordsAffected = db.SaveChanges();
}
}
DOMAIN CODE
public abstract class PaymentComponent
{
public int PaymentComponentID { get; set; }
public abstract int MyValue { get; set; }
public abstract string MyType { get; set; }
public abstract int GetEffectiveValue();
}
public partial class GiftCouponPayment : PaymentComponent
{
private int couponValue;
private string myType;
public override int MyValue
{
get
{
return this.couponValue;
}
set
{
this.couponValue = value;
}
}
public override string MyType
{
get
{
return this.myType;
}
set
{
this.myType = value;
}
}
public override int GetEffectiveValue()
{
if (this.PaymentComponentID < 2000)
{
return 0;
}
return this.couponValue;
}
}
public partial class ClubCardPayment : PaymentComponent
{
private int cardValue;
private string myType;
public override int MyValue
{
get
{
return this.cardValue;
}
set
{
this.cardValue = value;
}
}
public override string MyType
{
get
{
return this.myType;
}
set
{
this.myType = value;
}
}
public override int GetEffectiveValue()
{
return this.cardValue;
}
}
public partial class Payment
{
public int PaymentID { get; set; }
public List<PaymentComponent> PaymentComponents { get; set; }
public DateTime PayedTime { get; set; }
}
//System.Data.Entity.DbContext is from EntityFramework.dll
public class NerdDinners : System.Data.Entity.DbContext
{
public NerdDinners(string connString): base(connString)
{
}
protected override void OnModelCreating(DbModelBuilder modelbuilder)
{
modelbuilder.Conventions.Remove<PluralizingTableNameConvention>();
}
public DbSet<GiftCouponPayment> GiftCouponPayments { get; set; }
public DbSet<Payment> Payments { get; set; }
}
[1]: http://i.stack.imgur.com/6WyU3.jpg | 0 | [
2,
9252,
6596,
1797,
64,
45,
16203,
4070,
14215,
19,
6018,
800,
3726,
3726,
31,
589,
568,
9252,
6596,
1797,
64,
2141,
9,
31,
57,
249,
1797,
20,
14692,
1054,
77,
7582,
11103,
218,
2291,
17,
7582,
7484,
9,
14,
1054,
1017,
14215,
77,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
editing json string in php
===
I am trying to edit a data query using php by passing it through javascript,
my ajax request looks like
var totalSearchResult=10;
$.ajax({
url:"php/queryManipulation.php",
type: 'POST',
data: { totalQuery : totalSearchResult, query : '{"data":{"match_all":{}}}'},
success: function(finalList)
{
alert(finalList);
}
});
my php code looks like
<?php
$from=$_POST["totalQuery"];
$qry=json_decode($_POST["query"]);
$qry->from=$from; }?>
I am trying to get it in the form,
{"data": {"match_all" {}} , "from": 10}
I get the error `Object of class stdClass could not be converted to string ` | 0 | [
2,
9510,
487,
528,
3724,
19,
13,
26120,
800,
3726,
3726,
31,
589,
749,
20,
9392,
21,
1054,
25597,
568,
13,
26120,
34,
2848,
32,
120,
8247,
8741,
15,
51,
20624,
3772,
1879,
101,
4033,
600,
25136,
29955,
3726,
1036,
73,
5579,
9,
688... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Sphinx RT index error
===
I have tried with sample example thru Sphinx Ql source code. Still i am getting "No Data Base Selected" error. Can anyone share the sample Example? it will be very useful for me.. Please
using following Querys:
$option['host'] = 'localhost';
$classApi = new SphinxQL($option);
$value = $classApi->exec(" select count(DISTINCT ID) from tablename where fanme=2769457");
ERROR : No Database Selected | 0 | [
2,
27274,
13,
5256,
4348,
7019,
800,
3726,
3726,
31,
57,
794,
29,
5717,
823,
19637,
27274,
13,
22402,
1267,
1797,
9,
174,
31,
589,
1017,
13,
7,
251,
1054,
1000,
1704,
7,
7019,
9,
92,
1276,
1891,
14,
5717,
823,
60,
32,
129,
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... |
How to add a class, and get results once complete
===
How would i go about using jQuery to add a "selected" class to the LI's in this?
Once all 6 questions have been selected, i would then need to go through the questions and get the selected answer. I have added the Question ID along with the answer ID to each answer which might make it easier to pick up and process later.
<div id="1002" class="question2" style="display: block; ">
<h1>Question 2</h1>
<p><i>This is Question 2</i></p>
<div class="answer-grid">
<ul class="answer">
<li id="1002-a1">Answer 1</li>
<li id="1002-a2">Answer 2</li>
<li id="1002-a3">Answer 3</li>
</ul>
</div>
</div>
Many thanks in advance. | 0 | [
2,
184,
20,
3547,
21,
718,
15,
17,
164,
1736,
382,
1279,
800,
3726,
3726,
184,
83,
31,
162,
88,
568,
487,
8190,
93,
20,
3547,
21,
13,
7,
18,
7138,
7,
718,
20,
14,
2093,
22,
18,
19,
48,
60,
382,
65,
400,
2346,
57,
74,
1704,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Whitespace sensitive FParsec
===
I'm trying to implement a whitespace sensitive parser using FParsec, and I'm starting off with the baby step of defining a function which will parse lines of text that start with `n` chars of whitespace.
Here's what I have so far:
let test: Parser<string list,int>
= let manyNSatisfy i p = manyMinMaxSatisfy i i p
let p = fun (stream:CharStream<int>) ->
let state = stream.UserState
// Should fail softly if `state` chars wasn't parsed
let result = attempt <| manyNSatisfy state (System.Char.IsWhiteSpace) <| stream
if result.Status <> Ok
then result
else restOfLine false <| stream
sepBy p newline
My issue is that when I run
`runParserOnString test 1 "test" " hi\n there\nyou" |> printfn "%A"`
I get an error on "you". I was under the impression that `attempt` would backtrack any state changes, and returning `Error` as my status would give me soft failure.
How do I get `["hi"; "there"]` back from my parser? | 0 | [
2,
359,
5582,
7830,
398,
3574,
14332,
800,
3726,
3726,
31,
22,
79,
749,
20,
8713,
21,
359,
5582,
7830,
2017,
4104,
568,
398,
3574,
14332,
15,
17,
31,
22,
79,
1422,
168,
29,
14,
1578,
1424,
16,
14684,
21,
1990,
56,
129,
2017,
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... |
Multi Phrase / Word Autocompletebox for Sliverlight
===
I have been using the autocompletebox from Silverlight Toolkit for Windows Phone
e.g. http://jesseliberty.com/2011/07/25/windows-phone-toolkit-autocompletebox/
Can the autocompletebox be made(changed/extended ?) to support auto completion for multiple phrases/words ? i.e. support something similar to
![Enabling autosuggest for the 2nd word also?][1]
[1]: http://i.stack.imgur.com/UXFxn.png
-
as soon as 'c' is entered in above the dropdown list shows items starting with 'c' etc.
(or can something similar to be done using normal text box?)
Related to this
http://www.codeproject.com/Articles/180311/Rich-Text-Box-With-Intellisense-Ability | 0 | [
2,
1889,
6845,
13,
118,
833,
3108,
15990,
5309,
26,
27890,
3130,
800,
3726,
3726,
31,
57,
74,
568,
14,
3108,
15990,
5309,
37,
1172,
3130,
5607,
13703,
26,
1936,
1132,
13,
62,
9,
263,
9,
7775,
6903,
728,
13505,
18681,
1084,
9,
960,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 pass a simple JSON array to jQuery then Flot?
===
I've been Googling for a while trying to find a solution to my problem, but everything I've found which comes close is too complicated!
I have a working Flot pie chart. It receives a JSON array from Django in this format:
`[0, 3, 5, 6, 7]`
The array represents the number of instances of each series (i.e. 0 instances of Series 1, 3 instances of Series 2 etc etc).
That array is then shown in a simple Flot Pie Chart using this code (`theData` is the array above):
function loadTotalChart(theData) {
$.plot($("#total-pie-chart"), theData ,
{
series: {
pie: {
show: true
}
},
label: {
show:true
},
legend: {
show: false
},
grid: {
hoverable: true,
}
});
}
The problem is that the labels are undefined in the array, so my pie chart shows "Undefined: 30%" or similar for each series.
What I'm trying to do is add labels for each series: the labels are the same for every instance of the chart.
How can I take the JSON array, add labels and then pass that to Flot??
Thanks very much! | 0 | [
2,
184,
107,
31,
1477,
21,
1935,
487,
528,
7718,
20,
487,
8190,
93,
94,
9319,
38,
60,
800,
3726,
3726,
31,
22,
195,
74,
162,
5598,
802,
26,
21,
133,
749,
20,
477,
21,
4295,
20,
51,
1448,
15,
47,
796,
31,
22,
195,
216,
56,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
JComboBox elements
===
I have a little question about JComboBox. But we get there later. So I made a modal JInternalFrame for may purposes, and for correct management. My problem is, when I create a JComboBox, the boxes popup doesn't roll down. But I can select between then with the keyboard. I use the modality over a JFrame, with its GlassPane. The GlassPane is a JPanel with overridden PaintComponent method(from the suns tutorial) and a dummymouselistener. So my question is. Why can't I see the rolldown popup? Or which layer or pane does the JComboBox draws its items.
Sincerely István | 0 | [
2,
487,
960,
1192,
5309,
2065,
800,
3726,
3726,
31,
57,
21,
265,
1301,
88,
487,
960,
1192,
5309,
9,
47,
95,
164,
80,
138,
9,
86,
31,
117,
21,
13,
20756,
5627,
8766,
192,
8361,
26,
123,
4612,
15,
17,
26,
4456,
1097,
9,
51,
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... |
Where to start when writing very simple irc bot?
===
I Am trying to make a very simple irc bot in python, but can't figure out how to do that with sockets.
The only thing i want it to is: Connect to irc server, set nick (and name), join a channel, and write a message to the irc channel.
Anyone who can lead me in the right direction or small example of code? | 1 | [
2,
113,
20,
799,
76,
1174,
253,
1935,
31,
5453,
11012,
60,
800,
3726,
3726,
31,
589,
749,
20,
233,
21,
253,
1935,
31,
5453,
11012,
19,
20059,
15,
47,
92,
22,
38,
1465,
70,
184,
20,
107,
30,
29,
18482,
18,
9,
14,
104,
584,
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... |
Inserting content in tinymce, additional text is placed inside inserted content
===
Ive got a video upload for tinymce, which inserts some code into the editor like so:
var content2 = "<div class='playvideo' id='<?php echo $randomnumber;?>'>
<img class='posterimage' src='<?php echo $new_image_path; ?>'>
<a id='<?php echo $new_file; ?>' class='videoplaceholder'></a>
</div></div>";
parent.tinyMCE.execCommand('mceInsertContent',false,content2);
this works fine, and outputs this :
<p><div id="581827" class="playvideo">
<img class="posterimage" src="/uploads/videos/images/1097VID.jpg" alt="" />
<a class="videoplaceholder" id="1097VID.mp4"></a>
</div></p>
But after this content is inserted, ofcourse i would like to continue writing text. But when i do that, the text gets placed inside my inserted content after the img tag.
like so :
<p><div id="581827" class="playvideo">
<img class="posterimage" src="/uploads/videos/images/1097VID.jpg" alt="" />text i try to write goes here for some reason
<a class="videoplaceholder" id="1097VID.mp4"></a>
</div></p>
[Fiddle example][1]
When enter is clicked for new line, it creates a second div with the same class as what i inserted. It's a weird behavior.. i read that a div is illegal inside a paragraph, but it doesnt work with span either.
Does anyone have any pointers? Any help is greatly appreciated.
[1]: http://fiddle.tinymce.com/fPbaab | 0 | [
2,
14692,
68,
2331,
19,
3228,
79,
1105,
15,
1351,
1854,
25,
1037,
572,
14215,
2331,
800,
3726,
3726,
5568,
330,
21,
763,
71,
8294,
26,
3228,
79,
1105,
15,
56,
14692,
18,
109,
1797,
77,
14,
1835,
101,
86,
45,
4033,
2331,
135,
800... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
User registering/login management in GWT application
===
I have a java application with GWT frontend, that do some stuff.
Now I want to implement users and their registrations, things like "forgot password", logging in and out.
My problem is - it is a thing, that almost everyone does at their application, but there are many things to do wrong (hashing passwords, somebody faking "forgot password", and so on), so there has to be some general solution or library.
And what I mean by that is both some GUI widget on client side and something for the server side, that would handle the user logins and save their passwords.
Does something like that exist? | 0 | [
2,
4155,
2243,
68,
118,
5567,
108,
1097,
19,
14094,
38,
3010,
800,
3726,
3726,
31,
57,
21,
8247,
3010,
29,
14094,
38,
431,
2451,
15,
30,
107,
109,
3217,
9,
130,
31,
259,
20,
8713,
3878,
17,
66,
8587,
18,
15,
564,
101,
13,
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... |
The code below is working fine in other browsers but not in IE .please help me out on this
===
$(document).ready(function() { $("div.panel_button").click(function(){ $("div#panel").animate({height: "223px",}, "fast");$("div.panel_button").toggle();}); $("div#hide_button").click(function(){ $("div#panel").animate({height: "0px",}, "slow"); });
}); | 0 | [
2,
14,
1797,
1021,
25,
638,
1123,
19,
89,
16495,
18,
47,
52,
19,
13,
660,
13,
9,
6744,
448,
55,
70,
27,
48,
800,
3726,
3726,
5579,
5,
28132,
6,
9,
15193,
5,
22359,
5,
6,
13,
1,
5579,
5,
7,
12916,
9,
3206,
532,
1,
811,
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... |
What is the difference between "git reset" vs "git rebase"?
===
I have been playing around with git (still very noob) and I wanted to know the difference between "reset" and "rebase". Is the one more powerful than the other?
Say I wanted to delete the 3 commits in bold from the history, which one will be better to use, or should I tag it and then delete it with "git tag -d <tagname>"?
17a64df 2012-06-21 | Hello uses style.css (HEAD, origin/style, master),<br>
a6792e4 2012-06-21 | Added css stylesheet<br>
801e13e 2012-06-21 | Added README<br>
5854339 2012-06-21 | Added index.html<br>
0b1dd4c 2012-06-21 | Moved hello.html to lib<br>
55649c3 2012-06-21 | Add an author/email comment<br>
9b2f3ce 2012-06-21 | Added an author comment<br>
cdb39b0 2012-06-21 | Commit p tags with text (v1.1)<br>
<b>b7b5fce 2012-06-21 | This reverts commit a6faf60631b5fbc6ee79b52a1bdac4c971b69ef8.</b> <br>
<b>a6faf60 2012-06-21 | Revert "Oops, we didn't want this commit"</b> <br>
<b>a006669 2012-06-21 | Oops, we didn't want this commit</b><br>
262d1f7 2012-06-21 | Added HTML header (v1)<br>
b1846e5 2012-06-21 | Added standard HTML page tags (v1-beta)<br>
bf1131e 2012-06-21 | Added HI TAG <br>
02b86d0 2012-06-21 | First Commit <br> | 0 | [
2,
98,
25,
14,
2841,
128,
13,
7,
10404,
23422,
7,
4611,
13,
7,
10404,
302,
8436,
7,
60,
800,
3726,
3726,
31,
57,
74,
791,
140,
29,
13,
10404,
13,
5,
8073,
253,
90,
4995,
6,
17,
31,
417,
20,
143,
14,
2841,
128,
13,
7,
99,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 is using MonoTouch for iPhone development not recommendet?
===
We want to develop an application for iOS and Android smartphones. We are mainly using Microsoft technologies for developing our applications. We thought that if we would use MonoTouch and Mono for Android we would only have to maintain one code base with only a different UI layer for each device.
Because currently nobody in our small team ever developed a smartphone application and we need it quickly we want to outsource it. We asked other companies whether they perfer MonoTouch or Objective C for iPhone development. Most of them said, that the would choose Objective C. They said that Objective C offers more functionality and possibilities, it's faster and for MonoTouch there is a chance that Apple will not support it anymore in the future. Is all of that true or are there other reasons to prefer Objective C? I know there are other threads like this around, but they did not answer my questions, especially the one regarding Apple's support for MonoTouch.
Thanks for your help | 0 | [
2,
483,
25,
568,
4129,
15725,
26,
21024,
522,
52,
12360,
1198,
60,
800,
3726,
3726,
95,
259,
20,
2803,
40,
3010,
26,
13,
7760,
17,
13005,
21421,
18,
9,
95,
50,
2011,
568,
7099,
5740,
26,
3561,
318,
3767,
9,
95,
289,
30,
100,
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... |
Issue in creating Plist file in xcode
===
I have a animated sprite with 6 images which I want to use in my cocos2d game . But I have a problem in creating plist file with these images , I want to use this plist in my code ,and I do not want plist through code . I want to create it through xcode plist Can one help?
Thank you for reading and replying | 0 | [
2,
1513,
19,
2936,
351,
5739,
3893,
19,
993,
9375,
800,
3726,
3726,
31,
57,
21,
5784,
27902,
29,
400,
3502,
56,
31,
259,
20,
275,
19,
51,
22470,
18,
135,
43,
250,
13,
9,
47,
31,
57,
21,
1448,
19,
2936,
351,
5739,
3893,
29,
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... |
C++ WINAPI set windows background image not working
===
I hate that I have done it before, I feel like I am missing something and I don't know what it is. So, I am trying to set the background image of a windows in C++ WinAPI.
My Resources.rc
#include "Resources.h"
BACKGROUND BITMAP "background.bmp"
My Resources.h
#define BACKGROUND 200
My Main.cpp
....
HWND Window = CreateWindowEx (
WS_EX_LAYERED|WS_EX_TOOLWINDOW,
wcls.lpszClassName,
L"Window Title",
WS_VISIBLE|WS_POPUP|WS_CLIPCHILDREN,
CW_USEDEFAULT,
CW_USEDEFAULT,
384,
128,
NULL,
NULL,
hInstance,
NULL
);
if (!Window ) return 0;
SetLayeredWindowAttributes(
Window,
RGB(35, 35, 35),
85,
LWA_ALPHA|LWA_COLORKEY
);
SetWindowPos(
Window,
HWND_TOPMOST,
0,
0,
0,
0,
SWP_NOMOVE|SWP_NOREDRAW|SWP_NOSIZE
);
ShowWindow(Window, SW_SHOWNORMAL);
UpdateWindow(Window);
LRESULT CALLBACK WndProc(HWND hWnd, UINT Msg, WPARAM Wpar, LPARAM Lpar) {
HBITMAP Background = NULL;
BITMAP BgImg;
HDC DeviceContext, BgContext;
PAINTSTRUCT PaintStruct;
switch (Msg) {
case WM_PAINT:
ContextLansator = BeginPaint(hWnd, &PaintStruct);
Fundal = LoadBitmap(hInstance, MAKEINTRESOURCE(BACKGROUND));
FundalLansator = CreateCompatibleDC(DeviceContext);
SelectObject(DeviceContext, Background);
GetObject(Background, sizeof(BgImg), &BgImg);
BitBlt(DeviceContext, 0, 0, 384, 128, BgContext, 0, 0, SRCAND);
DeleteObject(Background);
DeleteDC(BgContext);
EndPaint(hWnd, &PaintStruct);
break;
.....
I am using Code::Blocks. The resource is embedded correctly, the window starts but just a white background, the image is not painted. The WM_PAINT message is called once, at the beginning. I fill like something is wrong with BgImg but I don't know what. Some help needed! Thanks! | 0 | [
2,
272,
20512,
628,
2552,
49,
309,
1936,
2395,
1961,
52,
638,
800,
3726,
3726,
31,
3223,
30,
31,
57,
677,
32,
115,
15,
31,
583,
101,
31,
589,
2863,
301,
17,
31,
221,
22,
38,
143,
98,
32,
25,
9,
86,
15,
31,
589,
749,
20,
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... |
SQL SERVER 2008: Generic Convert to date
===
I have a little problem in my query. My database at my local development server is running with french date format (dd/mm/yyyy) but my release server is on north american format (mm/dd/yyyy).
So this throws an error
SELECT CodPeriodoInsc, CONVERT(VARCHAR, FechaDesde, 103) AS FechaDesde, CONVERT(VARCHAR, FechaHasta, 103) AS FechaHasta FROM SedesPeriodosInscripcion WHERE FechaDesde <= '25/06/2012'
But it works on development, and this works on release
SELECT CodPeriodoInsc, CONVERT(VARCHAR, FechaDesde, 103) AS FechaDesde, CONVERT(VARCHAR, FechaHasta, 103) AS FechaHasta FROM SedesPeriodosInscripcion WHERE FechaDesde <= '06/25/2012'
But it doesn't work on development.
Is there a way I can make the query work on both databases? | 0 | [
2,
4444,
255,
8128,
15573,
12733,
8406,
20,
1231,
800,
3726,
3726,
31,
57,
21,
265,
1448,
19,
51,
25597,
9,
51,
6018,
35,
51,
375,
522,
8128,
25,
946,
29,
484,
1231,
2595,
13,
5,
8096,
118,
3363,
118,
93,
93,
93,
93,
6,
47,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
two setTimeout under one function
===
i am trying to get notifications for a small project of mine using setTimeout but it requires me to get two types of notification 1. messages 2.global so i had to write two functions , is this possible to use two setTimeout under one function here is what i coded
// Message Notification Poll
(function pollmsg() { setTimeout(function() {
var demon=$('.msgnotimore').val();
var page="notimsg";
var a=$('.gvpgvpxgvp').val();
$.ajax({ url: 'modules/notifications/beast.php?nid='+demon+'&id='+a+'&page='+page,
success: function(html) {
if ($.trim(html) == 'no')
{
}
else
{
$('.msgnotimore').remove();
$('.notiloadmsg').prepend($(html).fadeIn('slow'));
}
}, dataType: "html", complete: pollmsg }); }, 60000); })();
// Global Notification Poll
(function pollglobal() { setTimeout(function() {
var demon=$('.globalnotimore').val();
var page="notiglobal";
var a=$('.gvpgvpxgvp').val();
$.ajax({ url: 'modules/notifications/beast.php?nid='+demon+'&id='+a+'&page='+page,
success: function(html) {
if ($.trim(html) == 'no')
{
}
else
{
$('.globalnotimore').remove();
$('.notiloadglobal').prepend($(html).fadeIn('slow'));
}
}, dataType: "html", complete: pollglobal }); }, 60000); })(); | 0 | [
2,
81,
309,
891,
1320,
131,
53,
1990,
800,
3726,
3726,
31,
589,
749,
20,
164,
52,
4634,
18,
26,
21,
284,
669,
16,
1114,
568,
309,
891,
1320,
47,
32,
4781,
55,
20,
164,
81,
2551,
16,
52,
4634,
137,
9,
7561,
172,
9,
26763,
86,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
JLayeredPane not drawing
===
Good day,
Hopefully this is a quick kill question. I am writing an application that uses JPanels and JLayeredPane inside a JFrame. On the initial start of my application, one of the panels does not show up until my mouse moves over the area where the panel should be. I even call the validate and repaint methods, but I am still able to display both panels together. Any suggestions? Thank you.
**Here is my JFrame class (which has the main method)**
import java.awt.Dimension;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLayeredPane;
import javax.swing.JPanel;
public class Application extends JFrame
{
public Application()
{
this.setSize(500,500);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
JLayeredPane lp = new JLayeredPane();
lp.setBounds(0,0,500,500);
this.setLayeredPane(lp);
Mypanel p1 = new Mypanel();
Mypanel2 p2 = new Mypanel2();
this.getLayeredPane().add(p1,0);
this.getLayeredPane().add(p2,1);
this.validate();
this.repaint();
this.validate();
}
public static void main(String[] args)
{
Application app = new Application();
}
}
**Here is one of my panel classes**
import javax.swing.JButton;
import javax.swing.JPanel;
public class Mypanel extends JPanel
{
public JButton button;
public Mypanel()
{
this.setLayout(null);
this.setBounds(0, 0, 500, 500);
JButton b = new JButton("Hello");
b.setBounds(20,20,300,300);
this.add(b);
}
}
**And finally my last panel class**
import javax.swing.JButton;
import javax.swing.JPanel;
public class Mypanel2 extends JPanel
{
public JButton button;
public Mypanel2()
{
this.setLayout(null);
this.setBounds(0, 0, 500, 500);
JButton b = new JButton("SUP");
b.setBounds(20,10,200,200);
this.add(b);
this.repaint();
this.validate();
this.repaint();
}
} | 0 | [
2,
487,
15187,
69,
16660,
52,
3533,
800,
3726,
3726,
254,
208,
15,
13416,
48,
25,
21,
2231,
1177,
1301,
9,
31,
589,
1174,
40,
3010,
30,
2027,
487,
3206,
6798,
17,
487,
15187,
69,
16660,
572,
21,
487,
8361,
9,
27,
14,
2104,
799,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Having Trouble Getting Color Scale Conditional Formatting From Excel File to Show up in Embedded Spreadsheet in Windows Form
===
I have a Windows Form that currently displays a spreadsheet that is editable. I have functionality to allow the user to browse for an Excel file to import to the spreadsheet in the Form view. It is important that an Excel file with a Color Scale Conditional Format be imported with the colors of the cells, as a result of the conditional format, to show up in the embedded spreadsheet. I am currently using SpreadsheetGear's WorkbookView, but I have also discovered that SpreadsheetGear does not handle the conditional formatting with a color scale. Is there a way to either,
1. save the resulting cell colors from my excel object to apply later to the cells in my SpreadsheetGear object? Or,
2. Use a control in the Microsoft.Office.Interop.Excel namespace that DOES handle the color scaling conditional formatting found in existing excel files?
Any help would be greatly appreciated. Thanks!
| 0 | [
2,
452,
2572,
1017,
1665,
3464,
21206,
2595,
1203,
37,
20700,
3893,
20,
298,
71,
19,
12138,
1789,
17627,
19,
1936,
505,
800,
3726,
3726,
31,
57,
21,
1936,
505,
30,
871,
9412,
21,
1789,
17627,
30,
25,
9392,
579,
9,
31,
57,
18548,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
JQGrid data not loading on page load
===
I am using [JQGrid][1]
I have it on 2 domains (same code)... On domain 1, I have not problems with the loading of data when the page loads.
On Domain 2 I have the exact same code but with a problem.
When the page loads it won't load the data but when I click the refresh button on JQGrid the data loads fine but never during page load.
I've looked at the code and it seems the same to me.
Does anyone have any ideas on what could make this strange thing happen?
I've run out of ideas on where to look.
[1]: http://www.trirand.com/ | 0 | [
2,
487,
1251,
16375,
1054,
52,
12797,
27,
2478,
6305,
800,
3726,
3726,
31,
589,
568,
636,
728,
1251,
16375,
500,
2558,
165,
500,
31,
57,
32,
27,
172,
15544,
13,
5,
18,
8357,
1797,
6,
9,
9,
9,
27,
4603,
137,
15,
31,
57,
52,
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 use Async task to pause program multiple times
===
I know the title is somewhat confusing, my problem is this: I want to "pause" my program multiple times (via a loop) using sleep(ms) and make changes to several buttons that the user has pressed. I understand that changes to the UI can only be made in the main thread, so I am wondering how to convert this code into an Async task. I also remember reading somewhere that Async task can only be called once? If this is so, what other solutions could I look into?
View.OnClickListener SimulateButtonHandler = new View.OnClickListener() {
@Override
public void onClick(View v) {
for(int j=0;j<169;j++) //169 buttons to click
{
if(ClickedPoints[j]!=null) //how I keep track of which buttons has clicked
{ //clear button color
Drawable d2 = ClickedPoints[j].getBackground();
ClickedPoints[j].invalidateDrawable(d2);
d2.clearColorFilter();
}
}
Timer timer = new Timer();
for(int i=0;i<169;i++)
{
if(ClickedPoints[i]!=null)
{ //change the color after some time
Simulate(timer, i);
//clear color again
Drawable d2 = ClickedPoints[i].getBackground();
ClickedPoints[i].invalidateDrawable(d2);
d2.clearColorFilter();
}
}
}
};
public void Simulate(Timer timer, final int index)
{
timer.schedule(new TimerTask()
{
public void run() {
Sim(index);
}
}, 1000); //delay for some amount of time, then rehighlight the button
}
private void Sim(int i)
{
Drawable d1 = ClickedPoints[i].getBackground();
PorterDuffColorFilter filter = new PorterDuffColorFilter(Color.RED, PorterDuff.Mode.SRC_ATOP);
d1.setColorFilter(filter);
}
| 0 | [
2,
184,
20,
275,
21,
9507,
150,
3005,
20,
6911,
625,
1886,
436,
800,
3726,
3726,
31,
143,
14,
581,
25,
4131,
18084,
15,
51,
1448,
25,
48,
45,
31,
259,
20,
13,
7,
1060,
3699,
7,
51,
625,
1886,
436,
13,
5,
5034,
21,
5293,
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... |
Set HSQL script newline format
===
We have a HSQL .script file in source control. Some of our developers use Linux, some use Windows. Each time there is a commit we have to deal with conflicts (each line in file has one) due to platform specific newline characters in script.
Is there a way to specify newline format for the HSQL script file. | 0 | [
2,
309,
746,
18,
22402,
3884,
78,
1143,
2595,
800,
3726,
3726,
95,
57,
21,
746,
18,
22402,
13,
9,
8741,
3893,
19,
1267,
569,
9,
109,
16,
318,
10168,
275,
13024,
15,
109,
275,
1936,
9,
206,
85,
80,
25,
21,
9686,
95,
57,
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... |
Calling my own sql function through the R package RODBC
===
I'm currently trying to call my own sql function (named ``Sentiment``) with the ``R`` package ``RODBC`` through the following command lines:
dbhandle <- odbcDriverConnect('driver={SQL Server};server=bgexcsddb01;database=Test;trusted_connection=true')
score <- sqlQuery(dbhandle, 'select dbo.fnc_Sentiment(\'This is a bad string!!!\')')
As you might see, my sql function has as a domain character strings and return a value for its sentiment. But, it turns out that I'd like to pass a data frame, say ``DF`` (each row is a string), to my ``Sentiment`` function.
So, my question is: How can I do that? Functions like ``eval``, ``parse``, ``sprintf`` come to mind, but I still don't imagine how to put them together. Any hints?
Also, I'd like to ask you if you consider this a misuse of R? The idea is to program the ``Sentiment`` function in ``R`` in the short future.
| 0 | [
2,
2555,
51,
258,
4444,
255,
1990,
120,
14,
761,
6030,
4281,
7229,
800,
3726,
3726,
31,
22,
79,
871,
749,
20,
645,
51,
258,
4444,
255,
1990,
13,
5,
11482,
13,
7,
18,
16001,
1130,
7,
6,
29,
14,
13,
7,
139,
7,
6030,
13,
7,
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... |
Embedding executable in Java application
===
How can I embed binary file (executable, to be exact) in Java application? Is there a way to read a file during compile time, or I have to copy hex dump into source code of the application? | 0 | [
2,
11911,
69,
3258,
1396,
17194,
5924,
19,
8247,
3010,
800,
3726,
3726,
184,
92,
31,
11911,
69,
14171,
3893,
13,
5,
1706,
17194,
5924,
15,
20,
44,
5340,
6,
19,
8247,
3010,
60,
25,
80,
21,
161,
20,
1302,
21,
3893,
112,
26561,
85,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0... |
A query calls two instances of the same tables joined to compare fields, gives mirrored results. How do I eliminate mirrored duplicates?
===
This is a simpler version of the query I have.
Alias1 as
(select distinct ID, file_tag, status, creation_date from tables),
Alias2 as
(select distinct ID, file_tag, status, creation_date from same tables)
select distinct Alias1.ID ID_1,
Alias2.ID ID_2,
Alias1.file_tag,
Alias1.creation_date in_dt1,
Alias2.creation_date in_dt2
from Alias1, Alias2
where Alias1.file_tag = Alias2.file_tag
and Alias1.ID != Alias2.ID
order by Alias1.creation_dt desc
This is an example of the results. Both of these are the same, though their values are flipped.
ID_1 ID_2 File_Tag in_dt1 in_dt2
70 66 Apples 6/25/2012 3:06 6/25/2012 2:53:47 PM
66 70 Apples 6/25/2012 2:53 6/25/2012 3:06:18 PM
The goal of the query is to find more than one ID with a matching file tag and do stuff to the one submitted earlier in the day. I am still relatively new to SQL/Oracle and wonder if there's a better way to approach this problem. | 0 | [
2,
21,
25597,
3029,
81,
13946,
16,
14,
205,
7484,
670,
20,
11590,
2861,
15,
2352,
3402,
69,
1736,
9,
184,
107,
31,
10628,
3402,
69,
19429,
18,
60,
800,
3726,
3726,
48,
25,
21,
19120,
615,
16,
14,
25597,
31,
57,
9,
15794,
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... |
why there is no add method in Iterator interface
===
In Iterator sun added the remove method to remove the last accessed element of the collection. Why there is no add method to add a new element to the collection? What kind of side-effects it may have to the collection or iterator?
Thanks | 0 | [
2,
483,
80,
25,
90,
3547,
2109,
19,
32,
106,
3457,
6573,
800,
3726,
3726,
19,
32,
106,
3457,
939,
905,
14,
4681,
2109,
20,
4681,
14,
236,
12904,
4520,
16,
14,
1206,
9,
483,
80,
25,
90,
3547,
2109,
20,
3547,
21,
78,
4520,
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 to install GraphicsMagick with PNG support on Amazon EC2?
===
If you naively follow [the steps on the GraphicsMagick website](http://www.graphicsmagick.org/INSTALL-unix.html), after running `./configure`, you end up with no PNG support:
checking for PNG support ...
checking png.h usability... no
checking png.h presence... no
PNG --with-png=yes no
This makes for a pretty useless GraphicsMagick instalation.
How can I enable PNG support? Libpng seems to be installed already, but not detected:
> $ sudo yum install libpng
> Package 2:libpng-1.2.49-1.12.amzn1.x86_64 already installed and latest version
| 0 | [
2,
184,
20,
16146,
8351,
21200,
197,
29,
351,
2723,
555,
27,
8059,
6695,
135,
60,
800,
3726,
3726,
100,
42,
16288,
102,
1740,
636,
124,
2382,
27,
14,
8351,
21200,
197,
2271,
500,
5,
21127,
6903,
6483,
9,
12084,
18,
21200,
197,
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... |
facebook connect redirect url suddenly broke
===
Before a minute ago after successful login it redirected to `site.com/home`, but now the link is `site.com/home?state={long-code}6&code={long_code}`
And this is ugly. Any ideas?
| 0 | [
2,
9090,
6379,
302,
14706,
287,
6362,
1605,
1842,
800,
3726,
3726,
115,
21,
2038,
1464,
75,
1300,
6738,
108,
32,
302,
14147,
20,
13,
1,
9097,
9,
960,
118,
8167,
1,
15,
47,
130,
14,
3508,
25,
13,
1,
9097,
9,
960,
118,
8167,
60,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 any c++ library to connect iCloud//Yahoo calendars via CalDav protocal
===
I have started working on c++ Windows application which needs to fetch Icloud and Yahoo Calendars by connecting to the CalDav servers.
Is there any c++ library which does it.
| 0 | [
2,
25,
80,
186,
272,
20512,
1248,
20,
6379,
31,
19174,
118,
118,
1046,
8884,
7036,
18,
1197,
3550,
43,
5214,
9347,
3430,
800,
3726,
3726,
31,
57,
373,
638,
27,
272,
20512,
1936,
3010,
56,
2274,
20,
18312,
31,
19174,
17,
23553,
703... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
GZip Compression between Java and AS3?
===
How would one compress a byte array byte[] in java and then uncompress it in as3 and vice-versa?
Can someone provide example code?
I am trying to transfer JSON strings between the 2 platform but JSON has a large overheard and I see it can be compressed.
So far I've come across the following to use:
GZipOutputStream in Java and ByteArray.uncompress in AS3 | 0 | [
2,
489,
2553,
306,
14864,
128,
8247,
17,
28,
240,
60,
800,
3726,
3726,
184,
83,
53,
26060,
21,
34,
591,
7718,
34,
591,
2558,
500,
19,
8247,
17,
94,
367,
960,
5890,
32,
19,
28,
240,
17,
1821,
8,
5498,
58,
60,
92,
737,
1181,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 it possible to navigate a site by clicking links and then downloading the correct piece?
===
I'll try to explain what exactly I mean. I'm working on a program and I'm trying to download a bunch of images automatically from [this][1] site.
Namely, I want to download the big square icons from the page you get when you click on a hero name there, for example on the [Darius][2] page the image in the top left with the name `DariusSquare.png` and save that into a folder.
Is this possible or am I asking too much from C#?
Thank you very much!
[1]: http://leagueoflegends.wikia.com/wiki/List_of_champions
[2]: http://leagueoflegends.wikia.com/wiki/Darius | 0 | [
2,
25,
32,
938,
20,
20782,
21,
689,
34,
25590,
6271,
17,
94,
7121,
68,
14,
4456,
1855,
60,
800,
3726,
3726,
31,
22,
211,
1131,
20,
3271,
98,
1890,
31,
884,
9,
31,
22,
79,
638,
27,
21,
625,
17,
31,
22,
79,
749,
20,
7121,
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... |
How to shrink images on my blog's RSS feed?
===
this is my first time using stackoverflow!
Well, I've got a blog (blogger-based) and I use high res images that can be clicked on to expand. Typically, using CSS, the images are reduced to a width of approx 650 pixels. The full res is about twice that, though.
On my CSS feed the images are downright enormous, even on my 15" laptop. I know it's possible to reduce them because many of the feeds I follow have small thumbnail images. I think my readers would appreciate this quite a bit, though correct me if I'm wrong.
Here is the feed: http://www.gearhungry.com/feeds/posts/default?alt=rss
The site is: [gearhungry][1]
Thanks in advance!
[1]: http://www.gearhungry.com | 0 | [
2,
184,
20,
16269,
3502,
27,
51,
8146,
22,
18,
13,
1224,
18,
4063,
60,
800,
3726,
3726,
48,
25,
51,
64,
85,
568,
7566,
2549,
9990,
187,
134,
15,
31,
22,
195,
330,
21,
8146,
13,
5,
220,
29480,
8,
1281,
6,
17,
31,
275,
183,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Sending file through ObjectOutputStream and then saving it in Java?
===
I have this simple Server/Client application. I'm trying to get the Server to send a file through an OutputStream (FileOutputStream, OutputStream, ObjectOutputStream, etc) and receive it at the client side before saving it into an actual file. The problem is, I've tried doing this but it keeps failing. Whenever I create the file and write the object I received from the server into it, I get a broken image (I just save it as a jpg, but that shouldn't matter). Here are the parts of the code which are most likely to be malfunctioning (all the seemingly un-declared objects you see here have already been declared beforehand):
Server:
ObjectOutputStream outToClient = new ObjectOutputStream(
connSocket.getOutputStream());
File imgFile = new File(dir + children[0]);
outToClient.writeObject(imgFile);
outToClient.flush();
Client:
ObjectInputStream inFromServer = new ObjectInputStream(
clientSocket.getInputStream());
ObjectOutputStream saveImage = new ObjectOutputStream(
new FileOutputStream("D:/ServerMapCopy/gday.jpg"));
saveImage.writeObject(inFromServer.readObject());
So, my problem would be that I can't get the object through the stream correctly without getting a broken file. | 0 | [
2,
4907,
3893,
120,
3095,
1320,
4881,
11260,
17,
94,
7599,
32,
19,
8247,
60,
800,
3726,
3726,
31,
57,
48,
1935,
8128,
118,
150,
18513,
38,
3010,
9,
31,
22,
79,
749,
20,
164,
14,
8128,
20,
2660,
21,
3893,
120,
40,
5196,
11260,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 are the must Have Tools for CentOS Linux User
===
I am New to Linux and I have just installed CentOS started learning things in that.As a Web developer what are the tools I should install in Linux in order to get started | 4 | [
2,
98,
50,
14,
491,
57,
4672,
26,
5802,
759,
13024,
4155,
800,
3726,
3726,
31,
589,
78,
20,
13024,
17,
31,
57,
114,
4066,
5802,
759,
373,
2477,
564,
19,
30,
9,
472,
21,
2741,
10058,
98,
50,
14,
4672,
31,
378,
16146,
19,
13024,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Refreshing yahoo mail?
===
Yahoo mail isn't thunder bird, It doesn't refresh itself so you can see if you have new mail. Sometimes I don't reply for 10-20 minutes just because I didn't refresh the yahoo page.
So I'm thinking of a way to refresh my yahoo mail every two minutes. Could i maybe create a file containing yahoo mail as an iframe and refresh it every 2 minutes? How would you go about doing this? And how can you refresh an iframe every 2 minutes? | 2 | [
2,
27134,
23553,
4216,
60,
800,
3726,
3726,
23553,
4216,
2532,
22,
38,
5710,
2838,
15,
32,
1437,
22,
38,
24905,
1145,
86,
42,
92,
196,
100,
42,
57,
78,
4216,
9,
1030,
31,
221,
22,
38,
6504,
26,
332,
8,
1323,
902,
114,
185,
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... |
Fortran equivalent to matlab find - application to slicing matrix without memory duplication
===
I use the command find quite a lot in matlab, and I wonder how to translate this smartly in fortran to extract a slice of an array. In matlab you can slice with either logicals or indexes, but in fortran you need indexes to slice. I'm aware of the intrinsic subroutines pack et al, but have never used them. Also, since I'm dealing with big matrices, I would like to avoid duplicating memory. I want the sliced matrix to be manipulated within a subroutine. I've read somewhere that slices of array were not duplicated. I don't know how this the slicing in done in matlab though. I'm puzzled also because in matlab some allocations are transparent to you.
I'd like to know how to reproduce the examples below, and make sure I'm not duplicating stuff in memory and that it's actually elegant to do so. Otherwise, I would forget about slicing and just send the whole matrix(since it's by reference) and loop through an index array I...
Matlab example 1: simply reproducing find
v=[1 2 3 4];
I=find(v==3);
Matlab example 2:
m=rand(4,4);
bools=logical([ 1 0 0 1]);
I=find(bools==1);
% which I could also do like:
I=1:size(m,1);
I=I(bools);
for i=1:length(I)
% here dealing with m(I(i)),:) and do some computation
% etc.
Example 3: just call a subroutine on m(I,:) , but using directly booleans for slicing
foo( m(bools, :) , arg2, arg3 )
In advance thank you for your help!
| 0 | [
2,
26,
17685,
4602,
20,
4277,
9086,
477,
13,
8,
3010,
20,
27646,
8187,
366,
1912,
1052,
20669,
800,
3726,
3726,
31,
275,
14,
1202,
477,
1450,
21,
865,
19,
4277,
9086,
15,
17,
31,
2666,
184,
20,
20628,
48,
3978,
102,
19,
26,
1768... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 a way (plugin) to insert html/css/images ect automatically into every wordpress post?
===
is there a way (plugin) to insert html/css/images ect.. automatically into every wordpress post? most of my posts are going to be very similar so is there a plugin that will automatically insert the pre written html/css/ ect in every post as opposed to me entering it manually every time.
Thank you in advance ;-) | 0 | [
2,
25,
80,
21,
161,
13,
5,
18527,
5831,
6,
20,
14692,
13,
15895,
118,
6824,
18,
118,
22039,
18,
13,
11557,
7499,
77,
352,
833,
5890,
678,
60,
800,
3726,
3726,
25,
80,
21,
161,
13,
5,
18527,
5831,
6,
20,
14692,
13,
15895,
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... |
SharePoint: Open Word doc link in same window
===
SharePoint 2010
Word 2007
Does anyone know how to have a link within a Word document, that is opened inside a SharePoint browser window, which, when the link is clicked it will open a second Word document in the same browser window?
SharePoint 2010 Browser Window 1
Open Word Doc 1
Click on link within Word Doc 1
Word Doc 2 is opened (in the same browser window)
If I click 'Close' in the 'Word Viewer', Word Doc 2 will close and I am back to Word Doc 1
Word 2007 does not like JavaScript to open a new window with _self. Thanks in advance. | 0 | [
2,
1891,
3132,
45,
368,
833,
9765,
3508,
19,
205,
1463,
800,
3726,
3726,
1891,
3132,
498,
833,
624,
630,
1276,
143,
184,
20,
57,
21,
3508,
363,
21,
833,
4492,
15,
30,
25,
520,
572,
21,
1891,
3132,
16495,
1463,
15,
56,
15,
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... |
Is it possible to set a JavaFX static property in CSS?
===
Sample FXML with the BorderPanel.alignment ["static property"](http://docs.oracle.com/javafx/2/api/javafx/fxml/doc-files/introduction_to_fxml.html#static_property_elements):
<BorderPane>
<top>
<Label text="My Label" BorderPanel.alignment="CENTER"/>
</top>
</BorderPane>
The CSS-supported version:
<BorderPane stylesheets="Style.css">
<top>
<Label text="My Label" styleClass="labelClass"/>
</top>
</BorderPane>
Style.css would be:
.labelClass
{
-fx-borderpanel-alignement: center
}
| 0 | [
2,
25,
32,
938,
20,
309,
21,
8247,
16488,
12038,
1354,
19,
272,
18,
18,
60,
800,
3726,
3726,
5717,
13,
16488,
8184,
29,
14,
1862,
3206,
532,
9,
192,
9693,
1130,
636,
7,
18077,
1354,
7,
500,
5,
21127,
6903,
13799,
18,
9,
6055,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
MVC 3 Forms Authentication not working in Internet Explorer keeps redirecting to login page
===
I have implented some lovely forms authentication in ASP.NET MVC 3, this has been working fantastic in Chrome. Now is the time test on the worlds worst browser, Internet Explorer. I just simply went to Log in, and the page just goes back to the login in page every time I click the submit button. The credentials are correct. I have stepped through the code, I am using a RedirectToAction to a page and no errors are being flagged it just goes straight back to the login page.
I should point out I have tried the following:
- Removed webmatrix dlls and dependancies
- Removed System.Web.Helpersn
- These have both been removed from the bin, the references and the
bin_deploayableAssemblies folder in VS2010
I have also dded the following to the web.config appsettings:
<add key="enableSimpleMembership" value="false" />
<add key="autoFormsAuthentication" value="false" />
<add key="loginUrl" value="~/LoginReg/LogOn"/>
Here is my full web.config:
http://pastebin.com/t6cj6cSb
I should point out my login page is in a folder called: Login Reg, so the url would be /LoginReg/LogOn.
This works perfectly in chrome but for some reason doe not work in Internet Explorer.
Does anyone have any ideas hwo to fix this really annoying problem or have any useful articles
Thanks | 0 | [
2,
307,
8990,
203,
1997,
27963,
52,
638,
19,
2620,
8520,
8968,
302,
14706,
68,
20,
6738,
108,
2478,
800,
3726,
3726,
31,
57,
5420,
13465,
69,
109,
8601,
1997,
27963,
19,
28,
306,
9,
2328,
307,
8990,
203,
15,
48,
63,
74,
638,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Session destroy after page refresh
===
I have a domain example.com which is working fine and i have enabled htaccess for that domain. Now created a folder inside that domain example.com/myfolder in this folder when i create a session against login but when i refresh page or go to another page, it destroy the session. I removed all the html and php code just start session but on refresh i found the same problem.
this is the htaccess code on example.com
RewriteBase /sellers/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ /index.php [L] | 0 | [
2,
3723,
4407,
75,
2478,
24905,
800,
3726,
3726,
31,
57,
21,
4603,
823,
9,
960,
56,
25,
638,
1123,
17,
31,
57,
9338,
13,
9020,
20604,
26,
30,
4603,
9,
130,
679,
21,
19294,
572,
30,
4603,
823,
9,
960,
118,
915,
8814,
106,
19,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
SQLiteClosable exeption in contentProvider
===
I using custom content provider to access to sqlite database. This work ok in all version > 2.2, but in Android 2.1 I sometimes get this:
Caused by: java.lang.IllegalStateException: attempt to acquire a reference on a close SQLiteClosable
at android.database.sqlite.SQLiteClosable.acquireReference(SQLiteClosable.java:31)
at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:56)
at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:49)
at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:49)
at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1221)
at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1108)
at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1066)
at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1143)
at com.vk.messenger.utils.VkContentProvider.query(VkContentProvider.java:57)
at android.content.ContentProvider$Transport.query(ContentProvider.java:130)
at android.content.ContentResolver.query(ContentResolver.java:202)
How to solve this? | 0 | [
2,
4444,
10601,
13023,
18,
579,
1396,
3492,
3309,
19,
2331,
26735,
139,
800,
3726,
3726,
31,
568,
5816,
2331,
11747,
20,
1381,
20,
4444,
10601,
6018,
9,
48,
170,
5854,
19,
65,
615,
13,
1,
172,
9,
135,
15,
47,
19,
13005,
172,
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... |
how to get jobject in invokeshutdown method
===
I am trying to write windows service for my Java server. Here is how I have written my `invokeshutdown` method. But I am confused on how i will get `jobject` reference here.
DWORD WINAPI InvokeShutdown( LPVOID lpParam ) {
JNIEnv *env;
jclass cls;
jmethodID mid;
//Since the JVM was created in a another thread. We have to attach the thread
//to JVM before making " calls
vm->AttachCurrentThread((void **)&env, 0);
cls = env->FindClass("com.my.internal.Launcher");
// Create the argument list.
va_list args;
va_start(args, "-dir=stop");
mid = env->GetMethodID(env, cls, "stop", "()V");
env->CallVoidMethodV(env, obj, mid, args);
vm->DetachCurrentThread();
Log( "Detached thread\n");
return 0;
}
how do i get `obj` in `env->CallVoidMethodV(env, obj, mid, args);`
| 0 | [
2,
184,
20,
164,
487,
23793,
19,
28371,
15640,
2968,
2109,
800,
3726,
3726,
31,
589,
749,
20,
2757,
1936,
365,
26,
51,
8247,
8128,
9,
235,
25,
184,
31,
57,
642,
51,
13,
1,
108,
2625,
1048,
15640,
2968,
1,
2109,
9,
47,
31,
589,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Javascript component returned failure code 0x80004005 NS_ERROR_FAILURE
===
A website cart A takes input from a text field and uses the XMLHttpRequest object to send the GET data to an external website B.
The request is sent fine, however I cannot access the .responseText. I thought this was because of the same-origin-policy but wouldn't that disallow the GET request to begin with?
I even used http://anyorigin.com in case this was the policy issue and I get the same error.
<a href="http://i.stack.imgur.com/63iMI.jpg"><img src="http://i.stack.imgur.com/63iMI.jpg"></a>
Thanks for any help. | 0 | [
2,
8247,
8741,
5912,
587,
2990,
1797,
713,
396,
28064,
7114,
264,
13,
2172,
1,
29992,
1,
24910,
4221,
800,
3726,
3726,
21,
2271,
6420,
21,
1384,
6367,
37,
21,
1854,
575,
17,
2027,
14,
23504,
21127,
99,
10351,
3095,
20,
2660,
14,
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... |
C++ socket programming, multicast with compression, any good libraries/wrappers?
===
I am beginning to get into socket programming. Currently, I am transferring data between server and clients using scp which scales very poorly when dealing with streams of data (it seems like each new scp session needs to open a new TCP connection and this really slows down the speed).
I would like to transfer text to multiple clients, over a day, this text could reach a couple gigabytes in size so implementing some sort of compression is key.
Can anybody recommend some good libraries or wrappers which can simplify writing this code? The standard C++ sockets interface is quite cumbersome to work with. So far, my only lead is Boost ASIO but that doesn't seem to have compression capabilities. Any suggestions would be much appreciated. | 0 | [
2,
272,
20512,
18482,
3143,
15,
1889,
6146,
29,
14864,
15,
186,
254,
8649,
118,
7127,
7753,
445,
60,
800,
3726,
3726,
31,
589,
997,
20,
164,
77,
18482,
3143,
9,
871,
15,
31,
589,
15798,
1054,
128,
8128,
17,
7421,
568,
13,
18,
74... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.util.ConcurrentModificationException drawing a route
===
I´m drawing a route in the MapActivity using the code:
List<DirectionPathOverlay> list_over = new ArrayList<DirectionPathOverlay>();
for(int i = 2; i < route_marks.size() - 1; i++)
{
try
{
DirectionPathOverlay dpo = new DirectionPathOverlay(point1, point2);
mMapView01.getOverlays().add(dpo);
point1 = point2;
lon_d = Double.parseDouble(route_marks.get(i).getLongitude()) * 1E6;
lon = (int)lon_d;
lat_d = Double.parseDouble(route_marks.get(i).getLatitude()) * 1E6;
lat = (int)lat_d;
point2 = new GeoPoint(lat, lon);
list_points.add(point2);
}
catch(Exception e) {
}
}
mMapView01.getOverlays().add(new DirectionPathOverlay(point2, point2));
And
public class DirectionPathOverlay extends Overlay {
private GeoPoint gp1;
private GeoPoint gp2;
public DirectionPathOverlay(GeoPoint gp1, GeoPoint gp2) {
this.gp1 = gp1;
this.gp2 = gp2;
}
@Override
public boolean draw(Canvas canvas, MapView mapView, boolean shadow,
long when) {
// TODO Auto-generated method stub
Projection projection = mapView.getProjection();
if (shadow == false) {
Paint paint = new Paint();
paint.setAntiAlias(true);
Point point = new Point();
projection.toPixels(gp1, point);
paint.setColor(Color.BLUE);
Point point2 = new Point();
projection.toPixels(gp2, point2);
paint.setStrokeWidth(2);
canvas.drawLine((float) point.x, (float) point.y, (float) point2.x,
(float) point2.y, paint);
}
return super.draw(canvas, mapView, shadow, when);
}
@Override
public void draw(Canvas canvas, MapView mapView, boolean shadow) {
// TODO Auto-generated method stub
super.draw(canvas, mapView, shadow);
}
}
I´m executing the code into new thread and I´m getting the exeption:
07-08 18:23:21.179: E/AndroidRuntime(23510): FATAL EXCEPTION: main
07-08 18:23:21.179: E/AndroidRuntime(23510): java.util.ConcurrentModificationException
07-08 18:23:21.179: E/AndroidRuntime(23510): at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:569)
07-08 18:23:21.179: E/AndroidRuntime(23510): at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:44)
07-08 18:23:21.179: E/AndroidRuntime(23510): at com.google.android.maps.MapView.onDraw(MapView.java:530)
07-08 18:23:21.179: E/AndroidRuntime(23510): at android.view.View.draw(View.java:11082)
07-08 18:23:21.179: E/AndroidRuntime(23510): at android.view.ViewGroup.drawChild(ViewGroup.java:2991)
07-08 18:23:21.179: E/AndroidRuntime(23510): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2593)
07-08 18:23:21.179: E/AndroidRuntime(23510): at android.view.ViewGroup.drawChild(ViewGroup.java:2989)
07-08 18:23:21.179: E/AndroidRuntime(23510): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2593)
07-08 18:23:21.179: E/AndroidRuntime(23510): at android.view.ViewGroup.drawChild(ViewGroup.java:2989)
07-08 18:23:21.179: E/AndroidRuntime(23510): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2593)
07-08 18:23:21.179: E/AndroidRuntime(23510): at android.view.ViewGroup.drawChild(ViewGroup.java:2989)
07-08 18:23:21.179: E/AndroidRuntime(23510): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2593)
07-08 18:23:21.179: E/AndroidRuntime(23510): at android.view.View.draw(View.java:11085)
07-08 18:23:21.179: E/AndroidRuntime(23510): at android.widget.FrameLayout.draw(FrameLayout.java:462)
07-08 18:23:21.179: E/AndroidRuntime(23510): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2145)
07-08 18:23:21.179: E/AndroidRuntime(23510): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2026)
07-08 18:23:21.179: E/AndroidRuntime(23510): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1634)
07-08 18:23:21.179: E/AndroidRuntime(23510): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)
07-08 18:23:21.179: E/AndroidRuntime(23510): at android.os.Handler.dispatchMessage(Handler.java:99)
07-08 18:23:21.179: E/AndroidRuntime(23510): at android.os.Looper.loop(Looper.java:137)
07-08 18:23:21.179: E/AndroidRuntime(23510): at android.app.ActivityThread.main(ActivityThread.java:4441)
07-08 18:23:21.179: E/AndroidRuntime(23510): at java.lang.reflect.Method.invokeNative(Native Method)
07-08 18:23:21.179: E/AndroidRuntime(23510): at java.lang.reflect.Method.invoke(Method.java:511)
07-08 18:23:21.179: E/AndroidRuntime(23510): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
07-08 18:23:21.179: E/AndroidRuntime(23510): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
07-08 18:23:21.179: E/AndroidRuntime(23510): at dalvik.system.NativeStart.main(Native Method)
Where is the problem? | 0 | [
2,
8247,
9,
14255,
9,
1126,
17657,
13670,
4634,
10066,
872,
3533,
21,
858,
800,
3726,
3726,
31,
307,
3533,
21,
858,
19,
14,
2942,
19348,
568,
14,
1797,
45,
968,
1,
14706,
872,
8353,
2549,
4414,
1,
968,
1,
2549,
800,
78,
7718,
57... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
View cannot access system.data.objects / Controllers Can
===
I am using MVC 4, my project was upgraded from MVC 3.
Entity Framework is version 5.
I have a controller that is able to use objectcontext from System.Data.Objects.
My Usings:
using System.Data.Objects;
using System.Data.Entity;
When I try to include the using in the view form System.Data.Objects, I get :
CS0234: The type or namespace name 'Objects' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
I am targeting .net 4.5
My Build Displays this message:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1561,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly. | 0 | [
2,
1418,
1967,
1381,
329,
9,
18768,
9,
23793,
18,
13,
118,
9919,
18,
92,
800,
3726,
3726,
31,
589,
568,
307,
8990,
268,
15,
51,
669,
23,
9958,
37,
307,
8990,
203,
9,
9252,
6596,
25,
615,
331,
9,
31,
57,
21,
9919,
30,
25,
777... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Equivalent of usleep() in CUDA kernel?
===
I'd like to call something like `usleep()` inside a CUDA kernel. The basic goal is to make all GPU cores sleep or busywait for a number of millesconds--it's part of some sanity checks that I want to do for a CUDA application. My attempt at doing this is below:
#include <unistd.h>
#include <stdio.h>
#include <cuda.h>
#include <sys/time.h>
__global__ void gpu_uSleep(useconds_t wait_time_in_ms)
{
usleep(wait_time_in_ms);
}
int main(void)
{
//input parameters -- arbitrary
// TODO: set these exactly for full occupancy
int m = 16;
int n = 16;
int block1D = 16;
dim3 block(block1D, block1D);
dim3 grid(m/block1D, n/block1D);
useconds_t wait_time_in_ms = 1000;
//execute the kernel
gpu_uSleep<<< grid, block >>>(wait_time_in_ms);
return 0;
}
I get the following error when I try to compile this using NVCC:
error: calling a host function("usleep") from a __device__/__global__
function("gpu_uSleep") is not allowed
Clearly, I'm not allowed to use a host function such as `usleep()` inside a kernel. What would be a good alternative to this? | 0 | [
2,
4602,
16,
287,
21092,
5,
6,
19,
272,
5729,
17007,
60,
800,
3726,
3726,
31,
22,
43,
101,
20,
645,
301,
101,
13,
1,
291,
21092,
5,
6,
1,
572,
21,
272,
5729,
17007,
9,
14,
2125,
1195,
25,
20,
233,
65,
489,
4201,
2884,
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... |
unable to make file editable on mac ox (lion)
===
I'm trying to edit the httpd.conf file located in /private/etc/apache2, and I can't figure out how to get permission to write
I've done
$ cd /private/etc/apache2
$ sudo chown bdh httpd.conf
$ ls -lash
0 drwxr-xr-x 13 root wheel 442B Jun 7 00:11 .
0 drwxr-xr-x 93 root wheel 3.1K Jun 26 10:51 ..
0 drwxr-xr-x 13 root wheel 442B Jan 3 16:26 extra
24 -r--r--r-- 1 bdh wheel 24K Jun 7 00:11 httpd.conf
...etc...
$ vim httpd.conf
and it says `"httpd.conf" [readonly] 677L, 24330C`
tried `cp`ing to the desktop, but I cant get permission to edit it there either
I'm pretty new to using the terminal, is there some other command I can use?
| 0 | [
2,
2343,
20,
233,
3893,
9392,
579,
27,
1572,
7506,
13,
5,
14891,
6,
800,
3726,
3726,
31,
22,
79,
749,
20,
9392,
14,
7775,
43,
9,
14093,
3893,
335,
19,
13,
118,
20181,
118,
1198,
150,
118,
7738,
2569,
135,
15,
17,
31,
92,
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... |
active on hover
===
I want to create a tabbed window. with 3 tabs, `Blue`, `Green` and `Red`. the first tab, `Blue` and its content are selected default.
I need a jQuery script to do this job:
When mouse goes on each tab, the title should be selected (`selected` class) and the content shows; and when mouse goes out (from title or content), after 500 milliseconds, default tab should be selected. (the most important thing: when the mouse goes down from title to content, content shouldn't hide. if mouse completely goes out, the default should show)
Another thing is it, if use click on the selected title or content, default should change to current selected tab.
I create [this fiddle][1], for example.
Thanks, a lot.
[1]: http://jsfiddle.net/Xkjbq/3/ | 0 | [
2,
1348,
27,
21350,
800,
3726,
3726,
31,
259,
20,
1600,
21,
6523,
4283,
1463,
9,
29,
203,
6523,
18,
15,
13,
1,
6997,
1,
15,
13,
1,
6852,
1,
17,
13,
1,
2095,
1,
9,
14,
64,
6523,
15,
13,
1,
6997,
1,
17,
82,
2331,
50,
1704,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
In ColdFusion what do single and double quotes around attribute values do?
===
For example what do the "" around #Trim(FORM.fromfirstname)# do? I'm adding <cfqueryparam...> tags and am wondering if the quotes are still required?
<CFQUERY NAME="account" DATASOURCE="#APPLICATION.centralDSN#">
SELECT *
FROM users
WHERE (firstname =<CFQUERYPARAM VALUE="#Trim(FORM.fromfirstname)#">)
AND (lastname = <CFQUERYPARAM VALUE="#Trim(FORM.fromlastname)#">)
AND (email = '#Trim(FORM.fromemail)#')
</CFQUERY>
Here's one that doesn't use quotes for the `WHERE` clause
<CFIF getUser.RecordCount>
<CFQUERY NAME="cUser" DATASOURCE="#APPLICATION.centralDSN#">
UPDATE users
SET mailing_list = <CFIF IsDefined("FORM.mailing_list")>#FORM.mailing_list#<CFELSE>0</CFIF>
WHERE user_id = #getUser.user_id#
</CFQUERY>
</cfif> | 0 | [
2,
19,
1191,
9818,
98,
107,
345,
17,
1494,
18901,
140,
35,
14755,
4070,
107,
60,
800,
3726,
3726,
26,
823,
98,
107,
14,
13,
7,
7,
140,
6926,
3367,
79,
5,
4190,
9,
2665,
3552,
7259,
6,
5910,
107,
60,
31,
22,
79,
4721,
13,
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... |
C++ read()-ing from a socket to an ofstream
===
Is there a C/C++ way to read data from a socket using read() and having the receiving buffer be a file (ofstream) or a similar self-extending object (vector e.g.)?
Thanks. | 0 | [
2,
272,
20512,
1302,
5,
6,
8,
68,
37,
21,
18482,
20,
40,
16,
11260,
800,
3726,
3726,
25,
80,
21,
272,
118,
150,
20512,
161,
20,
1302,
1054,
37,
21,
18482,
568,
1302,
5,
6,
17,
452,
14,
3396,
17497,
44,
21,
3893,
13,
5,
1041,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
This LINQ-to-Entities join seems overly complex, am I doing something wrong?
===
I have two queries that I need to combine in LINQ that both actually come from the same table. The reason for this is that one of the queries needs to get the max of a field for each day and then sum the days together where the second query can just sum everything right off the bat. Here is the first query:
var queryDownload = from p in
(from p in almdbContext.cl_contact_event
where p.time_of_contact >= startDate && p.time_of_contact < endDate && p.input_file_name.Contains(inputFileName) && listName.Contains(listName)
group p by new
{
date = EntityFunctions.CreateDateTime(p.time_of_contact.Value.Year, p.time_of_contact.Value.Month, p.time_of_contact.Value.Day, 0, 0, 0),
listName = p.contact_list_name
} into g
select new
{
date = g.Key.date,
listName = g.Key.listName,
download = g.Max(a => a.total_number_of_records)
})
group p by p.listName into g
select new
{
listName = g.Key,
totalDownload = g.Sum(a => a.download),
};
This is the second:
var queryPenData = from p in almdbContext.cl_contact_event
where p.time_of_contact >= startDate && p.time_of_contact < endDate && p.input_file_name.Contains(inputFileName) && listName.Contains(listName)
group p by p.contact_list_name into g
select new
{
listName = g.Key,
dials = g.Sum(a => a.ov_dial_start_time != null ? 1 : 0),
agentConnects = g.Sum(a => a.agent_login_name != null ? 1 : 0),
abandons = g.Sum(a => a.response_status == "DAC" || a.response_status == "DAD" ? 1 : 0),
rightPartyContacts = g.Sum(a => a.response_status == "PTP" || a.response_status == "RPC" ? 1 : 0),
promiseToPays = g.Sum(a => a.response_status == "PTP" ? 1 : 0),
talkTime = g.Sum(a => EntityFunctions.DiffSeconds(a.ov_call_connected_time, a.ov_trunk_released_time)) ?? 0,
wrapTime = g.Sum(a => EntityFunctions.DiffSeconds(a.ov_trunk_released_time, a.record_released_time)) ?? 0
};
And this is the query joining them together.
var queryJoin = queryDownload.Join(queryPenData,
o => o.listName,
i => i.listName,
(o, i) => new
{
listName = i.listName,
download = o.totalDownload,
dials = i.dials,
agentConnects = i.agentConnects,
abandons = i.abandons,
rightPartyContacts = i.rightPartyContacts,
promiseToPays = i.promiseToPays,
talkTime = i.talkTime,
wrapTime = i.wrapTime
});
This seems extremely verbose/roundabout to me. Is there a better way I can write/approach this to shrink/simplify the code? | 0 | [
2,
48,
6294,
1251,
8,
262,
8,
2291,
3808,
1865,
2206,
18234,
1502,
15,
589,
31,
845,
301,
1389,
60,
800,
3726,
3726,
31,
57,
81,
9386,
2829,
30,
31,
376,
20,
12287,
19,
6294,
1251,
30,
156,
1121,
340,
37,
14,
205,
859,
9,
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... |
R: allEffects() on GLMM gives an error message
===
I get the following error messgae in R when I try to use allEffects() from the effects-package on a GLMM (mpc7j) created with glmer() from lme4:
>mpc7j<- glmer(correct_response ~ pc * Stim.cond + sess:pc + sess:Stim.cond + (1|item.no) + (1|id), data=d7nowl, family=binomial)
> allEffects(mpc7j)
Error in eval(expr, envir, enclos) : Object 'sess' not found
When I use allEffects() on a different model ("dummy") on the same data without a term including "sess" in the fixed effects, it works just fine.
>dummy<- glmer(correct_response ~ pc * Stim.cond + (1|item.no) + (1|id), data=d7nowl, family=binomial)
I used str(mpc7j) to check my model and it looks like "sess" is in there as factor in the group of contrast treatments.
.. .. ..$ pc : chr "contr.treatment"
.. .. ..$ Stim.cond: chr "contr.treatment"
.. .. ..$ sess : chr "contr.treatment"
"sess" is a factor with 2 levels and refers to the time of testing (repeated measures, session1 and session2). One of the subjects I tested was tested only once, not twice like all the other subjects. Could that have anything to do with the error?
I would appreciate any pointers as to what I am doing wrong here or where I should look for a solution. I already googled the error message without success. The R documentation on the allEffects() function did not help me either. Help, please? | 0 | [
2,
761,
45,
65,
21295,
18,
5,
6,
27,
13,
8430,
3363,
2352,
40,
7019,
2802,
800,
3726,
3726,
31,
164,
14,
249,
7019,
3957,
17721,
19,
761,
76,
31,
1131,
20,
275,
65,
21295,
18,
5,
6,
37,
14,
2292,
8,
8573,
1303,
27,
21,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
On click, passing a variable from Javascript into Rails/Ruby
===
I have a Javascript Highchart that I'm displaying and trying to get more information out of. I have it set up currently so when I click a column in the bar graph, it alerts me to the name of the column and the value.
I'm trying to go a step further by rendering the contents of that column of the graph in a table below. I have the HTML all done but I'm trying to pass in the value clicked, `this.category` which contains a string, into the @show_me instance variable that will render the chart as soon as it's not nil.
My code below is breaking my graph, causing it not to render. I'm not entirely sure of the correct way to pass in the value of `this.category` into @show_me on click.
Any help would be huge. Thanks so much!
> click: function() { this.category == <%= @show_me %>; } | 0 | [
2,
27,
10840,
15,
2848,
21,
7612,
37,
8247,
8741,
77,
2240,
18,
118,
1820,
779,
800,
3726,
3726,
31,
57,
21,
8247,
8741,
183,
5433,
38,
30,
31,
22,
79,
17418,
17,
749,
20,
164,
91,
676,
70,
16,
9,
31,
57,
32,
309,
71,
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... |
Best practice for converting an object to string
===
I've seen a number of ways of converting an `Object` to a `String` in .NET, typically for displaying the object's value to the user when the object type is not known.
These include:
Dim x as Object
Dim l_displayString As String
x = 3
l_displayString = "" & x
x = Nothing
l_displayString = If(x, "").ToString()
x = DbNull.Value
l_displayString = Convert.ToString(x)
Is there a method which is recommended by Microsoft, or do these all compile down to the same byte code? | 0 | [
2,
246,
1345,
26,
19583,
40,
3095,
20,
3724,
800,
3726,
3726,
31,
22,
195,
541,
21,
234,
16,
2847,
16,
19583,
40,
13,
1,
23793,
1,
20,
21,
13,
1,
11130,
1,
19,
13,
9,
2328,
15,
2442,
26,
17418,
14,
3095,
22,
18,
1923,
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 to simplify this mass of similar ifs
===
I am trying to figure out how to simplify this piece of code. The logic for every if condition is basically the same so I want to get rid of the duplicate ifs:
if "video_codec" in profile:
self.video_codec = profile["video_codec"]
if "resolution_width" in profile:
self.resolution_width = profile["resolution_width"]
if "resolution_height" in profile:
self.resolution_height = profile["resolution_height"]
if "ratio" in profile:
self.ratio = profile["ratio"]
if "video_bitrate" in profile:
self.video_bitrate = profile["video_bitrate"]
if "profile" in profile:
self.profile = profile["profile"]
if "audio_codec" in profile:
self.audio_codec = profile["audio_codec"]
if "audio_channels" in profile:
self.audio_channels = profile["audio_channels"]
if "audio_bitrate" in profile:
self.audio_bitrate = profile["audio_bitrate"]
I hope this can be done in 3-4 lines instead of my 18 lines. | 0 | [
2,
184,
20,
28257,
48,
1619,
16,
835,
100,
18,
800,
3726,
3726,
31,
589,
749,
20,
1465,
70,
184,
20,
28257,
48,
1855,
16,
1797,
9,
14,
7085,
26,
352,
100,
2874,
25,
11374,
14,
205,
86,
31,
259,
20,
164,
6681,
16,
14,
19429,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 it possible for Visual Studio C++ to compile objects without linking
===
I'm running VS 2010 SP1 and I have a special analysis configuration that runs once a week (because it takes a long time for the build server to analyze everything).
I'd like this configuration to run without bothering to link. If the analysis passes for all the code in a project, then I'd like the build to just continue on to the next project without linking.
I can't see a way to tell VS to just run the C++ compiler without linking. Does anyone know of a way to do this within an existing vcxproj?
My next course of action is hand editing the vcxproj to see if I can't get rid of the link phase of building. | 0 | [
2,
25,
32,
938,
26,
3458,
1120,
272,
20512,
20,
26561,
3916,
366,
12585,
800,
3726,
3726,
31,
22,
79,
946,
4611,
498,
3782,
165,
17,
31,
57,
21,
621,
2495,
8091,
30,
1461,
382,
21,
877,
13,
5,
4451,
32,
1384,
21,
175,
85,
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... |
How do I stop Devise from logging out my users when PayPal posts to the 'return' url?
===
Devise is logging out my users when PayPal posts to the 'return' url. Is there a way for paypal to post to the 'return' url and have the user stay logged in?
I presume this is because the session identifier is not present in the paypal post. But shouldn't there be a way for the user to stay logged in? | 0 | [
2,
184,
107,
31,
747,
29276,
37,
13,
13919,
70,
51,
3878,
76,
1372,
6720,
9868,
20,
14,
13,
22,
24632,
22,
287,
6362,
60,
800,
3726,
3726,
29276,
25,
13,
13919,
70,
51,
3878,
76,
1372,
6720,
9868,
20,
14,
13,
22,
24632,
22,
28... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Excel get multiples values based on a match condition?
===
I have a spreadsheet with 1000s of records.
The columns look like this:
> Path Year-Month Timestamp # SN Filename Match
> D:\ABC\trt21.mrk 2012-04 4/17/2012 10:57 2 trt21.mrk abcd.mrk
> D:\DEF\pty09.mrk 2012-05 5/17/2012 10:57 1 pty09.mrk zzz12.mrk
> D:\ABC\abcd.mrk 2012-06 6/17/2012 10:55 1 abcd.mrk ddy1.mrk
> D:\ABC\abcd.mrk 2012-07 7/2/2012 10:34 3 abcd.mrk
The columns Path, year-Month, Timestamp, #SN are all the related information for the column Filename. Match column contains some files that I m interested in. I want to be able to find if filename in Match column is in Filename column, then give me its all related info such as Path, Year-Month, Timestamp, #SN, Filename.
So it will bring me back this:
> Path Year-Month Timestamp # SN Filename Match
> D:\ABC\abcd.mrk 2012-06 6/17/2012 10:55 1 abcd.mrk abcd.mrk
> D:\ABC\abcd.mrk 2012-07 7/2/2012 10:34 3 abcd.mrk
Any idea on how to get it? TIA. | 0 | [
2,
20700,
164,
1886,
18,
4070,
432,
27,
21,
730,
2874,
60,
800,
3726,
3726,
31,
57,
21,
1789,
17627,
29,
6150,
18,
16,
742,
9,
14,
7498,
361,
101,
48,
45,
13,
1,
2013,
159,
8,
6444,
436,
38,
10158,
6926,
8912,
3893,
7259,
730,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
VLC using :input-slave parameter in JS api
===
I'm trying with no luck the following code to play two files (video + audio) at the same time with the VLC JS api using the :input-slave option.
Separately, they play just fine.
Do anyone have an idea?
Thankyou!
function doGo()
{
var vlc = getVLC("vlc");
var options = [":rtsp-tcp",":input-slave=file://place/audio.WAV"];
var itemId = vlc.playlist.add("file://place/video.AVI","",options);
options = [];
vlc.playlist.playItem(itemId);
}
}
| 0 | [
2,
566,
6109,
568,
13,
45,
108,
4881,
8,
6151,
62,
18906,
19,
487,
18,
21,
2159,
800,
3726,
3726,
31,
22,
79,
749,
29,
90,
5419,
14,
249,
1797,
20,
418,
81,
6488,
13,
5,
14785,
2754,
4023,
6,
35,
14,
205,
85,
29,
14,
566,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Obtain Details of docx4j Comparison
===
I took the suggestion for comparing docx files from here: http://stackoverflow.com/questions/7308299/outofmemoryerror-while-doing-docx-comparison-using-docx4j
However, this line:
Body newBody = (Body) org.docx4j.XmlUtils.unmarshalString(contentStr);
triggers a number of JAXB Warnings such as:
WARN org.docx4j.jaxb.JaxbValidationEventHandler .handleEvent line 80 - [ERROR] : unexpected element (uri:"", local:"ins"). Expected elements are <{[?]}text>
INFO org.docx4j.jaxb.JaxbValidationEventHandler .handleEvent line 106 - continuing (with possible element/attribute loss)
That is understandable given that <code>org.docx4j.wml.Text</code> does not indicate handling for any nested tags *and* the string written by <code>Docx4jDriver.diff()</code> contains:
<w:t dfx:insert="true" xml:space="preserve"><ins>This</ins><ins> </ins><ins>first</ins><ins> </ins><ins>line</ins><ins> </ins><ins>has</ins><ins> </ins><ins>a</ins><ins> </ins></w:t>
Consequently, the <code>Text.getValue()</code> calls which contain <code><ins></code> tags return an empty String.
I'm attempting to programatically determine diffs between two docx files (original + result of round-tripping a docx transformation process) using the suggested approach plus the following code:
Body newBody = (Body) org.docx4j.XmlUtils.unmarshalString(contentStr);
for ( Object bodyPart : newBody.getContent() ) {
if ( bodyPart instanceof P ) {
P bodyPartInCast = (P)bodyPart;
for ( Object currentPContent : bodyPartInCast.getContent() ) {
if ( currentPContent instanceof R ) {
R pContentCast = (R)currentPContent;
for( Object currentRContent : pContentCast.getContent() ) {
if ( currentRContent instanceof JAXBElement ) {
JAXBElement rContentCast = (JAXBElement)currentRContent;
Object jaxbValue = rContentCast.getValue();
if ( jaxbValue instanceof Text ) {
Text textValue = (Text)jaxbValue;
System.out.println( "Text: --> " + textValue.getValue() );
}
}
}
}
}
}
}
So, the question is: if this isn't the correct approach for processing the details of the differences between two files, what is?
I'm using docx4j version 2.8.0 and will attempt to attache the two docx files being compared.
| 0 | [
2,
5545,
3289,
16,
9765,
396,
300,
728,
6050,
800,
3726,
3726,
31,
199,
14,
10910,
26,
15047,
9765,
396,
6488,
37,
235,
45,
7775,
6903,
25325,
2549,
9990,
9,
960,
118,
24652,
18,
118,
23647,
4075,
3483,
118,
1320,
1041,
790,
5171,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
CSS cutting off the right side of my webpage.
===
Hey guys not sure what the deal is but when the page is at full screen it all comes into view fine but when the browser is resized down to half or enough to get the top nav bar off the screen it will just cut it off and not animate unless you hover over it. I'm super new to CSS so I'm not really sure what would be causing it because a lot of this code is google-copypasted. So yeah any diagnostics or thoughts on what it might be would be awesome!!
http://jsfiddle.net/YkevD/ | 1 | [
2,
272,
18,
18,
5378,
168,
14,
193,
270,
16,
51,
2741,
6486,
9,
800,
3726,
3726,
8409,
2776,
52,
562,
98,
14,
1183,
25,
47,
76,
14,
2478,
25,
35,
503,
2324,
32,
65,
1624,
77,
1418,
1123,
47,
76,
14,
16495,
25,
302,
6560,
125... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
OS X 10.8 is missing mod_*_svn.so libraries
===
After upgrading to OS X 10.8 (Mountain Lion) I find that my SVN server is broken. Under 10.7 I had it set up to use the httpd server to provide access, but after the upgrade the LoadModules for dav_svn_module and authz_svn_module (mod_dav_svn.so and mod_authz_svn.so) are missing.
Does anyone know how to get these for the standard Apple-provided subversion (v1.6.18)?
thanks,
Thom
| 0 | [
2,
13,
759,
993,
332,
9,
457,
25,
2863,
7226,
1,
2483,
1,
18,
16578,
9,
656,
8649,
800,
3726,
3726,
75,
26939,
20,
13,
759,
993,
332,
9,
457,
13,
5,
23741,
6023,
6,
31,
477,
30,
51,
13,
18,
16578,
8128,
25,
2023,
9,
131,
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... |
Error, "The timestamp service is not available." when using codesign on Mac OS X 10.8
===
I'm signing an app bundle using an Apple Developer ID certificate. I need to sign using the the command line tool since our build is automated and runs from our toolchain. 90% of the time it works fine with this command:
ws5:bin nick$ codesign -fs "Developer ID Application: <my name here>" MyApp.app
ws5:bin nick$ spctl --assess MyApp.app
ws5:bin nick$
*Note:* MyApp.app is not my real applicaiton name, and `<my name here>` is not the actual value.
So, maybe 1 in 10 times it intermittently fails with this error:
MyApp.app: The timestamp service is not available.
I've verified the .app gets through the quarentine mechanism with `spctl --assess` and by zipping it and downloading the signed file -- so please don't say "you're doing it wrong, use Xcode". I know that Apple doesn't "officially" reccomend using `codesign` for developer ID certificates (according to a [WWDC video][1]) but we need to use it for automation and because our app is a strange combination of gcc and Qt build output.
Is the best strategy around this error to just retry until it works again? That's all I can think to do.
[1]: https://developer.apple.com/videos/wwdc/2012/?id=702 | 0 | [
2,
7019,
15,
13,
7,
124,
436,
38,
10158,
365,
25,
52,
904,
9,
7,
76,
568,
326,
19862,
27,
1572,
13,
759,
993,
332,
9,
457,
800,
3726,
3726,
31,
22,
79,
5479,
40,
4865,
10194,
568,
40,
4037,
10058,
4924,
6259,
9,
31,
376,
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 to open root directory in finder [Mac OS X]
===
I am a Mac freshman and I don't know how to open ceratin folders with Finder.
For example I want to place a script that launches a program in my folder /usr/local/bin , but the problem is I can't open that folder in Finder - what I know so far that Macintosh HD is "/" equivalent and there should be folders like bin/ sbin/ usr/ , but they aren't visible in Finder.
Is there any way to make them visible? ( I know I can paste that script into /usr/local/bin with a terminal command, but this is not my question ).
I've already done that using another file manager, but I want to know if it is possible in Finder since it is the default file manager for Mac OS X.
thanks
EDIT: I also know that there is such a way - open Finder, go to Macintosh HD and then choose "Go -> Go to a directory -> type 'usr' " and this is it, however this is super non-handy solution for me :P | 0 | [
2,
184,
20,
368,
5900,
16755,
19,
13,
18639,
636,
6893,
13,
759,
993,
500,
800,
3726,
3726,
31,
589,
21,
1572,
11297,
17,
31,
221,
22,
38,
143,
184,
20,
368,
13,
20684,
108,
19294,
18,
29,
13,
18639,
9,
26,
823,
31,
259,
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... |
In Eclipse. How can I change the automatic highlighting colors? (I made a Screenshot of what I mean)
===
I don´t know how to specify on what I mean exactly so I made a screenshot.
http://i.imgur.com/7iepp.png
How can I change the color on the light grey highlightnings? Diabling them would be also fine. | 0 | [
2,
19,
11652,
9,
184,
92,
31,
753,
14,
6715,
23102,
5268,
60,
13,
5,
49,
117,
21,
2324,
7868,
16,
98,
31,
884,
6,
800,
3726,
3726,
31,
221,
13,
38,
143,
184,
20,
19077,
27,
98,
31,
884,
1890,
86,
31,
117,
21,
2324,
7868,
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... |
How to programmatically classify a list of objects
===
I'm trying to take a long list of objects (in this case, applications from the iTunes App Store) and classify them more specifically. For instance, there are a bunch of applications currently classified as "Education," but I'd like to label them as Biology, English, Math, etc.
Is this an AI/Machine Learning problem? I have no background in that area whatsoever but would like some resources or ideas on where to start for this sort of thing. | 0 | [
2,
184,
20,
625,
6732,
1326,
25117,
21,
968,
16,
3916,
800,
3726,
3726,
31,
22,
79,
749,
20,
247,
21,
175,
968,
16,
3916,
13,
5,
108,
48,
610,
15,
3767,
37,
14,
12952,
4865,
1718,
6,
17,
25117,
105,
91,
3524,
9,
26,
4851,
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... |
What is the use of the Nuget .package directory in my solution root
===
My solution's `.package` folder increases the size of the solution by several orders of magnitude - not including my Mvc app's build folders, of course. The bin folder isn't getting commited to source control and I'm wondering if I can skip out on the nuget folder too without having negative side effects. | 0 | [
2,
98,
25,
14,
275,
16,
14,
3152,
3060,
13,
9,
8573,
1303,
16755,
19,
51,
4295,
5900,
800,
3726,
3726,
51,
4295,
22,
18,
13,
1,
9,
8573,
1303,
1,
19294,
7104,
14,
1072,
16,
14,
4295,
34,
238,
3204,
16,
10323,
13,
8,
52,
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... |
Opening file on android
===
i want to open a file that i create in android and allways give me this error
07-29 14:56:09.708: E/AndroidRuntime(577): at java.lang.reflect.Method.invoke(Method.java:511)
07-29 14:56:09.708: E/AndroidRuntime(577): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
07-29 14:56:09.708: E/AndroidRuntime(577): at dalvik.system.NativeStart.main(Native Method)
07-29 14:56:09.708: E/AndroidRuntime(577): at java.lang.reflect.Method.invokeNative(Native Method)
07-29 14:56:09.708: E/AndroidRuntime(577): at java.lang.reflect.Method.invoke(Method.java:511)
07-29 14:56:09.708: E/AndroidRuntime(577): at menu.menuapp.FrontActivity.confirm(FrontActivity.java:51)
07-29 14:56:09.708: E/AndroidRuntime(577): at libcore.io.Posix.open(Native Method)
This is the code to save the file.
//Opening the notes file to be write.
String notes_str = "<resource></resource>"
FileOutputStream notes_file = openFileOutput("notes.xml", Context.MODE_PRIVATE);
//Converting to string the notes_doc
String notes_str = new menu.menuapp.general().xmltostring(notes_doc);
//Saving on the file
notes_file.write(notes_str.getBytes());
//Closing the file.
notes_file.close();
This is the code to open the file.
File file = new File("notes.txt");
FileInputStream notes_xml = new FileInputStream(file);
byte fileContent[] = new byte[(int)notes_xml.available()];
//The information will be content on the buffer.
notes_xml.read(fileContent);
String strContent = new String(fileContent);
notes_xml.close(); | 0 | [
2,
1214,
3893,
27,
13005,
800,
3726,
3726,
31,
259,
20,
368,
21,
3893,
30,
31,
1600,
19,
13005,
17,
65,
11000,
590,
55,
48,
7019,
13,
2984,
8,
2738,
513,
23235,
45,
2545,
9,
465,
3099,
45,
13,
62,
118,
290,
18524,
3169,
891,
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... |
Sqlite no such table error
===
i am getting a table not found error .googled a lot but not able to found the source of the error
// class 1 update
public class update extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.update);
Button upbtn=(Button)findViewById(R.id.upbutton);
final EditText detedit=(EditText)findViewById(R.id.upedit);
final EditText amtedit=(EditText)findViewById(R.id.editText1);
stdb obj=new stdb(this);
final SQLiteDatabase dobj=obj.getWritableDatabase();
upbtn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
String setdet,setamt;
setdet=detedit.getText().toString();
setamt=amtedit.getText().toString();
//try{
String insertQuery = "INSERT INTO " +stdb.tname+" (" + stdb.details+" , "+stdb.amt+") VALUES("+setdet+" , "+setamt+");";
//Log.e("sql",insertQuery);
dobj.execSQL(insertQuery);
//}
//catch(SQLException e ){
// Log.e("sqlite",e.toString());
//}
}
});
}
} //class 2
public class stdb extends SQLiteOpenHelper {
private static final int version = 1;
public static final String dname = "statments.db";
public static final String tname="transactions";
public static final String sid = "sno";
public static final String details = "details";
public static final String amt = "amount";
public stdb(Context context) {
super(context, dname, null, version);
// TODO Auto-generated constructor stub
}
@Override
public void onCreate(SQLiteDatabase db) {
// TODO Auto-generated method stub
String ex="CREATE TABLE " + tname + " (" + sid + " INTEGER PRIMARY KEY AUTOINCREMENT," + details+ " VARCHAR(255),"+amt+" INTEGER);";
Log.e("ex",ex );
db.execSQL("CREATE TABLE " + tname + " (" + sid + " INTEGER PRIMARY KEY AUTOINCREMENT," + details+ " VARCHAR(255),"+amt+" INTEGER);");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS "+ tname);
onCreate(db);
}
}
Thanks in advance | 0 | [
2,
4444,
10601,
90,
145,
859,
7019,
800,
3726,
3726,
31,
589,
1017,
21,
859,
52,
216,
7019,
13,
9,
16111,
4875,
43,
21,
865,
47,
52,
777,
20,
216,
14,
1267,
16,
14,
7019,
12894,
718,
137,
11100,
317,
718,
11100,
9073,
2358,
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 install Sql Server 2008 through command-line with Visual Studio Setup Project
===
I have a windows form application that I am building which uses Sql Server 2008 for some database functionality. What I want to do is install a named Sql Server 2008 instance on the user's machine, so that I know the instance exists and I know what its name is.
At the moment I am using a very basic setup project to check for, and install, Sql Server 2008. I simply checked Sql Server 2008 in the "Prerequisites" dialog box, so it is downloading and installing Sql Server 2008 at program install if necessary. The problem with this is that, even if this installation goes through, I'm not guaranteed to have any Sql Server 2008 named instances available to me, and the default instance could be another version of Sql Server that I can't use. This is why I want my application to have its very own named instance.
I have done some research, and this link has shown me that I can set up an instance when installing Sql Server through the command line by using command line parameters:
[Embedding SQL Server 2008 Express in an Application][1]
However, I have no idea how to do that with a setup project. The only options I see are to have it download the necessary setup files and run them without any options. That link also notes that it is recommended that my installer contains the necessary Sql Server setup files instead of having to download them externally. I would like to do this, but I don't know how I would include, and then use, the setup files in my project.
Thanks very much to anyone who has the patience to help me understand this a little better.
[1]: http://msdn.microsoft.com/en-us/library/dd981032%28SQL.100%29.aspx | 0 | [
2,
184,
20,
16146,
4444,
255,
8128,
570,
120,
1202,
8,
1143,
29,
3458,
1120,
18161,
669,
800,
3726,
3726,
31,
57,
21,
1936,
505,
3010,
30,
31,
589,
353,
56,
2027,
4444,
255,
8128,
570,
26,
109,
6018,
18548,
9,
98,
31,
259,
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... |
Is there anyone who can tell me the APIS of java used to develop the netbeans?
===
I am a student of computer ENGG final year and i have to submit a minor project in this semester so I want to know about the APIs used in the development of `NETBEANS`, this question is asked by me because i am want to develop a software like the `NETBEANS` in my minor project. I know it is quite difficult to develop a software as `NETBEANS` is but the main thing is that i have to do it in minor project of this semester. | 1 | [
2,
25,
80,
1276,
72,
92,
494,
55,
14,
21,
8954,
16,
8247,
147,
20,
2803,
14,
4275,
863,
5950,
60,
800,
3726,
3726,
31,
589,
21,
1209,
16,
1428,
1957,
4572,
426,
159,
17,
31,
57,
20,
12298,
21,
1689,
669,
19,
48,
13738,
86,
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... |
rootViewController set but comes up as incorrect orientation
===
My situation is very similar to [this question][1] . I have an app that is universal where iPhone is in portrait orientation and the iPad is in Landscape and I switch between all of my main screens using the appDelegate.window.rootViewController = newScreen; The iPhone app works perfectly. The iPad app will sometime throw the screen up in portrait orientation instead of landscape. Here is some sample transition code:
AppDelegate* appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
ViewController* v = nil;
if (IS_IPAD()) {
v = [[ViewController alloc] initWithNibName:@"ViewController-iPad" bundle:nil];
}else{
v = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
}
[appDelegate.window setRootViewController:(UIViewController*)v];
I also tried this from [this other question][2] :
AppDelegate* appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
ViewController* v = nil;
if (IS_IPAD()) {
v = [[ViewController alloc] initWithNibName:@"ViewController-iPad" bundle:nil];
}else{
v = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
}
[UIView
transitionWithView:appDelegate.window
duration:0.5
options:UIViewAnimationOptionTransitionCrossDissolve
animations:^(void) {
BOOL oldState = [UIView areAnimationsEnabled];
[UIView setAnimationsEnabled:NO];
[appDelegate.window setRootViewController:(UIViewController*)v];
[UIView setAnimationsEnabled:oldState];
}
completion:nil];
But nothing has fixed it.
Also tried using [appDelegate.window makeKeyAndVisable] and [appDelegate.window makeKeyWindow] in the hopes that this would "shock" it into doing the correct orientation.
[1]: http://stackoverflow.com/questions/6532894/orientation-problem-when-i-set-a-rootviewcontroller
[2]: http://stackoverflow.com/questions/8053832/rootviewcontroller-animation-transition-initial-orientation-is-wrong | 0 | [
2,
5900,
4725,
12898,
1252,
309,
47,
1624,
71,
28,
18867,
10245,
800,
3726,
3726,
51,
1858,
25,
253,
835,
20,
636,
1565,
1301,
500,
2558,
165,
500,
13,
9,
31,
57,
40,
4865,
30,
25,
4172,
113,
21024,
25,
19,
5548,
10245,
17,
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... |
Zend Mail is declared as Ratware
===
I'm using Zend_mail with SMTP in a wrapper class like this:
//$_config has all required and valid attributes to send a mail successfully.
$tmpconfig = Array('auth' => 'login',
'username' => $this->_config->MAIL_LOGIN,
'password' => $this->_config->MAIL_PASSWORT);
$this->_transport = new Zend_Mail_Transport_Smtp($this->_config->MAIL_SMTP,$tmpconfig);
$this->_mail = new Zend_Mail();
$this->_mail->setFrom($this->_config->MAIL_ADDRESS, $this->_config->MAIL_SENDER_NAME);
...
//$_data has already all required and valid fields and values...
$this->_mail->setBodyText($this->_data['maildata']['BodyText'],'UTF-8','UTF-8');
$this->_mail->setSubject($this->_data['maildata']['Subject']);
$this->_mail->addTo($this->_data['maildata']['RecipientEmail'], $this->_data['maildata']['RecipientName']);
$this->_mail->send($this->_transport);
Scenario 1: I'm sending the Mail with a test account to a proprietary server to a test mailaddress from my testsystem. This mail will be received.
Scenario 2: I'm sending the Mail with another test account to another proprietary server to the same mailaddress, with two test systems. This mail is rejected as ratware. I've already talked to the server administrator, he said that the mail generation is incorrect. There is no valid EHLO greeting: "remote host used our name in HELO/EHLO greeting."
I don't really know if its a problem within the zend_mail class or the test systems.
1st Testsystem: PHP Version 5.3.2-1ubuntu4.14, Apache/2.2.14 (Ubuntu)
2nd Testsystem: PHP Version 5.3.1, Apache/2.2.14 (Unix) (Apache on Mac OS X) | 0 | [
2,
10526,
43,
4216,
25,
2482,
28,
4595,
5011,
800,
3726,
3726,
31,
22,
79,
568,
10526,
43,
1,
8079,
29,
7613,
13726,
19,
21,
28051,
718,
101,
48,
45,
12894,
4403,
1,
14093,
2816,
63,
65,
1390,
17,
7394,
13422,
20,
2660,
21,
4216... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-UI-Rails gem loading all modules
===
I know there a ton of questions about getting [jquery-ui-rails](https://github.com/joliss/jquery-ui-rails) to work with the asset pipeline, but I can't help myself.
I have the following in my `application.js`:
//= require jquery
//= require jquery_ujs
//= require jquery.ui.draggable
//= require_tree .
And my Gemfile has the following:
group :assets do
gem 'sass-rails', '3.1.0'
gem 'coffee-rails', '3.1.0'
gem 'uglifier', '1.1.0'
gem 'compass', '0.12.alpha.4'
gem 'compass-960-plugin', '0.10.4', :require => 'ninesixty'
gem 'formalize-rails', '0.1.2'
gem 'fancybox-rails', '0.1.4'
gem 'jquery-ui-rails', '0.4.0'
end
When I run `rake assets:precompile`, it spits out every conceivable jQuery-UI module. Why is this happening? | 0 | [
2,
487,
8190,
93,
8,
5661,
8,
7301,
18,
8551,
12797,
65,
17113,
800,
3726,
3726,
31,
143,
80,
21,
13,
444,
16,
2346,
88,
1017,
636,
728,
8190,
93,
8,
5661,
8,
7301,
18,
500,
5,
21127,
18,
6903,
10404,
20926,
9,
960,
118,
1636,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Rails: Custom Rake Task error => rake aborted! missing :controller
===
(RoR with Rails 3.1, gem rake 0.9.2.2)
I'm trying to run the most basic custom rake task as you can see here:
task :update_me => :environment do
Product.all.each do |product|
puts product.link
end
end
I keep getting the error below. The task will run if I just print out hello world and take out the ":environment" part. My rake task seems to be having trouble with the ":environment" part of this, but I need this to access my models.
rake aborted!
missing :controller
Tasks: TOP => update_me => environment
(See full trace by running task with --trace)
trace:
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/actionpack-3.2.3/lib/action_dispatch/routing/mapper.rb:179:in `default_controller_and_action'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/actionpack-3.2.3/lib/action_dispatch/routing/mapper.rb:76:in `normalize_options!'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/actionpack-3.2.3/lib/action_dispatch/routing/mapper.rb:59:in `initialize'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/actionpack-3.2.3/lib/action_dispatch/routing/mapper.rb:1302:in `new'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/actionpack-3.2.3/lib/action_dispatch/routing/mapper.rb:1302:in `add_route'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/actionpack-3.2.3/lib/action_dispatch/routing/mapper.rb:1282:in `decomposed_match'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/actionpack-3.2.3/lib/action_dispatch/routing/mapper.rb:1268:in `block in match'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/actionpack-3.2.3/lib/action_dispatch/routing/mapper.rb:1268:in `each'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/actionpack-3.2.3/lib/action_dispatch/routing/mapper.rb:1268:in `match'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/actionpack-3.2.3/lib/action_dispatch/routing/mapper.rb:505:in `map_method'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/actionpack-3.2.3/lib/action_dispatch/routing/mapper.rb:467:in `get'
/home/ubuntu/code/preevio/config/routes.rb:35:in `block in <top (required)>'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:282:in `instance_exec'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:282:in `eval_block'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:260:in `draw'
/home/ubuntu/code/preevio/config/routes.rb:1:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `load'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `block in load'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `load'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/railties-3.2.3/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/railties-3.2.3/lib/rails/application/routes_reloader.rb:40:in `each'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/railties-3.2.3/lib/rails/application/routes_reloader.rb:40:in `load_paths'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/railties-3.2.3/lib/rails/application/routes_reloader.rb:16:in `reload!'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/railties-3.2.3/lib/rails/application/routes_reloader.rb:26:in `block in updater'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/activesupport-3.2.3/lib/active_support/file_update_checker.rb:78:in `call'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/activesupport-3.2.3/lib/active_support/file_update_checker.rb:78:in `execute'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/railties-3.2.3/lib/rails/application/routes_reloader.rb:27:in `updater'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/railties-3.2.3/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/railties-3.2.3/lib/rails/application/finisher.rb:66:in `block in <module:Finisher>'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/ubuntu/code/preevio/config/environment.rb:5:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/railties-3.2.3/lib/rails/application.rb:103:in `require_environment!'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/railties-3.2.3/lib/rails/application.rb:292:in `block (2 levels) in initialize_tasks'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/home/ubuntu/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/home/ubuntu/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/bin/rake:19:in `load'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p290@rails31/bin/rake:19:in `<main>'
| 0 | [
2,
2240,
18,
45,
5816,
21009,
3005,
7019,
800,
1,
21009,
21557,
69,
187,
2863,
13,
45,
12898,
1252,
800,
3726,
3726,
13,
5,
139,
248,
29,
2240,
18,
203,
9,
165,
15,
8551,
21009,
713,
9,
518,
9,
135,
9,
135,
6,
31,
22,
79,
74... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
SQL statement working in MySQL not working in Postgresql - Sum & group_by rails 3
===
So I'm very new to working in SQL in general, let alone rails but I have this statement that works in MySQL:
portfolio_values.select("portfolio_values.*, SUM(portfolio_values.value) as totals").group("portfolio_values.day").map(&:totals)
But in postgresql is throws this error:
> GError: ERROR: column "portfolio_values.id" must appear in the GROUP
> BY clause or be used in an aggregate function : SELECT
> portfolio_values.*, SUM(portfolio_values.value) as totals FROM
> "portfolio_values" WHERE "portfolio_values"."user_id" = 3 GROUP BY
> portfolio_values.day ActiveRecord::StatementInvalid: PGError: ERROR:
> column "portfolio_values.id" must appear in the GROUP BY clause or be
> used in an aggregate function
I just don't really understand what its saying I should be doing differently? | 0 | [
2,
4444,
255,
3331,
638,
19,
51,
18,
22402,
52,
638,
19,
678,
6879,
18,
22402,
13,
8,
3907,
279,
214,
1,
779,
2240,
18,
203,
800,
3726,
3726,
86,
31,
22,
79,
253,
78,
20,
638,
19,
4444,
255,
19,
297,
15,
408,
1056,
2240,
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... |
Can I pass a variable in a Meta Http Equiv Refresh?
===
I just finished this script it works well, but I am struggling to pass along the $invite variable to the register.php page. Can someone please tell me how I can achieve this? I have it defined as $invite = $_POST['inviteinput'];
How do I get the users input from index.php to transfer to register.php? Thank you for your help!
HTML FORM:
<form action="index.php" method="post">
What is your Invite Code?<BR />
<input class="textbox" name="inviteinput" type="text" />
<BR />
<input type="hidden" name="formsubmitted" value="TRUE" />
<input name="Submit" type="submit" value="Verify" />
</form>
PHP:
<?PHP
include ('scripts/dbconnect.php');
$invite = $_POST['inviteinput'];
if (isset($_POST['formsubmitted'])) {
if (empty($_POST['inviteinput'])) {
echo '<div class="errormsgempty"><u>ERROR</u>:<br>You must enter a valid invite code to proceed!</div>';
} else {
$invite = $_POST['inviteinput'];//else assign it a variable
$invite = stripslashes($invite);
$invite = mysql_real_escape_string($invite);
$sql = "SELECT yourMemberId FROM Register WHERE yourMemberId='$invite'";
$result = mysql_query($sql);
if(mysql_num_rows($result) > 0) {
echo '<META HTTP-EQUIV="Refresh" Content="0; URL=register.php">';
} else {
echo '<div class="errormsgbox"><u>ERROR</u>:<br>The Invite Code you entered ' . $invite . ' is NOT a valid invite code!</div>';
//($notvalidcode = "The Invite Code you entered <strong>" . $invite . "</strong> is NOT a valid invite code!");
}
}
}
?> | 0 | [
2,
92,
31,
1477,
21,
7612,
19,
21,
7618,
7775,
13,
9629,
710,
24905,
60,
800,
3726,
3726,
31,
114,
842,
48,
3884,
32,
693,
134,
15,
47,
31,
589,
7587,
20,
1477,
303,
14,
5579,
108,
8901,
62,
7612,
20,
14,
2243,
9,
26120,
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... |
CDI Injection and serialization
===
I'm considering to use CDI injection for slf4j logger, so I've created a producer.
I'm injecting it into an ApplicationScoped bean which is serializable:
@ApplicationScoped
public final class CurrentApplicationBean implements Serializable {
@Inject
private transient Logger logger;
}
It must be transient because org.slf4j.Logger is an interface which doesn't extend Serializable, but this means that the logger must be re-injected after deserialization.
I think that CDI doesn't handle that, what's you knowledge?
Moreover, the provider always provides a new Logger instance beacuse it must set the logger name from the InjectionPoint, this means that RequestScoped beans have their own logger instance instead of a static per class logger.
Maybe logging is not a good context for CDI injection... what are your considerations?
Thank you
| 0 | [
2,
1745,
49,
13646,
17,
5956,
1829,
800,
3726,
3726,
31,
22,
79,
5154,
20,
275,
1745,
49,
13646,
26,
13,
18,
9641,
300,
728,
13,
29480,
15,
86,
31,
22,
195,
679,
21,
1421,
9,
31,
22,
79,
20316,
68,
32,
77,
40,
3010,
11555,
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... |
Conevrt 3 and more elements Python tuple to dictionary
===
Is there a way to create dictionary from Python 3 elements tuple? I saw may examples how this can be achieved with 2 elements tuple. I'm thinking to convert 2 of the elements of each tuple to another tuple, but I have a feeling that it can be achieved differently. Appreciate any help) | 0 | [
2,
11085,
6938,
38,
203,
17,
91,
2065,
20059,
2289,
5106,
20,
9186,
800,
3726,
3726,
25,
80,
21,
161,
20,
1600,
9186,
37,
20059,
203,
2065,
2289,
5106,
60,
31,
441,
123,
3770,
184,
48,
92,
44,
3153,
29,
172,
2065,
2289,
5106,
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... |
How to configure WebLogic to run as a Windows Service
===
I am having some trouble getting WebLogic to run as a Windows Service.
I ran the scripts to install the Service and I can see it in the Services menu list.
However when I try to start it. I get the following:
The beasvc base_domain_AdminServer service on blah-server started and then stopped.
Some services stop automatically if they are not in use by other service or programs.
I have even tried to net start from a cmd prompt and still no cigar.
net start "beasvc base_domain_AdminServer"
The beasvc base_domain_AdminServer service is starting.
The beasvc base_domain_AdminServer service could not be started.
The service did not report an error.
Has anyone encountered this and do you know a fix.
| 0 | [
2,
184,
20,
1065,
15951,
2741,
24268,
20,
485,
28,
21,
1936,
365,
800,
3726,
3726,
31,
589,
452,
109,
2572,
1017,
2741,
24268,
20,
485,
28,
21,
1936,
365,
9,
31,
717,
14,
17505,
20,
16146,
14,
365,
17,
31,
92,
196,
32,
19,
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... |
When I'm looking for a particular iPhone feature for my iPhone app, how do I know what class or framework to look for in Xcode documentation?
===
When I'm looking for a particular iPhone feature for my iPhone/iPad app, how do I know what class or framework to look for in Xcode documentation? | 0 | [
2,
76,
31,
22,
79,
699,
26,
21,
1498,
21024,
1580,
26,
51,
21024,
4865,
15,
184,
107,
31,
143,
98,
718,
54,
6596,
20,
361,
26,
19,
993,
9375,
13945,
60,
800,
3726,
3726,
76,
31,
22,
79,
699,
26,
21,
1498,
21024,
1580,
26,
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... |
boost::filesystem3::path buffer overflow exception
===
I get buffer overflow exceptions while using boost::filesystem3::path(std::string):
void InitConfigurator(const std::string& sConfigFileName)
{
if(sConfigFileName.empty() ||
!boost::filesystem3::exists(boost::filesystem3::path(sConfigFileName)) ||
false)
{
log4cxx::BasicConfigurator::configure();
}
else
{
// BasicConfigurator replaced with PropertyConfigurator.
log4cxx::PropertyConfigurator::configure(sConfigFileName);
}
}
Function stack is:
ArchiveServer.exe!__crt_debugger_hook() Unknown
ArchiveServer.exe!__report_gsfailure(unsigned __int64 StackCookie=1438471) Строка 302 C
ArchiveServer.exe!__GSHandlerCheck_EH(_EXCEPTION_RECORD * ExceptionRecord=0x0000000000160000, void * EstablisherFrame=0x000000000015f310, _CONTEXT * ContextRecord=0x000000013fd76178, _DISPATCHER_CONTEXT * DispatcherContext=0x0000000000155000) Строка 99 C
ntdll.dll!0000000077b24f4d()
[Указанные ниже фреймы могут быть неверны и (или) отсутствовать, символы для ntdll.dll не загружены]
ntdll.dll!0000000077b05b3c()
ntdll.dll!0000000077b3f638()
KernelBase.dll!000007fefdb4a88d()
msvcr90d.dll!_CxxThrowException(void * pExceptionObject=0x000000000015f0c0, const _s__ThrowInfo * pThrowInfo=0x00000000716eb448) Строка 161 C++
msvcp90d.dll!std::_String_base::_Xran() Строка 18 + 0x32 байт C++
msvcp90d.dll!std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >::replace(unsigned __int64 _Off=719889, unsigned __int64 _N0=18446744073708831715, const std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > & _Right="ArchiveServerLog.conf", unsigned __int64 _Roff=0, unsigned __int64 _Count=18446744073709551615) Строка 1316 C++
msvcp90d.dll!std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> >::replace(unsigned __int64 _Off=719889, unsigned __int64 _N0=18446744073708831715, const std::basic_string<unsigned short,std::char_traits<unsigned short>,std::allocator<unsigned short> > & _Right="ArchiveServerLog.conf") Строка 1309 C++
msvcp90d.dll!std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::replace(std::_String_const_iterator<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > * _First=0x000000000015f838 "", std::_String_const_iterator<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > * _Last=0xfffffffffffffffe <Неправильный указатель>, const std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > & _Right="ArchiveServerLog.conf") Строка 1441 + 0x13e байт C++
ArchiveServer.exe!std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::_Append<wchar_t *>() + 0xc9 байт C++
ArchiveServer.exe!`anonymous namespace'::convert_aux() + 0x11b байт C++
ArchiveServer.exe!boost::filesystem3::path_traits::convert() + 0xcf байт C++
ArchiveServer.exe!boost::filesystem3::path_traits::dispatch<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > >(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & c="ArchiveServerLog.conf", std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > & to=<Неправильный указатель>, const std::codecvt<wchar_t,char,int> & cvt={...}) Строка 175 C++
ArchiveServer.exe!boost::filesystem3::path::path<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & source="ArchiveServerLog.conf", void * __formal=0x0000000000000000) Строка 135 + 0x17 байт C++
ArchiveServer.exe!InitConfigurator(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & sConfigFileName="ArchiveServerLog.conf") Строка 15 + 0x2a байт C++
ArchiveServer.exe!main(int argc=2, char * * argv=0x0000000002679150) Строка 26 + 0x2a байт C++
ArchiveServer.exe!WinMain() + 0x149 байт C++
ArchiveServer.exe!__tmainCRTStartup() Строка 578 + 0x25 байт C
kernel32.dll!00000000779ef33d()
ntdll.dll!0000000077b22ca1()
My environment is MS Visual Studio 2008, x64, boost 1.49, charset - Unicode, wchar_t build-in type (yes).
I get this exception only in Release configuration. Debug works like a charm.
Please help me understand what is wrong with string conversion.
| 0 | [
2,
10419,
45,
45,
16877,
10724,
240,
45,
45,
8353,
17497,
20285,
5391,
800,
3726,
3726,
31,
164,
17497,
20285,
13392,
133,
568,
10419,
45,
45,
16877,
10724,
240,
45,
45,
8353,
5,
384,
43,
45,
45,
11130,
6,
45,
11364,
19,
242,
1126... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 automate capability changes for file?
===
I have a file in linux, that need some capabilities for start. I can set them using `setcap`, but the problem is that this file is updated very often and I don't want to set them every time the file is updated(and enter password during this process).
Is there any other way to do this, except to write a program that will do this? Or maybe could I somehow omit to save password in this program?(But I prefer don't write program at all)
And yes, I've already goggled about capabilities and my problem, and haven't found any suitable solution for it. Thanks!
| 1 | [
2,
184,
20,
3108,
5281,
11480,
1693,
26,
3893,
60,
800,
3726,
3726,
31,
57,
21,
3893,
19,
13024,
15,
30,
376,
109,
10209,
26,
799,
9,
31,
92,
309,
105,
568,
13,
1,
3554,
4666,
1,
15,
47,
14,
1448,
25,
30,
48,
3893,
25,
6372,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 git svn init handle sibling directories of trunk/branches/tags that should be part of base checkout
===
The macports svn repository looks like this:
branches/
contrib/
distfiles/
downloads/
tags/
trunk/
users/
I want to import this using git svn and use the standard features to correctly interpret the branches and tags.
What I would like to see is a single git repo that has directories
trunk/
contrib/
distfiles/
downloads/
users/
Or some other way to access all these parts of the repo without regarding them as branches and needing to switch every time I want to see them.
Maybe I'm just not understanding the other answers on this site but they seemed to be all aimed at dealing with nested projects or adding additional branches while this is just somehow having other related probjects coexist with trunk.
Yes, I know I could just add these all as submodules of some empty project but that would be a huge pain. The point is I want to be able to rebase the whole thing at once just as if these extra directories had been placed inside trunk. | 0 | [
2,
92,
13,
10404,
13,
18,
16578,
19,
242,
3053,
24792,
559,
1596,
16,
6436,
118,
23014,
160,
118,
8628,
18,
30,
378,
44,
141,
16,
1000,
2631,
1320,
800,
3726,
3726,
14,
1572,
1993,
18,
13,
18,
16578,
24869,
1879,
101,
48,
45,
43... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
php max execution time ignoring php.ini
===
I am trying to export a large database via phpMyAdmin. I jeep getting an error that the script stopped because the maximum execution time of 600 seconds was reached (or something like that). I tried setting `max_execution_time` in `php.ini` to 0 and -1. The change takes effect as I can see it in `phpinfo()`, but I am still getting the error. Another strang thing is that originally (before I changed it to 0) it wasn't 600 either. It was 180! Where is this 600 set? | 0 | [
2,
13,
26120,
2049,
5769,
85,
9321,
13,
26120,
9,
2651,
800,
3726,
3726,
31,
589,
749,
20,
7487,
21,
370,
6018,
1197,
13,
26120,
915,
1283,
2160,
9,
31,
14270,
1017,
40,
7019,
30,
14,
3884,
1175,
185,
14,
2979,
5769,
85,
16,
731... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
castle windsor passing parameters
===
I have a DI container and I want to pass in arguments to the constructor, via the DI container.
ie,
public interface IPerson { }
public class Person : IPerson {
private int _personId;
Person() { _personId = 0; }
Person(int id) { _personId = id; }
}
...
Container.Register(Component.For<IPerson>().ImplementedBy<Person>().Lifestyle.Transient);
...
//Person is already available
Container.Resolve<Person>(55);
//Person is not available
Container.Resolve<Person>();
This is basically what I want to do. Sometimes I need a new class created, sometimes I already have the class available. How would I achieve this please?
I have thought that I might be able to use dynamic parameters, but I am not sure how.
Thank you in advance.
| 0 | [
2,
1339,
10784,
2848,
12905,
800,
3726,
3726,
31,
57,
21,
926,
12147,
17,
31,
259,
20,
1477,
19,
10553,
20,
14,
6960,
248,
15,
1197,
14,
926,
12147,
9,
13,
660,
15,
317,
6573,
31,
7276,
13,
1,
13,
1,
317,
718,
840,
13,
45,
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... |
Regular expression to restrict to 100 characters without considering space and dot
===
Is there a way to limit the length of characters to 100 without taking into consideration blank spaces and dots using regular expression?
I have an expression ^\s*([^\s]\s*){0,100}$ which exempts space only.
| 0 | [
2,
1290,
1803,
20,
15436,
20,
808,
1766,
366,
5154,
726,
17,
14123,
800,
3726,
3726,
25,
80,
21,
161,
20,
4496,
14,
1476,
16,
1766,
20,
808,
366,
741,
77,
9888,
6463,
7644,
17,
17900,
568,
1290,
1803,
60,
31,
57,
40,
1803,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Forcing WaitForDebugEvent to execute a certain thread
===
I am writing a windows debugger, so I have the usual ContinueDebugEvent/WaitForDebugEvent loop:
while (true)
{
ContinueDebugEvent(hTargetProcessId, hTargetThreadId, lastDebugResult);
WaitForDebugEvent(&evt, INFINITE);
...
hTargetThreadId = evt.dwThreadId;
}
This works fine, but I'm in the process of adding a feature which requires the ability to execute a specific thread mid-debugging. To do this, I suspend all threads I'm not interested in, like this (I've omitted a load of code for brevity - hope this is clear enough!):
while (true)
{
if (onlyACertainThread)
{
for (int n=0; n<threadcount; n++)
if(threads[n] != certainThread)
SuspendThread(threads[n]);
}
ContinueDebugEvent(hTargetProcessId, hTargetThreadId, lastDebugResult);
WaitForDebugEvent(&evt, INFINITE);
if (onlyACertainThread)
{
for (int n=0; n<threadcount; n++)
if(threads[n] != certainThread)
ResumeThread(threads[n]);
}
...
(code to add to 'threads', update threadcount, decide if we want to restrict to a certain thread, etc)
...
hTargetThreadId = evt.dwThreadId;
}
However, I often see debug events from the wrong thread. For example:
* Thread A is running
* Decide we want to observe thread B; suspend thread A, call continue/waitfordebugevent(.. A.pid..)
* Get debug notifications (breakpoints, exceptions) from thread A.
What I want is for the final step to be 'get notifications from B'. I've tried calling WaitForDebugEvent(..B.pid..) which doesn't work.
Is this expected behaviour?
My suspicion is that thread suspend/resume counters are only observed by the kernel when at thread is being scheduled; ie, at the end of a timeslice. This would cause thread A to continue running until its current timeslice is up. Can anyone confirm/deny this idea? If so.. how would I work around it? My best idea at the moment is to 'inject' an artificial call to Sleep(0) after I suspend a thread, but I really don't want to do that unless I have to!
If it's any difference, the machine I run on is a single-threaded XP box. | 0 | [
2,
6135,
1760,
1426,
7665,
13054,
6645,
20,
15644,
21,
1200,
9322,
800,
3726,
3726,
31,
589,
1174,
21,
1936,
121,
2345,
11356,
15,
86,
31,
57,
14,
3820,
578,
7665,
13054,
6645,
118,
8195,
1426,
7665,
13054,
6645,
5293,
45,
133,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
In MySQL, how to set col1's value to col2's value when col2 and col3 values are not NULL?
===
In MySQL, how to set col1's value to col2's value when col2 and col3 values are not NULL?
UPDATE t SET col1=col2 WHERE col2 IS NOT NULL AND col3 IS NOT NULL;
Is this going to work? | 0 | [
2,
19,
51,
18,
22402,
15,
184,
20,
309,
3313,
165,
22,
18,
1923,
20,
3313,
135,
22,
18,
1923,
76,
3313,
135,
17,
3313,
240,
4070,
50,
52,
16203,
60,
800,
3726,
3726,
19,
51,
18,
22402,
15,
184,
20,
309,
3313,
165,
22,
18,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
cross compilation on ccs
===
I am supposed to build a project using neon intrinsic and since CCS doesn't support neon intrinsic, I am compiling the program on cygwin command line using GCC and will later link it on CCS.
Now the problem is that I have got the object file . But I am not able to link it on CCS. I don't want to be spoon fed , just a basic set of steps that I need to follow will suffice.Thank you in advance | 0 | [
2,
919,
4868,
27,
8093,
18,
800,
3726,
3726,
31,
589,
2293,
20,
1895,
21,
669,
568,
17907,
22892,
17,
179,
8093,
18,
1437,
22,
38,
555,
17907,
22892,
15,
31,
589,
24378,
14,
625,
27,
6728,
263,
4181,
1202,
293,
568,
489,
3384,
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... |
Eclipse crashes when attempting to "Sign in to Google" on Linux using two-factor authentication
===
First, apologies if StackOverflow is the wrong Q&A site for this question, I'm happy to move it to another if needed...
Eclipse crashes whenever I try to sign in to my Google account in the plugin (the link in bottom left of eclipse). I can enter my email and password ok, it then loads the page for my verification code (because I use [Google's two-factor authentication][1]). After I submit my verification code, eclipse completely crashes and disappears from my desktop.
Any ideas?
**Environment**: Fresh install of the following:
1. Mint Linux 13
1. I have two-factor authentication enabled on my Google (apps) account.
1. Eclipse Indigo
1. Google plugin for eclipse
[1]: http://googleblog.blogspot.co.uk/2011/02/advanced-sign-in-security-for-your.html | 0 | [
2,
11652,
21563,
76,
6314,
20,
13,
7,
11255,
19,
20,
8144,
7,
27,
13024,
568,
81,
8,
17455,
27963,
800,
3726,
3726,
64,
15,
27101,
100,
7566,
2549,
9990,
25,
14,
1389,
2593,
1569,
58,
689,
26,
48,
1301,
15,
31,
22,
79,
1700,
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... |
How show label message in JSP
===
Could you please help me in displaying message after certain work done like 1 record deleted after
deleting data from database.
In JFrame there is a method like setVisible(true), similarly is there any way in JSP? | 0 | [
2,
184,
298,
1899,
2802,
19,
487,
3401,
800,
3726,
3726,
110,
42,
2247,
448,
55,
19,
17418,
2802,
75,
1200,
170,
677,
101,
137,
571,
19584,
75,
121,
1336,
68,
1054,
37,
6018,
9,
19,
487,
8361,
80,
25,
21,
2109,
101,
309,
3762,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0,
0,
0... |
How to manipulate a given String to get 2 different string using regex?
===
I need to do to a String manipulation. Initially i will be getting an image path as one of the below <br>
image = images/registration/student.gif <br>
image = images/registration/student_selected.gif <br>
image = images/registration/student_highlighted.gif <br>
and i need to manipulate the string image path to get 2 different image paths.
<br> One is to get the path as <br>
image1 = images/registration/student.gif <br>
for that i used the below function <br>
private String getImage1(final String image) {
String image1 = image;
image1 = image.replace("_highlight", "");
image1 = image.replace("_selected", "");
return image1;
}
the second image path i need is to get the path <br>
image2 = image = images/registration/student_selected.gif <br>
the function i used to get the image2 output was
<br>
private String getImage2(final String image) {
String image2 = image;
boolean hasUndersore = image2.matches("_");
if (hasUndersore) {
image2 = image2.replace("highlight", "selected");
} else {
String[] words = image2.split("\\.");
image2 = words[0].concat("_selected.") + words[1];
}
return image2;
}
But the above methods didn't give me the expected result. Can anyone help me with it?
Thanks a lot!
| 0 | [
2,
184,
20,
18468,
21,
504,
3724,
20,
164,
172,
421,
3724,
568,
7953,
1706,
60,
800,
3726,
3726,
31,
376,
20,
107,
20,
21,
3724,
17561,
9,
1537,
31,
129,
44,
1017,
40,
1961,
2013,
28,
53,
16,
14,
1021,
13,
1,
5145,
1,
1961,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 foreign keys and allow null on existing field
===
So I am changing the scope on a database, and need to make a field which is a foreign key, allow null values.
I am doing this in phpmyadmin, but the query is below
ALTER TABLE `nuggets` CHANGE `n_st_id` `n_st_id` INT( 11 ) NULL DEFAULT NULL
It tells me the query ran successfully, but its showing null as no, and default as 0. Its an innodb table, any ideas why its not letting me change it? | 0 | [
2,
51,
18,
22402,
1228,
5534,
17,
1655,
16203,
27,
3149,
575,
800,
3726,
3726,
86,
31,
589,
4226,
14,
9914,
27,
21,
6018,
15,
17,
376,
20,
233,
21,
575,
56,
25,
21,
1228,
1246,
15,
1655,
16203,
4070,
9,
31,
589,
845,
48,
19,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
VHDL IEEE standard lib vs. component
===
I'm working on a VHDL project for a Xilinx FPGA, and found myself at a cross road.
I need for example to add two signals (C=A+B), and found that Xilinx has Tool that can generate a component which will do the job.
But this could also be implemented in standard VHDL: C <= A + B
If I use standard VHDL the code should be portable, but does this has lower throughput?
I mean, does the special components use DSP functions inside the FPGA ect., that makes them faster, or can the Synthesizer normally handle this? | 0 | [
2,
566,
252,
8643,
19215,
1236,
13,
8326,
4611,
9,
5912,
800,
3726,
3726,
31,
22,
79,
638,
27,
21,
566,
252,
8643,
669,
26,
21,
5641,
1226,
396,
13,
12087,
1136,
15,
17,
216,
992,
35,
21,
919,
383,
9,
31,
376,
26,
823,
20,
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... |
How to create a world map in R with specific countries filled in?
===
I would like to use R to generate a very basic world map with a specific set of countries filled with a red colour to indicate that they are malaria endemic countries.
I have a list of these countries in a data frame but am struggling to overlay them on a world map.
i have tried using the wrld_simpl object and also the joinCountryData2Map method in the rworldmap package
I would comment on this answer to prevent addition of a possibly redundant question but I do not have enough reputation at the moment, apologies for this.
http://stackoverflow.com/a/9102797/1470099
I am having difficulty understanding the arguments given to the plot() command - I wondered if there was just an easy way to tell R to plot all of the country NAMEs in my list on the wrld_simpl map.. instead of using grepl() etc. etc.
plot(wrld_simpl,
col = c(gray(.80), "red")[grepl("^U", wrld_simpl@data$NAME) + 1])
Hope this all makes sense, Many thanks!! | 0 | [
2,
184,
20,
1600,
21,
126,
2942,
19,
761,
29,
1903,
1166,
1943,
19,
60,
800,
3726,
3726,
31,
83,
101,
20,
275,
761,
20,
7920,
21,
253,
2125,
126,
2942,
29,
21,
1903,
309,
16,
1166,
1943,
29,
21,
402,
4609,
20,
4342,
30,
59,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Where to keep library in source code directory structure and build tools
===
My project have following components.
1. Third party library with custom source code path.
2. Third party library without any changes in source code as archive files(zip).
3. Our own common library
4. Source code for different app.
5. Common source code of different app.
Current Directory Structure look like this:
Trunk
/source/
app/
/commoncode
/webappcommoncode
/consoleappcommoncode
/app1
/app2
lib(our own written lib which is user in other projects)
/lib1
/external/
/src/(It contains library with custom patch code)
/lib1
/lib2
archive/
/lib1.zip
Is it a good directory structure ?
Another question should I keep patched library complete source code or only a patch file which can reduce the size of repo ?
| 0 | [
2,
113,
20,
643,
1248,
19,
1267,
1797,
16755,
1411,
17,
1895,
4672,
800,
3726,
3726,
51,
669,
57,
249,
5090,
9,
137,
9,
422,
346,
1248,
29,
5816,
1267,
1797,
2013,
9,
172,
9,
422,
346,
1248,
366,
186,
1693,
19,
1267,
1797,
28,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.