unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Grails Unique Constraint
===
i have grails application using `hibernate`
under `grails 1.3.7` everything works properly
but when i switch to `grails 2.0.3` the following problem appears
i can't check for unique fields under `java/src` directory. if i try to add or update any record with the same unique key, batch insert error appears
under `src/groovy` i create a class to check validation
Example: LanguageCommand.groovy
package myproject.command
import org.codehaus.groovy.grails.validation.Validateable;
@Validateable
class LanguageCommand {
String code
String codeDescription
static constraints= {
code(blank:false, maxSize:50)
codeDescription(maxSize:200)
}
}
and under `src/java` i create a class to check for unique fields
Example: LanguageConstraints.groovy
package myproject.model
constraints = {
code unique: true
}
where `myproject.model` is the name of the package that contains hibernate classes
<b>Note:</b> `Validation class works fine but the unique one not. i try to add unique constraints to validation class, same error appears`
<b>Error:</b>
Error 500: Executing action [save] of controller
[myproject.controller.LanguageController]
caused exception: Runtime error executing action
Servlet: grails
URI: /myproject/grails/language/save.dispatch
Exception Message: Batch entry 0 insert into language
(language_code, code_description, version, id)
values (en, English, 0, 1) was aborted.
Call getNextException to see the cause.
Caused by: Batch entry 0 insert into language
(language_code, code_description, version, id)
values (en, English, 0, 1) was aborted.
Call getNextException to see the cause.
Class: LanguageController
At Line: [125]
Code Snippet:
any help?
| 0 | [
2,
489,
7301,
18,
2619,
28804,
800,
3726,
3726,
31,
57,
489,
7301,
18,
3010,
568,
13,
1,
8630,
106,
8820,
1,
131,
13,
1,
263,
7301,
18,
137,
9,
240,
9,
465,
1,
796,
693,
7428,
47,
76,
31,
5521,
20,
13,
1,
263,
7301,
18,
17... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Flex mobile singleton downside
===
Are there any downsides of using Singleton Pattern in a flex mobile project ? Like memory consumption, performance , etc.. ?
Thank you | 0 | [
2,
14409,
3241,
345,
444,
125,
1416,
800,
3726,
3726,
50,
80,
186,
125,
1416,
18,
16,
568,
345,
444,
3732,
19,
21,
14409,
3241,
669,
13,
60,
101,
1912,
8330,
15,
956,
13,
15,
2722,
9,
9,
13,
60,
3531,
42,
3,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Batch file renaming file with its and date
===
I am trying to creat a batch file that rename all the files in the folder by its name underscore and date for example if there is a file name is >User1 so it will be >User1_25072012. I found a code which change all the file name by date but I and the name and the date as in the example above.
So could you please show me a way?
Thanks from now. | 0 | [
2,
13064,
3893,
25934,
3893,
29,
82,
17,
1231,
800,
3726,
3726,
31,
589,
749,
20,
5059,
721,
21,
13064,
3893,
30,
302,
7259,
65,
14,
6488,
19,
14,
19294,
34,
82,
204,
131,
15077,
17,
1231,
26,
823,
100,
80,
25,
21,
3893,
204,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 the last Textbox value before i hitting Delete key?
===
itemBox.addKeyUpHandler( new KeyUpHandler()
{
public void onKeyUp( KeyUpEvent event )
{
String currentValue = itemBox.getValue().trim();
// handle backspace
if( event.getNativeKeyCode() == KeyCodes.KEY_BACKSPACE )
{
if( "".equals( currentValue ) )
{
doTheJob( );
}
}
}
} );
Expect behavior:
when the textbox is empty, then i hit delete, will run doTheJob();
Current behavior:
when there is one character, i hit delete, it will trigger doTheJob();
In other word, is there any way i can get textbox content before i hit delete?
I tried to used a var to hold the last value, but it needs to register another listener and the impl is not so effective.
Thanks for your input. | 0 | [
2,
184,
20,
164,
14,
236,
1854,
5309,
1923,
115,
31,
6687,
27448,
1246,
60,
800,
3726,
3726,
9101,
5309,
9,
14854,
4237,
576,
3203,
1252,
5,
78,
1246,
576,
3203,
1252,
5,
6,
13,
1,
317,
11364,
27,
4237,
576,
5,
1246,
576,
4943,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 make bold font NSString value?
===
I am new in iPhone application development. i am developing now iPhone application. In this application i want make bold font in NSString value. How can i achieve this. I am used below code for making bold font text in NSString value. But showing error
like this
Undefined symbols for architecture i386:
"_kCIAttributeName",
NSString *boldFontName = [[UIFont boldSystemFontOfSize:12] fontName];
NSString *yourString = [NSString stringWithFormat:@"%@%@%@",key,@":",@" "];
NSRange boldedRange = NSMakeRange(22, 4);
NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:yourString];
[attrString beginEditing];
[attrString addAttribute:kCIAttributeName
value:boldFontName
range:boldedRange];
[attrString endEditing];
NSString *string = [NSString stringWithFormat:@"%@%@",attrString,[dic objectForKey:key]];
can you help me how to make bold font in string.
Thanks
| 0 | [
2,
184,
20,
233,
5657,
9978,
13,
2172,
11130,
1923,
60,
800,
3726,
3726,
31,
589,
78,
19,
21024,
3010,
522,
9,
31,
589,
3561,
130,
21024,
3010,
9,
19,
48,
3010,
31,
259,
233,
5657,
9978,
19,
13,
2172,
11130,
1923,
9,
184,
92,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Removing Charts in Excel
===
I was trying to chart some RTD data and accidentally ended up with hundreds of charts on the same worksheet. Now I'm trying to undo my error and remove all of the charts but I'm not having much luck with it.
I recorded a macro where I deleted one of the charts manually and then tried editing the code to loop through all of the charts but I keep getting an error. My code is below:
Sub Macro3()
Dim i As Integer
For i = 1 To 100
Sheets("Calculations").Select
ActiveSheet.ChartObjects("Chart " & CStr(i)).Activate
ActiveChart.ChartArea.Select
ActiveWindow.Visible = False
Selection.Delete
Next i
End Sub
When I try running this, I get an error saying that the ChartObjects property was inaccessible from the Worksheet class.
I'm sure there's a simple explanation/solution to this but I've learned that VBA sometimes does things a little differently than you might be expecting. So, I guess my question is, how do I remove the charts without having to go through each one at a time?
Any help would be appreciated. Thanks. | 0 | [
2,
9096,
5158,
19,
20700,
800,
3726,
3726,
31,
23,
749,
20,
1795,
109,
13,
5256,
43,
1054,
17,
9746,
1272,
71,
29,
4541,
16,
5158,
27,
14,
205,
170,
17627,
9,
130,
31,
22,
79,
749,
20,
367,
537,
51,
7019,
17,
4681,
65,
16,
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... |
Navigational entity threw an exception of type 'System.ObjectDisposedException'
===
I have following EF code first code. It is working fine. But when I look for the value of 'club2.Members', it says following:
> 'club2.Members' threw an exception of type 'System.ObjectDisposedException'.
Message is:
> The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.
I have not set value for Members property. That’s okay. However it should not cause any exception internally. Is there a way to overcome this exception?
![enter image description here][1]
namespace LijosEF
{
public class Person
{
public int PersonId { get; set; }
public string PersonName { get; set; }
public virtual ICollection<Club> Clubs { get; set; }
}
public class Club
{
public int ClubId { get; set; }
public string ClubName { get; set; }
public virtual ICollection<Person> Members { 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)
{
//Fluent API - Plural Removal
modelbuilder.Conventions.Remove<PluralizingTableNameConvention>();
}
public DbSet<Person> Persons { get; set; }
public DbSet<Club> Clubs { get; set; }
}
}
static void Main(string[] args)
{
Database.SetInitializer<NerdDinners>(new MyInitializer());
CreateClubs();
CheckValues();
}
public static void CreateClubs()
{
string connectionstring = "Data Source=.;Initial Catalog=NerdDinners;Integrated Security=True;Connect Timeout=30";
using (var db = new NerdDinners(connectionstring))
{
Club club1 = new Club();
club1.ClubName = "club1";
Club club2 = new Club();
club2.ClubName = "club2";
Club club3 = new Club();
club3.ClubName = "club3";
db.Clubs.Add(club1);
db.Clubs.Add(club2);
db.Clubs.Add(club3);
int recordsAffected = db.SaveChanges();
}
}
public static Club GetClubs(string clubName)
{
string connectionstring = "Data Source=.;Initial Catalog=NerdDinners;Integrated Security=True;Connect Timeout=30";
using (var db = new NerdDinners(connectionstring))
{
var query = db.Clubs.SingleOrDefault(p => p.ClubName == clubName);
return query;
}
}
public static void CheckValues()
{
string connectionstring = "Data Source=.;Initial Catalog=NerdDinners;Integrated Security=True;Connect Timeout=30";
using (var db = new NerdDinners(connectionstring))
{
Club club1 = GetClubs("club1");
Club club2 = GetClubs("club2");
Club club3 = GetClubs("club3");
}
}
[1]: http://i.stack.imgur.com/p8XdD.jpg | 0 | [
2,
8368,
192,
9252,
3144,
40,
5391,
16,
1001,
13,
22,
10724,
9,
23793,
2906,
15690,
43,
10066,
872,
22,
800,
3726,
3726,
31,
57,
249,
11599,
1797,
64,
1797,
9,
32,
25,
638,
1123,
9,
47,
76,
31,
361,
26,
14,
1923,
16,
13,
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... |
MobiScroll and Jquery Validation Plugin Ignoring each other
===
I am using [MobiScroll][1] Date and Time picker widget to fill in... the date and time on a form. The start date and end date are required fields. When I validate the form using the [JQuery validation plugin][2] it recognizes if the date/time field has a value or is empty.
If the input field is empty the plugin displays its usual warning. Normally the plugin dismisses the warning when the user corrects the input field, however, this doesnt happen with MobiScroll, the error stays until the form is re-submitted.
Does anybody know how the validation tool triggers the "re-evaluation" if you will?
[1]: http://mobiscroll.com/
[2]: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ | 0 | [
2,
7327,
403,
150,
8694,
17,
487,
8190,
93,
27999,
10922,
108,
9321,
206,
89,
800,
3726,
3726,
31,
589,
568,
636,
1293,
10056,
150,
8694,
500,
2558,
165,
500,
1231,
17,
85,
2036,
106,
4807,
43,
3060,
20,
3509,
19,
9,
9,
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... |
How to run GUI program using different user
===
I have three accounts on Windows 2008: Admin, User1, User2, User3. I would like to run GUI program from Admin account using c# on these User1, User2, User3 accounts. The problem is that while using `Process.Start` with User1 or any other user credentials the GUI app starts on Admin user desktop. I would like to run program on User1 desktop.
I would like to simulate behavior like manually we do: Switch User, Login with User1, Run GUI program.
Is it possible to do that? | 0 | [
2,
184,
20,
485,
9457,
625,
568,
421,
4155,
800,
3726,
3726,
31,
57,
132,
5310,
27,
1936,
15573,
21,
43,
2160,
15,
4155,
165,
15,
4155,
135,
15,
4155,
240,
9,
31,
83,
101,
20,
485,
9457,
625,
37,
21,
43,
2160,
2176,
568,
272,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 filter an option that has attribute "selected"
===
I have tried to use `.filter('[selected'])` but it does not work:
> options
[
<option label value data-parent="VUT" style="display: inline; "></option>
,
<option label="Fakulta architektury" value="architektury" data-parent="VUT" style="display: inline; ">Fakulta architektury</option>
,
<option label="Fakulta elektrotechniky" value="elektrotechniky" selected="selected" data-parent="VUT" style="display: inline; ">Fakulta elektrotechniky</option>
]
> options.filter('[selected'])
[
<option label value data-parent="VUT" style="display: inline; "></option>
]
How can I get the option with "selected" attribute? | 0 | [
2,
487,
8190,
93,
11945,
40,
4255,
30,
63,
35,
14755,
13,
7,
18,
7138,
7,
800,
3726,
3726,
31,
57,
794,
20,
275,
13,
1,
9,
11924,
815,
5,
22,
2558,
18,
7138,
22,
500,
6,
1,
47,
32,
630,
52,
170,
45,
13,
1,
6368,
636,
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... |
Runtime errors on integrating ZXing in my App
===
I followed a tutorial by [Javier Manzano][1] on how to integrate ZXing on my App without passing intent. My App has no errors, except the App crashes when I press "start zxing Activity", it ends up showing many Runtime errors: http://j.mp/MThYu4
Will be really helpful if anyone can help me out here.
[1]: http://www.jmanzano.es/blog/?p=244&lang=en | 0 | [
2,
485,
891,
11908,
27,
24529,
2052,
18222,
19,
51,
4865,
800,
3726,
3726,
31,
709,
21,
29724,
34,
636,
1004,
9397,
169,
19202,
500,
2558,
165,
500,
27,
184,
20,
18399,
2052,
18222,
27,
51,
4865,
366,
2848,
6936,
9,
51,
4865,
63,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 center a variable sized image
===
This should be quite easy, and I have done some research on this. I have spliced code from [here][1], [here][2], [here][3], and other places, but I can't get this to work.
I have a webpage which has 3 .pngs layered on top of each other. The top two are variable sized, and 100% of the page. The top one has a whole in it (it's transparent in the middle,) and the middle disappears using javascript to reveal the bottom one. The top two .pngs and the javascript are working perfectly.
I want the bottom image to be in the exact center, vertically and horizontally, and be proportional to the page size. I can get it centered, or proportional, but not both. I can't put the bottom picture as the background, because then the background isn't the right color, or it's tiled.
Here is a sample of some of the code:
HTML:
<body>
<div >
<p0 id="face" ><img src="face2.png"; class='face'> </p0>
</div>
<p1 id="circuit" > <img src= 'circuit.png' width = '100%' height = '100%' /> </p1>
<p2 id="hole" ><img src="hole.png" width='100%' height = '100%' /> </p2>
</body>
CSS:
p0{
width: 50%;/*I can't set the height to 50% because it is a different size than the width*/
center
z-index:1;
position: absolute;
}
p1{
z-index: 2;
width: 100%;
padding:0;
margin: 0;
height:100%;
position: absolute;
}
p2{
z-index:3;
width: 100%;
padding:0;
margin: 0;
height:100%;
position: absolute;
}
[1]: http://css-tricks.com/snippets/css/absolute-center-vertical-horizontal-an-image/
[2]: http://bytes.com/topic/html-css/answers/778423-center-image-page
[3]: http://stackoverflow.com/questions/388180/how-to-make-an-image-center-vertically-horizontally-inside-a-bigger-div | 0 | [
2,
184,
20,
459,
21,
7612,
13,
6560,
1961,
800,
3726,
3726,
48,
378,
44,
1450,
2010,
15,
17,
31,
57,
677,
109,
527,
27,
48,
9,
31,
57,
11202,
596,
69,
1797,
37,
636,
6836,
500,
2558,
165,
500,
15,
636,
6836,
500,
2558,
135,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
AS3 iPhone app that runs in the background
===
I'm developing an iPhone app using Actionscript 3.0. It uses GPS to send an email once you're within certain co-ordinates. At the moment the app automatically pauses itself when it's exited, and so isn't listening out for any geolocation changes and won't do it's job unless open.
Is there any way I can run the app in the background, or without actually being open?
Hope someone can help,
Cheers | 0 | [
2,
28,
240,
21024,
4865,
30,
1461,
19,
14,
2395,
800,
3726,
3726,
31,
22,
79,
3561,
40,
21024,
4865,
568,
1028,
8741,
203,
9,
387,
9,
32,
2027,
18298,
20,
2660,
40,
8517,
382,
42,
22,
99,
363,
1200,
326,
8,
23239,
18,
9,
35,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Parallax effect based on image position
===
I'm still working on a Parallax website for a client based around 3 levels. I've encountered a problem that makes it impossible for me to add in the third top level.
The site itself has a full screen background that scrolls at one speed. Its a very long vertical image scrolling slowly. On top of that is the content which scrolls at the standard speed.
The third level is simply position: absolute graphics that sit on top of certain content areas. Floating images basically.
The problem I'm having is that with the majority of parallax plugins I've tried the floating third level images don't have anything to disappear behind. Meaning while I can set them based on the screen size as soon as I change it, I see it disappearing behind an invisible line.
Are there any plugins or methods I can use to stop this happening? So essentially I want to set a position where the image would be, if the parallax effect wasn't working, and it parallaxs around that point. | 0 | [
2,
2258,
211,
7522,
1590,
432,
27,
1961,
649,
800,
3726,
3726,
31,
22,
79,
174,
638,
27,
21,
2258,
211,
7522,
2271,
26,
21,
6819,
432,
140,
203,
2216,
9,
31,
22,
195,
8208,
21,
1448,
30,
1364,
32,
3992,
26,
55,
20,
3547,
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... |
Refresh a page after content disposition in ASP.NET
===
We are developing a web application in which, one page opens a PDF file after we click "Generate Report". This PDF file is displayed as an attachment using **response.AddHeader("Content-Disposition", "attachment; filename=" + FileName + ";");**
It is required that **we have to refresh the page** as well (persisting the input parameters we passed in the text fields as part of generating the PDF file). I tried to use ** response.Redirect(Request.Url.ToString());** How ever, the page is not getting refreshed.
For your reference, I am sending the code below.
String filePath = this.Page.MapPath(FileName);
System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
response.ClearContent();
response.Clear();
response.ContentType = "text/plain";
response.AddHeader("Content-Disposition", "attachment; filename=" + FileName + ";");
response.TransmitFile(filePath);
response.Flush();
response.Redirect(Request.Url.ToString());
response.End();
Please update me if there is a better way of achieving this.
Thanks,
Sriram | 0 | [
2,
24905,
21,
2478,
75,
2331,
22157,
19,
28,
306,
9,
2328,
800,
3726,
3726,
95,
50,
3561,
21,
2741,
3010,
19,
56,
15,
53,
2478,
8965,
21,
13,
11124,
3893,
75,
95,
10840,
13,
7,
17083,
1373,
1330,
7,
9,
48,
13,
11124,
3893,
25,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
WebView In Android 4.0 Woes
===
So I have the following html stored in a raw text file. It should call from folder in the raw folder containing a js file which is a html5 based game. The raw text file with html loads fine but the javascript does not and yes I have javascript enabled. The following line in the html is what loads the javascript file.
<script type="text/javascript" src="html5game/index.js?WZUAC=967064895"></script>
Then I have the following code in my android application.
public class BlockyBlaine extends Activity {
WebView webview;
AdView adView;
String javas;
private class BlaineViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
}
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
}
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
adView = (AdView) findViewById(R.id.adView);
webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setPluginsEnabled(true);
webview.getSettings().setSupportZoom(false);
webview.setVerticalScrollBarEnabled(false);
webview.setHorizontalScrollBarEnabled(false);
webview.getSettings().setUseWideViewPort(false);
webview.getSettings().setDomStorageEnabled(true);
webview.setWebViewClient(new BlaineViewClient());
webview.setFocusableInTouchMode(false);
try {
InputStream input = getResources().openRawResource(R.raw.lights);
Reader is = new BufferedReader(
new InputStreamReader(input, "windows-1252"));
int size;
size = input.available();
byte[] buffer = new byte[size];
input.read(buffer);
input.close();
javas = new String(buffer);
} catch (IOException e) {
e.printStackTrace();
}
webview.loadDataWithBaseURL("file:///android_res/raw/", javas, "text/html","UTF-8", null);
AdRequest adRequest = new AdRequest();
adRequest.addTestDevice(AdRequest.TEST_EMULATOR);
adView.loadAd(new AdRequest());
}
Any help would be great to get the javascript loading up correctly. | 0 | [
2,
2741,
4725,
19,
13005,
268,
9,
387,
4808,
160,
800,
3726,
3726,
86,
31,
57,
14,
249,
13,
15895,
8214,
19,
21,
4333,
1854,
3893,
9,
32,
378,
645,
37,
19294,
19,
14,
4333,
19294,
3503,
21,
487,
18,
3893,
56,
25,
21,
13,
15895... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Entity Framework, one-to-many, several columns
===
If I have a main table, lets say orders, and a sub table of items and the items table has a fields for item number BUT it also has a nullable (optional) field for color that applied only to certain items. How would I update the items table, at the same time as the orders table, using Entity Framework?
Here is a code example of what I have so far. Two problems, I'm only entering one of my items and, from what my research indicates, I can't add another field to the items table?
foreach (Guid c in AllItems)
{ Items.OrderItemID = Guid.NewGuid();
ITemsOrderID = order.OrderID;
ITems.ItemID = c;
If (ItemID = ItemThatLetsYouChoseAColorID)
{
Items.ItemColorID = ColorID;
} else {
Items.ItemColorID = null;
}
}
context.Orders.AddObject(Orders);
context.Items.AddObject(Items);
context.SaveChanges();
My Orders table gets a record inserted, and the Items gets ONE record inserted. I'm missing something basic here, I'm afraid. | 0 | [
2,
9252,
6596,
15,
53,
8,
262,
8,
14842,
15,
238,
7498,
800,
3726,
3726,
100,
31,
57,
21,
407,
859,
15,
6884,
395,
3204,
15,
17,
21,
972,
859,
16,
3755,
17,
14,
3755,
859,
63,
21,
2861,
26,
9101,
234,
47,
32,
67,
63,
21,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to remove <script> tags from jQuery ajax response?
===
I write to the database HTML data from users, and display it on the site. I don't want to execute any javascripts from them. How to strip out <script> tags from the jquery ajax response? | 1 | [
2,
184,
20,
4681,
13,
1,
8741,
1,
3383,
18,
37,
487,
8190,
93,
20624,
1627,
60,
800,
3726,
3726,
31,
2757,
20,
14,
6018,
13,
15895,
1054,
37,
3878,
15,
17,
3042,
32,
27,
14,
689,
9,
31,
221,
22,
38,
259,
20,
15644,
186,
8247... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Smarty include doesn't load template sometimes (nginx)
===
I have nginx working and sometimes Smarty's 'include' function doesn't work in my template:
`{include file="header.tpl"}`
Caching is disabled: Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Does anybody know what could be a reason for this problem? | 0 | [
2,
3978,
93,
468,
1437,
22,
38,
6305,
22894,
1030,
13,
5,
2723,
108,
396,
6,
800,
3726,
3726,
31,
57,
13,
2723,
108,
396,
638,
17,
1030,
3978,
93,
22,
18,
13,
22,
22640,
22,
1990,
1437,
22,
38,
170,
19,
51,
22894,
45,
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... |
Should I use "self" in a block to access class methods?
===
I have a class to perform little conversions like NSDate to NSString with a specific format, etc.
Every methods are class methods, eg `+[Tools humanReadableStringForDate:(NSDate*)date];`
I sometime need my method `+[Tools A]` to call a method `+[Tools B]` of my class, but inside a block.
Should I create a `__block safeSelf = self;` or is it unnecessary because I use class level methods ?
Thank you ! | 0 | [
2,
378,
31,
275,
13,
7,
8411,
7,
19,
21,
1921,
20,
1381,
718,
3195,
60,
800,
3726,
3726,
31,
57,
21,
718,
20,
2985,
265,
6263,
18,
101,
13,
2172,
8209,
20,
13,
2172,
11130,
29,
21,
1903,
2595,
15,
2722,
9,
352,
3195,
50,
718... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Oracle PL/SQL, how to debug a complex stored proc?
===
In the Oracle PL/SQL, how to debug a complex stored proc ?
for example, the codes below, it is using loop + correlated subquery. how to fully understand it ? I have learned that the best way to debug is divide-and-conquer, then how to cut this coding into small pieces ?
Thanks
v_count := 1;
while v_count > 0
LOOP
update tbl_A a
set a.name = (select b.name from tbl_B b where a.id = b.id)
where a.id = (
select c.id from tbl_C c where c.id = a.id
)
v_count := sql%rowcount;
END LOOP | 0 | [
2,
15759,
12443,
118,
18,
22402,
15,
184,
20,
121,
16254,
21,
1502,
8214,
13,
15617,
60,
800,
3726,
3726,
19,
14,
15759,
12443,
118,
18,
22402,
15,
184,
20,
121,
16254,
21,
1502,
8214,
13,
15617,
13,
60,
26,
823,
15,
14,
11358,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
NSString text transfer to another ViewController
===
Now i'm trying to pass NSString text to anotherView in Button click event in iOS.
I wrote following codes.
self.detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
self.detailViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:self.detailViewController animated:YES];
self.detailViewController.urlAddress = @"http://www.google.com";
i already declared "urlAddress" property in detailViewController.
After i tested with NSLog in ViewWillAppeared ,it's show only null, not the urlAddress string.
How can i solve it?
Please let me know if you can.
Thanks in advance. | 0 | [
2,
13,
2172,
11130,
1854,
2617,
20,
226,
1418,
12898,
1252,
800,
3726,
3726,
130,
31,
22,
79,
749,
20,
1477,
13,
2172,
11130,
1854,
20,
226,
4725,
19,
5167,
10840,
807,
19,
13,
7760,
9,
31,
738,
249,
11358,
9,
1119,
9,
546,
8682... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
camera takes picture where it temporary save picture in android?
===
i m working on project and requirements of the project is to **do some action if camera takes any picture** any suggestions on how can i do this......
this issue is solvable but it need your help so please give any suggestions
http://developer.android.com/reference/android/hardware/Camera.html#ACTION_NEW_PICTURE
this link is not have any help about my question | 0 | [
2,
3336,
1384,
2151,
113,
32,
4700,
2079,
2151,
19,
13005,
60,
800,
3726,
3726,
31,
307,
638,
27,
669,
17,
4786,
16,
14,
669,
25,
20,
13,
1409,
537,
109,
1028,
100,
3336,
1384,
186,
2151,
1409,
186,
18389,
27,
184,
92,
31,
107,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Downgrad iPad1 from IOS 5.1.1 to IOS 4.2.1
===
I have updated my ipad to 5.1.1 recently but i need to downgrade to 4.2.1 . I have searched lot ,without jail-broking i want to downgrade my iPad. Please tell steps or link.Help me. | 2 | [
2,
125,
7691,
31,
8240,
165,
37,
13,
7760,
331,
9,
165,
9,
165,
20,
13,
7760,
268,
9,
135,
9,
165,
800,
3726,
3726,
31,
57,
6372,
51,
31,
8240,
20,
331,
9,
165,
9,
165,
1989,
47,
31,
376,
20,
125,
8031,
20,
268,
9,
135,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
onclick jquery slidetoggle default state from cookie
===
by default my div element #bannerbox displays as normal, i'm using the following code to hide the div element.
<div id="toggleclose">
<a href="#" class="closebutton" onclick="jQuery('#bannerbox').slideToggle('normal');" title="Close"><span class="hidespan">Close</span></a>
</div>
What i would like to do is when the button is clicked, as well as the current functionality, have the state then saved to cookie so that the next time the page is loaded the visibility of the div element is retained from the last state saved to the cookie.
This is the current code i'm working with, which does not currently work.
<script type="text/javascript">
$(document).ready(function(){
var openToggle = getCookie("open") || false;
if ( openToggle ) $("#bannerbox").show();
else $("#bannerbox").hide();$('.closebutton').click(function() {
var closed = $("#bannerbox").is(":none");
if ( closed ) $("#bannerbox").show();
else $("#bannerbox").hide();
setCookie("open", !closed, 365 );});});
</script>
Any assistance is greatly appreciated. | 0 | [
2,
27,
150,
10129,
487,
8190,
93,
6464,
262,
263,
4875,
12838,
146,
37,
19980,
800,
3726,
3726,
34,
12838,
51,
13,
12916,
4520,
6926,
4059,
1031,
5309,
9412,
28,
1826,
15,
31,
22,
79,
568,
14,
249,
1797,
20,
3077,
14,
13,
12916,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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# ADO Application crashes on form load
===
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'membersDataSet.Members' table. You can move, or remove it, as needed.
this.membersTableAdapter.Fill(this.membersDataSet.Members);
}
the statement which runs the fill query to the datagridview I have on my form creashes when the form loads. | 1 | [
2,
272,
5910,
21,
537,
3010,
21563,
27,
505,
6305,
800,
3726,
3726,
932,
11364,
505,
165,
1,
8294,
5,
23793,
2660,
106,
15,
807,
10663,
18,
13,
62,
6,
13,
1,
12894,
20,
537,
45,
48,
293,
16,
1797,
19069,
1054,
77,
14,
13,
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... |
Variable not saving data in C#
===
i've been wondering why my variable is not saving data. this is my code
class MainProg
{
public string name;
static void Main()
{
Register rs = new Register();
Register r = (Register)rs;
r.run();
Console.WriteLine(name);
}
}
class Register : MainProg
{
public void run()
{
name = "a";
}
}
Did I forget anything?everytime I try to show the output it shows nothing.Thanks by the way for taking your time. | 0 | [
2,
7612,
52,
7599,
1054,
19,
272,
5910,
800,
3726,
3726,
31,
22,
195,
74,
5712,
483,
51,
7612,
25,
52,
7599,
1054,
9,
48,
25,
51,
1797,
718,
407,
2740,
263,
13,
1,
317,
3724,
204,
73,
12038,
11364,
407,
5,
6,
13,
1,
2243,
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... |
beginSheet modalForwindow: nil position ?
===
I'm trying to understand how ` (void)beginSheet:(NSWindow *)sheet modalForWindow:(NSWindow *)docWindow modalDelegate:(id)modalDelegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo` chooses the position on my window since it's modal for no window ? (i passed `nil` to `modalForWindow:`)
The first position is the one defined in the Interface builder. Once I closed it for the first time, each time a re-open it, it center in the half top of the screen. Isn't possible to always open it a the same position ?
thx
| 0 | [
2,
2348,
17627,
13,
20756,
1106,
27508,
45,
1781,
255,
649,
13,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
1369,
184,
13,
1,
13,
5,
2625,
1340,
6,
17143,
108,
17627,
45,
5,
2172,
27508,
1637,
6,
17627,
13,
20756,
1106,
27508,
45,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Database normalization in archive systems
===
As of now I have my data normalized in the 4th form. I would like to create archive system that will be stored on other server. And questions: wouldn't it be better to store at the archive system all data in one table ( or not one but anyway denormalized)? Because I won't ever Perform delete Or update operations. In that way archive system ( designed mainly for analytics) will work faster. What do you think? Am I correct? | 0 | [
2,
6018,
1826,
1829,
19,
9250,
1242,
800,
3726,
3726,
28,
16,
130,
31,
57,
51,
1054,
1826,
1333,
19,
14,
268,
96,
505,
9,
31,
83,
101,
20,
1600,
9250,
329,
30,
129,
44,
8214,
27,
89,
8128,
9,
17,
2346,
45,
1265,
22,
38,
32,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Web Service between Visual Basic 2010 and Android
===
i am making a project to help restaurant order system.. so the cashier using application build in visual basic 2010, and the waiter/waitress will use android as a Menu Book and they will sent data order to the server.
my problem is : i want to transfer my data which in database in visual basic (.mdf) to gadget android via wifi. so far, i was able to transfer string from android to VB 2010 via TCP socket.
please help to about the concept or best way to transfer database via wifi, a book / reference or some tutorial with a simple code will good :)
database in visual basic and in Android have the same structure :) | 0 | [
2,
2741,
365,
128,
3458,
2125,
498,
17,
13005,
800,
3726,
3726,
31,
589,
544,
21,
669,
20,
448,
3284,
389,
329,
9,
9,
86,
14,
3392,
1944,
568,
3010,
1895,
19,
3458,
2125,
498,
15,
17,
14,
17304,
118,
8195,
9058,
129,
275,
13005,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Snake script is not passing values to variable
===
So here is my snake script -
http://jsfiddle.net/6bKHc/24/
I started to create a snake game, but basically move(top), move(bottom) e.c. is not working. Any ideas why? I understand that I can't pass the elements to variable like this, so maybe you could show me how to do that correctly? | 0 | [
2,
6358,
3884,
25,
52,
2848,
4070,
20,
7612,
800,
3726,
3726,
86,
235,
25,
51,
6358,
3884,
13,
8,
7775,
6903,
728,
18,
1707,
12312,
9,
2328,
118,
379,
16356,
9469,
15718,
12918,
31,
373,
20,
1600,
21,
6358,
250,
15,
47,
11374,
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... |
Find specific column and get values to an array in visual C#
===
I am trying to refer to a specific column of a DataGrid and get all the values into an array. I don't get any errors but the problem is that only the zeroth position of the array seem to have a value while the other positions are null.There are 4 records in the Datagrid. What am I doing wrong
Here's My code:
private void button1_Click(object sender, EventArgs e)
{
string[] arr = new string[10];
DataTable getdata = new DataTable();
foreach (DataGridViewRow row in this.dataGridView1.Rows)
{
DataGridViewCell cell = row.Cells[1];
{
if (cell != null && (cell.Value != null))
{
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
arr[i] = cell.Value.ToString();
}
}
}
}
if (arr[0] != null)
{
textBox3.Text = arr[0].ToString();//Prints value
}
else if (arr[1] != null)//Seems to be null
{
textBox2.Text = arr[1].ToString();
}
} | 0 | [
2,
477,
1903,
4698,
17,
164,
4070,
20,
40,
7718,
19,
3458,
272,
5910,
800,
3726,
3726,
31,
589,
749,
20,
5017,
20,
21,
1903,
4698,
16,
21,
1054,
16375,
17,
164,
65,
14,
4070,
77,
40,
7718,
9,
31,
221,
22,
38,
164,
186,
11908,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Insert custom HTML into Zend_Form
===
I have a Zend_Form created from a controller like this:
$form = new Zend_Form;
$form->setAction('/ad/add')->setMethod('post')->setAttrib('id', 'add_form');
$form->addElement('text', 'name', array(
'label' => 'Name',
'description' => 'Ex.: Samsung Galaxy Tab 10.1',
'validators' => array(
'alnum',
'notEmpty',
array('stringLength', array('min' => 3, 'max' => 150))
),
'required' => true
));
$form->addElement('textarea', 'description', array(
'label' => 'Description',
'description' => 'Make sure you give an accurate description of your item.',
'validators' => array(
'alnum',
'notEmpty',
array('stringLength', array('min' => 10, 'max' => 255))
),
'required' => true
));
$form->addElement('submit', 'Submit');
When I output that from the view, it works just fine, being rendered with dl and dd magic just as it should.
What I want now is to add an ajax image upload feature to this form. Each image will be uploaded by ajax, displayed in a div, and then a hidden field from my form will be populated with IDs of uploaded files. How can I achieve this, while having the image upload bits INSIDE my forms's markup? | 0 | [
2,
14692,
5816,
13,
15895,
77,
10526,
43,
1,
4190,
800,
3726,
3726,
31,
57,
21,
10526,
43,
1,
4190,
679,
37,
21,
9919,
101,
48,
45,
5579,
4190,
800,
78,
10526,
43,
1,
4190,
73,
5579,
4190,
8,
1,
3554,
8645,
5,
22,
118,
1283,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Scala type constraints doesn't allows null
===
I have the following Scala code:
class X[T1 <: AnyRef] {
var _x : T1 = null
}
The code _x = null is highlighted as error:
error: type mismatch;
found : Null(null)
required: T1
var _x : T1 = null : T1
If I add Null type constraint everything works fine. Why this happens? Scala defines AnyRef as equivalent of java.lang.Object, which is of course, nullable.
| 0 | [
2,
25975,
1001,
16747,
1437,
22,
38,
2965,
16203,
800,
3726,
3726,
31,
57,
14,
249,
25975,
1797,
45,
718,
993,
2558,
38,
165,
13,
1,
45,
186,
14057,
500,
13,
1,
4033,
13,
1,
396,
13,
45,
13,
38,
165,
800,
16203,
13,
1,
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... |
Optimization of conversion of palette texture to RGB565 on iOS 4+ (using lookup table)
===
The game I'm converting is operating on 8-bit palette texture, and nearly every frame I have to update parts of that texture to OpenGL texture for rendering. It looks like this:
unsigned short RGB565PaletteLookupTable[256]; // Lookup table
unsigned char* Src; // Source data
unsigned short* Dst; // Destination buffer
int SrcPitch; // Source data row length
int OriginX, OriginY, Width, Height; // Subrectangle to copy
assert( Width % 4 == 0 );
int SrcOffset = SrcPitch-Width;
Src += OriginY*SrcPitch+OriginX;
int x, y;
for( y = OriginY; y < OriginY+Height; ++y )
{
for( x = OriginX; x < OriginX+Width; x += 4, Src += SrcOffset )
{
*Dst++ = RGB565PaletteLookupTable[*Src++];
*Dst++ = RGB565PaletteLookupTable[*Src++];
*Dst++ = RGB565PaletteLookupTable[*Src++];
*Dst++ = RGB565PaletteLookupTable[*Src++];
}
}
This code takes 17% of main thread time during the game, so I'm looking for ways to speed it up. Data goes directly to glTexSubImage2D(), so I can't change anything in destination buffer. It comes from code in the game which is ancient and not documented, and no one knows how it works anymore, so I can't mess much with it either. The lookup table is provided by this ancient code as well, and can change during game.
Would it be possible to speed up this code using Accelerate framework / assembly instructions / any other means? I read examples of direct conversion of RGB888 to RGB565, but these didn't need to use lookup tables. Where should I look to learn how to speed it up optimally?
| 0 | [
2,
21597,
16,
6263,
16,
27349,
12714,
20,
761,
11400,
264,
3577,
27,
13,
7760,
268,
2430,
13,
5,
12655,
361,
576,
859,
6,
800,
3726,
3726,
14,
250,
31,
22,
79,
19583,
25,
2455,
27,
469,
8,
3326,
27349,
12714,
15,
17,
1212,
352,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Changing a jqGrid text column's editable property based on results of an autocomplete in another column
===
I am using jqGrid 4.4.0 with inline editing. For the sake of this question, my grid has four columns: an ID column, a text column with a jQuery autocomplete, a single character text column, and a hidden `boolean` column. I need to enable or disable editing of the single character column based on the value of the `boolean` column. I've got this working on existing rows using `onSelectRow` and `setColProp`, but for some reason I cannot get it to behave correctly on newly inserted rows. If I add a new row and select a value from the autocomplete, the single character column is **always** not editable. I've stepped through the Javascript using the Chrome and IE developer tools, and the column values and properties are getting set properly, but the enable/disable does not reflect this.
I apologize for the gigantic code snippet, but I don't want to leave anything out.
$("#coolGrid").jqGrid({
url: '@Url.Action("GetCoolGridData")',
postData: {
someId: function () { return $("#someId").val(); },
otherStaticArg: function () { return 1; }
},
datatype: 'json',
mtype: 'POST',
loadonce: true,
cellsubmit: 'clientArray',
editurl: 'clientArray',
scroll: true,
pager: $("#coolGridPager"),
rowNum: 200,
sortname: 'SomeGridRowId',
sortorder: 'asc',
viewrecords: true,
height: '100%',
colNames: ['SomeGridRowId', 'CanEditSingleChar', 'Autocomplete', 'SingleChar'],
colModel: [
{ name: 'SomeGridRowId', index: 'SomeGridRowId', hidden: true },
{ name: 'CanEditSingleChar', index: 'CanEditSingleChar', hidden: true },
{
name: 'Autocomplete',
index: 'Autocomplete',
width: 220,
editable: true,
edittype: 'text',
editoptions: {
dataInit: function (elem) {
$(elem).autocomplete({
source: '@Url.Action("GetSomeGridAutocomplete")',
minLength: 2,
select: function (event, ui) {
var rowId = getRowId($(this));
if (ui.item) {
$("#coolGrid").jqGrid('setCell', rowId, 'CanEditSingleChar', ui.item.CanEditSingleChar, '', '');
$("#coolGrid").jqGrid('setCell', rowId, 'Autocomplete', ui.item.label, '', '');
setSingleCharEditMode(rowId);
}
}
});
}
}
},
{
name: 'SingleChar',
index: 'SingleChar',
width: 10,
editable: true, //default to true, most are editable
edittype: 'text'
}
],
onSelectRow: function (clickedRow) {
if (clickedRow && clickedRow != $.coolGridLastSelectedRow) {
$("#coolGrid").jqGrid('saveRow', $.coolGridSelectedRow, false, 'clientArray');
$.coolGridLastSelectedRow = clickedRow;
}
setSingleCharEditMode($.coolGridLastSelectedRow);
$("#coolGrid").jqGrid('editRow', $.coolGridLastSelectedRow, true);
},
afterInsertRow: function (rowid, rowdata, rowelem) {
if (rowid == 'new_row') { //shown solely for completeness, pretty sure this is not the problem
var newRowIndex = $("#coolGridNewRowIndex").val();
if (!newRowIndex)
newRowIndex = 1;
var newRowId = rowid + "_" + newRowIndex;
$("#new_row").attr('id', newRowId);
newRowIndex++;
$("#coolGrid").val(newRowIndex);
$("#coolGrid").jqGrid('setSelection', newRowId, true);
}
}
});
$("#coolGrid").jqGrid('navGrid', '#coolGridPager',
{
add: false,
del: false,
edit: false,
search: false,
beforeRefresh: function () {
$("#coolGrid").jqGrid('setGridParam', { datatype: 'json' });
}
});
$("#coolGrid").jqGrid('inlineNav', '#coolGridPager',
{
edit: false,
add: true,
addtext: "Add",
save: false,
cancel: false,
restoreAfterSelect: false,
addParams: {
position: 'last',
addRowParams: {
keys: true
}
}
});
And the `setSingleCharEditMode` function:
function setSingleCharEditMode(rowid) {
var rowData = $("#coolGrid").jqGrid('getRowData', rowid);
if (rowData.CanEditSingleChar === "false") {
$("#coolGrid").jqGrid('setColProp', 'SingleChar', { editable: false });
} else {
$("#coolGrid").jqGrid('setColProp', 'SingleChar', { editable: true });
}
}
I've tried a whole slew of stuff, rifled through a pile of other SO questions, googled like mad....all to no avail. I've resorted to pulling my hair out. How can I control the `editable` property of one column after an autocomplete `select` on another column, all on a new row?
| 0 | [
2,
4226,
21,
487,
1251,
16375,
1854,
4698,
22,
18,
9392,
579,
1354,
432,
27,
1736,
16,
40,
3108,
15990,
19,
226,
4698,
800,
3726,
3726,
31,
589,
568,
487,
1251,
16375,
268,
9,
300,
9,
387,
29,
19,
1143,
9510,
9,
26,
14,
8132,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
PDPageContentStream Y-Axis Base
===
Apologies if this is a terrible question, but is there any way to tell the PDPageContentStream that 0 on the y-axis is actually the top of the page instead of the bottom?
We have all our coordinates stored that way (e.g. "0,10" is the ten points _down_ on the left side of the page) and as we're generating PDFs we're finding countless bugs that are related to broken math around calculating the inverse of the value so that we can call moveTextPositionByAmount().
Thanks in advance! | 0 | [
2,
13,
9251,
6486,
25424,
11260,
13,
93,
8,
19676,
1000,
800,
3726,
3726,
27101,
100,
48,
25,
21,
5803,
1301,
15,
47,
25,
80,
186,
161,
20,
494,
14,
13,
9251,
6486,
25424,
11260,
30,
713,
27,
14,
13,
93,
8,
19676,
25,
1121,
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... |
Backbone events that are used across multiple views
===
I plan on using multiple popups on my website. Every popup will be rendered by a different view. How can I share certain events, like clicking outside of the popup to close it, across these multiple views that each use a popup?
Thanks! | 0 | [
2,
24036,
963,
30,
50,
147,
464,
1886,
4146,
800,
3726,
3726,
31,
944,
27,
568,
1886,
1675,
15699,
27,
51,
2271,
9,
352,
1675,
576,
129,
44,
10877,
34,
21,
421,
1418,
9,
184,
92,
31,
1891,
1200,
963,
15,
101,
25590,
719,
16,
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... |
Multitouch with HTML5 with native support for Windows 7
===
Im new to HTML5 and Im try to recreate this light table which only supports iOS. https://developer.apple.com/safaridemos/light-table.php
So the user can pinch and zoom in or out but I need it to support Windows 7 native touch.
It seemed like its been done before but no source code or a live site:
https://vimeo.com/22110766
Any thoughts how I create that light table using HTMl5 but supporting Windows? | 0 | [
2,
1889,
15725,
29,
13,
15895,
264,
29,
1275,
555,
26,
1936,
453,
800,
3726,
3726,
797,
78,
20,
13,
15895,
264,
17,
797,
1131,
20,
21119,
48,
471,
859,
56,
104,
6747,
13,
7760,
9,
7775,
18,
6903,
26051,
106,
9,
24212,
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... |
Django/Ajax - Executing javascript in a template received through ajax call
===
In my application, I make an ajax call that renders this template with js:
<div id="ajax_reply">
<div id="hidden_data" style="display:none;"></div>
<script type="text/javascript">
var data = [];
data.push(['Col1', 'Col2', 'Col3', 'Col4']);
{% for entry in mydata %}
var dCell = [];
dCell.push({{ entry.Col1 }});
dCell.push({{ entry.Col2 }});
dCell.push({{ entry.Col3 }});
dCell.push({{ entry.Col4 }});
data.push(dCell);
{% endfor %}
document.getElementById('hidden_data').innerHTML = JSON.stringify(data);
</script>
</div>
This doesn't work, if I run the resulting js manually in console, it does get inserted into the div, but otherwise, the javascript is never executed. I've searched on SO but couldn't find questions on this exact topic. hidden_data is in scope, any suggestions? | 0 | [
2,
3857,
14541,
118,
6881,
7522,
13,
8,
25836,
8247,
8741,
19,
21,
22894,
420,
120,
20624,
645,
800,
3726,
3726,
19,
51,
3010,
15,
31,
233,
40,
20624,
645,
30,
16535,
18,
48,
22894,
29,
487,
18,
45,
13,
1,
12916,
4924,
3726,
7,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
working with files on "start without debugging"
===
I'm programming in C, and
I have the following problem:
I use fopen and try to read from a csv file, that is currently storred in the folder of the exe file of the program.
the program works fine in debug mode and release mode, but when I try to run the program in "start without debugging" on visual studio 2008 express edition, the program stops working and windows is showing a message: "***.exe has stopped working. a program caused the program to stop working correctly. windows will close the program and notify you if a solution is available".
I've tried running the program on several computers, and it's the same.
another information I can give you is that if I enter the full path of the file (C:\....file.csv) - then is works just fine, without any problem.
I know I didn't write any code, but I hope someone will have an idea why this can happend.
thanks is advance. | 0 | [
2,
638,
29,
6488,
27,
13,
7,
13680,
366,
121,
16254,
2762,
7,
800,
3726,
3726,
31,
22,
79,
3143,
19,
272,
15,
17,
31,
57,
14,
249,
1448,
45,
31,
275,
398,
10157,
17,
1131,
20,
1302,
37,
21,
272,
18,
710,
3893,
15,
30,
25,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Setting up PhoneGap 1.8.1 and Sencha Touch 2 project. Cant call Ext.setup
===
with help of the Eclipse Plugin MDS 1.1 for PhoneGap on Android i was setting up a new project including Sencha Touch.
Target Android 4.0.3
min SDK 15
Problem is that when i want to call Ext.setup that the function doesnt Exist.
I ve included the sencha-touch.js files in the index.html and the css as well.
Help would be appreciated | 0 | [
2,
2697,
71,
1132,
1136,
306,
137,
9,
457,
9,
165,
17,
8252,
1651,
1723,
172,
669,
9,
2973,
645,
1396,
38,
9,
3554,
576,
800,
3726,
3726,
29,
448,
16,
14,
11652,
10922,
108,
8138,
18,
137,
9,
165,
26,
1132,
1136,
306,
27,
1300... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
IE7 align text next to a button in a table cell
===
I have this simple table where the last row displays a text next to an image button. This works well in other browser except IE7.
<table>
<tr>
<td>Some header</td>
<td>Some other header</td>
</tr>
<tr>
<td colspan="2" class="infoRow">Info:
<input type="image" class="infoButton" src="Images/down_arrow.png" /></td>
</tr>
</table>
From CSS file:
.infoButton
{
float: right;
padding: 0;
margin-left: 20px;
}
.infoRow
{
text-align: right;
}
IE7 displays the text all the way to the right in the table cell and the image button is under it and also aligned to the right. I want to display the "Info:" text left of the image button, which works fine in other browsers. | 0 | [
2,
13,
660,
465,
23389,
1854,
328,
20,
21,
5167,
19,
21,
859,
1667,
800,
3726,
3726,
31,
57,
48,
1935,
859,
113,
14,
236,
3131,
9412,
21,
1854,
328,
20,
40,
1961,
5167,
9,
48,
693,
134,
19,
89,
16495,
1613,
13,
660,
465,
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... |
Performing Get Copy All Operation With Microsoft Sync Framework
===
I'm testing out Microsoft Sync Framework to try and see if it'll be suitable for a task that I'm working on. One of the things I'd like to be able to do is to have the option to not just send changed files, but instead to send all of the files (for example, if I'm syncing to a client machine for the first time, and so want to send all files).
I can't seem to find an example of this in the documentation, so any advice would be welcome. | 0 | [
2,
2955,
164,
4344,
65,
1453,
29,
7099,
6063,
150,
6596,
800,
3726,
3726,
31,
22,
79,
4431,
70,
7099,
6063,
150,
6596,
20,
1131,
17,
196,
100,
32,
22,
211,
44,
6445,
26,
21,
3005,
30,
31,
22,
79,
638,
27,
9,
53,
16,
14,
564,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 access external database table in MySQL
===
I have two MySQL databases in 2 different hosts.
I would like to from MySQL A table 1 to connect and retrieve data from MySQL B table 2.
I do not know which one should set up privilege in order to connecting both each other.
I keep receiving:
SELECT command denied to user 'MySQL A'@'localhost' for table 'MySQL B table 2' | 0 | [
2,
184,
20,
1381,
4886,
6018,
859,
19,
51,
18,
22402,
800,
3726,
3726,
31,
57,
81,
51,
18,
22402,
6018,
18,
19,
172,
421,
5397,
9,
31,
83,
101,
20,
37,
51,
18,
22402,
21,
859,
137,
20,
6379,
17,
11917,
1054,
37,
51,
18,
2240... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
get device ip address from service provider ip address
===
I need get the local machine ip address of my website visited users for that i used below code
string ipAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (!string.IsNullOrEmpty(ipAddress))
{
string[] addresses = ipAddress.Split(',');
if (addresses.Length != 0)
{
stradd = addresses[0];
}
else
{
stradd = ipAddress;
}
}
else
{
stradd = Request.ServerVariables["REMOTE_ADDR"].ToString();
}
hostName = Dns.GetHostByAddress(stradd).HostName;
this is giving the ip address of the service provider & name of the service provider but i don't want this i wanted user device(local) ip address, is it possible to get local ip address? please help me. | 0 | [
2,
164,
3646,
15735,
3218,
37,
365,
11747,
15735,
3218,
800,
3726,
3726,
31,
376,
164,
14,
375,
1940,
15735,
3218,
16,
51,
2271,
3120,
3878,
26,
30,
31,
147,
1021,
1797,
3724,
15735,
27950,
800,
3772,
9,
10321,
106,
8220,
579,
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... |
Which database for scientific data (images + metadata searching)
===
I'm looking for a good database solution to store large (~100's of GB to several TB) amounts of scientific data. Ideally it would be able to handle larger quantities of data.
##Requirements##
My datafiles are "images", a ~4 million entry array (1000x1000x3 ints + 1000x1000 floats), plus associated metadata of ~50-100 entries. The metadata is stored hierarchically. Images will be organized into one or several "folders" (or "projects"), which themselves can contain other folders. Everything has owners, etc.
I will need to search 100-10,000 images, in one or several folders, based predominantly on its metadata. Then, I might need to pull slices from the image -- I really don't want to load all of the data if I only need a fraction of it. The images should be stored in a compressed format.
##Current Approach##
My current, and not so great, solution is to mix databases. First, I'm using a SQL database (Django + MySQL right now) to handle "folder", owners, and has a record for each image, but none of its data. I might create records for the metadata as well. Second, I'm using PyTables to store the images and metadata in an hdf5 format and treat it like a database. This solves the slicing and compression problem, and allows me to store the metadata hierarchically, but PyTables does not seem scalable and is far less developed than commercial databases. (It's not made for a multiuser environment: I'm writing my own locks!, which is a bad sign.)
##Help!##
I'm not a hardcore programmer, so a standard database solution is strongly preferred. My "optimization" would definitely include maintenance and programming cost.
Any ideas? Options might be SciDB (not common, could be good), SQL (heard it's bad for these applications, maybe PostgreSQL?), and HBase (actually, I know nothing about it). I feel like there must be good solutions in the scientific, especially astronomy, community, but the large-scale projects seem to require a serious team to build and maintain.
I'm happy to provide lots more info. | 0 | [
2,
56,
6018,
26,
2272,
1054,
13,
5,
22039,
18,
2754,
28057,
5792,
6,
800,
3726,
3726,
31,
22,
79,
699,
26,
21,
254,
6018,
4295,
20,
1718,
370,
13,
5,
1,
4031,
22,
18,
16,
14857,
20,
238,
13,
11872,
6,
8545,
16,
2272,
1054,
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... |
Defining return transition for jQueryMobile pages
===
I am using jQueryMobile's `$.mobile.changePage(...)` method to switch to a different page within my project.
When I run that method, the transition works perfectly but when I hit the browser's return button I see no reverse transition.
I played around with some of the parameters described in http://jquerymobile.com/test/docs/api/methods.html but had no luck.
Especially setting `reverse=true` just reversed the transition when moving forward to the target page but there is still no transition when I hit the back button. | 0 | [
2,
14684,
788,
4513,
26,
487,
8190,
93,
12571,
4434,
800,
3726,
3726,
31,
589,
568,
487,
8190,
93,
12571,
22,
18,
13,
1,
4403,
9,
12571,
9,
16229,
6486,
5,
9,
9,
9,
6,
1,
2109,
20,
5521,
20,
21,
421,
2478,
363,
51,
669,
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... |
Android - preventing onDraw() function from restarting during config changes
===
I have an activity which basically sleeps for a time and initialize another activity. During this sleep time I make some animated drawings on screen.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
View splashScreen = new SplashScreenView(this);
setContentView(splashScreen);
Thread splashThread = new Thread(){
public void run(){
try{
sleep(6500);
startActivity(new Intent("com.example.LOGIN"));
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
finally{
finish();
}
}
};
splashThread.start();
}
But when the screen orientation changes, the activity was restarting. So I handled it by modifying manifest file.
<activity
android:name=".SplashScreenActivity"
android:configChanges="orientation|keyboardHidden"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
I have one problem left. I prevent activity from restarting but the onDraw() function in my SplashScreenView class still restarts.
protected void onDraw(Canvas canvas) {
canvas.drawBitmap(dstbmp2, logoX, logoY, null);
canvas.drawBitmap(dstbmp, ballX, ballY, null);
// Update the position of the ball.
update();
// Delay
try {
Thread.sleep(100);
} catch (InterruptedException e) { }
invalidate();
} | 0 | [
2,
13005,
13,
8,
11520,
27,
43,
12404,
5,
6,
1990,
37,
22767,
68,
112,
13,
14093,
2816,
1693,
800,
3726,
3726,
31,
57,
40,
2358,
56,
11374,
1742,
18,
26,
21,
85,
17,
2104,
2952,
226,
2358,
9,
112,
48,
1742,
85,
31,
233,
109,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 simple associative array
===
I've done this a million times but for some reason I can't get this to work today...
I have this associative array
Array
(
[0] => stdClass Object
(
[registrantKey] => 106569618
[firstName] => xxx
[lastName] => yyy
[email] => x@x.x
)
[1] => stdClass Object
(
[registrantKey] => 106975808
[firstName] => qqq
[lastName] => ppp
[email] => aaa@aaa.com
)
...
...
I just want to get the first name of each one of them, im using a foreach loop but doesn't really let me get what I want.
Any ideas?
foreach($array as $key=>$value){
echo $value['firstName'];
} | 0 | [
2,
13,
26120,
1935,
28,
18,
16325,
3366,
7718,
800,
3726,
3726,
31,
22,
195,
677,
48,
21,
507,
436,
47,
26,
109,
1215,
31,
92,
22,
38,
164,
48,
20,
170,
786,
9,
9,
9,
31,
57,
48,
28,
18,
16325,
3366,
7718,
7718,
13,
5,
636... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to simulate sql join?
===
Now I tried to use the sql join algorithms (Nested loop join:[http://en.wikipedia.org/wiki/Nested_loop_join][1]) for simulating the operation that joining two (or more) tables in nosql.
If I have two tables TableA and TableB,now I want to join these.First I will SELECT all record(s) form these two tables.And using two loops to find record(s) from TableA and TableB that satisfy(s) the join condition.
But now I can't handle the join-on-condition like this:
(TableA.id = TableB.id OR TableA.name= TableB.name) AND TableA.age = TableB.age
Could I convert the complex join-on-condition which cantains '(' or ')' to one-level join-on-condition which only contains AND , OR.(Like this: TableA.id = TableB.id AND TableA.age = TableB.age OR TableA.name= TableB.name AND TableA.age = TableB.age )
[enter link description here][1]
[1]: http://en.wikipedia.org/wiki/Nested_loop_join | 0 | [
2,
184,
20,
24969,
4444,
255,
1865,
60,
800,
3726,
3726,
130,
31,
794,
20,
275,
14,
4444,
255,
1865,
15935,
13,
5,
2696,
1427,
5293,
1865,
45,
2558,
21127,
6903,
219,
9,
17375,
26132,
9,
5583,
118,
17375,
118,
2696,
1427,
1,
18786... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Inline list items changing position when li:active
===
I have a horizontal navigation bar that when one of the links are selected the link then becomes bold. However, when I click on one, the item to the right of it move position because the font gets larger thus making the width of the list item larger. Is there anyway to avoid this? I would like the text to stay in the same place. Thank you. | 0 | [
2,
19,
1143,
968,
3755,
4226,
649,
76,
2093,
45,
7889,
800,
3726,
3726,
31,
57,
21,
10095,
8368,
748,
30,
76,
53,
16,
14,
6271,
50,
1704,
14,
3508,
94,
2633,
5657,
9,
207,
15,
76,
31,
10840,
27,
53,
15,
14,
9101,
20,
14,
193... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Visual Studio's code snippet: how to add logic in it?
===
I've made a small code snippet to create a property for WPF data bingings:
private string property;
public string Property
{
get { return this.property; }
set
{
this.property = value;
this.OnPropertyChanged(() => Property);
}
}
It is pretty cumbersome to create the field name in Camel Case and rewrite the property in Pascal Case. Is there a way to only write the field and let the snippet writes the property using the name of the field with the first character in upper case?
| 0 | [
2,
3458,
1120,
22,
18,
1797,
13,
29061,
45,
184,
20,
3547,
7085,
19,
32,
60,
800,
3726,
3726,
31,
22,
195,
117,
21,
284,
1797,
13,
29061,
20,
1600,
21,
1354,
26,
619,
7721,
1054,
18080,
68,
18,
45,
932,
3724,
1354,
73,
317,
37... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Avoid capybaras webkit console.log output
===
I am using rspec with the capybara-webkit driver for javascript tests.
While this is a great feature for automatic tests I want to stop console.log in javascript messing the output. I tried creating the driver with
Capybara.register_driver :webkit_silent do |app|
Capybara::Driver::Webkit.new(app, :stdout => nil)
end
and using it with either with
Capybara.javascript_driver = :webkit_silent
for all in spec_helper or
Capybara.current_driver = :webkit_silent
for one test, the output is still there. I looked a little into the code and verified stdout was set to null in the connection class.
Is there any other method to stop the output?
| 0 | [
2,
2658,
2605,
93,
13259,
18,
2741,
13703,
8650,
9,
5567,
5196,
800,
3726,
3726,
31,
589,
568,
13,
1224,
12610,
29,
14,
2605,
93,
13259,
8,
14113,
13703,
2425,
26,
8247,
8741,
4894,
9,
133,
48,
25,
21,
374,
1580,
26,
6715,
4894,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 pygame (or even in python in general), how would I create a loop that keeps executing while a sound is playing?
===
In pygame is there a way to tell if a sound has finished playing? I read the set_endevent and get_endevent documentation but I can't make sense of it or find an example.
I'm trying to specifically do the following:
> play a sound
> While the sound is playing keep iterating on a loop
> When the sound has finished playing, move on.
i'm a relative noob so apologize if the question is not clear. I did check the other questions that were asked - didnt find anything specifically targeting python / pygame.
Thanks!! | 0 | [
2,
19,
7103,
5128,
13,
5,
248,
166,
19,
20059,
19,
297,
6,
15,
184,
83,
31,
1600,
21,
5293,
30,
8968,
25836,
133,
21,
646,
25,
791,
60,
800,
3726,
3726,
19,
7103,
5128,
25,
80,
21,
161,
20,
494,
100,
21,
646,
63,
842,
791,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Running variable string as command in batch scripting
===
The command variable is the command I want to execute. The name variable is pulling a list of computer names. When I echo !command! it returns the value I want to use. That should run the command needed to delete all of the machines, however, when I actually run !command! or %command%, the name variable isn't added and it fails. What am I missing? Thanks in advanced.
d:
cd "Program Files\admin"
setlocal EnableDelayedExpansion
SET string=%
for /f "tokens=*" %%a in (oldMachines.txt) do (
set name=%%a
set command=sbadmcl.exe AdminUser:admin -AdminPwd:password -Command:DeleteMachine -Machine:!name!
REM echo !name!
REM echo !command!
REM !command!
%command%
)
pause | 3 | [
2,
946,
7612,
3724,
28,
1202,
19,
13064,
3884,
68,
800,
3726,
3726,
14,
1202,
7612,
25,
14,
1202,
31,
259,
20,
15644,
9,
14,
204,
7612,
25,
3303,
21,
968,
16,
1428,
1817,
9,
76,
31,
8117,
13,
187,
16239,
187,
32,
4815,
14,
192... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Uncaught SyntaxError in JS and possibly Wordpress
===
I'm not too sure why my code is causing this.
I have this jquery script in the header:
<script>
$(document).ready(function() {
$('.control').on('click', function(e) {
e.preventDefault();
var field = $(this).data('field');
$('.hider:visible').fadeOut("slow", function() {
$('#' + field + '-gallery, #' + field + '-tag').fadeIn("slow");
});
});
var randomIndex = Math.floor((Math.random() * 100) + 1) % 3;
console.log(randomIndex);
var field = $($('a').get(randomIndex)).data('field');
$('#' + field + '-gallery, #' + field + '-tag').fadeIn("slow");
});
</script>
when I reload the page, nothing happens so it appears the script isn't running. When I inspect the page on Chrome, I see there is this error which is in a tab called (program) and it's in the first few lines line:
if (window.top.require) {
Uncaught SyntaxError: Unexpected token ILLEGAL
window.top.require("ripple/bootstrap").inject(window, document);}
I don't know what it is in my code to cause this error. When I take out my script, it goes away. Not too sure if it's something with wordpress or jqueryUI (I have that loaded for another plugin).
| 0 | [
2,
16061,
12647,
22649,
29992,
19,
487,
18,
17,
2879,
833,
5890,
800,
3726,
3726,
31,
22,
79,
52,
266,
562,
483,
51,
1797,
25,
3242,
48,
9,
31,
57,
48,
487,
8190,
93,
3884,
19,
14,
157,
106,
45,
13,
1,
8741,
1,
5579,
5,
2813... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
SSIS with variable excel connection manager
===
I am trying to do automatic package execution with a WMI Event Watcher Task. The functionality I want is automatic package execution when excel files are dropped into a certain folder. However, these excel files will be the connection managers for populating a database.
Currently SSIS will not allow me to do this because my excel connection manager does not have a path when I run the program, and only exists once the files are dropped in the folder.
Is there a way for variable excel connection managers or the value of the connection string to be a variable? | 0 | [
2,
13,
18,
4557,
29,
7612,
20700,
2760,
1382,
800,
3726,
3726,
31,
589,
749,
20,
107,
6715,
6030,
5769,
29,
21,
619,
1435,
807,
1455,
106,
3005,
9,
14,
18548,
31,
259,
25,
6715,
6030,
5769,
76,
20700,
6488,
50,
1539,
77,
21,
120... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 write a query to select required columns from two tables at a time
===
i am working with mvc3
i have two tables Bugs and Bughistory i need to select the values and need to show as lables in fromt end plz help to write query
Look this are my tables
Bugs(BugId int identity primary key,Title varchar(50),Description varchar(max),ProjectId int foreign key (ProjectId) references Projects(ProjectId),Version varchar(50),BuildNumber varchar(50),CreatedByID int,Category varchar(50),CreatedDate date,Severity varchar(50),Priority varchar(50),ReleasePhase varchar(50),Type varchar(50))
BugHistory(BugHistoryID int identity primary key,BugId int foreign key (BugId) references Bugs(BugId),FixedByID int,AssignedToID int,Resolution varchar(50),FromStatus varchar(50),ToStatus varchar(50))
First some insert the bug with these details
so i hve these two tables no i need to select this values(BugId ,Description ,Version ,BuildNumber ,Category,CreatedDate,Severity,Priority,ReleasePhase )
from Bughistory (AssignedToID ,Resolution ,ToStatus )
now i need show these details (view in front end application) as labels
how to select these (View) these values plz help me
thank you in advance
| 0 | [
2,
184,
20,
2757,
21,
25597,
20,
5407,
1390,
7498,
37,
81,
7484,
35,
21,
85,
800,
3726,
3726,
31,
589,
638,
29,
307,
8990,
240,
31,
57,
81,
7484,
13925,
17,
6256,
16853,
31,
376,
20,
5407,
14,
4070,
17,
376,
20,
298,
28,
4343,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
I don't want my recipients to see the "via" link
===
I don't want my recipients to see the "via" link in the email From. What can I do?
I dont want my recipients should see "via DNS name" link. I am using php Code. | 1 | [
2,
31,
221,
22,
38,
259,
51,
18560,
20,
196,
14,
13,
7,
5034,
7,
3508,
800,
3726,
3726,
31,
221,
22,
38,
259,
51,
18560,
20,
196,
14,
13,
7,
5034,
7,
3508,
19,
14,
8517,
37,
9,
98,
92,
31,
107,
60,
31,
1049,
259,
51,
185... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 ideal image for tesseract library?
===
I am doing OCR in my project using tesseract . I have used images with 72 dpi .But it is given me output far from accuracy . I have read somewhere that it is well to give input above 200 dpi. But what is the standard image configurations i.e. size, dpi, file format etc for tesseract library ? | 0 | [
2,
98,
25,
14,
5628,
1961,
26,
13338,
106,
5183,
1248,
60,
800,
3726,
3726,
31,
589,
845,
13,
2499,
139,
19,
51,
669,
568,
13338,
106,
5183,
13,
9,
31,
57,
147,
3502,
29,
7571,
13,
43,
2159,
13,
9,
811,
32,
25,
504,
55,
5196... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 - unrecognized expression: li:nth-child?
===
(function (){
var num = parseInt($('body').attr('data-site')) + 1,
theul = $(".submenu li:nth-child(" + num + ") a"),
newNum = num - 1,
theNewUl = $(".submenu li:nth-child(" + newNum + ") a");
console.log(theul);
theul.addClass('activex');
console.log(theNewUl);
theNewUl.addClass('lastsl');
})();
Hello, when I try to run this script console says:
"Uncaught Syntax error, unrecognized expression: li:nth-child"
Althoung I linked the jQuery source before this script,
thanks for anwsers | 0 | [
2,
487,
8190,
93,
13,
8,
367,
99,
13974,
103,
1333,
1803,
45,
2093,
45,
103,
96,
8,
11287,
60,
800,
3726,
3726,
13,
5,
22359,
13,
5,
6,
1,
4033,
13,
6336,
800,
2017,
870,
6391,
5,
4403,
5,
22,
9760,
22,
6,
9,
10303,
139,
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... |
C# WPF String Length Converter
===
Iam using a converter to check if a String length is bigger then 0 or not.
If it's bigger i return true else false.
Everything is working fine. But i was wondering if this is the correct way of a converter?
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
bool error = false;
if (value != null)
{
if (value.ToString().Length > 0)
{
error = true;
}
else
{
error = false;
}
}
return error;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new InvalidOperationException("IsNullConverter can only be used OneWay.");
}
| 0 | [
2,
272,
5910,
619,
7721,
3724,
1476,
25893,
800,
3726,
3726,
31,
765,
568,
21,
25893,
20,
2631,
100,
21,
3724,
1476,
25,
6197,
94,
713,
54,
52,
9,
100,
32,
22,
18,
6197,
31,
788,
1151,
962,
4997,
9,
796,
25,
638,
1123,
9,
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... |
JPG File Chooser (Android) doesn't work
===
I've got the JPG File Chooser from android-coding.blogspot.com2012/05/jpg-file-chooser.html
Java - 1.7; Android - 2.2; Eclipse.
`package com.androidcustomdialog;
import java.io.File;
public class AndroidCustomDialogActivity extends Activity {
Button buttonOpenDialog;
Button buttonUp;
TextView textFolder;
ImageView image;
String KEY_TEXTPSS = "TEXTPSS";
static final int CUSTOM_DIALOG_ID = 0;
ListView dialog_ListView;
File root;
File curFolder;
private List<String> fileList = new ArrayList<String>();
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
image = (ImageView)findViewById(R.id.image);
buttonOpenDialog = (Button)findViewById(R.id.opendialog);
buttonOpenDialog.setOnClickListener(new Button.OnClickListener(){
public void onClick(View arg0) {
showDialog(CUSTOM_DIALOG_ID);
}});
root = new File(Environment.getExternalStorageDirectory().getAbsolutePath());
curFolder = root;
}
@Override
protected Dialog onCreateDialog(int id) {
Dialog dialog = null;
switch(id) {
case CUSTOM_DIALOG_ID:
dialog = new Dialog(AndroidCustomDialogActivity.this);
dialog.setContentView(R.layout.dialoglayout);
dialog.setTitle("Select JPG");
dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(true);
textFolder = (TextView)dialog.findViewById(R.id.folder);
buttonUp = (Button)dialog.findViewById(R.id.up);
buttonUp.setOnClickListener(new OnClickListener(){
public void onClick(View v) {
ListDir(curFolder.getParentFile());
}});
//Prepare ListView in dialog
dialog_ListView = (ListView)dialog.findViewById(R.id.dialoglist);
dialog_ListView.setOnItemClickListener(new OnItemClickListener(){
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
File selected = new File(fileList.get(position));
if(selected.isDirectory()){
ListDir(selected);
}else {
Toast.makeText(AndroidCustomDialogActivity.this,
selected.toString() + " selected",
Toast.LENGTH_LONG).show();
dismissDialog(CUSTOM_DIALOG_ID);
Bitmap bm = BitmapFactory.decodeFile(selected.getAbsolutePath());
image.setImageBitmap(bm);
}}});
break;
}
return dialog;
}
@Override
protected void onPrepareDialog(int id, Dialog dialog, Bundle bundle)
{
super.onPrepareDialog(id, dialog, bundle);
switch(id) {
case CUSTOM_DIALOG_ID:
ListDir(curFolder);
break;
}
}
void ListDir(File f)
{
if(f.equals(root)){
buttonUp.setEnabled(false);
}else{ //115 134 54
buttonUp.setEnabled(true);
}
curFolder = f;
textFolder.setText(f.getPath());
File[] files = f.listFiles();
fileList.clear();
for (File file : files)
{
if(file.isDirectory()){
fileList.add(file.getPath());
}else{
Uri selectedUri = Uri.fromFile(file);
String fileExtension
= MimeTypeMap.getFileExtensionFromUrl(selectedUri.toString());
if(fileExtension.equalsIgnoreCase("jpg")){
fileList.add(file.getPath());
}
}
}
ArrayAdapter<String> directoryList
= new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, fileList);
dialog_ListView.setAdapter(directoryList);
}`
There are no errors before start, but after pressing "Load JPG" it is "stopped unexpectedly". The logs are:
`07-24 07:43:10.328: E/AndroidRuntime(5634): FATAL EXCEPTION: main
07-24 07:43:10.328: E/AndroidRuntime(5634): java.lang.NullPointerException
07-24 07:43:10.328: E/AndroidRuntime(5634): at com.androidcustomdialog.AndroidCustomDialogActivity.ListDir(AndroidCustomDialogActivity.java:129)
07-24 07:43:10.328: E/AndroidRuntime(5634): at com.androidcustomdialog.AndroidCustomDialogActivity.onPrepareDialog(AndroidCustomDialogActivity.java:111)
07-24 07:43:10.328: E/AndroidRuntime(5634): at android.app.Activity.showDialog(Activity.java:2555)
07-24 07:43:10.328: E/AndroidRuntime(5634): at android.app.Activity.showDialog(Activity.java:2514)
07-24 07:43:10.328: E/AndroidRuntime(5634): at com.androidcustomdialog.AndroidCustomDialogActivity$1.onClick(AndroidCustomDialogActivity.java:54)
07-24 07:43:10.328: E/AndroidRuntime(5634): at android.view.View.performClick(View.java:2408)
07-24 07:43:10.328: E/AndroidRuntime(5634): at android.view.View$PerformClick.run(View.java:8816)
07-24 07:43:10.328: E/AndroidRuntime(5634): at android.os.Handler.handleCallback(Handler.java:587)
07-24 07:43:10.328: E/AndroidRuntime(5634): at android.os.Handler.dispatchMessage(Handler.java:92)
07-24 07:43:10.328: E/AndroidRuntime(5634): at android.os.Looper.loop(Looper.java:123)
07-24 07:43:10.328: E/AndroidRuntime(5634): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-24 07:43:10.328: E/AndroidRuntime(5634): at java.lang.reflect.Method.invokeNative(Native Method)
07-24 07:43:10.328: E/AndroidRuntime(5634): at java.lang.reflect.Method.invoke(Method.java:521)
07-24 07:43:10.328: E/AndroidRuntime(5634): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-24 07:43:10.328: E/AndroidRuntime(5634): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-24 07:43:10.328: E/AndroidRuntime(5634): at dalvik.system.NativeStart.main(Native Method)` | 0 | [
2,
487,
9623,
3893,
3538,
139,
13,
5,
290,
18524,
6,
1437,
22,
38,
170,
800,
3726,
3726,
31,
22,
195,
330,
14,
487,
9623,
3893,
3538,
139,
37,
13005,
8,
15458,
9,
7091,
5447,
4296,
9,
960,
3212,
118,
4071,
118,
12851,
263,
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... |
WPF DataGrid .NET framework 4
===
I have a problem in WPF using DataGrid, I am using SQLDataReader and when I populate record from Datatable to Datagrid there are no record but it hasRows my Code is this.
try
{
string commandText = "dbo.sp_select_survey";
SqlConnection conn = new SqlConnection("Data Source=IT-PC1;Initial Catalog=gcserp;User ID=test;Password=test;Initial Catalog=gcserp;Integrated Security=True");
SqlCommand cmd = new SqlCommand(commandText, conn);
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.CommandTimeout = 600;
conn.Open();
SqlDataReader objRDR = cmd.ExecuteReader((CommandBehavior.CloseConnection));
DataTable dt = new DataTable();
dt.Load(objRDR);
dataGrid1.ItemsSource=dt.DefaultView;
}
catch
{
}
}
| 0 | [
2,
619,
7721,
1054,
16375,
13,
9,
2328,
6596,
268,
800,
3726,
3726,
31,
57,
21,
1448,
19,
619,
7721,
568,
1054,
16375,
15,
31,
589,
568,
4444,
255,
18768,
10647,
106,
17,
76,
31,
1675,
12383,
571,
37,
1054,
5924,
20,
1054,
16375,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
PostgreSQL 9.1 - Query on VIEWS taking a lot of time
===
We are using postgreSQL 9.1. We are having problems while executing queries on a VIEW of PostgreSQL. Following is the situation:
We have a partitioned Table "buz_scdr" over which we have built a VIEW "Swiss_client_wise_minutes_and_profit". The purpose of this VIEW is to join data from different tables including the "buz_scdr" table to make efficient queries. This strategy was working fine until the Table "buz_scdr" became gigantic(overall records in all the partitions became huge.The table is partitioned on the basis of Date). The query being executed on this VIEW started taking very long time (around 5 to 10 mins). For figuring out why this query is taking so long to execute, we used EXPLAIN command to show its Execution PLAN. The Query which we used is as follows:
EXPLAIN SELECT * from "Swiss_client_wise_minutes_and_profit" where start_time = '2012-7-22 08:00';
Its Results are as follows:
Subquery Scan on "Swiss_client_wise_minutes_
and_profit" (cost=2127919.71..94874537.55 rows=40474 width=677)
Filter: ("Swiss_client_wise_minutes_and_profit".start_time = '2012-07-22 08:00:00+00'::timestamp with time zone)
-> WindowAgg (cost=2127919.71..94773352.06 rows=8094839 width=148)
-> Sort (cost=2127919.71..2148156.81 rows=8094839 width=148)
Sort Key: cc.name, rdga.group_id
-> Hash Left Join (cost=1661.50..604234.77 rows=8094839 width=148)
Hash Cond: (((cc.company_id)::text = (rdga.company_id)::text) AND ((cs.c_prefix_id)::text = (rdga.dest_id)::text))
-> Hash Left Join (cost=7.88..460615.39 rows=8094839 width=123)
Hash Cond: ((cs.client_name_id)::text = (cc."Alias_name")::text)
-> Append (cost=0.00..349303.48 rows=8094839 width=111)
-> Seq Scan on "Swiss_buz_scdr" cs (cost=0.00..1.06 rows=1 width=610)
Filter: ((customer_name)::text = 'SSP Root'::text)
-> Seq Scan on scdr_buz__2012_07_11 cs (cost=0.00..349302.41 rows=8094838 width=111)
Filter: ((customer_name)::text = 'SSP Root'::text)
-> Hash (cost=5.17..5.17 rows=217 width=24)
-> Seq Scan on "Corporate_companyalias" cc (cost=0.00..5.17 rows=217 width=24)
-> Hash (cost=1334.42..1334.42 rows=21280 width=50)
-> Hash Join (cost=169.56..1334.42 rows=21280 width=50)
Hash Cond: ((rdga.company_id)::text = (c.name)::text)
-> Hash Join (cost=162.68..1034.93 rows=21280 width=50)
Hash Cond: ((rdga.group_id)::text = (rdg.name)::text)
-> Seq Scan on "RateManagement_destgroupassign" rdga (cost=0.00..497.35 rows=25935 width=40)
-> Hash (cost=123.64..123.64 rows=3123 width=32)
-> Hash Join (cost=13.08..123.64 rows=3123 width=32)
Hash Cond: (rdg.country_id = cc.id)
-> Seq Scan on "RateManagement_destinationgroup" rdg (cost=0.00..65.06 rows=3806 width=26)
-> Hash (cost=7.48..7.48 rows=448 width=14)
-> Seq Scan on "Corporate_country" cc (cost=0.00..7.48 rows=448 width=14)
-> Hash (cost=4.17..4.17 rows=217 width=16)
-> Seq Scan on "Corporate_company" c (cost=0.00..4.17 rows=217 width=16)
SubPlan 1
-> Seq Scan on "Corporate_companyalias" cc (cost=0.00..5.71 rows=1 width=12)
Filter: (("Alias_name")::text = (cs.client_name_id)::text)
SubPlan 2
-> Seq Scan on "Corporate_companyalias" cc (cost=0.00..5.71 rows=1 width=12)
Filter: (("Alias_name")::text = (cs.vendor_name_id)::text)
(36 rows)
The result above of the EXPLAIN command shows that our query is sequentially scanning the "buz_scdr" Table (as highlighted above) which contains total 8094838 records. The query on the VIEW is not following the partition constraints (date) of "buz_scdr", which is causing it to scan the whole Table.
For experimental purpose, we directly executed a query on the "buz_scdr" TABLE with a WHERE statement along with date and time , and it duly respected the partition constraints and didn't scan the whole table. This indicates that the query executed directly on the partitioned Table is working as expected but the VIEW built upon it is having problems.
Is this a global problem with postgreSQL Views or have I missed something?
| 2 | [
2,
678,
6879,
18,
22402,
561,
9,
165,
13,
8,
25597,
27,
4146,
741,
21,
865,
16,
85,
800,
3726,
3726,
95,
50,
568,
678,
6879,
18,
22402,
561,
9,
165,
9,
95,
50,
452,
1716,
133,
25836,
9386,
2829,
27,
21,
1418,
16,
678,
6879,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 timer event
===
I'm using setInterval function at the beginning of my program, but my problem is I don't want to wait when I start code. I want it to start immediately, after it will apply this timeinterval. Here is my code:
function initialize() {
setInterval(function(){myFunc()},5000);
}
google.setOnLoadCallback(initialize); | 0 | [
2,
8247,
8741,
85,
139,
807,
800,
3726,
3726,
31,
22,
79,
568,
309,
6280,
3377,
1990,
35,
14,
997,
16,
51,
625,
15,
47,
51,
1448,
25,
31,
221,
22,
38,
259,
20,
1760,
76,
31,
799,
1797,
9,
31,
259,
32,
20,
799,
1375,
15,
75... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Log file processing with R
===
I have just found out about R, which seems to be the ideal tool to get statistics on webserver logfiles. I have looked into several libs like ``zoo`` and ``plyr``, but none of them offer a straight forward solution to aggregate timestamped data.
Is there any R lib or a tutorial or a documentation which focuses on analyzing log file like data? Which emphasize on aggregating the time in slices?
Possible usecases:
- average request time per day
- average requests per session per day
- get the slowest requests this week
- ... | 0 | [
2,
6738,
3893,
5511,
29,
761,
800,
3726,
3726,
31,
57,
114,
216,
70,
88,
761,
15,
56,
2206,
20,
44,
14,
5628,
5607,
20,
164,
5818,
27,
2741,
10321,
106,
6738,
16877,
18,
9,
31,
57,
292,
77,
238,
13,
8326,
18,
101,
13,
7,
250... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
retrieve log4j logs
===
What would be the easiest way to retrieve all log4j logs between two given dates, for a given level (debug, critical, ...), from a file for example, and display them in a web browser (with swing for example) that asks for the inputs (two dates, and log level) ?
I'm sure this has already been made by someone, as it seems quite a common question, but I haven't found anything that was already implemented. | 0 | [
2,
11917,
6738,
300,
728,
18893,
800,
3726,
3726,
98,
83,
44,
14,
27237,
161,
20,
11917,
65,
6738,
300,
728,
18893,
128,
81,
504,
4076,
15,
26,
21,
504,
662,
13,
5,
546,
16254,
15,
2507,
15,
13,
9,
9,
9,
6,
15,
37,
21,
3893,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Prevent the page scrolling down each time "page" button link are clicked?
===
I´m using scrollTo jQuery plugin on a wordpress page and wonder if
there is a way to prevent the page scrolling down each time "page" button link are clicked?
http://www.missbee.se/missBeev1/?page_id=5#page1
Here is my code,
$(function() {
var $target = $('#mask');
$('#btn1').click(function() {
$target.scrollTo($('#page1'),500);
});
$('#btn2').click(function() {
$target.scrollTo($('#page2'),500);
});
$('#btn3').click(function() {
$target.scrollTo($('#page3'),500);
});
$('#btn4').click(function() {
$target.scrollTo($('#page4'),500);
});
$('#btn5').click(function() {
$target.scrollTo($('#page5'),500);
});
}); | 0 | [
2,
2501,
14,
2478,
13,
28166,
125,
206,
85,
13,
7,
6486,
7,
5167,
3508,
50,
15802,
60,
800,
3726,
3726,
31,
307,
568,
12159,
262,
487,
8190,
93,
10922,
108,
27,
21,
833,
5890,
2478,
17,
2666,
100,
80,
25,
21,
161,
20,
2501,
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... |
PHP URL Directory
===
If the URL is the following :
If: `http://www.imvu-e.com/products/dnr/`<br>
Then: `http://www.imvu-e.com/products/dnr/`
If: `http://www.imvu-e.com/products/dnr/?`<br>
Then: `http://www.imvu-e.com/products/dnr/`
If: `http://www.imvu-e.com/products/dnr/index.php`<br>
Then: `http://www.imvu-e.com/products/dnr/`
If: `http://www.imvu-e.com/products/dnr/page.php?var=2`<br>
Then: `http://www.imvu-e.com/products/dnr/`
If: `http://www.imvu-e.com/products/dnr`<br>
Then: `http://www.imvu-e.com/products/`
How can I do this?
My attempt:
print "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['REQUEST_URI'])."/"; | 0 | [
2,
13,
26120,
287,
6362,
16755,
800,
3726,
3726,
100,
14,
287,
6362,
25,
14,
249,
13,
45,
100,
45,
13,
1,
21127,
6903,
6483,
9,
1660,
8924,
8,
62,
9,
960,
118,
14086,
18,
118,
43,
12835,
118,
1,
5145,
1,
94,
45,
13,
1,
21127... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
rake spec - prerequisites seem nonsensical
===
I'm trying to set up a reliable continuous integration server that runs rspec. I've read [this answer][1], and indeed if I run db:reset that seems to get me in a good state to run the tests. In fact, if I run db:reset and then after it, on the cli, run rake spec - my tests run.
However, if I make one rake task that does both, like this:
desc 'Run all tests, used by Jenkins CI'
task :run => [ 'db:reset' ] do
Rake::Task["spec"].invoke
end
By the time the tests run, the database is empty. That appears to be because rake:spec calls the following:
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
** Execute db:test:load
** Invoke db:schema:load
** Execute spec
If I'm reading it right, it will (line 2) abort if there are pending migrations. Then, eventually db:schema:load again, which loads the database from schema rb... which I'd already done. And, it makes me particularly unclear why, if it's going to re-wipe the db, it would abort if migrations wouldn't have been applied.
Worse still, in my case the first thing the spec task does is bail because the users table doesn't exist... and that was defined in schema.rb (which at this point has been loaded twice).
Any ideas where I'm misunderstanding?
[1]: http://stackoverflow.com/questions/4116067/how-to-recreate-the-database | 0 | [
2,
21009,
12737,
13,
8,
782,
99,
16756,
6359,
2260,
538,
1264,
18,
4272,
800,
3726,
3726,
31,
22,
79,
749,
20,
309,
71,
21,
11398,
6357,
8078,
8128,
30,
1461,
13,
1224,
12610,
9,
31,
22,
195,
1302,
636,
1565,
1623,
500,
2558,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Object Reference casting vb.net
===
I have no idea on how to cast an object that type was 'Object' to a user defined class type.
I have a private instance variable:
Private studyType as Object
What i need to do is to instantiate this object from an event handling method. And no, not to instance new Object().
Basically it would look like this:
studyType = new VCEOnly()
However, I am only allowed to use the 'Object' class subs and functions as the type was defined as 'Object'. So i need to cast it to VCEOnly class type so i can access its subs and functions.
Basically, studyType needs to be casted from 'Object' to 'VCEOnly'. I am not allowed to pre-define studyType as 'VCEOnly' when declared. | 0 | [
2,
3095,
2801,
9087,
13,
20468,
9,
2328,
800,
3726,
3726,
31,
57,
90,
882,
27,
184,
20,
1325,
40,
3095,
30,
1001,
23,
13,
22,
23793,
22,
20,
21,
4155,
2811,
718,
1001,
9,
31,
57,
21,
932,
4851,
7612,
45,
932,
949,
4474,
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... |
Issue: Jersey umarshalls parameter QueryParam/PathParam as null
===
I am not able to pass my own object through <code>@FormParam</code> with Jersey. It is always null. I have method like this:
@POST
@Path("search")
@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public SearchResult search(
@FormParam("record") MyObject record,
@FormParam("offset") Integer offset,
...) {
...
}
When I try to pass the MyObject, it's always null. The parameter offset is passed correctly.
Client side in JavaScript for illustration:
$.ajax({
'url': url,
'type': 'POST',
'dataType': 'json', 'contentType': 'application/json',
'data': {'record': record, 'offset': 123}
})
I thought that it might be a problem with jQuery, so I tried to change the parameter to some nonsence <code>'data': {'record': 'string instead of json', 'offset': 123}</code> and I got 400 (Bad Request). I also checked the body of the request and it seemed alright.
But when I change the method to look like this:
public SearchResult search(MyObject record) { ... }
And the client script accordingly:
$.ajax({
'url': url,
'type': 'POST',
'dataType': 'json', 'contentType': 'application/json',
'data': JSON.stringify(record)
})
The MyObject is obtained correctly.
I tried to use GET method with the same results.
Is it possible that it's a bug in Jersey or am I missing something? | 0 | [
2,
1513,
45,
2134,
287,
19988,
1233,
18,
18906,
25597,
6351,
79,
118,
8353,
6351,
79,
28,
16203,
800,
3726,
3726,
31,
589,
52,
777,
20,
1477,
51,
258,
3095,
120,
13,
1,
9375,
1,
4190,
6351,
79,
1,
118,
9375,
1,
29,
2134,
9,
32... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
using dijit.byId w dojox.mobile widgets
===
I'm dynamically building a series of dojox.mobile.ListItem widgets under a statically defined dojox.mobile.RoundRectList widget via this function...
function displayOpps(items) {
// Create the list container that will hold application names
var rrlOppsContainer = dijit.byId("rrlOpps");
// Add a new item to the list container for each element in the server respond
for (var i in items){
// Create and populate the list container with applications' names
var name = items[i].CustName + " - " + items[i].OppNbr;
var liOpps = new dojox.mobile.ListItem({
label: name,
moveTo: "sv3OppDetail"
});
// Add the newly created item to the list container
rrlOppsContainer.addChild(liOpps);
}
}
When I run this code during onLoad() in my html file, I get the following error using Chrome's dev tools...
Uncaught TypeError: Object #<Object> has no method 'byId'
I've read numerous articles around this topic and it appears that lots of folks have this problem, but each that I have found are in relation to some other technology (e.g., Spring MVC, etc) and I'm attempting to use it w a dojox.mobile based app. That said, I attempted to mimic some of the solutions brought up by others by including this in my html file, and it still doesn't work...
<script type="text/javascript"
data-dojo-config="isDebug: true, async: true, parseOnLoad: true"
src="dojo/dojo.js">
dojo.require("dojox.mobile.RoundRectList")
</script>
What am I doing wrong?
Thank you in advance for your time and expertise.
| 0 | [
2,
568,
926,
13803,
9,
779,
1340,
619,
107,
1636,
396,
9,
12571,
4807,
43,
3060,
18,
800,
3726,
3726,
31,
22,
79,
7782,
1326,
353,
21,
231,
16,
107,
1636,
396,
9,
12571,
9,
5739,
2119,
79,
4807,
43,
3060,
18,
131,
21,
12038,
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... |
Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]
===
i converted the following working code to pdo
<?php
include('config.php');
$link =mysql_connect($db_host,$username,$password);
mysql_select_db($db_name);
$id= $_POST["uniqi"];
$comments= $_POST["comments"];
$comments= mysql_real_escape_string($comments);
$comments = strip_tags($comments);
$update = "UPDATE mastertable SET comments = '$comments' WHERE id_pk= '$id'";
mysql_query($update, $link);
mysql_close();
header('Location: ccccc.com/pabrowser/… Updated');
?>
TO
<?php
$id= $_POST["uniqi"];
$comments= $_POST["comments"];
$conn = new PDO("mysql:host=$db_host;dbname=$db_name",$username,$password);
$sql = "UPDATE mastertable SET comments=? WHERE id_pk=?";
$q = $conn->prepare($sql);
$q->execute(array($comments,$id));
header('Location: ccccc.com/pabrowser/… Updated');
?>
which gave me
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' in /home/content/58/9508458/html/pabrowser/comsumcompro.php:4 Stack trace: #0 /home/content/58/9508458/html/pabrowser/comsumcompro.php(4): PDO->__construct('mysql:host=;dbn...', NULL, NULL) #1 {main} thrown in /home/content/58/9508458/html/pabrowser/comsumcompro.php on line 4 | 0 | [
2,
16061,
12647,
5391,
13,
22,
306,
537,
10066,
872,
22,
29,
2802,
13,
22,
18,
22402,
3859,
2558,
5608,
3993,
500,
800,
3726,
3726,
31,
3494,
14,
249,
638,
1797,
20,
351,
537,
13,
1,
60,
26120,
468,
5,
22,
14093,
2816,
9,
26120,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Which regular expression to use in order to determine which characters to escape for html attirbutes and javascript?
===
I am adopting some code from Twig for escaping html and js output. Now I don't entirely understand the regex they are using.
They use:
<!-- language-all: lang-php -->
preg_replace_callback( '#[^a-zA-Z0-9,\._]#Su' , '_twig_escape_js_callback' , $string ); // for javascript
preg_replace_callback( '#[^a-zA-Z0-9,\.\-_]#Su' , '_twig_escape_html_attr_callback' , $string ); // for html attibutes
Where the callback functions will replace everything that corresponds to the negative character class.
As far as I can tell, this is equivalent (getting rid of some backslashes):
'#[^a-zA-Z0-9,._]#Su'
'#[^a-zA-Z0-9,._-]#Su'
Now we see that for javascript they allow commas, which I don't understand because a comma is a control character in a javascript context. Take this example of a comma exploit:
// say we have a function call to a javascript function like this
function ajax( timeout, onerror, onsuccess ) {...};
// now assume I get the timeout value from somewhere dodgy (in php)
$timeout = escapeJS( '1000, evilCallback, evilCallback2' );
echo "ajax( $timeout, myErrorHandler, mySuccessHandler );"
Note that javascript will happily ignore the extra parameters...
In the html attribute, the idea is to prevent closing the attribute, hence they don't allow spaces, since it is common to write attributes without quotes and in html4 it is legal as well. However, i see spaces used in attributes for giving multiple classes to an element like: `<tr class="tablerow odd">`. So dissallowing spaces prevents class attributes like this from coming from a database with templates or other sources...
1. Given that in xhtml it is forbidden to use attributes without quotes and my site generates xhtml strict doctype, can I afford to allow spaces?
2. Should I forbid the comma for javascript?
| 0 | [
2,
56,
1290,
1803,
20,
275,
19,
389,
20,
3746,
56,
1766,
20,
2220,
26,
13,
15895,
35,
14134,
811,
160,
17,
8247,
8741,
60,
800,
3726,
3726,
31,
589,
17577,
109,
1797,
37,
19690,
26,
14700,
13,
15895,
17,
487,
18,
5196,
9,
130,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Serialize an object using DataContractJsonSerializer
===
I have created a generic extension method to serialize JSON using the DataContractJsonSerializer.
looks like this:
public static string ToJSON<T>(this T obj) where T : class
{
DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(T));
using (MemoryStream stream = new MemoryStream())
{
serializer.WriteObject(stream, obj);
return Encoding.Default.GetString(stream.ToArray());
}
}
I need to create a class, when serialize to json it should be like this :
{
"expiration": "2011-04-20T11:54:21.032Z",
"conditions": [
["eq", "acl", "private"],
["eq", "bucket": "myas3bucket"],
["eq", "$key", "myfilename.jpg"],
["content-length-range", 0, 20971520],
["eq", "$redirect", "myredirecturl"],
]
}
What are the attributes of this class?
Thanks,
| 0 | [
2,
5956,
2952,
40,
3095,
568,
1054,
23311,
728,
528,
4104,
2815,
11907,
800,
3726,
3726,
31,
57,
679,
21,
12733,
3896,
2109,
20,
5956,
2952,
487,
528,
568,
14,
1054,
23311,
728,
528,
4104,
2815,
11907,
9,
1879,
101,
48,
45,
317,
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... |
PHP regex preg_split - split by largest group only
===
I have the following regex
((\$|(\\\[)).*?(\$|(\\\])))
which should capture everything between `$$` and `\[\]` and I tested it on http://gskinner.com/RegExr/ and it's working.
PHP variant is (doubled backslashes)
((\$|(\\\\\[)).*?(\$|(\\\\\])))
and I would like to split my text based on that regex. How can I tell that it uses just the first (and largest group) and not these small ones?
preg_split('/((\$|(\\\\\[)).*?(\$|(\\\\\])))/', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
So for text `This is my $test$ for something.` I should get an array
[0] => This is my
[1] => $test$
[2] => for something.
But I get
[0] => This is my
[1] => $test$
[2] => $
[3] =>
[4] => $
[5] => for something. | 0 | [
2,
13,
26120,
7953,
1706,
782,
263,
1,
25603,
13,
8,
2132,
34,
1075,
214,
104,
800,
3726,
3726,
31,
57,
14,
249,
7953,
1706,
13,
5,
5,
1,
4403,
1,
5,
1,
2558,
6,
6,
9,
2483,
60,
5,
1,
4403,
1,
5,
1,
500,
6,
6,
6,
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... |
Visual Studio 2010 Font size change control + mouse wheel 1080p res monitor
===
I recently bought a 1080p monitor and I'm still not used to the resolution. The default font size, Consolas 10, is too small for me to read and 11 is a bit bigger than I want it to be.
If I increase the font with control + mouse wheel while the enviroment font size is 10, it gets bigger than I want it. The font size I'm ok with is 11 with one control + mouse wheel step decrement, but that is a little bit bigger than the default Consolas 10.
I'm wondering if the control + mouse wheel increments/decrements the text editor's font size by 1,5 value. How can I set it to the one I'm comfortable with? (Consolas 11 decremented by 1 control + mouse wheel) | 0 | [
2,
3458,
1120,
498,
9978,
1072,
753,
569,
2754,
7567,
3556,
332,
2887,
306,
10719,
7626,
800,
3726,
3726,
31,
1989,
2448,
21,
332,
2887,
306,
7626,
17,
31,
22,
79,
174,
52,
147,
20,
14,
4302,
9,
14,
12838,
9978,
1072,
15,
11608,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Programmatically setting the borderbrush of a border within a datatemplate in a datagrid in a usercontrol
===
I have a UserControl which is basically a DataGrid. The datagrid has one TemplateColumn which is bound to an object.
I want to add a property to the UserControl which will set the Borderbrush that is inside the DataTemplate.
Here is my Xaml:
<DataGrid.Columns>
<DataGridTemplateColumn Header="No" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Border x:Name="ElementBorder" BorderThickness="1">
<Viewbox Height="Auto" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<TextBlock Text="{Binding Name}" VerticalAlignment="Top"></TextBlock>
</Viewbox>
</Border>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
I would like to set the ElementBorder's BorderBrush property based on a "ElementBorderColor" property in my UserControl. | 0 | [
2,
625,
6732,
1326,
2697,
14,
1862,
20632,
16,
21,
1862,
363,
21,
1054,
9577,
6554,
19,
21,
1054,
16375,
19,
21,
4155,
12898,
800,
3726,
3726,
31,
57,
21,
4155,
12898,
56,
25,
11374,
21,
1054,
16375,
9,
14,
1054,
16375,
63,
53,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 store small to medium sets of data in iOS (for easy iCloud-sync)?
===
I have an iOS application that currently manages a small bunch of settings (via NSUserDefaults, I know how to sync these via iCloud) and some list data.
Let's say as an example I want to store a list of <color name / color / comment>. So I create a custom type, that is called ColorInfo. In my app I need to store multiple values of ColorInfo, I'd try and achieve that using an NSMutableArray or a database, but both are not easily synchronizable via the iCloud.
What ways to manage lists of data do you prefer in your iOS apps to meet the following two requirements?
1. You should be able to easily store the data persistently on the local phone.
2. You should be able to easily sync the data via the iCloud. | 0 | [
2,
184,
20,
1718,
284,
20,
4152,
3415,
16,
1054,
19,
13,
7760,
13,
5,
1106,
2010,
31,
19174,
8,
9507,
150,
6,
60,
800,
3726,
3726,
31,
57,
40,
13,
7760,
3010,
30,
871,
9118,
21,
284,
7653,
16,
12410,
13,
5,
5034,
13,
2172,
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... |
Cannot Connect to ASPNETDB in Production server using SQL Server 2008 R2 Standard Edition
===
I am a newbie in ASP.net and just following Tutorials. This Particular Problem has been Giving me a Real Headache, I have developed a website in VS 2010 , used the ASPNETDB SQL server database provided by Asp.Net Login Controls for creating users and roles. Also added Some tables, After i Was Done Used the " publish to Provider " feature to generate the Script (ASPNETDB.MDF.sql) . I Used this Script to Generate the Database and Tables -Sql Server 2008 R2 management Studio, and Modified the web.config Like This-
<!--Connection String-->
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Server=AkumJamir-PC\SQLEXPRESS;Initial Catalog=ASPNETDB;Integrated Security=true" providerName="System.Data.SqlClient" />
<add name="con" connectionString="Server=AkumJamir-PC\SQLEXPRESS;Initial Catalog=ASPNETDB;Integrated Security=True"/>
<add name="ConnectionString" connectionString="Server=AkumJamir-PC\SQLEXPRESS;Initial Catalog=ASPNETDB;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
<roleManager enabled="true">
<providers>
<remove name="AspNetSqlRoleProvider"/>
<add connectionStringName="ConnectionString" applicationName="/"
name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider,System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<remove name="AspNetWindowsTokenProvider"/>
</providers>
</roleManager>
<membership>
<providers>
<remove name="AspNetMembershipProvider"/>
<add connectionStringName="ConnectionString" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphaNumericCharacters="1" passwordAttemptWindow="5" passwordStrengthRegularExpression="" name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider,System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>
<webParts>
<personalization defaultProvider="AspNetSqlPersonalizationProvider">
<providers>
<remove name="AspNetSqlPersonalizationProvider"/>
<add name="AspNetSqlPersonalizationProvider" type="System.Web.UI.WebControls.Webparts.SqlPersonalizationProvider"
connectionStringname="ConnectionString" applicationName="/"/>
</providers>
</personalization>
</webParts>
Now The Problem is That Works On my Development Machine But on our Staging Server, It Doesnt connect to the Database whenever i try browse to Some Pages where i have some data to be displayed from the Database Neither Does the Login Page Work.The connectionString Looks Like This in the Server:
<!--Connection String-->
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Driver={SQL Native Client};Server=WIN-K16NMM4128C;Initial Catalog=ASPNETDB;Integrated Security=true" providerName="System.Data.SqlClient" />
<add name="con" connectionString="Server=WIN-K16NMM4128C;Initial Catalog=ASPNETDB;Integrated Security=True"/>
<add name="ConnectionString" connectionString="Data Source=WIN-K16NMM4128C\SqlServer2008;Initial Catalog=ASPNETDB;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
I Am Eating My braings Away, I've Gone through the Topics Covered Already,,,, Thanks For any Advise...
| 0 | [
2,
1967,
6379,
20,
28,
306,
2328,
9007,
19,
637,
8128,
568,
4444,
255,
8128,
570,
761,
135,
1236,
1322,
800,
3726,
3726,
31,
589,
21,
78,
5893,
19,
28,
306,
9,
2328,
17,
114,
249,
29724,
18,
9,
48,
1498,
1448,
63,
74,
1438,
55... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Umbraco: How to get TabPage on which a user control data type exists
===
I'm building a custom data type using the user control wrappper method. Within it I am adding the existing tinymce data type. The problem is that I need to find a way to dynamically get a hold of the current TabPage on which the data type resides so that I can add the TinyMCE buttons to the menu. This is what I have currently (the TabPage is hardcoded):
Using statements:
using umbraco.cms.businesslogic.datatype;
using umbraco.editorControls.tinyMCE3;
using umbraco.uicontrols;
OnInit method:
private TinyMCE _tinymce = null;
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
this.ID = "crte";
DataTypeDefinition d = DataTypeDefinition.GetDataTypeDefinition(-87);
_tinymce = d.DataType.DataEditor as TinyMCE;
ConditionalRTEControls.Controls.Add(_tinymce);
TabView tab = Page.FindControl("TabView1", true) as TabView;
TabPage page = tab.Controls[0] as TabPage;
page.Menu.InsertSplitter();
page.Menu.NewElement("div", "umbTinymceMenu_" + _tinymce.ClientID, "tinymceMenuBar", 0);
}
User control:
<asp:PlaceHolder ID="ConditionalRTEControls" runat="server" /> | 0 | [
2,
13,
723,
2559,
716,
45,
184,
20,
164,
6523,
6486,
27,
56,
21,
4155,
569,
1054,
1001,
5636,
800,
3726,
3726,
31,
22,
79,
353,
21,
5816,
1054,
1001,
568,
14,
4155,
569,
8118,
8763,
2109,
9,
363,
32,
31,
589,
4721,
14,
3149,
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... |
Listen for network activity, and piggyback my own message when network is busy anyway
===
One of the costs on a phone is that of sending messages, like for instance heartbeat messages to a service in order to be able to receive push messages.
One solution I'm trying for is to set up my timers with a time frame, for earliest heartbeat, and latest, so that when I hit the early time, I'll start listening for network traffic, and if the radio on the phone is busy anyway, I'll send my heartbeat when it is.
The idea is that I may save some power by preventing the phone from having to power up the radio just for me.
That is the theory.
But there are two problems. I'm new to Android, and I haven't been able to figure out if there is such a service I can listen to.
I'm aiming at Android 2.1 for the widest possible audience. | 0 | [
2,
3834,
26,
982,
2358,
15,
17,
351,
23142,
1958,
51,
258,
2802,
76,
982,
25,
4394,
2774,
800,
3726,
3726,
53,
16,
14,
4227,
27,
21,
1132,
25,
30,
16,
4907,
7561,
15,
101,
26,
4851,
12694,
7561,
20,
21,
365,
19,
389,
20,
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... |
Check for x consecutive days - given timestamps in database
===
Could anybody give me an idea or hint how you could check for X consecutive days in a database table (MySQL) where logins (user id, timestamp) are stored?
Stackoverflow does it (e.g. badges like Enthusiast - if you log in for 30 consecutive days or so...). What functions would you have to use or what is the idea of how to do it?
Something like `SELECT 1 FROM login_dates WHERE ...`? | 0 | [
2,
2631,
26,
993,
4195,
509,
13,
8,
504,
436,
4919,
1919,
19,
6018,
800,
3726,
3726,
110,
11181,
590,
55,
40,
882,
54,
6382,
184,
42,
110,
2631,
26,
993,
4195,
509,
19,
21,
6018,
859,
13,
5,
915,
18,
22402,
6,
113,
2205,
17040... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Facing url redirect issue
===
hi there i am using wordpress on main domain and mybb forum script on subdomain
now problem is this
when i point to site.com/forum/
the index.php file open up the forum with wrong urls
but my real url is subdoamin.site.com/index.php
how can i fix that
also getting this in error log
site.com/forum/thread title
istead of subdomain.site.com/thread title
using apache and cpanel
if one you have some time to check my problem please check it and help me i am very thank full to you if it fixed as i asked wordpress, mybb and also hoster to check and fix but no luck yet so please help me
thanks in advance
here is my url
asf-mobiles.com
and forums.asf-mobiles.com | 0 | [
2,
4325,
287,
6362,
302,
14706,
1513,
800,
3726,
3726,
4148,
80,
31,
589,
568,
833,
5890,
27,
407,
4603,
17,
51,
3490,
5691,
3884,
27,
972,
537,
6232,
130,
1448,
25,
48,
76,
31,
454,
20,
689,
9,
960,
118,
1106,
723,
118,
14,
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... |
How to convert from BCL/3rd Party types to my own ones
===
I am currently struggling with .net type conversions of e.g. List<TestCaseAttachment>.Cast<MyType>()
*TestCaseAttachment* being a type defined in Microsoft's TFS / Test Management API and I need to convert them to my own types. Now I could certainly write (extension) methods, but out of interest, is there a way to implement implicit/explicit conversion operators for BCL / 3rd party types & classes that are out of my 'control' so that standard c# language behaviors work? | 0 | [
2,
184,
20,
8406,
37,
2726,
255,
16842,
897,
346,
2551,
20,
51,
258,
53,
18,
800,
3726,
3726,
31,
589,
871,
7587,
29,
13,
9,
2328,
1001,
6263,
18,
16,
13,
62,
9,
263,
9,
968,
1,
10543,
10325,
14986,
673,
1130,
1,
9,
6146,
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... |
Git "unable to determine absolute path of git directory"
===
I'm a git newbie and am having problems trying to get the latest version of a remote project:
S:\dev\prj\myprj [master]> git pull
/usr/libexec/git-core/git-sh-setup: line 266: cd: .git: No such file or directory
Unable to determine absolute path of git directory
It was working fine until today and strangely I don't think I've changed anything since it last worked fine.
This is on Windows 7. My project is on an encrypted drive (S:) and git is on C:
S:\dev\prj\myprj [master]> git --exec-path
C:\Users\matt\AppData\Local\GitHub\PortableGit_656cc1ef6d04f06ddf8b2f5bedbac921caed3b62/libexec/git-core
Manually doing a cd to the exec directory above works fine (even though there are mixed slash types).
Any ideas how to even start working out what has gone wrong? | 0 | [
2,
13,
10404,
13,
7,
1020,
579,
20,
3746,
7070,
2013,
16,
13,
10404,
16755,
7,
800,
3726,
3726,
31,
22,
79,
21,
13,
10404,
78,
5893,
17,
589,
452,
1716,
749,
20,
164,
14,
5736,
615,
16,
21,
5388,
669,
45,
13,
18,
45,
1,
1443... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 right FTP permision for PHP files on a normal LAMP server?
===
I need to know what the right FTP permision is for PHP files on a normal LAMP server? I heard about the linux permision rules and how to modify them using chmod but what are the dangers for a normal user like my client?
For instance, if he modified a PHP file with Filezilla to 777 is the world really allowed to write to the file? Thanks for your help and advises.
| 0 | [
2,
98,
25,
14,
193,
1187,
306,
416,
5858,
872,
26,
13,
26120,
6488,
27,
21,
1826,
6792,
8128,
60,
800,
3726,
3726,
31,
376,
20,
143,
98,
14,
193,
1187,
306,
416,
5858,
872,
25,
26,
13,
26120,
6488,
27,
21,
1826,
6792,
8128,
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... |
Disable Text Selector In JavaScript
===
[Prevent Defaults][1]
At the above link it describes how to prevent the default behaviour in JavaScript,but only shows you how to disable all defaults.
I only want to disable Text Selection / Context Menus
How would I go about this? Or am I going about this the wrong way?
This is nessary for the following reasons
- Disabling paste/copy on the playbook
- When using auto complete the text selector pops up and is very annoying and sometimes in the way
Thanks
[1]: http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/How-to-prevent-default-touch-and-mouse-events-in-the-BlackBerry/ta-p/1223685 | 0 | [
2,
1460,
579,
1854,
23946,
19,
8247,
8741,
800,
3726,
3726,
636,
3515,
6645,
12838,
18,
500,
2558,
165,
500,
35,
14,
784,
3508,
32,
4359,
184,
20,
2501,
14,
12838,
7727,
19,
8247,
8741,
15,
811,
104,
1285,
42,
184,
20,
1460,
579,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Launch .bat on a webcontent?
===
I'm on a JSF application, i have a .bat that i want to launch when clicking on a Command button, this script is in the webcontent directory of my project.
The code of the action is :
> public String genererRapportTable() {
>
> try {
> ServletContext ctx = (ServletContext) FacesContext
> .getCurrentInstance().getExternalContext().getContext(); String realPath = ctx.getRealPath("/"); String[] command = {
> "cmd.exe", "/C", "run",
> realPath + "Tools\\cmd.bat" }; Runtime.getRuntime().exec(command); } catch (IOException e) {
> e.printStackTrace(); } return null; }
the path is correctly constracted but the script is not launched!
The debugging screen :
![enter image description here][1]
This what I get like output :
![enter image description here][2]
So the path is correct but the script is not lunched. When I put the .bat on c:\Tools and i use this path "C:\\Tools\\cmd.bat" it works.
What is the problem?
[1]: http://i.stack.imgur.com/ywDDo.png
[2]: http://i.stack.imgur.com/wBwaw.png | 0 | [
2,
3394,
13,
9,
4900,
27,
21,
2741,
25424,
60,
800,
3726,
3726,
31,
22,
79,
27,
21,
487,
18,
410,
3010,
15,
31,
57,
21,
13,
9,
4900,
30,
31,
259,
20,
3394,
76,
25590,
27,
21,
1202,
5167,
15,
48,
3884,
25,
19,
14,
2741,
254... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
incorrect frame using zoom uiscrollview
===
I have got an UIScrollView that contain UIImageView.
I need to zoom my UIImageView.
I'm using method below:
- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
return imageView; // my UIImage about I describe here.
}
In viewDidLoad method I set frame for my UIImageView (e.g. NSRect: {{110, 180}, {100, 100}})
NSLog(@"image view frame %@", [NSValue valueWithCGRect:self.imageView.frame]);
in this case in log out this value: image view frame NSRect: **{{110, 180}, {100, 100}}**
but when I try to out put frame of imageView after zoom I get new value with a next amount:
**{{9.9999971, 9.9999971}, {100.00001, 100.00001}}**
And I don't understand why I get this value **9.9999971**. What I mean. Yes I know that after zoom we change our coordinate, but I dont understand why we get not a **9.0f** instead **9.9999971** and why not **100.0** instead **100.00001** | 0 | [
2,
18867,
3523,
568,
19469,
13,
5661,
3862,
8694,
4725,
800,
3726,
3726,
31,
57,
330,
40,
13,
5661,
3862,
8694,
4725,
30,
3717,
13,
5661,
22039,
4725,
9,
31,
376,
20,
19469,
51,
13,
5661,
22039,
4725,
9,
31,
22,
79,
568,
2109,
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... |
Android a button for creating a bitmap
===
Good afternoon ,
I have a button, and I want when I click on it the canvas inserts a image I've made /res/xhdpi/frame.png and when the image comes it gets on the top of the already inserted image
example, I chose an image from the gallery then the image appears in the imageView and below it there is a button .. I want when I click on this button another image which is a frame to be placed over the chosen image.. thanks | 0 | [
2,
13005,
21,
5167,
26,
2936,
21,
1142,
15022,
800,
3726,
3726,
254,
3435,
13,
15,
31,
57,
21,
5167,
15,
17,
31,
259,
76,
31,
10840,
27,
32,
14,
9696,
14692,
18,
21,
1961,
31,
22,
195,
117,
13,
118,
99,
18,
118,
396,
252,
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... |
UILabel Not Released And Wrong Position Display
===
What I am trying to do is display a label on loading view for first time. When User will tap an object, that label should disappear and three circles should appear on its position. But what is happening is that *my label is not hidden when I am trying to release it*, as I will be needing it no more. Also it is not *present at position* I want.
![View After Being Load And Tapped][1]
What I have done is:
<!-- language: lang-cs -->
@interface AnimateCircle : UIViewController
{
UILabel *text;
CALayer *smallCircle1;
CALayer *smallCircle2;
CALayer *smallCircle3;
}
and then declared property for label and synthesized it. **Please note that I have added** `AnimateCircle` **as subview of a view. So my subview is starting from small circles as indicated in 2nd figure.**
In `viewDidLoad`, I wrote:
<!-- language: lang-cs -->
text = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, 310, 100)];
text.text = @"Tap the Red Button To Start The Timer...!";
text.font = [UIFont fontWithName:@'SnellRoundHand-Bold" size:8];
[self.view addSubview:text];
[text release];
At tap Gesture, I call a method in which I release my label `text` to hide it.
<!-- language: lang-cs -->
[text removeFromSuperView];
and draw three circles at its position. Just showing position...
<!-- language: lang-cs -->
smallCircle1.frame = CGRectMake(100, 15, 30, 30);
smallCircle2.frame = CGRectMake(140, 15, 30, 30);
smallCircle3.frame = CGRectMake(180, 15, 30, 30);
Failed after struggling for 2 hours. Please can someone tell me that what am I missing? Thanks a lot...
[1]: http://i.stack.imgur.com/EHYAQ.png, | 0 | [
2,
13,
5661,
21018,
52,
261,
17,
1389,
649,
3042,
800,
3726,
3726,
98,
31,
589,
749,
20,
107,
25,
3042,
21,
1899,
27,
12797,
1418,
26,
64,
85,
9,
76,
4155,
129,
5526,
40,
3095,
15,
30,
1899,
378,
10866,
17,
132,
7845,
378,
189... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
XQuery - Order By not correctly ordering
===
Order by clause does not seem to be working. Do I have the correct xquery query?
for $record in doc('XQuery.xml')/dataroot/RecentIndices_solarFlux
where $record/Month = 1 or
$record/Month = 2
order by $record/Geomagnetic_Smoothed_Ap
return $record
The output I'm getting is something like this:
-1, 10.5, 11.6, 5, 8.7
I am using Stylus Studio X14 Release 2 XML Enterprise Suite. | 0 | [
2,
993,
8190,
93,
13,
8,
389,
34,
52,
12044,
15775,
800,
3726,
3726,
389,
34,
9040,
630,
52,
2260,
20,
44,
638,
9,
107,
31,
57,
14,
4456,
993,
8190,
93,
25597,
60,
26,
5579,
14953,
19,
9765,
5,
22,
396,
8190,
93,
9,
396,
818... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can i skip fist post? Wordpress
===
Hy how can i skip first post. i use wordpress
Code:
<?php
$recentPosts = new WP_Query();
$recentPosts->query(array('showposts' => 6,'post_type' =>array('stiri')));
?>
<?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
Thanks | 0 | [
2,
184,
92,
31,
12532,
5499,
678,
60,
833,
5890,
800,
3726,
3726,
4085,
184,
92,
31,
12532,
64,
678,
9,
31,
275,
833,
5890,
1797,
45,
13,
1,
60,
26120,
5579,
99,
5089,
6962,
18,
800,
78,
13,
13790,
1,
8190,
93,
5,
6,
73,
557... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Permissions and SVN Updates on Windows Server 2008: same folder & SVN account, different Active Directory users
===
We're experiencing strange permission issues with SVN after switching from Windows Server 2003 to Server 2008.
On our standard build box there is a folder ("C:\SVN_Code_Folder") which AD_User_A associates with a SVN repository using SVN_User and TortoiseSVN 1.7.6
When using Windows 2003, when AD_User_B logs into the box and tries to Update, Switch, Merge the SVN_Code_Folder with SVN_User, the command is executed.
It Windows 2008, it fails with the message:
*Command: Update
Error: Working copy 'C:\jboss-4.2.3.GA\server\New folder' locked
Error: sqlite: attempt to write a readonly database
Error: sqlite: attempt to write a readonly database
Completed!*
Attempting to unlock the file, which was never locked, via the context menu is met with the following message:
*There's nothing to unlock. No file has a lock in this working copy.*
I've played with the permissions of the folder and I've discovered that giving "Domain Users" control over the folder fixes the issue, but I would prefer to not have such a broad permissions. I've tried granting the same permissions to individual users and a SVN-group, but these too did not work.
What am I missing?
Is this an improper use of SVN?
Can 2 different Domain users update a folder using SVN without removing the .SVN file?
| 0 | [
2,
5572,
18,
17,
13,
18,
16578,
16779,
27,
1936,
8128,
15573,
205,
19294,
279,
13,
18,
16578,
2176,
15,
421,
1348,
16755,
3878,
800,
3726,
3726,
95,
22,
99,
15138,
2578,
5572,
1549,
29,
13,
18,
16578,
75,
13027,
37,
1936,
8128,
97... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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# Process StandardOutput.ReadLine returns the wanted output, but this is erased with no reason
===
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.FileName="id";
proc.StartInfo.Arguments="-un";
proc.Start();
string nome_user = proc.StandardOutput.ReadLine();
proc.WaitForExit();
Hi, I was trying to run a shell command using Mono GTK#. When the debugger is on the **proc.Start();** line, **proc.StandardOutput.ReadLine()** added to watch shows the output correctly, but when the debugger jumps to the next line (**string nome_user = proc.StandardOutput.ReadLine();**), with no reason the value of the **proc.StandardOutput.ReadLine()** turns into null. Can you help me? | 0 | [
2,
272,
5910,
953,
1236,
1320,
4881,
9,
10647,
1143,
4815,
14,
417,
5196,
15,
47,
48,
25,
25513,
29,
90,
1215,
800,
3726,
3726,
329,
9,
4286,
21944,
18,
9,
16835,
13,
15617,
800,
78,
329,
9,
4286,
21944,
18,
9,
16835,
5,
6,
73... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Using a Dialog Box in a c++ dll project
===
I want to add a dialog box to a c++ dll application. First of all I would like to know if this is possible and afterwards how can I do the project compile.
When I set in the configurations "using MFC standard library" I receive the error: fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
When I set the configuration using MFC in a shared dll file I receive the error: general error c101008a: Failed to save the updated manifest to the file ".\Debug\RenameDLL.dll.embed.manifest" false parameter.
Any suggestion how to tackle this? I make also use of windows.h library.
| 0 | [
2,
568,
21,
28223,
1649,
19,
21,
272,
20512,
13,
43,
211,
669,
800,
3726,
3726,
31,
259,
20,
3547,
21,
28223,
1649,
20,
21,
272,
20512,
13,
43,
211,
3010,
9,
64,
16,
65,
31,
83,
101,
20,
143,
100,
48,
25,
938,
17,
4601,
184,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.