unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
How to search for only indesign file osx finder?
===
I want list to all the indesign file in my external HD, I tried the finder but I don't see an option to search just by extension. I selected the external HD and under kind I selected other that gave me an input box. It works when I type photoshop but doesn't work when I type indesign?? | 0 | [
2,
184,
20,
2122,
26,
104,
19,
19862,
3893,
13,
759,
396,
13,
18639,
60,
800,
3726,
3726,
31,
259,
968,
20,
65,
14,
19,
19862,
3893,
19,
51,
4886,
8590,
15,
31,
794,
14,
13,
18639,
47,
31,
221,
22,
38,
196,
40,
4255,
20,
212... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SQLite Query in Android
===
I'm in a mobile programming course right now and we need to create a simple application where the user fills out a form and we take that data and record it in our own custom SQLite db. I've successfully made the form activity, with extensive error checking, and the ContentProvider to handle the database stuff. I'm pretty much completed, everything works right. I'm just struggling to add in this one last requirement- before we let the user submit his data for the form, we need to query the database and check if the username he's adding already exists. If so, we notify him and don't allow the database to be updated/created.
He's some stuff from my content provider that describes the database:
public final static String DBNAME = "FormStorage";
public static final String AUTHORITY = "com.connor.black.provider";
public final static String TABLE_NAMESTABLE = "formstable";
private static UriMatcher sUriMatcher;
public final static String COLUMN_FIRSTNAME = "FirstName";
public final static String COLUMN_LASTNAME = "LastName";
public final static String COLUMN_PHONE = "PhoneNumber";
public final static String COLUMN_EMAIL = "Email";
public final static String COLUMN_USERNAME = "Username";
public final static String COLUMN_PASSWORD = "Password";
public final static String COLUMN_GENDER = "Gender";
public final static String COLUMN_COUNTRY = "Country";
public static final Uri CONTENT_URI = Uri.parse("content://com.connor.black.provider/" + TABLE_NAMESTABLE);
private static final String SQL_CREATE_MAIN = "CREATE TABLE " + TABLE_NAMESTABLE + "("+"_ID INTEGER PRIMARY KEY, "+
"FirstName TEXT, " +
"LastName TEXT, " +
"PhoneNumber TEXT, " +
"Email TEXT, " +
"Username TEXT, " +
"Password TEXT, " +
"Gender TEXT, " +
"Country TEXT)";
From my activity, in the submit onclicklister I'm doing this:
final Cursor mCursor;
submit.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Boolean submitCheck = true;
//...and code goes by....//
//Username duplicate check
String[] mProjection = new String[]{"FormStorage.formstable.Username"};
mCursor = getContentResolver().query(MyContentProvider.CONTENT_URI,
mProjection, null, null, null);
if(mCursor != null) {
if(mCursor.getCount() > 0) {
// Check if username already exists
}
}
So my question:
What should my mProjection string look like? I know the one I currently have is wrong, but I'm confused as to what the selection string should be?
| 0 | [
2,
4444,
10601,
25597,
19,
13005,
800,
3726,
3726,
31,
22,
79,
19,
21,
3241,
3143,
674,
193,
130,
17,
95,
376,
20,
1600,
21,
1935,
3010,
113,
14,
4155,
3509,
18,
70,
21,
505,
17,
95,
247,
30,
1054,
17,
571,
32,
19,
318,
258,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 protect my excel file from reading by the others?
===
Basically, I want to develop an office excel addin. Once you've installed this addin, all the excel files created can only be opened by a user whose excel has this addin installed. So I have two questions here:
1. Can I use VBA to develop it or I have to use C# or VB to develop it as an application level addin?
2. How to do it? It seems like I have to modify excel file format a little bit when saving, so that the other excel without this addin will deem that this is a broken file. Is there any excel API doing this? If not, do you have some better ideas?
Thanks a lot!
| 0 | [
2,
184,
20,
2196,
51,
20700,
3893,
37,
1876,
34,
14,
654,
60,
800,
3726,
3726,
11374,
15,
31,
259,
20,
2803,
40,
488,
20700,
3547,
108,
9,
382,
42,
22,
195,
4066,
48,
3547,
108,
15,
65,
14,
20700,
6488,
679,
92,
104,
44,
520,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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: to establish as first element of an array the element you need to
===
I have an array with academic years:
$arrayAcademicYears = array(
array("8889", "1988-1989"),
array("8990", "1989-1990"),
array("9091", "1990-1991"),
array("0405", "2004-2005"),
array("1112", "2011-2012"),
array("1213", "2012-2013")
);
foreach($arrayAcademicYears as $k => $v) {
echo "KEY: ";
echo $v[0];
echo " -> VALUE: ";
echo $v[1];
echo "<br>";
}
This prints:
KEY: 8889 -> VALUE: 1988-1989
KEY: 8990 -> VALUE: 1989-1990
KEY: 9091 -> VALUE: 1990-1991
KEY: 0405 -> VALUE: 2004-2005
KEY: 1112 -> VALUE: 2011-2012
KEY: 1213 -> VALUE: 2012-2013
Then I have the current academic year in a variable like this:
$currentAcademicYear="1112";
How can I change the code to print:
KEY: 1112 -> VALUE: 2011-2012
KEY: 1213 -> VALUE: 2012-2013
KEY: 0405 -> VALUE: 2004-2005
KEY: 9091 -> VALUE: 1990-1991
KEY: 8990 -> VALUE: 1989-1990
KEY: 8889 -> VALUE: 1988-1989
Please note that this is just an example, I’m not asking for a solution to any kind of academic course exercise. Just a self taught PHP learner here.
Thanks a lot! (.. for helping me becoming a better PHP programmer :))
| 0 | [
2,
13,
26120,
45,
20,
4088,
28,
64,
4520,
16,
40,
7718,
14,
4520,
42,
376,
20,
800,
3726,
3726,
31,
57,
40,
7718,
29,
1810,
122,
45,
5579,
8576,
93,
28524,
731,
18,
800,
7718,
5,
7718,
5,
7,
3020,
3877,
7,
15,
13,
7,
5930,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Saving changes is not permitted
===
([possible duplicate](http://stackoverflow.com/questions/4043950/is-there-any-way-to-avoid-the-saving-changes-is-not-permitted-error-when-tryin))
I have the issue described here: http://msdn.microsoft.com/en-us/library/bb895146.aspx
- I tried this same change on the same database in two regions. It worked in Dev, but not in Production.
- I am attempting to make a column non-nullable. I have filled values in, thus eliminating all nulls.
- The table contains a mere 134 rows.
Dropping and recreating the table would be acceptable, but only if doing so would update all foreign keys.
Why does this happen in Prod, but not in Dev? | 0 | [
2,
7599,
1693,
25,
52,
7387,
800,
3726,
3726,
13,
5,
2558,
12551,
18,
3426,
19429,
500,
5,
21127,
6903,
25325,
2549,
9990,
9,
960,
118,
24652,
18,
118,
23397,
23884,
15928,
403,
8,
1887,
8,
6001,
8,
1443,
8,
262,
8,
13884,
1340,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Excel VBA Automation Error
===
I'm using VBA automation from an Access 2010 to create charts using Excel 2010. My code works fine, but leaves an orphan Excel.exe process running. I have traced the problem to a call to an Excel VBA function in a separate module. If I eliminate the call to this function, the Excel process is closed when the codes finishes. The function is Chip Pearson's FindAll with modifications to get it to run in Access, such as declaring ranges as excel.Range and explicitly referencing the Union method as excel.Application.Union. How do I need to modify this function so that is does not leave an orphaned Excel process running?
The FindAll function is below:
<code>
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' modFindAll
' By Chip Pearson, chip@cpearson.com. www.cpearson.com
' 24-October-2007
' This module is described at www.cpearson.com/Excel/FindAll.aspx
' Requires Excel 2000 or later.
'
' This module contains two functions, FindAll and FindAllOnWorksheets that are use
' to find values on a worksheet or multiple worksheets.
'
' FindAll searches a range and returns a range containing the cells in which the
' searched for text was found. If the string was not found, it returns Nothing.
' FindAllOnWorksheets searches the same range on one or more workshets. It return
' an array of ranges, each of which is the range on that worksheet in which the
' value was found. If the value was not found on a worksheet, that worksheet's
' element in the returned array will be Nothing.
'
' In both functions, the parameters that control the search have the same meaning
' and effect as they do in the Range.Find method.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function FindAll(SearchRange As excel.Range, _
FindWhat As Variant, _
Optional LookIn As XlFindLookIn = xlValues, _
Optional LookAt As XlLookAt = xlWhole, _
Optional SearchOrder As XlSearchOrder = xlByRows, _
Optional MatchCase As Boolean = False) As Range
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' FindAll
' This searches the range specified by SearchRange and returns a Range object
' that contains all the cells in which FindWhat was found. The search parameters to
' this function have the same meaning and effect as they do with the
' Range.Find method. If the value was not found, the function return Nothing.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim FoundCell As excel.Range
Dim FirstFound As excel.Range
Dim LastCell As excel.Range
Dim ResultRange As excel.Range
With SearchRange
Set LastCell = .Cells(.Cells.Count)
End With
'On Error Resume Next
On Error GoTo 0
Set FoundCell = SearchRange.Find(What:=FindWhat, _
after:=LastCell, _
LookIn:=LookIn, _
LookAt:=LookAt, _
SearchOrder:=SearchOrder, _
MatchCase:=MatchCase)
If Not FoundCell Is Nothing Then
Set FirstFound = FoundCell
Set ResultRange = FoundCell
Set FoundCell = SearchRange.FindNext(after:=FoundCell)
Do Until False ' Loop forever. We'll "Exit Do" when necessary.
If (FoundCell Is Nothing) Then
Exit Do
End If
If (FoundCell.Address = FirstFound.Address) Then
Exit Do
End If
Set ResultRange = excel.Application.Union(ResultRange, FoundCell)
Set FoundCell = SearchRange.FindNext(after:=FoundCell)
Loop
End If
Set FindAll = ResultRange
'added below
Set ResultRange = Nothing
Set FoundCell = Nothing
Set FirstFound = Nothing
Set LastCell = Nothing
Set SearchRange = Nothing
End Function
</code>
| 0 | [
2,
20700,
566,
969,
23217,
7019,
800,
3726,
3726,
31,
22,
79,
568,
566,
969,
23217,
37,
40,
1381,
498,
20,
1600,
5158,
568,
20700,
498,
9,
51,
1797,
693,
1123,
15,
47,
2084,
40,
11728,
20700,
9,
1706,
62,
953,
946,
9,
31,
57,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can I write java code in android xml layout or string values files?
===
I want to know if it is possible to write java code in android XML layout or string values files?
I mean something like this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Utilities.doSomething("Hello World, ActMain!")</string>
<string name="app_name">insurance</string>
</resources> | 0 | [
2,
92,
31,
2757,
8247,
1797,
19,
13005,
23504,
9106,
54,
3724,
4070,
6488,
60,
800,
3726,
3726,
31,
259,
20,
143,
100,
32,
25,
938,
20,
2757,
8247,
1797,
19,
13005,
23504,
9106,
54,
3724,
4070,
6488,
60,
31,
884,
301,
101,
48,
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... |
QTP, Is there anyway to make changes to all function libraries at once ?
===
is there anyway in QTP to make changes take place on all function libraries at once without having to go to each function library and make the update ?
i have an issue with some functions, i have built new ones and i want to use them in my script.
your help is highly appreciated.
thanks
Manaysah | 0 | [
2,
2593,
13726,
15,
25,
80,
2774,
20,
233,
1693,
20,
65,
1990,
8649,
35,
382,
13,
60,
800,
3726,
3726,
25,
80,
2774,
19,
2593,
13726,
20,
233,
1693,
247,
209,
27,
65,
1990,
8649,
35,
382,
366,
452,
20,
162,
20,
206,
1990,
1248... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ColdFusion query of query strange type cast
===
<cfquery dbtype="query" name="LOCAL.modello">
SELECT
*
FROM
modelliDelMarchio
WHERE
marchioid = #ARGUMENTS.marchioid#
AND tipologia = #ARGUMENTS.tipo#
AND nome = '#ARGUMENTS.nome#'
</cfquery>
I have an error on the last query line.
It's:
> Query Of Queries runtime error. Comparison exception while executing
> =. Unsupported Type Comparison Exception: The = operator does not support comparison between the following types: Left hand side
> expression type = "STRING". Right hand side expression type = "LONG".
I swear that:
- ARGUMENTS.nome IS a string (I tried with javacast, too!)
- modelliDelMarchio is a valid db query, containing real data. "nome" is a varchar.
My version is 9.0.1 thank you.
| 0 | [
2,
1191,
9818,
25597,
16,
25597,
2578,
1001,
1325,
800,
3726,
3726,
13,
1,
8940,
8190,
93,
13,
9007,
4474,
3726,
7,
8190,
93,
7,
204,
3726,
7,
15580,
9,
13998,
1415,
7,
1,
5407,
1637,
37,
1061,
1210,
3436,
6620,
1963,
113,
285,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
2 Datepicker 's different format on jQuery ?
===
I need to do simple task :
show 2 datepickers :
one - by `month and year` , seocond - `regular`.
i *have* succed to find the css style which hides the calendar part and show only the month and year :
<style type="text/css">
.ui-datepicker-calendar { display: none; }
</style>
but i cant find away telling : this `datepicker` instance *SHOULD* self-apply this css ,and the other should *NOT*.
how can fix my **[code][1]** to apply the css *only* to 1 control ?
![enter image description here][2]
[1]: http://jsbin.com/ihalun/edit#source
[2]: http://i.stack.imgur.com/ldQ8X.jpg | 0 | [
2,
172,
1231,
16855,
106,
13,
22,
18,
421,
2595,
27,
487,
8190,
93,
13,
60,
800,
3726,
3726,
31,
376,
20,
107,
1935,
3005,
13,
45,
298,
172,
1231,
16855,
445,
13,
45,
53,
13,
8,
34,
13,
1,
6444,
17,
159,
1,
13,
15,
1353,
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... |
What is the bandwidth per second of this scenario?
===
If I have a video chat application with 10 users all visible to each other and the upstream and downstream rates are at 1MBs. Is the bandwidth used per second 10 * 1MBs * 2 (upstream and downstream) = 20MBs? Just trying to understand streaming. | 0 | [
2,
98,
25,
14,
23392,
416,
153,
16,
48,
12705,
60,
800,
3726,
3726,
100,
31,
57,
21,
763,
6615,
3010,
29,
332,
3878,
65,
4560,
20,
206,
89,
17,
14,
15657,
17,
14658,
5332,
50,
35,
137,
5024,
18,
9,
25,
14,
23392,
147,
416,
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 find peripheral when scanning for specific service CBUUID
===
When I use:
CBUUID * uuid = [CBUUID UUIDWithString:@"1800"]; // GAP
DEBUG_LOG(@"CBUUID: %@",uuid); // CBUUID: Generic Access Profile
_centralMan = [[CBCentralManager alloc] initWithDelegate:self queue:nil];
[_centralMan scanForPeripheralsWithServices:[NSArray arrayWithObject:uuid]
options:nil];
I cannot find my peripheral, but when I use:
_centralMan = [[CBCentralManager alloc] initWithDelegate:self queue:nil];
[_centralMan scanForPeripheralsWithServices:nil
options:nil];
…it shows up immediately.
When I connect, I am able to discover/read/write to all the services I am expecting. My understanding is that GAP makes this possible. I have also tried `CBUUID`'s for other services that I know are running (specifically "1804", TX power service), to no avail; the scan never discovers anything.
Even though the services are running (I can communicate w/ them upon connecting), when I scan passing the service UUID array as `nil` and this delegate method is called...
-(void) centralManager:(CBCentralManager *)central
didDiscoverPeripheral:(CBPeripheral *)peripheral
advertisementData:(NSDictionary *)advertisementData
RSSI:(NSNumber *)RSSI {
DEBUG_LOG(@"Found peripheral w/ UUID: %@ RSSI: %@ \n AdvData: %@",peripheral.UUID,RSSI,advertisementData);
DEBUG_LOG(@"Services found: %d",peripheral.services.count);
for (CBService * service in peripheral.services) {
DEBUG_LOG(@"Found service: %@ w/ UUID %@",service, service.UUID);
}
}
…it always reports "Services found: 0". Should I expect the `services` array to be populated w/ services found during the scan? (I assume this is at least partially possible, based on `scanForPeripheralsWithServices:[NSArray arrayWithObject:uuid]
options:nil`.)
Could this be a problem w/ my peripheral's service advertisements? Am I using the API incorrectly? Any guidance is much appreciated! :-)
PS: I'm pretty green w/ Bluetooth.
PPS: I control the source to the peripheral (it's a CC2540DK). So I'd be as likely to believe the problem is there as it is here. | 0 | [
2,
1967,
477,
17219,
76,
15863,
26,
1903,
365,
11642,
19612,
1340,
800,
3726,
3726,
76,
31,
275,
45,
11642,
19612,
1340,
1637,
13,
19612,
1340,
800,
636,
11849,
19612,
1340,
13,
19612,
1340,
1410,
11130,
45,
1,
7,
25408,
7,
12660,
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... |
htaccess: redirect if not match
===
I want to forward everything on site X (http://example.com) to Site Y (http://destinationwebsite.com)
except "PAGEX.aspx"
(http://example.com/PAGEX.aspx?callback=7259%2F7062434327_9fbc6da0cd)
What's wrong with this:
RewriteCond %{HTTP_HOST} ^(www\.)example\.com(!/PAGEX.aspx).*$
RewriteRule ^$ http://destinationwebsite.com | 0 | [
2,
13,
9020,
20604,
45,
302,
14706,
100,
52,
730,
800,
3726,
3726,
31,
259,
20,
917,
796,
27,
689,
993,
13,
5,
21127,
6903,
29041,
9,
960,
6,
20,
689,
13,
93,
13,
5,
21127,
6903,
43,
15018,
7914,
14113,
9097,
9,
960,
6,
1613,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Logically parse a string in excel to trim near duplicates
===
Assume the string:
item1, item1N, item1Z, item1fhg, item1_any_letters, item2, item3, item3N, item3H
my goal output is simply
item1, item2, item3
this is about a 100,000 line Excel file currently, but can be migrated to another program etc if needed temporarily.
Essentially I need to determine duplicates (any initial phrase ending in a number) with no regard to letters after the number. Some phrases might have for example "Brand item2, Brand item34" as well, the only determining factor of a duplicate is any and all terminology AFTER the number.
any ideas on where to begin with this? Each string usually has between 2 and 500 values in it, seperated by comma and a space. No comma follows the final value. | 0 | [
2,
11545,
102,
2017,
870,
21,
3724,
19,
20700,
20,
8971,
424,
19429,
18,
800,
3726,
3726,
7158,
14,
3724,
45,
9101,
165,
15,
9101,
165,
103,
15,
9101,
165,
380,
15,
9101,
165,
410,
18187,
15,
9101,
165,
1,
6001,
1,
19535,
18,
15... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Setting a WPFDataGrid columnheader to a TextBlock
===
I have a DataGrid with AutoGenerateColumns=True.
I want to set the ColumnHeaders to a TextBlock so the heading text can wrap.
I have:
Private Sub OnAutoGeneratingColumn(sender As System.Object, e As System.Windows.Controls.DataGridAutoGeneratingColumnEventArgs)
....
Dim tb As New TextBlock
tb.TextWrapping = TextWrapping.Wrap
tb.Text = SomeText
e.Column.Header = tb
End Sub
In other code, I can see that the ColumnHeader is actualy a TextBlock, and doing
Dim sHeader as String = DirectCast(dgtc.Header, TextBlock).Text
returns SomeText back.
But, the Grid Does not display any text in the header! If on the other hand I set
e.Column.Header = SomeText
The headings show OK.
What am I missing?
I know there are some answers for this on the site but I could not find any for AutoGenerateColumns = True.
| 0 | [
2,
2697,
21,
619,
7721,
18768,
16375,
4698,
1743,
106,
20,
21,
1854,
12048,
800,
3726,
3726,
31,
57,
21,
1054,
16375,
29,
3108,
17083,
1373,
716,
4404,
2172,
3726,
13398,
9,
31,
259,
20,
309,
14,
4698,
1743,
445,
20,
21,
1854,
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... |
d3.js Stack Chart
===
In reference to this stack chart on d3.js: http://mbostock.github.com/d3/ex/stack.html
Could somebody explain this chunk of javascript? I may be simply not understanding the fundementals behind javascript, I'm relatively new to it. I understand that the margin between bars is being set, the width of the entire view, the height, but then I get completely lost in the portion below. The entire source is on the mbostock link...thanks in advance.
var margin = 20,
width = 960,
height = 500 - .5 - margin,
mx = m,
my = d3.max(data, function(d) {
return d3.max(d, function(d) {
return d.y0 + d.y;
});
}),
mz = d3.max(data, function(d) {
return d3.max(d, function(d) {
return d.y;
});
}),
x = function(d) { return d.x * width / mx; },
y0 = function(d) { return height - d.y0 * height / my; },
y1 = function(d) { return height - (d.y + d.y0) * height / my; },
y2 = function(d) { return d.y * height / mz; }; | 0 | [
2,
13,
43,
240,
9,
728,
18,
7566,
1795,
800,
3726,
3726,
19,
2801,
20,
48,
7566,
1795,
27,
13,
43,
240,
9,
728,
18,
45,
7775,
6903,
12536,
7576,
9,
10404,
20926,
9,
960,
118,
43,
9280,
1706,
118,
25325,
9,
15895,
110,
8861,
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... |
jqplot grid on top of plot
===
I've been tinkering with a jqplot graph where the grid lines are on top (or in front depending how you look at it) of the graph as opposed to the default background area. I've made several attempts to get it to overlay the grid using the z-index. However, each attempt renders the entire graph non-functional and I receive no error for some unknown reason.
I'm working with a stacked bar chart that actually fills the entire grid, so I don't get to see any of the grid lines, they are all hidden beneath (or behind) the graph.
Here is the code:
<script type="text/javascript" language="javascript">
$.jqplot.config.enablePlugins = true;
var plot;
var data1 = [];
var data2 = [];
var index = 0;
var num = 0;
var delta = 0;
$(document).ready(function(){
for (i=0; i<100; i++) {
num = getRandomNumber();
delta = 100 - num;
index++;
data1.push([ index, num]);
data2.push([ index, delta]);
}
plot = $.jqplot('graph', [data1, data2],{
title: 'my title',
animate: true,
stackSeries: true,
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
rendererOptions: { highlightMouseDown: true },
pointLabels: {show: true}
},
series: [ {label: 'one'}, {label: 'two'} ],
seriesColors:['#ff0000', '#0000ff'],
legend: {
show: true,
location: 'e',
placement: 'outsideGrid'
},
grid: {
gridLineColor: '#333333',
borderWidth: 0
},
axesDefaults: {
pad: 0,
padMin: 0
},
axes: {
xaxis: {
showTicks: false,
pad: 0,
padMin: 0,
rendererOptions: { forceTickAt0: true, forceTickAt100: true }
},
yaxis: {
pad: 0,
padMin: 0,
rendererOptions: { forceTickAt0: true, forceTickAt100: true }
}
}
});
});
getRandomNumber = function(){
return Math.floor(Math.random()* 100);
};
</script>
Anyone run into this requirement and know how to get the grid lines to show up on top of the graph? Thanks | 0 | [
2,
487,
1251,
13221,
38,
7354,
27,
371,
16,
3798,
800,
3726,
3726,
31,
22,
195,
74,
25438,
68,
29,
21,
487,
1251,
13221,
38,
7210,
113,
14,
7354,
1560,
50,
27,
371,
13,
5,
248,
19,
431,
4758,
184,
42,
361,
35,
32,
6,
16,
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... |
Hiding dropdown list when list is empty
===
I currently have a dropdown list that is populated on page load and sometimes the dropdown list doesn't contain anything and is empty. I would like the hide the dropdown list whenever there aren't any items in the list. I thought i could do this via javascript but i am not sure what i could be doing wrong because after adding the javascript it stills appear on the page.
dropdown select:
<select data-bind="options: endReason() ? endReason().SubReasons : [], value: subReasonId, optionsText: 'Text', optionsValue: 'Value', visible: isChecked"
name="subReasons">
</select>
This is my Javascript:
<script type="text/javascript">
function OnClientDropDownOpening(sender, eventArgs)
{ var combo = $find("<%= subReasons %>");
items = combo.get_items();
if(items.get_count()==0)
{
eventArgs.set_cancel(true);
}
}
</script>
| 0 | [
2,
5314,
2804,
2968,
968,
76,
968,
25,
2424,
800,
3726,
3726,
31,
871,
57,
21,
2804,
2968,
968,
30,
25,
11111,
27,
2478,
6305,
17,
1030,
14,
2804,
2968,
968,
1437,
22,
38,
3717,
602,
17,
25,
2424,
9,
31,
83,
101,
14,
3077,
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... |
Google charts dynamic icons deprecated. Alternatives?
===
https://developers.google.com/chart/image/docs/gallery/dynamic_icons
Im using this to create markers, e.g: http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|FF9900
or even
return new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|" + hexColor,
new google.maps.Size(21, 34),
new google.maps.Point(0,0),
new google.maps.Point(10, 34));
But the title says
> Image Charts (Deprecated)
Does anyone know for how long it will be usable? Are there any alternatives?
Thanks | 0 | [
2,
8144,
5158,
7782,
9801,
18,
121,
3515,
150,
1669,
9,
2676,
18,
60,
800,
3726,
3726,
7775,
18,
6903,
26051,
445,
9,
16111,
4875,
9,
960,
118,
5433,
38,
118,
22039,
118,
13799,
18,
118,
14074,
3849,
118,
20985,
1,
49,
12124,
797,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
custom UITable cell how to build with unique included object state?
===
So I has custom table cell defined via builder and loaded via nib (and it has a property of its idexPath) and it has 2 buttons. I want to show table with dynamically changed state of those buttons. IE 1st cell - both enabled, 2nd cell - both buttons disabled, 3rd - 1st btn enabled and 2nd btn disabled and so on. <br>
Now if I use 1 reuse identifier all the cells will look the same which I don't want. I want every cell has its own view which means unique reuse id for every cell. <br>
But how to reach this? If I'll create some unique cellId at
- (UITableViewCell *)tableView:(UITableView *)_tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
which will be a string then I could not create the same string in meaning of objects. I could create string with same text but this will be another object so I couldn't get the previously created cell with such cellId again via reuseId. So i cant change buttons state of one cell and update it then with
[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:path] withRowAnimation:UITableViewRowAnimationNone];
but only the `[tableView reloadData];` will work.
| 0 | [
2,
5816,
13,
11193,
579,
1667,
184,
20,
1895,
29,
2619,
506,
3095,
146,
60,
800,
3726,
3726,
86,
31,
63,
5816,
859,
1667,
2811,
1197,
14960,
17,
8572,
1197,
1781,
220,
13,
5,
290,
32,
63,
21,
1354,
16,
82,
4924,
1706,
8353,
6,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Stuck with the Struts-tiles Web Application
===
I am stuck with this error **"Attribute property has a runtime value of definitions-config. property must reference a valid Java identifier"**.
<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
<set-property property="moduleAware" value="true" />
</plug-in>
I am working with struts-tiles in order to create a web application with Header, Footer, Body & Menu. I don't know weather I am missing some jar files? I have no clue. Please help me folks.
| 0 | [
2,
4549,
29,
14,
18316,
18,
8,
9802,
18,
2741,
3010,
800,
3726,
3726,
31,
589,
4549,
29,
48,
7019,
13,
1409,
7,
721,
14755,
1354,
63,
21,
485,
891,
1923,
16,
18544,
8,
14093,
2816,
9,
1354,
491,
2801,
21,
7394,
8247,
25570,
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... |
C# ConcurrentQueue - raise event when Enqueue happens?
===
I have a WCF service that is hosted in a Windows Service.
The WCF service is injected with a ***ConcurrentQueue < SomeClass >***.
The Windows Service (that hosts the WCF service) is also injected with the ***ConcurrentQueue < SomeClass >***.
The Windows Service starts the WCF service, and also spawns a worker thread.
The worker thread pushes (**Enqueue**) objects of **SomeClass** to the *ConccurrentQueue*.
I would like somehow for the WCF Service to be triggered when an object is enqueued to the *ConcurrentQueue* so that it could dequeue it (and any other object that might be in the queue), and send a message to all connected clients.
.
**TWO QUESTIONS :**
1. How do I make the WCF service 'hook' on the 'Enqueue' method of the injected ConccurentQueue, so that when objects are pushed into the queue - the WCF service will do something about it ?
2. If I do manage to somehow hook the 'Enqueue' event, and now the worker thread in the Windows Service has enqueued **two** objects into the queue - that means that it would also 'trigger' the WCF service's 'Enqueue hook' twice - will those two triggered events happen in different threads ? I need to somehow make sure that the WCF service pulls the objects from the queue in order. I do not want to suddenly see that for every Enqueue operation - the WCF service triggers in a seperate thread and pulls objects out ...
I hope my questions are clear enough ... | 0 | [
2,
272,
5910,
19513,
2005,
4185,
13,
8,
3972,
807,
76,
1957,
2005,
4185,
5531,
60,
800,
3726,
3726,
31,
57,
21,
11801,
410,
365,
30,
25,
2812,
19,
21,
1936,
365,
9,
14,
11801,
410,
365,
25,
23256,
29,
21,
8980,
1126,
17657,
2005... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Securing WCF Services across multiple projects
===
I'm having a hard time wrapping my head around some architectural elements to securing a core WCF service that is consumed by many different applications.
Internally, we have an application that allows HR folks to update a peron's details. This is contained in a WPF app. Externally, we have a website that would allow individual people to authenticate (throuh an AD Membership provider) and update their details.
We don't want users to be able to see other user's information (for obvious reasons). But we don't want to host this service inside the same web application that the users would log into. Here is how the architecture would look from a visual studio perspective:
ServiceApplication
WpfApplication
MVCWebApplication
They don't exist inside the same domains, for example, the service application would be hosted at http://www.service1.com/Service.svc and the mvc application would be hosted at http://www.updateyourprofile.com . So a user logs into http://www.updateyourprofile.com and we'd like to hit a Wcf service via JSON. Both the service application, wpf application, and mvc web application would use AD credentials to authenticate. But how do we secure the service so that users who log into the mvc web application can only see their information?
Most of the examples I see say to use the HttpContext.Current.User check inside the service. But since the user authenticated at a different site, how does the cookie transfer? Do you end up having to publish your service inside the same web application that you want to consume so that the cookies travel transparently?
Or is it just not possible to have a centrally located service with disparate applications that use the same authentication store to determine who has access to what on the service? | 0 | [
2,
13498,
11801,
410,
687,
464,
1886,
2314,
800,
3726,
3726,
31,
22,
79,
452,
21,
552,
85,
13437,
51,
157,
140,
109,
5350,
2065,
20,
13498,
21,
2884,
11801,
410,
365,
30,
25,
10936,
34,
151,
421,
3767,
9,
17739,
15,
95,
57,
40,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
cut an arry in three or four
===
How to cut an array (which has 10 items) in 4 arrays, which has 3 items maximum.
var a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'];
//a function splits it to four arrays.
console.log(b, c, d, e);
And it prints:
['a', 'b', 'c']
['d', 'e', 'f']
['j', 'h', 'i']
['j']
The length (3 here) maybe change to 4, 5 or 6.
Thanks | 0 | [
2,
1077,
40,
13,
512,
622,
19,
132,
54,
222,
800,
3726,
3726,
184,
20,
1077,
40,
7718,
13,
5,
2140,
63,
332,
3755,
6,
19,
268,
7718,
18,
15,
56,
63,
203,
3755,
2979,
9,
4033,
21,
800,
636,
22,
58,
22,
15,
13,
22,
220,
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... |
Problems with launch python script from rails
===
i need to launch python script from my rails app.
Pyton script have any external dependencies.
I need add folder to PYTHONPATH and start this script.
I do this so:
puts system(PYTHONPATH=../lib/python/ python ../reporter/src/reporter.py)
and script does not work(it should create some file, but it is not created), when i trying so:
puts system("PYTHONPATH=../lib/python/ | python ../reporter/src/reporter.py")
I recieve error - "ImportError: No module named....". It look as PYTHONPATH not set in second case.
What i do wrong? how i can start python script? | 0 | [
2,
1716,
29,
3394,
20059,
3884,
37,
2240,
18,
800,
3726,
3726,
31,
376,
20,
3394,
20059,
3884,
37,
51,
2240,
18,
4865,
9,
7103,
444,
3884,
57,
186,
4886,
29411,
9,
31,
376,
3547,
19294,
20,
20059,
8353,
17,
799,
48,
3884,
9,
31,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Adding fragments to older Android apps
===
I want to upgrade a couple of my Android apps to use Fragments. Here is a basic situation:
I have an Activity and a ListActivity. I want to convert these using fragments using the compatibility packaging. Below is what I have in the onCreate method in the Activity. (The ListActivity has similar items so I am only using the Activity as the example ere in the conversion).
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
setContentView(R.layout.rate);
Item = getIntent().getExtras().getString("name");
Category = getIntent().getExtras().getString("category");
title = (TextView) findViewById(R.id.tvRateItem);
ratingsBar = (RatingBar) findViewById(R.id.theRatingBar);
title.setText(Item);
// Display list of reviews
new starTotalTask().execute();
new starRatingTask().execute();
final EditText etTweetReview = (EditText) findViewById(R.id.etTweetReview);
Button button = (Button) findViewById(R.id.theRatingBarButton);
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// do stuff
}
}
});
Button BReviews = (Button) findViewById(R.id.bReviews);
BReviews.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// do stuff
}
});
}
So you see, I have a couple of Buttons, a couple of AsyncTasks, some getIntents that are grabbing data from other Activities, some "widget" declarations referencing to the XML.
I have the basic framework already setup with a FragmentActivity (from compatibility v4 package) with a couple of fragments it points to. In fact, I have a ViewPager, and tabs set up. The correct layouts are already setup as it should be to the new Fragment view. I just don't get how to move the data as seen above. I also understand the onCreateView is where you set the layout. Outside of that, where does everything else go? Not looking for code example as much as direction -- IF POSSIBLE.
especially interest in:
- Where do the RatingsBar and TextView (and other xml references) go?
- what about AsyncTask?
- and how do you handle passing around data in intents? | 0 | [
2,
4721,
10837,
20,
1234,
13005,
4865,
18,
800,
3726,
3726,
31,
259,
20,
9483,
21,
1335,
16,
51,
13005,
4865,
18,
20,
275,
10837,
9,
235,
25,
21,
2125,
1858,
45,
31,
57,
40,
2358,
17,
21,
968,
19348,
9,
31,
259,
20,
8406,
158,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
XAML Image Quality (interpolation) in a Metro-Style App
===
Given the following Image object (it's in the DataTemplate of a ListView object):
<Image Source="{Binding ImgSource}" ImageOpened="img_ImageOpened" />
how am I supposed to get an high-quality bicubic-interpolated image? (on screen, the size of this Image is smaller than the source PNG, but the default resizing appears to be performed with the poor-quality "nearest neighbor" interpolation).
Since I would like to rely on data binding alone (whenever the ImgSource of the associated data item changes, the Image content should change), I've tried to set an ImageOpened handler and change the just-loaded image to a better-quality one.
Unfortunately, the code below seems not to work (I just get empty images):
async void LoadImage(Image imgControl, string source)
{
try
{
StorageFile file = await StorageFile.GetFileFromPathAsync(source);
IRandomAccessStream fileStream = await file.OpenAsync(FileAccessMode.Read);
BitmapDecoder decoder = await BitmapDecoder.CreateAsync(fileStream);
InMemoryRandomAccessStream ras = new InMemoryRandomAccessStream();
BitmapEncoder enc = await BitmapEncoder.CreateForTranscodingAsync(ras, decoder);
enc.BitmapTransform.InterpolationMode = BitmapInterpolationMode.Cubic;
enc.BitmapTransform.ScaledHeight = Convert.ToUInt32(imgControl.ActualHeight);
enc.BitmapTransform.ScaledWidth = Convert.ToUInt32(imgControl.ActualWidth);
await enc.FlushAsync();
Windows.UI.Xaml.Media.Imaging.BitmapImage bImg = new Windows.UI.Xaml.Media.Imaging.BitmapImage();
bImg.SetSource(ras);
imgControl.Source = bImg;
}
catch (Exception e)
{
return;
}
}
void img_ImageOpened(object sender, RoutedEventArgs e)
{
Image imgControl = (Image)sender;
LoadImage(imgControl, <path to PNG file>);
}
| 0 | [
2,
13,
6791,
8184,
1961,
2190,
13,
5,
6280,
7332,
857,
6,
19,
21,
3986,
8,
4381,
4865,
800,
3726,
3726,
504,
14,
249,
1961,
3095,
13,
5,
242,
22,
18,
19,
14,
1054,
9577,
6554,
16,
21,
968,
4725,
3095,
6,
45,
13,
1,
22039,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
In Bash, how do I test if a variable is defined in "-u" mode
===
I just discovered `set -u` in bash and it helped me find several previously unseen bugs. But I also have a scenario where I need to test if a variable is defined before computing some default value. The best I have come up with for this is:
if [ "${variable-undefined}" == undefined ]; then
variable="$(...)"
fi
which works (as long as the variable doesn't have the string value `undefined`. I was wondering if there was a better way? | 0 | [
2,
19,
13158,
15,
184,
107,
31,
1289,
100,
21,
7612,
25,
2811,
19,
13,
7,
8,
291,
7,
3740,
800,
3726,
3726,
31,
114,
1848,
13,
1,
3554,
13,
8,
291,
1,
19,
13158,
17,
32,
1456,
55,
477,
238,
1343,
18783,
13925,
9,
47,
31,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Need assistance finding file sharing cloud for android
===
I am developing an app that will take a photo and upload it to the cloud and return a url link where the file is located, so I can send the url link to users via my own sms program.
I am looking for a simple file sharing program to use with a Java Api to use.
Here is link to a few: http://alternativeto.net/software/4shared/?platform=android
I was thinking of using cx.com but does not have java api.
The second choice is sugarsynch.
I would like some input. | 2 | [
2,
376,
4067,
3007,
3893,
6126,
4005,
26,
13005,
800,
3726,
3726,
31,
589,
3561,
40,
4865,
30,
129,
247,
21,
3056,
17,
71,
8294,
32,
20,
14,
4005,
17,
788,
21,
287,
6362,
3508,
113,
14,
3893,
25,
335,
15,
86,
31,
92,
2660,
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... |
NullPointer due to database not containing data
===
07-08 17:04:34.978: E/AndroidRuntime(322): FATAL EXCEPTION: main
07-08 17:04:34.978: E/AndroidRuntime(322): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gurpswu.gurps/com.gurpswu.gurps.Home}: java.lang.NullPointerException
07-08 17:04:34.978: E/AndroidRuntime(322): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
07-08 17:04:34.978: E/AndroidRuntime(322): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
07-08 17:04:34.978: E/AndroidRuntime(322): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
07-08 17:04:34.978: E/AndroidRuntime(322): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
07-08 17:04:34.978: E/AndroidRuntime(322): at android.os.Handler.dispatchMessage(Handler.java:99)
07-08 17:04:34.978: E/AndroidRuntime(322): at android.os.Looper.loop(Looper.java:123)
07-08 17:04:34.978: E/AndroidRuntime(322): at android.app.ActivityThread.main(ActivityThread.java:3683)
07-08 17:04:34.978: E/AndroidRuntime(322): at java.lang.reflect.Method.invokeNative(Native Method)
07-08 17:04:34.978: E/AndroidRuntime(322): at java.lang.reflect.Method.invoke(Method.java:507)
07-08 17:04:34.978: E/AndroidRuntime(322): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-08 17:04:34.978: E/AndroidRuntime(322): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-08 17:04:34.978: E/AndroidRuntime(322): at dalvik.system.NativeStart.main(Native Method)
07-08 17:04:34.978: E/AndroidRuntime(322): Caused by: java.lang.NullPointerException
07-08 17:04:34.978: E/AndroidRuntime(322): at com.gurpswu.gurps.Player.getIntField(Player.java:153)
07-08 17:04:34.978: E/AndroidRuntime(322): at com.gurpswu.gurps.Home.hudSetup(Home.java:102)
07-08 17:04:34.978: E/AndroidRuntime(322): at com.gurpswu.gurps.Home.onCreate(Home.java:25)
07-08 17:04:34.978: E/AndroidRuntime(322): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-08 17:04:34.978: E/AndroidRuntime(322): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
07-08 17:04:34.978: E/AndroidRuntime(322): ... 11 more
I have a game. When the user opens the app for the first time and presses the continue game button..the game will attempt to retrieve values from the database using the code below.
stats.open();
playerId = stats.getIntField(stats.KEY_ROWID);
String playerName = stats.getStringField(stats.KEY_NAME);
String playerCity = stats.getStringField(stats.KEY_CITY);
playerHealth = stats.getIntField(stats.KEY_HEALTH);
playerEnergy = stats.getIntField(stats.KEY_ENERGY);
playerRank = stats.getIntField(stats.KEY_RANK);
playerCash = stats.getIntField(stats.KEY_CASH);
stats.close();
However, none of these database fields are populated...how do install a check..so that this code is only run if a database exists. If it does not exist then it will ask the player to start a new game.
| 0 | [
2,
16203,
3132,
106,
397,
20,
6018,
52,
3503,
1054,
800,
3726,
3726,
13,
2984,
8,
3099,
369,
45,
3277,
21524,
9,
3643,
457,
45,
13,
62,
118,
290,
18524,
3169,
891,
5,
22257,
6,
45,
8773,
5391,
45,
407,
13,
2984,
8,
3099,
369,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 autocomplete texbox with asp.net gridview
===
I have an autocomplete jQeury textbox and a asp.net gridview binded to some db data. T
The user selects some item from the autocomplete and in response I create an ajax call to the server to get data relevant for that selection and try to bind the relevant data to the gridview. T
The ptorblem is that, the gridview does not change it's data, and remains with the old datasource althouth I change it - the gridview gets new datasource on the server.
Any suggestions?
Thanks Iliya | 0 | [
2,
487,
8190,
93,
3108,
15990,
14012,
5309,
29,
28,
306,
9,
2328,
7354,
4725,
800,
3726,
3726,
31,
57,
40,
3108,
15990,
487,
1251,
5630,
93,
1854,
5309,
17,
21,
28,
306,
9,
2328,
7354,
4725,
10193,
69,
20,
109,
13,
9007,
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... |
Make a WPF element look like it is focused (to fake 'dual focusing' ala VS Intellisense)?
===
I am trying to create a simple code completion 'window' for an editor. The front-end is proving more troublesome than I initially thought, because I need both the editor (to keep caret visible / text being entered in the correct place) and the completion popup focused (to receive up/down and enter key presses).
I can fake the focused part by capturing the keypresses etc from the editor and swallowing the relevant ones - however, I can't seem to make the `<Popup>` element and children look focused. I've tried setting the `Style` property to equal the `FocusedStyle` (which would be neat) but these properties seem to be meant to add a layer of styles on top of the existing - so they are empty, and it does not make the element focused.
Any ideas? | 0 | [
2,
233,
21,
619,
7721,
4520,
361,
101,
32,
25,
2604,
13,
5,
262,
7031,
13,
22,
43,
6948,
7796,
22,
21,
531,
4611,
14635,
3159,
6498,
6,
60,
800,
3726,
3726,
31,
589,
749,
20,
1600,
21,
1935,
1797,
5392,
13,
22,
27508,
22,
26,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Scanner class java file not found
===
Scanner Class couldnt find the file
I use NetBeansIDE, and the test.txt is in the folder path: D:\netbeans project works\ReadFile\src\readfile\test.txt
in the same folder the readfile.java exsist.
the code is as below.
It generates file not found.
package readfile;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Scanner;
public class ReadFile {
public static void main(String[] args) throws IOException , FileNotFoundException
{
Scanner scanner = new Scanner(new File("test.txt"));
while (scanner.hasNextLine())
System.out.println(scanner.nextLine());
}
}
output:-
run:
Exception in thread "main" java.io.FileNotFoundException: test.txt (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.util.Scanner.<init>(Scanner.java:636)
at readfile.ReadFile.main(ReadFile.java:14)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
| 0 | [
2,
23195,
718,
8247,
3893,
52,
216,
800,
3726,
3726,
23195,
718,
3245,
477,
14,
3893,
31,
275,
4275,
863,
210,
1416,
15,
17,
14,
1289,
9,
38,
396,
38,
25,
19,
14,
19294,
2013,
45,
13,
43,
45,
1,
2328,
863,
5950,
669,
693,
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... |
refreshing legends in multiple dojo charts in javascript code
===
I am using dojo charts in my project. I have a separate legend area for each chart i create.
The problem is that dojo doesnot allow me to re-register an area for the legend.
I need to have the ability to overwrite the chart where I would need to rebuild the legend.
But rewriting the legend shows me error that this area is already registered.
So, tell me how do I go about it?
The refresh method would be used in case I already knew which legend area the legend variable was pointing to. But since there are a number of charts and hence a number of legend areas, the refresh method would need a separate variable for each legend area to refresh the area.
Is there any way by which I could solve this issue? | 0 | [
2,
27134,
10089,
19,
1886,
107,
1636,
5158,
19,
8247,
8741,
1797,
800,
3726,
3726,
31,
589,
568,
107,
1636,
5158,
19,
51,
669,
9,
31,
57,
21,
1725,
4393,
217,
26,
206,
1795,
31,
1600,
9,
14,
1448,
25,
30,
107,
1636,
630,
1270,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
On Facebook Insights, what does "total referrals" mean if authenticated referrals is on?
===
when authenticated referrals is on, on Facebook Insights -> Open Graph -> Overview, does "Total Referrals" refer just to a click or to the user accepting the oAuth dialog as well?
Thanks in advance | 0 | [
2,
27,
9090,
9239,
18,
15,
98,
630,
13,
7,
20148,
28679,
18,
7,
884,
100,
14351,
1669,
28679,
18,
25,
27,
60,
800,
3726,
3726,
76,
14351,
1669,
28679,
18,
25,
27,
15,
27,
9090,
9239,
18,
13,
8,
1,
368,
7210,
13,
8,
1,
21598,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
BroadcastReceiver for incoming file by Bluetooth
===
I would like to know if it's possible to have a broacastreceiver which can handle an incoming file sent by bluetooth (by a laptop) ? I would like to override the normal behavior of Android (asking acceptance and downloading) for some specific kinds of files sent. Any idea how to do that ?
Thank you. | 0 | [
2,
1992,
99,
1105,
19737,
26,
17126,
3893,
34,
705,
15808,
800,
3726,
3726,
31,
83,
101,
20,
143,
100,
32,
22,
18,
938,
20,
57,
21,
5512,
9721,
11278,
1105,
19737,
56,
92,
3053,
40,
17126,
3893,
795,
34,
705,
15808,
13,
5,
779,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Contact thumbnail image from People App in Windows 8 Metro
===
I use below code to retrieve contact name from People's App in my Metro App:
function selectContact() {
var picker = Windows.ApplicationModel.Contacts.ContactPicker();
picker.commitButtonText = "Select";
picker.selectionMode = Windows.ApplicationModel.Contacts.ContactSelectionMode.contacts;
picker.pickMultipleContactsAsync().done(function (contacts) {
if(contacts.length>0){
var j =document.getElementById("contactlist");
contacts.forEach(function (contact) {
j.innerHTML += contact.name + "<br>";
});
}
Now, I need to retrieve contact thumbnail image and add it to my application. There is a getThumbnailAsync() method for contacts but I'm not sure how to use it... I used below code but thumbnail.size is always zero:
contacts.forEach(function (contact) {
contact.getThumbnailAsync().done(function (thumbnail) {
if (thumbnail.size > 0) {
var imageBlob = window.URL.createObjectURL(thumbnail,false);
document.getElementById("contactlist").innerHTML += "<img id=" + i + " /><br>";
document.getElementById(i).src = imageBlob;
i++;
}
});
}); | 0 | [
2,
11917,
2203,
5078,
325,
947,
1961,
37,
148,
4865,
19,
1936,
469,
3986,
800,
3726,
3726,
31,
275,
1021,
1797,
20,
11917,
2203,
204,
37,
148,
22,
18,
4865,
19,
51,
3986,
4865,
45,
1990,
5407,
29912,
5,
6,
13,
1,
4033,
2036,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 enable Workflow & Approvals on my Salesforce site?
===
I am trying to add a workflow to my Salesforce app and following the Cookbook tutorial I get that there should be an option under Create in the menu with the title Workflow & Approvals, but I don't have this option. What can I do? I read that Workflows have to be enabled, but I can't find where to do this.
Anyone with experience?
Thanks! | 0 | [
2,
184,
92,
31,
9240,
170,
9990,
279,
4988,
18,
27,
51,
2598,
8774,
689,
60,
800,
3726,
3726,
31,
589,
749,
20,
3547,
21,
170,
9990,
20,
51,
2598,
8774,
4865,
17,
249,
14,
27526,
29724,
31,
164,
30,
80,
378,
44,
40,
4255,
131,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Appending some elements into list but before paragraph
===
I have structure like this.
<ul class="gallerylist">
<li>
<image ...>
<input ...>
</li>
<li>
<image ...>
<input ...>
</li>
<li>
<image ...>
<input ...>
</li>
<p style="clear:both;"> </p>
</ul>
because of visual correction i have to use `<p style="clear:both;"> </p>` part and i'am adding new list items dynamically via JQuery by:
$('ul.gallerylist').append('<li><img .../><br/><input .../></li>');
but as you can guess it is appended after the `<p style="clear:both;"> </p>` part and it corrupts the visual correction.
My question is : Which way is true to add li inside ul as last but before p tag?
Thanks. | 0 | [
2,
4865,
7601,
109,
2065,
77,
968,
47,
115,
20599,
800,
3726,
3726,
31,
57,
1411,
101,
48,
9,
13,
1,
1287,
718,
3726,
7,
14074,
3849,
5739,
7,
1,
13,
1,
1210,
1,
13,
1,
22039,
13,
9,
9,
9,
1,
13,
1,
108,
4881,
13,
9,
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... |
UI Design Patterns
===
I have been reading about MVP, MVVM and have used asp.net MVC in couple of practice projects. These patterns are mostly referred to as UI patterns, which is bit confusing for me, since I used to think that only Views (in MVC) are the UI and the Model is data access layer + BLL.
My question is if I use Entity Framework (edmx) as my Model, why would I need to have a separate layer for data access (DAL) and what would this data access layer actually do in this scenario.
| 0 | [
2,
13,
5661,
704,
6282,
800,
3726,
3726,
31,
57,
74,
1876,
88,
13552,
15,
17967,
20147,
17,
57,
147,
28,
306,
9,
2328,
307,
8990,
19,
1335,
16,
1345,
2314,
9,
158,
6282,
50,
1555,
1870,
20,
28,
13,
5661,
6282,
15,
56,
25,
1142... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Remote server synchronization with local Github repository
===
I have been working on project with 3 more people from one main repository (forked one main) and we are all working on one dev server. Main problem that we have is local to remote synchronization when testing code. I'm using NetBeans as editor and NetBeans have nice sync tool but sometimes get a little bit mad and do not sync well, so I was google for some rsync scripts that will sync code from my local repository to remote server.
Basically, I need some sh script that will determine what file is changed and push that file to server, while testing and if everything is ok on server, I'll push changes to my GitHub repository. I found some lftp script and rsync script but that did not work because I do not know sh as well. So, every help is appreciate .
Thanks to all of you. | 0 | [
2,
5388,
8128,
13,
16023,
1829,
29,
375,
13,
10404,
20926,
24869,
800,
3726,
3726,
31,
57,
74,
638,
27,
669,
29,
203,
91,
148,
37,
53,
407,
24869,
13,
5,
1106,
4616,
53,
407,
6,
17,
95,
50,
65,
638,
27,
53,
9664,
8128,
9,
40... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 know which UI element is in focus
===
I have an eventhandler function for a textbox, that does the following,
- Searches the contacts of the user and displays, the contacts that matches the pattern
of the textbox
The same function should be done for two more textboxes.
Since the value of the textbox is obtained using "e.parameter.textbox1NAME", I have added two more functions as event handlers,
textbox2.addKeyUpHandler('search2');
textbox3.addKeyUpHandler('search3');
in addition to
textbox1.addKeyUpHandler('search1');
The only difference among the three functions is whether the pattern used is,
"e.parameter.textbox1NAME" or "e.parameter.textbox2NAME" or "e.parameter.textbox3NAME"
I think this is inefficient, is there any way to know which element invokes the handler or which element is in focus?
Thanks | 0 | [
2,
184,
20,
143,
56,
13,
5661,
4520,
25,
19,
1776,
800,
3726,
3726,
31,
57,
40,
807,
3203,
1252,
1990,
26,
21,
1854,
5309,
15,
30,
630,
14,
249,
15,
13,
8,
19994,
14,
11894,
16,
14,
4155,
17,
9412,
15,
14,
11894,
30,
1717,
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... |
SQL Server Configuration Manager 2012
===
I have Installed Microsoft® SQL Server® 2012 Express , but I cant find SQL Server Services to run it , so I can connect to SQL server ![SQL Server Configuration Manager 2012][1] , how would I add it , so I can run it?
[1]: http://i.stack.imgur.com/ioyHV.jpg | 2 | [
2,
4444,
255,
8128,
8091,
1382,
563,
800,
3726,
3726,
31,
57,
4066,
7099,
1,
4444,
255,
8128,
1,
563,
2999,
13,
15,
47,
31,
2973,
477,
4444,
255,
8128,
687,
20,
485,
32,
13,
15,
86,
31,
92,
6379,
20,
4444,
255,
8128,
13,
187,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is it possible to build CLI app for android that can be executed from adb shell?
===
Just wondering is it possible to build CLI app that can be run from adb shell? | 0 | [
2,
25,
32,
938,
20,
1895,
19391,
4865,
26,
13005,
30,
92,
44,
5557,
37,
21,
9007,
3593,
60,
800,
3726,
3726,
114,
5712,
25,
32,
938,
20,
1895,
19391,
4865,
30,
92,
44,
485,
37,
21,
9007,
3593,
60,
3,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Insert Record in SQLServer with C# WinForm
===
i just started to use SQLServer 2008. I have a winform application that must insert data from the application to Database and some textbox values could be empty. After googling to search how do that i found something but i would an explanation.
I found this code to insert record into DB (Excluding Connection code)
stringInsert += "INSERT INTO MyDatabase(dateTime, Name, Surname)";
stringInsert += "VALUES(@Date, @NameString, @SurnameString)";
SqlCommand cmd = new SqlCommand(stringInsert , con);
cmd.CommandType = CommandType.Text;
cmd.Parameters.Add(new SqlParameter("@Date", strTime));
cmd.Parameters.Add(new SqlParameter("@Name", StringName));
cmd.Parameters.Add(new SqlParameter("@Surname", StringSurname));
if (string.IsNullOrEmpty(StringName))
cmd.Parameters.Add(new SqlParameter("@Name", DBNull.Value.ToString()));
else
cmd.Parameters.Add(new SqlParameter("@Name", StringName));
But Someone else wrote that the method `cmd.Parameters.AddWithValue("@Name" , StringName);`
do the if else in automatic becouse if StringName is null or empty it sets DBNull.Value
Now My questions are :
1) I dont understand how `cmd.Parameters.Add(new SqlParameter("@Name", StringName));` modify stringInsert into StringName. The "@Name" it's only a part of the String so maybe the symbol "@" does something that i dont know? Normaly i use the @ symbol when i need to exclude escape like this way @"c:\home"
2) is it correct use `cmd.Parameters.AddWithValue("@Name" , StringName);` even if the StringName is empty or null?
3) is this the correct way to submit data into SQL Server DB with many textbox in a WinForm Application?
Thanks | 0 | [
2,
14692,
571,
19,
4444,
255,
10321,
106,
29,
272,
5910,
628,
4190,
800,
3726,
3726,
31,
114,
373,
20,
275,
4444,
255,
10321,
106,
570,
9,
31,
57,
21,
628,
4190,
3010,
30,
491,
14692,
1054,
37,
14,
3010,
20,
6018,
17,
109,
1854,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Uploading data from iOS app concurrently
===
I need to upload files to a server in an iOS app. I would like this to occur while the app is running, but in a concurrent manner (on a separate thread) so the upload is invisible to the user of the application.
Running anything in the "background" seems to complex, so I want to make sure I get the question right. What I would like to know is:
1) While the app is in the foreground, can I have a "background thread" that contains a timer that will upload data to the server as the data becomes available?
2) If so, what will happen to the upload task when another application is brought to the foreground by the user?
3) If so, what are the best practices for implementing this type of concurrency? Coming in cold, a thread would be the first thing I would consider, but there may be better, simpler ways to accomplish this.
Thanks for the help! | 0 | [
2,
71,
16866,
1054,
37,
13,
7760,
4865,
17651,
800,
3726,
3726,
31,
376,
20,
71,
8294,
6488,
20,
21,
8128,
19,
40,
13,
7760,
4865,
9,
31,
83,
101,
48,
20,
3744,
133,
14,
4865,
25,
946,
15,
47,
19,
21,
19513,
3832,
13,
5,
218... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 revert changes to a record in Oracle Forms 6i?
===
I have a form running in Oracle Forms 6i which has tabular formatted rows that are being populated from a certain table in the database. One column has a [List_Of_Values] property enabled to allow the user to select among possible values.
Some values among the list can only be selected if the user has permission to do that, and I have created a [ WHEN-VALIDATE-ITEM ] trigger to check the permission after the value has been changed. The trigger raises a form_trigger_failure to prevent the user from saving the changes done.
The problem is that if the user gets notified about lack of permission to select the value, then there is no way for the user to know the previous (old) value to select it again, unless the form is cancelled which will cause his other (valid) changes to be lost too.
Here is the code I have written in the trigger
DECLARE
NEW_LOCATION VARCHAR2(100);
BEGIN
NEW_LOCATION := :BLK_MAT_STG_PLACES_PILE.STG_LOC_ID;
IF NEW_LOCATION LIKE 'OH01%' THEN
IF NOT :GLOBAL.USER_ID LIKE 'Admin%' THEN
NULL;
ELSE
MESSAGEBOX('You are not authorized to select this value');
/* What can I write to load the old value to this item? */
RAISE FORM_TRIGGER_FAILURE;
END IF;
END IF;
END;
I have tried ROLLBACK but that did not revert the old value to the form. I tried SYNCHRONIZE as well, but that had no effect. Is there any option other than going through the database table again to pull out the value?
| 0 | [
2,
184,
92,
31,
24156,
1693,
20,
21,
571,
19,
15759,
1997,
400,
49,
60,
800,
3726,
3726,
31,
57,
21,
505,
946,
19,
15759,
1997,
400,
49,
56,
63,
6523,
7451,
13,
29850,
11295,
30,
50,
142,
11111,
37,
21,
1200,
859,
19,
14,
6018... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 I convert into string?
===
I select field in database using sql command
partner_obj = self.pool.get('res.partner'). browse (cr, uid, ids, *args)
partner_name = partner_obj.ids
customer = (partner_name)
cr.execute("select b.city from res_partner a, res_partner_address b where b.partner_id = a.id AND a.id = %s",(customer))
ads = cr.fetchone()
city = ads and ads[0] or None
but, I just know we must convert into string. I already try to make like this (the code above), but still doesn't work.
may you help me, please
thank you | 0 | [
2,
184,
31,
8406,
77,
3724,
60,
800,
3726,
3726,
31,
5407,
575,
19,
6018,
568,
4444,
255,
1202,
2417,
1,
111,
11741,
800,
1119,
9,
13378,
9,
3060,
5,
22,
99,
18,
9,
3091,
1031,
22,
6,
9,
10175,
62,
13,
5,
6711,
15,
287,
1340... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
updation of spinner in android
===
In my application i have 1 spinner option,in that i am displaying 6 values(which is array from values file). Now in that when i click ist 5 items of the spinner value the selected item will show in the spinner in the activity screen,When i select 6th item in spinner i have to start a new activity,Is it possible??Whether i have to do this by position value??. Also in the new activity(after selecting 6th item) i have 5 edittext value in which user can enter a string which should replace the old value in the spinner,is it possible to dynamic update of spinner?Please help me??
My spinner code:
Spinner s2=(Spinner)findViewById(R.id.spinner1);
ArrayAdapter<CharSequence> adapter1 = ArrayAdapter.createFromResource(
this, R.array.group_array, android.R.layout.simple_spinner_item);
adapter1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
s2.setAdapter(adapter1); | 0 | [
2,
71,
43,
857,
16,
3310,
1031,
19,
13005,
800,
3726,
3726,
19,
51,
3010,
31,
57,
137,
3310,
1031,
4255,
15,
108,
30,
31,
589,
17418,
400,
4070,
5,
2140,
25,
7718,
37,
4070,
3893,
6,
9,
130,
19,
30,
76,
31,
10840,
25,
38,
33... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Activate the 2nd tab of the tab panel
===
I have a `tabpanel`, and a button on the 1st tab. When i `click` on that `button`, i need to `setfocus` to the 2nd tab and `activate` it (as in show content that belongs to that tab). My code is as follows, and i unable to `setFocus` or `activate` that tab from the `Button click event`.
Ext.define('MyApp.view.MyTabPanel', {
extend: 'Ext.tab.Panel',
height: 250,
width: 400,
activeTab: 0,
initComponent: function() {
var me = this;
Ext.applyIf(me, {
items: [
{
xtype: 'panel',
title: 'Tab 1',
items: [
{
xtype: 'button',
text: 'MyButton',
listeners: {
click: {
fn: me.onButtonClick,
scope: me
}
}
}
]
},
{
xtype: 'panel',
title: 'Tab 2'
},
{
xtype: 'panel',
title: 'Tab 3'
}
]
});
me.callParent(arguments);
},
onButtonClick: function(button, e, options) {
// Set Focus, and activate the 2nd tab
}
}); | 0 | [
2,
18163,
14,
172,
706,
6523,
16,
14,
6523,
4113,
800,
3726,
3726,
31,
57,
21,
13,
1,
15783,
3206,
532,
1,
15,
17,
21,
5167,
27,
14,
137,
384,
6523,
9,
76,
31,
13,
1,
150,
10129,
1,
27,
30,
13,
1,
811,
444,
1,
15,
31,
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... |
mysql union different databases but the same schema
===
as picture(phpmyadmin),I have tables in the database **week1** the tables are now empty.
I have another databases with exactly the same sql schema **w1moninside** and **w1monoutside**
but they have values.
I want to **union** these two and insert them in week1
what should I do?
I inserted the picture just for clearance.unoin for one of the tables for example the first one, **data**
is enough for me
Thanks.
![enter image description here][1]
[1]: http://i.stack.imgur.com/Wfbc6.png | 0 | [
2,
51,
18,
22402,
667,
421,
6018,
18,
47,
14,
205,
23874,
800,
3726,
3726,
28,
2151,
5,
26120,
915,
1283,
2160,
6,
15,
49,
57,
7484,
19,
14,
6018,
13,
1409,
7219,
165,
1409,
14,
7484,
50,
130,
2424,
9,
31,
57,
226,
6018,
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... |
RightFax Server Setting
===
I am currently doing integration to rightfax which using visual basic. There are some basic settings in order to establish connection.
I would like to ask the server name it is limited to servername only or IP address also acceptable?
Because currently I am using IP but it return me an error "The system cannot find the file specified" Anyone can kindly advise me? Appreciate for any reply. | 0 | [
2,
193,
18947,
8128,
2697,
800,
3726,
3726,
31,
589,
871,
845,
8078,
20,
193,
18947,
56,
568,
3458,
2125,
9,
80,
50,
109,
2125,
12410,
19,
389,
20,
4088,
2760,
9,
31,
83,
101,
20,
1349,
14,
8128,
204,
32,
25,
1317,
20,
8128,
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... |
Putting a process list into a combo box in C#
===
All I want, is that when I click on the comboBox1 box, that it will display all of the processes currently running.
private void comboBox1_MouseClick(object sender, MouseEventArgs e)
{
comboBox1.Items.Clear();
Process[] MyProcess = Process.GetProcesses();
for (int i = 0; i < MyProcess.Length; i++)
comboBox1.Items.Add(MyProcess[i].ProcessName + "-" + MyProcess[i].Id);
}
Why does it refuse to work? :s | 0 | [
2,
3873,
21,
953,
968,
77,
21,
22621,
1649,
19,
272,
5910,
800,
3726,
3726,
65,
31,
259,
15,
25,
30,
76,
31,
10840,
27,
14,
22621,
5309,
165,
1649,
15,
30,
32,
129,
3042,
65,
16,
14,
5102,
871,
946,
9,
932,
11364,
22621,
5309,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
javax.el.PropertyNotFoundException: Target Unreachable, 'null' returned null on foreign key reference
===
**Please can someone pls help me fix this code. I knw there is something missing. Thank you.**
When i tried calling the managedbean to persist the department its give a null pointer to the faculty for example javax.el.PropertyNotFoundException: /administrator/department/DepartmentRegistration.xhtml @30,260 value="#{departmentRequestBean.department.faculty.facultyName}": Target Unreachable, 'null' returned null
`javax.el.PropertyNotFoundException: /administrator/department/DepartmentRegistration.xhtml @30,260 value="#{departmentRequestBean.department.faculty.facultyName}": Target Unreachable, 'null' returned null
at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:100)
at org.richfaces.component.util.InputUtils.findConverter(InputUtils.java:123)
at org.richfaces.component.util.InputUtils$1.getConverterByProperty(InputUtils.java:56)
at org.richfaces.component.util.InputUtils.getConvertedValue(InputUtils.java:148)
at org.richfaces.component.util.InputUtils.getConvertedValue(InputUtils.java:137)
at org.richfaces.renderkit.InputRendererBase.getConvertedValue(InputRendererBase.java:50)
at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1030)
at javax.faces.component.UIInput.validate(UIInput.java:960)
at javax.faces.component.UIInput.executeValidate(UIInput.java:1233)
at javax.faces.component.UIInput.processValidators(UIInput.java:698)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214)
at javax.faces.component.UIForm.processValidators(UIForm.java:253)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214)
at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214)
at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1172)
at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:636)
public class Department implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@NotNull
@Column(name = "DepartmentID")
private Integer departmentID;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 255)
@Column(name = "DepartmentName")
private String departmentName;
@JoinColumn(name = "FacultyName", referencedColumnName = "FacultyName")
@ManyToOne(optional = false, fetch = FetchType.EAGER)
public Faculty faculty;
public Faculty getFaculty() {
return faculty;
}
public void setFaculty(Faculty faculty) {
this.faculty = faculty;
}
public Department() {
}
public Department(Integer departmentID) {
this.departmentID = departmentID;
}
public Department(Integer departmentID, String departmentName) {
this.departmentID = departmentID;
this.departmentName = departmentName;
}
public Integer getDepartmentID() {
return departmentID;
}
public void setDepartmentID(Integer departmentID) {
this.departmentID = departmentID;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}}
public class Faculty implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@NotNull
@Column(name = "FacultyID")
private Integer facultyID;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 255)
@Column(name = "FacultyName")
private String facultyName;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "faculty", fetch = FetchType.EAGER)
private List<Department> departmentList;
public Faculty() {
}
public Faculty(Integer facultyID) {
this.facultyID = facultyID;
}
public Faculty(Integer facultyID, String facultyName) {
this.facultyID = facultyID;
this.facultyName = facultyName;
}
public Integer getFacultyID() {
return facultyID;
}
public void setFacultyID(Integer facultyID) {
this.facultyID = facultyID;
}
public String getFacultyName() {
return facultyName;
}
public void setFacultyName(String facultyName) {
this.facultyName = facultyName;
}
public List<Department> getDepartmentList() {
return departmentList;
}
public void setDepartmentList(List<Department> departmentList) {
this.departmentList = departmentList;
}}
public class DepartmentSessionBean {
@PersistenceContext(unitName = "ApplicationPU")
private EntityManager em;
public void persist(Department department) {
em.persist(department);
}}
| 0 | [
2,
8247,
396,
9,
532,
9,
10890,
106,
1084,
1270,
12235,
10066,
872,
45,
2935,
367,
18700,
579,
15,
13,
22,
4215,
211,
22,
587,
16203,
27,
1228,
1246,
2801,
800,
3726,
3726,
13,
1409,
6744,
92,
737,
12443,
18,
448,
55,
6098,
48,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 script on Amazon EC2 possibly cached
===
I've got a PHP script on an Amazon EC2 instance. I changed a couple things in it, but the output is the same when I load it in my browser. Does Amazon have some sort of caching in place? I know the East zone was down today, but my instance is running fine now. I've ruled out client-side caching already. | 0 | [
2,
13,
26120,
3884,
27,
8059,
6695,
135,
2879,
16522,
43,
800,
3726,
3726,
31,
22,
195,
330,
21,
13,
26120,
3884,
27,
40,
8059,
6695,
135,
4851,
9,
31,
1015,
21,
1335,
564,
19,
32,
15,
47,
14,
5196,
25,
14,
205,
76,
31,
6305,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Simple Discrete event simulation library (C++) for process/task scheduling?
===
Simple question:
I built a quasi-processor simulator that takes a precedence graph, determines priorities (and "ready" instructions), schedules the tasks on available functional units, etc. Pretty much a very basic simulator.
But I realized I should have built it on top of a DES engine, as I have no capacity (other than setting a flag and checking every node on every "clock tick") for saying things like "In 10 cycles, do this" (i.e. raising signals at pre-defined times and handling events that are supposed to happen in the future or when predetermined criteria have been met).
I could obviously implement this myself; built an "event" class, stick them on a queue, and at the end (or beginning) of every cycle, check the queue and see what's on there, but I figure there's no point in reinventing the wheel.
So complex network simulators are obviously WAY overkill. I don't need fancy modeling, or queuing or anything like that. All I need is a built in clock, and the ability to set events to happen, raise flags when things happen, etc, as I described above.
Freeware and C++ would be great.
Anyone have any ideas? (The closest I've come -- thanks to some other somewhat related questions -- is something called SIMLIB.)
Thank you so much! | 0 | [
2,
1935,
18563,
807,
10926,
1248,
13,
5,
150,
20512,
6,
26,
953,
118,
38,
20310,
23096,
60,
800,
3726,
3726,
1935,
1301,
45,
31,
392,
21,
17875,
8,
16835,
248,
24565,
30,
1384,
21,
24720,
7210,
15,
3746,
18,
20872,
13,
5,
290,
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... |
searching technique in xml docs
===
can anyone tell me how can I search words in xml documents using some searching algorithm without using queries .
Like I studied one of the techniques called indexing . I have multiple files and I need to search a word in all of them. How should I do indexing basically ? | 0 | [
2,
5792,
4873,
19,
23504,
9765,
18,
800,
3726,
3726,
92,
1276,
494,
55,
184,
92,
31,
2122,
715,
19,
23504,
4374,
568,
109,
5792,
9083,
366,
568,
9386,
2829,
13,
9,
101,
31,
1449,
53,
16,
14,
4212,
227,
4348,
68,
13,
9,
31,
57,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How we can integrate database with windows 7 phone gap?
===
I am new to windows 7 phonegap. i want to store and retrieve data using native application. i dont know how to store and display the retrieved data from native to phonegap(HTML)page.
can anyone pls guide me how to access sqlite with phonegap.?
Thanks in advance.
| 0 | [
2,
184,
95,
92,
18399,
6018,
29,
1936,
453,
1132,
4127,
60,
800,
3726,
3726,
31,
589,
78,
20,
1936,
453,
1132,
1136,
306,
9,
31,
259,
20,
1718,
17,
11917,
1054,
568,
1275,
3010,
9,
31,
1049,
143,
184,
20,
1718,
17,
3042,
14,
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... |
Changing font in C#?
===
I am using this code to make all my textboxes the same font:
if (textBox1.Font.Underline)
{
foreach (Control y in this.Controls)
{
if (y is TextBox)
{
((TextBox)(y)).Font = new Font(((TextBox)(y)).Font, FontStyle.Regular);
}
}
}
else
{
foreach (Control y in this.Controls)
{
if (y is TextBox)
{
((TextBox)(y)).Font = new Font(((TextBox)(y)).Font, FontStyle.Underline);
}
}
I want it to add the underline font to the current font. Like if i have the fon Bold, and i click the button, it will go to Regular and underline instead of Bold and underline....How do i fix this problem?
| 0 | [
2,
4226,
9978,
19,
272,
5910,
60,
800,
3726,
3726,
31,
589,
568,
48,
1797,
20,
233,
65,
51,
1854,
5309,
160,
14,
205,
9978,
45,
100,
13,
5,
11969,
5309,
165,
9,
21931,
9,
4579,
1143,
6,
13,
1,
26,
14322,
13,
5,
12898,
13,
93... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ActiveRecord query with nested models and derived column values?
===
I have the following relationships:
class Order < ActiveRecord::Base
has_many :item_selections, :dependent => :destroy
has_many :inventory_items, :through => :item_selections
end
class InventoryItem < ActiveRecord::Base
has_many :item_selections, :dependent => :destroy
has_many :orders, :through => :item_selections
end
class ItemSelection < ActiveRecord::Base
belongs_to :order
belongs_to :inventory_item
end
I am trying to create the ActiveRecord equivalent of this SQL query below and then load the sum of the *total_weight* & *total_volume* columns into an instance variable:
select t1.quantity, t2.volume, t2.weight,
t2.volume * t1.quantity as total_volume,
t1.quantity * t2.weight as total_weight
from orders t0
inner join item_selections t1 on t0.id = t1.order_id
inner join inventory_items t2 on t1.inventory_item_id = t2.id
where t0.id = <id_val>
Any idea on the right way to get these values using ActiveRecord? | 0 | [
2,
1348,
14953,
25597,
29,
5618,
69,
2761,
17,
3981,
4698,
4070,
60,
800,
3726,
3726,
31,
57,
14,
249,
5833,
45,
718,
389,
13,
1,
1348,
14953,
45,
45,
8436,
63,
1,
14842,
13,
45,
2119,
79,
1,
18,
5033,
18,
15,
13,
45,
19374,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Isotope active class when using select menu
===
I am using Metafizzy's Isotope plugin and have it set up to filter using a select menu as seen here: http://jsfiddle.net/trewknowledge/jJZEN/
$(function() {
var $container = $('#container'),
$select = $('#filters select');
$container.isotope({
itemSelector: '.item'
});
$select.change(function() {
var filters = $(this).val();
;
$container.isotope({
filter: filters
});
});
});
What I am trying to figure out is how I would add a highlight/active class to the selected elements when the filters variable is already being used. | 0 | [
2,
21288,
1348,
718,
76,
568,
5407,
11379,
800,
3726,
3726,
31,
589,
568,
798,
2565,
12607,
22,
18,
21288,
10922,
108,
17,
57,
32,
309,
71,
20,
11945,
568,
21,
5407,
11379,
28,
541,
235,
45,
7775,
6903,
728,
18,
1707,
12312,
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... |
Change img src to direct link, for use in photo gallary
===
I'm trying to make a page that will accept a URL input by the user then it will display all the images from that address. I have this working, however if the image src on the page is written like this:
/image/picture.jpg
Rather than this:
http://www.site.com/image/picture.jpg
Then my page wont display it because its not local to my server. What I want to know, is there a simple way to directly link to that files location?
My Code is below:
<?php
$html = file_get_contents('http://www.deviantart.com/');
$dom = new domDocument;
@$dom->loadHTML($html);
$dom->preserveWhiteSpace = false;
$images = $dom->getElementsByTagName('img');
foreach ($images as $image) {
$data = $image->getAttribute('src');
echo "<img src='".$data."' />";
}
?> | 0 | [
2,
753,
797,
263,
13,
18,
5453,
20,
1744,
3508,
15,
26,
275,
19,
3056,
9163,
1857,
800,
3726,
3726,
31,
22,
79,
749,
20,
233,
21,
2478,
30,
129,
3440,
21,
287,
6362,
6367,
34,
14,
4155,
94,
32,
129,
3042,
65,
14,
3502,
37,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to customize an a Mac application toolbar in Xcode 4.3.3?
===
In Xcode 3, double-clicking on a toolbar in Interface Builder brings up a configuration window to setup the toolbar's initial appearance – as in what items are initially displayed in the toolbar. However in Xcode 4 double-clicking a toolbar (in the window designer) doesn't do anything.
How can I customize my app windows' toolbars in Xcode 4? I'm using Xcode 4.3.3 on Lion and developing a Mac app.
Note: this is _not_ about customizing Xcode's toolbar, but customizing an app's toolbar that is being developed in Xcode
Thanks | 0 | [
2,
184,
20,
5816,
2952,
40,
21,
1572,
3010,
5607,
1850,
19,
993,
9375,
268,
9,
240,
9,
240,
60,
800,
3726,
3726,
19,
993,
9375,
203,
15,
1494,
8,
150,
10129,
68,
27,
21,
5607,
1850,
19,
6573,
14960,
7620,
71,
21,
8091,
1463,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Joomla - Multiple Instances of Module Divs
===
I'm used to using Joomla 1.5, and am trying to switch to 2.5.
I have 2 modules in the right position, I expect that there would be 2 boxes (which is what I want), one box for each module. But for some reason it's just adding the second module to the first.
It's not copying the divs (main_top_box, main_mid_box, main_bottom_box), instead it's just placing the `<jdoc:include type="modules" name="right"/>` in a new div called 'custom' and placing them side by side.
Here's what I see: 'Services' and 'Test' should be 2 different boxes.
![enter image description here][1]
[1]: http://i.stack.imgur.com/MF7RW.png
Joomla Code:
<?php if($this->countModules('right')) { ?>
<div class="main_top_box">
<div class="main_mid_box">
<div class="main_bottom_box">
<jdoc:include type="modules" name="right"/>
</div>
</div>
</div>
<?php } ?>
Code Output:
<div class="main_top_box">
<div class="main_mid_box">
<div class="main_bottom_box">
<div class="custom" >
<h3>Services</h3>
<ul>
<li>Family Law</li>
<li>Collaborative Law</li>
<li>Real Estate</li>
<li>Wills</li>
<li>Estate Planning</li>
<li>Estates</li>
</ul>
<p> </p>
</div>
<div class="custom" >
<h3>Test</h3>
<p>Testing the Right Box</p>
</div>
</div>
</div>
</div>
Should Be:
<div class="main_top_box">
<div class="main_mid_box">
<div class="main_bottom_box">
<h3>Services</h3>
<ul>
<li>Family Law</li>
<li>Collaborative Law</li>
<li>Real Estate</li>
<li>Wills</li>
<li>Estate Planning</li>
<li>Estates</li>
</ul>
</div>
</div>
</div>
<div class="main_top_box">
<div class="main_mid_box">
<div class="main_bottom_box">
<h3>Test</h3>
<p>Testing the Right Box</p>
</div>
</div>
</div>
| 0 | [
2,
2640,
2636,
531,
13,
8,
1886,
13946,
16,
12613,
13,
12916,
18,
800,
3726,
3726,
31,
22,
79,
147,
20,
568,
2640,
2636,
531,
137,
9,
264,
15,
17,
589,
749,
20,
5521,
20,
172,
9,
264,
9,
31,
57,
172,
17113,
19,
14,
193,
649,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Blur border of a canvas shape
===
How would I make a canvas shape go out of focus?
I've seen it done with webGl and I was hoping there was a way to do it with canvas and JS?
I want to be able to animate the amount of blur so I can't use an image. | 0 | [
2,
10330,
1862,
16,
21,
9696,
2539,
800,
3726,
3726,
184,
83,
31,
233,
21,
9696,
2539,
162,
70,
16,
1776,
60,
31,
22,
195,
541,
32,
677,
29,
2741,
8430,
17,
31,
23,
3935,
80,
23,
21,
161,
20,
107,
32,
29,
9696,
17,
487,
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... |
Flash/Php/MySQL Registration Form
===
I've been to almost every forum possible with this question (including this one). I almost got the answer to my question. The problem is no one seems to figure out my problem because everything looks right, and everything looks right to me too. Can someone please help me? Here are my codes.
Flash Code:
var lvSend:LoadVars = new LoadVars();
var lvReceive:LoadVars = new LoadVars();
register_button.onRelease = function(){
var valid:Boolean = validateForm();
if (valid) {
//gather information and put in loadvars object
lvSend.username = username1.text;
lvSend.password = password1.text;
lvSend.email = email1.text;
lvSend.sendAndLoad("register.php", lvReceive, "POST");
gotoAndStop(1);
}
};
lvReceive.onLoad = function(success:Boolean) {
if (success) {
username1.text = "";
password1.text = "";
email1.text = "";
}
}
function validateForm():Boolean {
if (username1.text == "" || password1.text == "" || email1.text == "") {
return false;
}
return true;
}
Php Code:
http://i.stack.imgur.com/RXPWb.png
(Sorry its in link form)
Please favorite this or something until I get an answer because I've been everywhere and no one could help me. :/ BTW I have been getting a few blank entries into my database but I don't know why. Also, the lvReceive function doesn't seem to work, but when I add the username1.text = ""; into the register_button function it seems to clear the text fields. Please help me. I left the database info on the php file cause I thought maybe the database I entered could be the problem, but I did use this php code with an html file and it worked fine. I will accept any answers. Thanks in advance! :D | 0 | [
2,
4433,
118,
26120,
118,
915,
18,
22402,
8587,
505,
800,
3726,
3726,
31,
22,
195,
74,
20,
557,
352,
5691,
938,
29,
48,
1301,
13,
5,
3970,
48,
53,
6,
9,
31,
557,
330,
14,
1623,
20,
51,
1301,
9,
14,
1448,
25,
90,
53,
2206,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why did my Visual Studio 10 stop using App.Config for my SQL connection string?
===
I have a working database application using WPF and SQL Server 2008 R2, which for two years has been getting its SQL Server connection string from the App.Config file. A few days ago on one dev machine, it started ignoring the App.Config file's connectionString, and is now using a string from somewhere else (looks like either settings.settings, or the DBML file).
Why might this be happening, and how can I get it to stop doing that?
The app.config starts out like this:
<configuration>
<configSections>
<section name="log4net" type="System.Configuration.IgnoreSectionHandler"/>
</configSections>
<connectionStrings>
<add name="DronzApp.Properties.Settings.DronzAppConnectionString"
connectionString="Server=dronz.db.123.dronzdbserver.com;Database=dronzdb;User ID=dronz;Password=secretsauce;"
providerName="System.Data.SqlClient" />
</connectionStrings>
| 0 | [
2,
483,
144,
51,
3458,
1120,
332,
747,
568,
4865,
9,
14093,
2816,
26,
51,
4444,
255,
2760,
3724,
60,
800,
3726,
3726,
31,
57,
21,
638,
6018,
3010,
568,
619,
7721,
17,
4444,
255,
8128,
570,
761,
135,
15,
56,
26,
81,
122,
63,
74... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to avoid exception on disconnect for JDBC driver?
===
I use JDBC connection to Oracle database.
Sometimes when I try disconnect I receive error:
Io exception Broken pipe
This is because network connection was broken.
How to better handler this exception?
Thanks. | 0 | [
2,
184,
20,
2658,
5391,
27,
29363,
26,
487,
43,
7229,
2425,
60,
800,
3726,
3726,
31,
275,
487,
43,
7229,
2760,
20,
15759,
6018,
9,
1030,
76,
31,
1131,
29363,
31,
2588,
7019,
45,
13,
1963,
5391,
2023,
7642,
48,
25,
185,
982,
2760... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Assistance with a regular expression
===
I am not good with regular expressions, and I could use some help with a couple of expressions I am working on. I have a line of text, such as "Text here then 999-99" and I'd like to isolate that number sequence at the end. It could be either 999-99 or 999-99-9. The following seems to work:
\d{3}-\d{2}(-\d{1})?
But I notice that it really just seems to be searching anywhere within the text, as I can add text after the number sequence and it still matches. This needs to be more strict, so that the line must end with this exact sequence, and nothing after it. I tried ending with $ instead of ?, but that never seems to create a match (it always returns false).
I could also use some help with character replacement. I am working on a program which deals with OCR scanning, and occasionally the string value that comes back contains undisplayable characters, represented by the ܀ symbol. Is there a regular expression which will replace the ܀ characters with a space? | 0 | [
2,
4067,
29,
21,
1290,
1803,
800,
3726,
3726,
31,
589,
52,
254,
29,
1290,
13832,
15,
17,
31,
110,
275,
109,
448,
29,
21,
1335,
16,
13832,
31,
589,
638,
27,
9,
31,
57,
21,
293,
16,
1854,
15,
145,
28,
13,
7,
11969,
235,
94,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 .NET, does the string returned by BigInteger.ToString() reflect the full precision of BigInteger?
===
Until today I (implicitly) assumed that when I output a `BigInteger` via the parameterless (overridden) instance method `BigInteger.ToString()` then the return string would contain the complete and exact decimal representation of my "big" integer.
But on [the MSDN doc page](http://msdn.microsoft.com/en-us/library/dd268260.aspx) I read: _"In most cases, the ToString method supports 50 decimal digits of precision. That is, if the BigInteger value has more than 50 digits, only the 50 most significant digits are preserved in the output string; all other digits are replaced with zeros. However, BigInteger supports the "R" standard format specifier, which is intended to round-trip numeric values. The string returned by the ToString(String) method with the "R" format string preserves the whole BigInteger value and can then be parsed with the Parse or TryParse method to restore its original value without any loss of data"._
However, I have not been able to find an example where `myBigInt.ToString()` differs from `myBigInt.ToString("R")`. The Remarks example from the above page does not, as claimed, provide an example, in my version of the framework (.NET 4.0 SP1). (Also `"G"` and `"R"` seem to be equivalent for `BigInteger`.)
**Is it safe to assume that the paramterless `ToString()` gives the full decimal expansion of the integer?** Did they change framework behavior, or has the above mentioned example code always been wrong?
**Note:** SO shows me [this "similar question" 2984184](http://stackoverflow.com/questions/2984184/) after I wrote this one, but I'm still submitting my question because the answer of 2984184 does not really claryfy how the zero-parameter `ToString()` works. | 0 | [
2,
19,
13,
9,
2328,
15,
630,
14,
3724,
587,
34,
580,
6391,
13699,
9,
262,
11130,
5,
6,
6907,
14,
503,
13133,
16,
580,
6391,
13699,
60,
800,
3726,
3726,
163,
786,
31,
13,
5,
8983,
16927,
38,
102,
6,
3632,
30,
76,
31,
5196,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Connecting to SQL Server LocalDB using JDBC
===
Is it possible to connect to a SQL Server LocalDB using JDBC? [It appears that][1] (as of Dec 2011) it was not possible.
Do you know of a workaround or change in status?
[1]: http://blogs.msdn.com/b/sqlexpress/archive/2011/07/12/introducing-localdb-a-better-sql-express.aspx#10249745 | 0 | [
2,
6440,
20,
4444,
255,
8128,
375,
9007,
568,
487,
43,
7229,
800,
3726,
3726,
25,
32,
938,
20,
6379,
20,
21,
4444,
255,
8128,
375,
9007,
568,
487,
43,
7229,
60,
636,
242,
1780,
30,
500,
2558,
165,
500,
13,
5,
472,
16,
6661,
54... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
delete structures in c++
===
Suppose a structure defined as below is allocated dynamically in an array. Would the type, label and description need to null terminated in order to safely delete the allocated structures.
struct operation
{
int number;
char* type;
char* label;
char* description;
}
| 0 | [
2,
27448,
3815,
19,
272,
20512,
800,
3726,
3726,
5787,
21,
1411,
2811,
28,
1021,
25,
11685,
7782,
1326,
19,
40,
7718,
9,
83,
14,
1001,
15,
1899,
17,
5318,
376,
20,
16203,
13780,
19,
389,
20,
9817,
27448,
14,
11685,
3815,
9,
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... |
Create multiple Debian packages for data files from one source
===
I have a bunch of dictionary files for the dictd dictionary program. There are 2 files for each dictionary (a dict.dz and a .index file) and there are 8 dictionaries in total.
The installation of the dictionaries is really simple, this is what I currently have in my script:
install -o root -g root -m 644 /path/to/dictd_dictionaries/* /usr/share/dictd
/usr/sbin/dictdconfig --write
service dictd restart
Now I want to package this lot of files up into .deb packages, one .deb package per dictionary. I'd really like to have one source .deb package that then creates all the separate packages, rather than having to create and maintain 8 individual packages (a number that might grow over time).
However I don't understand how the debian/whatever.files files relate to what goes in the debian/rules file. I tried downloading and looking at the source package for freedict, which is very similar to what I want to do, but its rules file is very complex. | 0 | [
2,
1600,
1886,
121,
10035,
16875,
26,
1054,
6488,
37,
53,
1267,
800,
3726,
3726,
31,
57,
21,
7653,
16,
9186,
6488,
26,
14,
13,
16315,
43,
9186,
625,
9,
80,
50,
172,
6488,
26,
206,
9186,
13,
5,
58,
13,
16315,
9,
11064,
17,
21,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
image with error constantly flashes
===
Situation:
I have products which a logo is added dynamically. for example. The image will have title="nike" and jquery adds the nike logo.
Problem:
The logo image is added by using the path to the image but the image can be either .gif or .png. The image with error flashes on/off and doesnt stop.
Code:
$('div.mainpic').each(function () {
var $this = $(this);
var logoName = $(this).find('img').attr('title');
$("<img>").prependTo($this).addClass('prod-logo').attr('src', '../../img/logos/' + logoName + '.gif');
$("img.prod-logo").error(function() {
$(this).attr('src','../../img/logos/' + logoName + '.png');
});
});
Any help would be appreciated. | 0 | [
2,
1961,
29,
7019,
7545,
19324,
800,
3726,
3726,
1858,
45,
31,
57,
1985,
56,
21,
6449,
25,
905,
7782,
1326,
9,
26,
823,
9,
14,
1961,
129,
57,
581,
3726,
7,
3239,
62,
7,
17,
487,
8190,
93,
10621,
14,
18593,
6449,
9,
1448,
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... |
Regex to remove [?] from line?
===
What would be the appropriate regex to remove all the [?] from the line as such:
/Hello[1]/World[2]/Foo[3]
/Bar[3]/Foo[2]
etc. | 0 | [
2,
7953,
1706,
20,
4681,
636,
60,
500,
37,
293,
60,
800,
3726,
3726,
98,
83,
44,
14,
4593,
7953,
1706,
20,
4681,
65,
14,
636,
60,
500,
37,
14,
293,
28,
145,
45,
13,
118,
11515,
2558,
165,
500,
118,
4423,
2558,
135,
500,
118,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Rails 3 nested resource association as choice
===
I am building a questionnaire for my website and I have models set up like so:
Question - has_many :answers
Answer - belongs_to :question
Response - belongs_to :answer, :user_application
UserApplication - has_many :responses
`Answers` are set answers, they could be Yes, No or a sentence, `Responses` are a nested resource of `UserApplication` so when I am hitting the new action in the `UserApplicationsController` I build responses, based on the number of questions, so I can use `f.fields_for` in the new form. When it renders I want the nested response to have radio buttons which have the id for the answer. So when the form is submitted the nested response receives the id for the selected answer. I just can not figure out the best way to do this. At the moment I am doing it like this:
= form_for @user_application do |f|
- @questions.each_with_index do |question, idx|
= question.content
.control-group
.controls
= select_tag "user_application[responses_attributes][#{idx}][answer_id]", options_for_select(question.answers.map {|u| [u.content,u.id]})
This feels a little hacky because when the user edits the application the select boxes for the previous answers are not selected. I have tried to explain my problem as best as possible. If anyone can understand what I am trying to do then any help would be appreciated! If you need to know anything ask!
Thanks
Tony | 0 | [
2,
2240,
18,
203,
5618,
69,
6577,
607,
28,
1837,
800,
3726,
3726,
31,
589,
353,
21,
29499,
26,
51,
2271,
17,
31,
57,
2761,
309,
71,
101,
86,
45,
1301,
13,
8,
63,
1,
14842,
13,
45,
5950,
4662,
18,
1623,
13,
8,
7034,
1,
262,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Java API for "indexed" property files
===
I am looking for a Java API which allows to write and read the property files in the following format:
<prefix>.<index>.<suffix>=<value>
For example:
launcher.1.id=23
launcher.1.name=abc
launcher.1.date=123123
launcher.2.id=sdfsdf
launcher.2.name=Asdfdsf
launcher.2.date=ghfgh
cec.1.id=sdfsdf
cec.1.name=Asdfdsf
cec.1.date=ghfgh
cec.2.id=sdfsdf
cec.2.name=Asdfdsf
cec.2.date=ghfgh
#...
log4j uses very similar format for configuring the appenders:
log4j.rootLogger=debug, stdout, R
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=example.log
log4j.appender.R.MaxFileSize=100KB
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
Anybody has an idea if there is a Java library for a case like this?
Thanks,
Ilya | 0 | [
2,
8247,
21,
2159,
26,
13,
7,
25671,
69,
7,
1354,
6488,
800,
3726,
3726,
31,
589,
699,
26,
21,
8247,
21,
2159,
56,
2965,
20,
2757,
17,
1302,
14,
1354,
6488,
19,
14,
249,
2595,
45,
13,
1,
3515,
18594,
1,
9,
1,
25671,
1,
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... |
PHP Query in my URL
===
I am trying to write a peace of code that will change the title of the page based on what is in the url query...
?page_id=62&action=register
so
if(action='register'){
do this
}else{
do this
}
how would I write this? I have never dealt with this before | 0 | [
2,
13,
26120,
25597,
19,
51,
287,
6362,
800,
3726,
3726,
31,
589,
749,
20,
2757,
21,
1728,
16,
1797,
30,
129,
753,
14,
581,
16,
14,
2478,
432,
27,
98,
25,
19,
14,
287,
6362,
25597,
9,
9,
9,
13,
60,
6486,
1,
1340,
3726,
3698,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Fast Converting RGBA to ARGB
===
I am trying to convert a rgba buffer into argb, is there any way to improve the next algorithm, or any other faster way to perform such operation?
Taking into account that the alpha value is not important once in the argb buffer, and should always end up as 0xFF.
int y, x, pixel;
for (y = 0; y < height; y++)
{
for (x = 0; x < width; x++)
{
pixel = rgbaBuffer[y * width + x];
argbBuffer[(height - y - 1) * width + x] = (pixel & 0xff00ff00) | ((pixel << 16) & 0x00ff0000) | ((pixel >> 16) & 0xff);
}
} | 0 | [
2,
1512,
19583,
13,
8911,
969,
20,
13,
10663,
220,
800,
3726,
3726,
31,
589,
749,
20,
8406,
21,
13,
8911,
969,
17497,
77,
13,
10663,
220,
15,
25,
80,
186,
161,
20,
3545,
14,
328,
9083,
15,
54,
186,
89,
4233,
161,
20,
2985,
145... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
css validation errors from http://validator.w3.org
===
I am getting a validation error from http://validator.w3.org as follows
1) Error Line 136, Column 34: there is no attribute "data-href"
2) Error Line 136, Column 259: there is no attribute "data-send"
3) Line 136, Column 259: there is no attribute "data-send"
4) Line 136, Column 278: there is no attribute "data-layout"
5) Line 136, Column 304: there is no attribute "data-width"
6) Error Line 136, Column 326: there is no attribute "data-show-faces"
and my code is
<div class="fb-like" data-href="{$url->job($details.jkey,$details.seocountry,$details.seocity,$details.seoindustry,$details.seojobtitle,$details.seoqulurl,$details.seojobSubCatagory)}" data-send="true" data-layout="button_count" data-width="100" data-show-faces="true"></div>
Please help me to solve these bugs.
Thanks in advance | 0 | [
2,
272,
18,
18,
27999,
11908,
37,
7775,
6903,
18506,
43,
3457,
9,
499,
240,
9,
5583,
800,
3726,
3726,
31,
589,
1017,
21,
27999,
7019,
37,
7775,
6903,
18506,
43,
3457,
9,
499,
240,
9,
5583,
28,
2415,
137,
6,
7019,
293,
13,
13690,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CakePHP: One column -> one TRUE
===
Hope someone could help me with this:
I would like to have a column that will contain one and only one `TRUE` value. I want to set a value of `TRUE` (or '1') to a row and be assured that the remaining rows are `FALSE` (or '0').
How this could be achieved with CakePHP? | 0 | [
2,
8390,
26120,
45,
53,
4698,
13,
8,
1,
53,
1151,
800,
3726,
3726,
1376,
737,
110,
448,
55,
29,
48,
45,
31,
83,
101,
20,
57,
21,
4698,
30,
129,
3717,
53,
17,
104,
53,
13,
1,
13398,
1,
1923,
9,
31,
259,
20,
309,
21,
1923,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can you left and right join in mysql
===
I need 3 tables that are all relevant to the same thing.
For instance, 1 has user information, 1 has page information for that user and the other has page options for that user.
all connected through user_id
is is possible to do this.
SELECT * FROM users LEFT JOIN page_info ON users.id=page_info.user_id RIGHT JOIN page_settings ON user.id=page_settings.user_id WHERE usser.id=$id
or will i be defeated to using 2 queries
Thanks | 0 | [
2,
92,
42,
225,
17,
193,
1865,
19,
51,
18,
22402,
800,
3726,
3726,
31,
376,
203,
7484,
30,
50,
65,
7480,
20,
14,
205,
584,
9,
26,
4851,
15,
137,
63,
4155,
676,
15,
137,
63,
2478,
676,
26,
30,
4155,
17,
14,
89,
63,
2478,
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... |
android: code to kill a specific process, kills the other processors runs at the same time
===
i wrote the following service to kill the Mini Player which comes in the mini menue on galaxy tab fails. i wrote the code to kill MiniPlayer service but it kills what ever the program i try to run when Mini player is on.
public class MyService extends Service {
//public final String KILLED_CANDIDATE = "com.sec.minimode.music";
@Override
public IBinder onBind(Intent intent) {
// TODO Auto-generated method stub
return null;
}
@Override
public void onCreate() {
// TODO Auto-generated method stub
super.onCreate();
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
BroadcastReceiver mReceiver = new StatusReceiver();
registerReceiver(mReceiver, filter);
Timer t = new Timer();
t.schedule(new TimerTask() {
@Override
public void run() {
if (isRunning()) {
tryKill();
}
}
}, 1000, 5000);
return START_STICKY;
}
public boolean isRunning() {
ActivityManager mActivityManager = (ActivityManager) getApplicationContext()
.getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningAppProcessInfo> mRunningProcessInfo;
mRunningProcessInfo = mActivityManager.getRunningAppProcesses();
for (ActivityManager.RunningAppProcessInfo process : mRunningProcessInfo) {
if (process.processName.equals("com.sec.minimode.music")) {
return true;
}
}
return false;
}
public void tryKill() {
Intent startMain = new Intent(Intent.ACTION_MAIN);
startMain.addCategory(Intent.CATEGORY_HOME);
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getApplicationContext().startActivity(startMain);
ActivityManager mActivityManager = (ActivityManager) getApplicationContext()
.getSystemService(Context.ACTIVITY_SERVICE);
mActivityManager.killBackgroundProcesses("com.sec.minimode.music");
}
}
following permissions are given
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" /> | 0 | [
2,
13005,
45,
1797,
20,
1177,
21,
1903,
953,
15,
9340,
14,
89,
21034,
1461,
35,
14,
205,
85,
800,
3726,
3726,
31,
738,
14,
249,
365,
20,
1177,
14,
4236,
517,
56,
1624,
19,
14,
4236,
11379,
62,
27,
9358,
6523,
13614,
9,
31,
738... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Edit html file in batch file
===
I have a script in which I read html files which I want to edit. Here I paste the code which calls :remove_redundant_columns subroutine.
It should remove the spaces/white spaces from begin of each line and remove <span></span> from html file. Only problem is that it adds extra text like <span></span>= to lines which are almost empty, just have few tabs.
The html file which I downloaded is from hidemyass.com/proxy-list/1
call parse_proxy.bat remove_redundant_columns !FILENAME!
exit /b
:remove_redundant_columns
REM Remove whitespaces from begin of lines and <span></span>
FOR /f "tokens=*" %%t in (%1) do (
SET S=%%t
SET S=!S:^<span^>^</span^>=!
if NOT "!S!"=="" >>$tmp$ echo !S!
)
del %1
REN $tmp$ %1
exit /b
| 0 | [
2,
9392,
13,
15895,
3893,
19,
13064,
3893,
800,
3726,
3726,
31,
57,
21,
3884,
19,
56,
31,
1302,
13,
15895,
6488,
56,
31,
259,
20,
9392,
9,
235,
31,
640,
62,
14,
1797,
56,
3029,
13,
45,
99,
16598,
1,
2095,
8724,
1830,
1,
716,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do deactivate flyway:clean goal in profile
===
i'm using flyway maven plugin to migrate a database:
<build>
[...]
<plugin>
<groupId>com.googlecode.flyway</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>1.6.1</version>
<configuration>
<user>${hibernate.connection.username}</user>
<password>${hibernate.connection.password}</password>
<driver>${driver}</driver>
<url>${url}</url>
</configuration>
</plugin>
I have three environments (dev, pre, pro) and a profile for each. Every environment sets their own properties, so i can use flyway setting concrete profile and make my migrations to DB what i want.
Flyway has a clean goal, this goal allow drops all objects in the schema without dropping the schema itself.
There is some way to desactivate this goal only in one of my profiles? (in prod obviusly :P) | 0 | [
2,
184,
107,
121,
19516,
1373,
2855,
1443,
45,
20254,
1195,
19,
5296,
800,
3726,
3726,
31,
22,
79,
568,
2855,
1443,
1216,
3124,
10922,
108,
20,
22985,
21,
6018,
45,
13,
1,
29361,
1,
636,
9,
9,
9,
500,
13,
1,
18527,
5831,
1,
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... |
How to relate Custom Posts with Taxonomies and Display Heirarchy on Frontend (Wordpress)
===
I am using the Listings Theme from Woo Themes to create a directory based site. I am having problems figuring out how to display the data based on the taxonomies I am using and custom post type.
Reference: [http://f.cl.ly/items/1u2k1b3P0P3v2B3Z0m3c/listings_Explained.jpg][1]
MY Current Set up is as follows:
* 1 x Custom Post Type (Farmers)
* 1 x Location Taxonomy (Location)
* 1 x Service Taxonomy (Services)
**Note:** Location Taxonomy has 2 x levels. State & City (Parent & Child) So I list out states and then I have cities as children under them like
- California
** LA
** San Fran
** San Diego
////
Custom Post - My custom post type is Farmers. Each Farmer will have a couple of services and a location
e.g. Farming LTD, Dairy Farming, California - San Diego
/////
So essentially what I am trying to do is the following from a hierarchical perspective:
* Taxonomy (Service)
- - Taxonomy (Location State)
- - - Taxonomy (Location City)
- - - - Post (Farmer)
/////
A working example of the above is (Also see a much better diagram I put together here explaining the below [http://f.cl.ly/items/1u2k1b3P0P3v2B3Z0m3c/listings_Explained.jpg][2])
* I click on Dairy Farming on the home page
- - I get brought to a dynamic page of all states with Dairy Farming taxonomies (Due to the Farmers having Dairy and being in that State) I click California for example
- - - I get brought to a dynamic page of all cities in California that have Dairy Farming. I click on San Fran as an example
- - - - I get brought to a page of all farmers within that city with Dairy Farming
- - - - - I click on a Farmer and get brought to the farmer profile page
/////
If anyone has any insight into how to create pages 2 & 3 that would be much appreciated. I am not sure if I should be creating another taxonomy for cities and not having parent / child in the 1 taxonomy, but then again I am not sure...
Thanks in advance!
//Steve
[1]: http://f.cl.ly/items/1u2k1b3P0P3v2B3Z0m3c/listings_Explained.jpg
[2]: http://f.cl.ly/items/1u2k1b3P0P3v2B3Z0m3c/listings_Explained.jpg
[3]: http://i.stack.imgur.com/ED2ZF.jpg | 0 | [
2,
184,
20,
16464,
5816,
9868,
29,
26044,
8560,
160,
17,
3042,
7678,
8027,
93,
27,
431,
2451,
13,
5,
9587,
5890,
6,
800,
3726,
3726,
31,
589,
568,
14,
9554,
18,
3184,
37,
10761,
6876,
20,
1600,
21,
16755,
432,
689,
9,
31,
589,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Writing .htaccess file in Ubuntu
===
I have a domain http://www.mentor.com .My root folder structure is like this.
- Root
-Wordpress
i want to redirect all requests to wordpress folder.
I googled and wrote the file like this
RewriteEngine on
rewritecond %{http_host} http://mentor.com/ [nc]
rewriterule (.*)$ http://mentor.com/wordpress [r=301,nc]
I am now getting 404 File not found error.
i even tried to use another technique to create an index file and use a `header('location:/wordpress1)`,This works well,but whenever I upload a theme in Wordpress it gives me 500 Internal srver Error..
Anyone who can help me with this
**Note:I am tagging php because they might use this file** | 0 | [
2,
1174,
13,
9,
9020,
20604,
3893,
19,
287,
12968,
2473,
800,
3726,
3726,
31,
57,
21,
4603,
7775,
6903,
6483,
9,
1130,
248,
9,
960,
13,
9,
915,
5900,
19294,
1411,
25,
101,
48,
9,
13,
8,
5900,
13,
8,
9587,
5890,
31,
259,
20,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to do simple shape drawing in GTK?
===
I am new to Gtk and want to do simple drawing of shapes like circles and rectangles. I was looking at the [gnome tutorial][1] and the hello word example. However the curves section is undocumented. I was wondering if someone could point me in the right direction as to what should I look at, and maybe if I need to include some other supplementary library to draw?
[1]: http://developer.gnome.org/gtk-tutorial/2.90/book1.html | 0 | [
2,
184,
20,
107,
1935,
2539,
3533,
19,
9509,
197,
60,
800,
3726,
3726,
31,
589,
78,
20,
9509,
197,
17,
259,
20,
107,
1935,
3533,
16,
12129,
101,
7845,
17,
27181,
18,
9,
31,
23,
699,
35,
14,
636,
17036,
790,
29724,
500,
2558,
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... |
Is returning HTTP 409 appropriate for a validation check?
===
I have a service where some validation rules must be checked before a particular operation should be able to take place.
For instance, the client should not generate printable reports if all of the validation rules are not being met.
However, an individual client may not have all of the required information (that user may only be able to access a subset of the data that is used to determine validation success), so a request must be sent to the server: basically "is a `thing` valid between `start` and `finish`".
The response will either be some sort of token that indicates `VALID: FEEL FREE TO CONTINUE`, or a list of validation failure reasons, that can be presented to the user.
It's obvious that a successful validation will return a `200 OK`. But I don't feel that a success status code is appropriate for a validation failure. I'm leaning towards a `409 Conflict`, but I've only ever used this to reject a `PUT` or `POST`. Is it valid (snicker) to have a validation failure indicated by a `409`, or is there a better way?
Note: the action performed is not being performed on the server, so skipping this check, and just attempting the action, with a `403` in the case of the action being forbidden is not an option. | 0 | [
2,
25,
2485,
7775,
1417,
518,
4593,
26,
21,
27999,
2631,
60,
800,
3726,
3726,
31,
57,
21,
365,
113,
109,
27999,
1761,
491,
44,
6505,
115,
21,
1498,
1453,
378,
44,
777,
20,
247,
209,
9,
26,
4851,
15,
14,
6819,
378,
52,
7920,
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... |
Updating row on QTableWidget cause segmentation fault
===
I have QTableWidget connected with `totale()` slot and [itemChanged(QTableWidgetItem *)][1] signal, in my table I am tracking user change on column 3 and 5.
void Store::totale(QTableWidgetItem *x)
{
int row = x->row();
float sum = 0;
float ttl = 0;
QTableWidgetItem *item = NULL;
if (ui->storeTab->currentIndex() == 1)
{
if(x->column() == 5)
{
item = new QTableWidgetItem;
sum = ui->itemsTableWidget->item(row, 3)->text().toFloat() * x->data(0).toFloat();
item->setText(QString::number(sum, 'f', 2));
ui->itemsTableWidget->setItem(x->row(), 6, item);
sum = 0;
for (int i = 0; i < ui->itemsTableWidget->rowCount(); ++i)
{
ttl += ui->itemsTableWidget->item(i, 5)->text().toFloat();
sum += ui->itemsTableWidget->item(i, 6)->text().toFloat();
}
ui->totaleBill0->setText(QString::number(sum, 'f', 2));
ui->ttlBill0->setText(QString::number(ttl, 'f', 2));
}
else if(x->column() == 3)
{
item = new QTableWidgetItem;
sum = x->data(Qt::DisplayRole).toFloat() * ui->itemsTableWidget->item(row, 5)->text().toFloat();
item->setText(QString::number(sum, 'f', 2));
ui->itemsTableWidget->setItem(x->row(), 6, item);
sum = 0;
for (int i = 0; i < ui->itemsTableWidget->rowCount(); ++i)
{
ttl += ui->itemsTableWidget->item(i, 5)->text().toFloat();
sum += ui->itemsTableWidget->item(i, 6)->text().toFloat();
}
ui->totaleBill0->setText(QString::number(sum, 'f', 2));
ui->ttlBill0->setText(QString::number(ttl, 'f', 2));
}
}
}
My problem if I make change on column 5, it works fine, but when I made change on column 3 I get segmentation fault.
[1]: http://doc.qt.nokia.com/4.7-snapshot/qtablewidget.html | 0 | [
2,
71,
43,
1880,
3131,
27,
2593,
5924,
3976,
43,
3060,
1679,
5631,
857,
4173,
800,
3726,
3726,
31,
57,
2593,
5924,
3976,
43,
3060,
2587,
29,
13,
1,
20148,
62,
5,
6,
1,
7958,
17,
636,
2119,
79,
16229,
43,
5,
1251,
5924,
3976,
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... |
Why am I required to initialize a primitive value in Java?
===
public class Foo {
public static void main(String[] args) {
float f;
System.out.println(f);
}
}
The print statement causes the following compile-time error,
> The local variable f may not have been initialized
If primitives in Java already have a [default value (float = 0.0f)][1], why am I required to define one?
----------
Edit-
So, this works
public class Foo {
float f;
public static void main(String[] args) {
System.out.println(new Foo().f);
}
}
Thanks, everyone!
[1]: http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html | 0 | [
2,
483,
589,
31,
1390,
20,
2104,
2952,
21,
11473,
1923,
19,
8247,
60,
800,
3726,
3726,
317,
718,
4310,
111,
13,
1,
317,
12038,
11364,
407,
5,
11130,
2558,
500,
13,
10663,
18,
6,
13,
1,
11510,
398,
73,
329,
9,
1320,
9,
10299,
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... |
Rails: How to draw charts?
===
I'm an amateur web developer and I would like to know how to create graphical charts and graphs from scratch.
What are some good tutorials and/or guides for producing them in Ruby on Rails? | 4 | [
2,
2240,
18,
45,
184,
20,
2003,
5158,
60,
800,
3726,
3726,
31,
22,
79,
40,
3852,
2741,
10058,
17,
31,
83,
101,
20,
143,
184,
20,
1600,
21755,
5158,
17,
7210,
18,
37,
12395,
9,
98,
50,
109,
254,
29724,
18,
17,
118,
248,
14838,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
save xquery result into xml file
===
I am using xqj api for implemeting XQuery in java, the following is a sample query I have got and it does work. I need to write the output of the query into a .xml file , any one help me in this please?
String queryString =
"declare variable $docName as xs:string external;" + sep +
"for $cat in doc($docName)/*/"+ objectName +
" where $cat/"+field+" > "+ value +
" order by $cat/" + field + " "+
"return $cat";
XQExpression expression = conn.createExpression();
expression.bindString(new QName("docName"), filename,
conn.createAtomicType(XQItemType.XQBASETYPE_STRING));
XQSequence results = expression.executeQuery(queryString);
System.out.println(results.getSequenceAsString(new Properties()));
| 0 | [
2,
2079,
993,
8190,
93,
829,
77,
23504,
3893,
800,
3726,
3726,
31,
589,
568,
993,
1251,
728,
21,
2159,
26,
5420,
413,
5909,
68,
993,
8190,
93,
19,
8247,
15,
14,
249,
25,
21,
5717,
25597,
31,
57,
330,
17,
32,
630,
170,
9,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
OSX Screen sharing issues - works once then not until restart
===
I have a couple of macbook pros with snow leopard and lion. I have issues screen sharing to the SL one repeatedly - I usually have to restart the machine. I can then connect - once. If I disconnect (either party) then I can no longer connect - I get a Connection Failed to Machine:5900.
Any idea what is happening? | 2 | [
2,
13,
759,
396,
2324,
6126,
1549,
13,
8,
693,
382,
94,
52,
163,
22767,
800,
3726,
3726,
31,
57,
21,
1335,
16,
1572,
5199,
895,
18,
29,
2224,
15446,
17,
6023,
9,
31,
57,
1549,
2324,
6126,
20,
14,
13718,
53,
8081,
13,
8,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Using Github for Windows to work with own private Git through SSH
===
Right now, I'm using msysgit to work with my own private repositories stored on a ec2 Amazon Cloud Server using SSH.
Until now, I've been able to successfully connect to those repositories through Git Bash (creating the ssh-rsa public and private key with ssh-keygen, adding the public key to the authorized_servers on the remote machine), so I can clone, push, pull, get through the CLI.
Now, I've seen Github for Windows, and I gotta say, it is a beautiful piece of software. Since it is based on msysgit, I was wondering that if it is possible to setup Github for Windows to connect, clone and push commits through the UI?
In the description it looks like possible, but the documentation seems to lacks information about what the software is capable to do.
Hope you can help me out here, cheers from Mexico. | 0 | [
2,
568,
13,
10404,
20926,
26,
1936,
20,
170,
29,
258,
932,
13,
10404,
120,
13,
18,
1635,
800,
3726,
3726,
193,
130,
15,
31,
22,
79,
568,
4235,
93,
18,
10404,
20,
170,
29,
51,
258,
932,
302,
14882,
262,
2829,
8214,
27,
21,
6695... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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# byte[][] SHA1
===
I have this code in C# that uses IKVM to utilize Java's SHA1 encryption.
public static string ComputeHash(params byte[][] bytes)
{
if (bytes == null) throw new ArgumentNullException("bytes");
MessageDigest digest = MessageDigest.getInstance("SHA-1");
foreach (var item in bytes)
{
if (item == null)
if (bytes == null) throw new ArgumentNullException("bytes", "Inner array is null");
digest.update(item);
}
string s = (new java.math.BigInteger(digest.digest())).toString(16);
return s;
}
Is there an alternative rather than using IKVM for this? | 0 | [
2,
272,
5910,
34,
591,
2558,
500,
2558,
500,
4116,
165,
800,
3726,
3726,
31,
57,
48,
1797,
19,
272,
5910,
30,
2027,
13,
2883,
20147,
20,
13151,
8247,
22,
18,
4116,
165,
24420,
9,
317,
12038,
3724,
23909,
25436,
5,
6351,
79,
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... |
xpath select selecting whitespaces
===
I have an XML list of countries as follows:
<countries>
<country>
<code>CA</code>
<country>Canada</country>
</country>
... etc...
</countries>
I want to select the nodes and iterate across them so use
path "/countries/*"
and then in JavaScript:
nodes = xml.evaluate(path, xml, null, XPathResult.ANY_TYPE, null);
When I iterate I find the first and 3rd nodes are whitespace (line feeds), the 2nd and 4th nodes are the actual XML I want.
How can I use XPath to ignore the whitespace nodes? I'm only interested in the XML parts and I can't guarantee that the XML would contain line feeds.
| 0 | [
2,
993,
8353,
5407,
20764,
359,
5582,
18,
800,
3726,
3726,
31,
57,
40,
23504,
968,
16,
1166,
28,
2415,
45,
13,
1,
16549,
2829,
1,
13,
1,
10741,
1,
13,
1,
9375,
1,
793,
1,
118,
9375,
1,
13,
1,
10741,
1,
18006,
1,
118,
10741,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can't install rmagick in Mountain Lion
===
Tried installing rmagick in Mountain Lion with sudo gem install rmagick and got the following. Any help is appreciated. None of the forum answers worked.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for xcrun... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... yes
checking for InitializeMagick() in -lMagickCore... no
checking for InitializeMagick() in -lMagick... no
checking for InitializeMagick() in -lMagick++... no
Can't install RMagick 2.13.1. Can't find the ImageMagick library or one of the dependent libraries. Check the mkmf.log file for more detailed information. | 0 | [
2,
92,
22,
38,
16146,
761,
21200,
197,
19,
1286,
6023,
800,
3726,
3726,
794,
25429,
761,
21200,
197,
19,
1286,
6023,
29,
13,
18,
18601,
8551,
16146,
761,
21200,
197,
17,
330,
14,
249,
9,
186,
448,
25,
13746,
9,
2369,
16,
14,
569... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
onchange check for numbers and symbols
===
<input name="full_name" type="text" id="full_name" maxlength="30" required placeholder="eg. Bill Gates" minlength="4" class="required" required pattern="^[a-zA-Z0-9]+[^0-9.]$" onchange="?">
How to display an advert with onchange, if user typed symbols/numbers?
Display: "Symbols/Numbers are not alowed in Name"
| 0 | [
2,
27,
16229,
2631,
26,
2116,
17,
9794,
800,
3726,
3726,
13,
1,
108,
4881,
204,
3726,
7,
13727,
1,
7259,
7,
1001,
3726,
7,
11969,
7,
4924,
3726,
7,
13727,
1,
7259,
7,
2049,
6325,
3726,
7,
1762,
7,
1390,
209,
12427,
3726,
7,
54... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Stock market program - Sell method not working
===
I am making a stock market evaluation program and I need to find out why my sell stock method isn't working. It was working just fine a few days ago and now I can't figure out for the life of me what is wrong. Basically the program runs with on a GUI timer. Every 24 ticks, it checks if it should buy or sell. The buy section of code works, but the sell code doesn't. From what I can tell the sell section of the timer isn't running at all. The code is all in C#. If anyone can help me fix it I will give them a copy of the program which could make you some money. Thanks in advance.
private void timer1_Tick(object sender, EventArgs e)
{
// Update candlestick data
Price current = new Price(MyCon);
prices.Add(current);
counter++;
if (counter % 24 == 0)
{
// This section of code makes the candlestick from 2 min of data
ArrayList currentCandlestickData = new ArrayList();
for (int i = prices.Count - 1; i >= 0; i--)
{
currentCandlestickData.Add(prices[i]);
}
Candlestick currentCandlestick = new Candlestick(currentCandlestickData);
candlesticks.Add(currentCandlestick);
prices = new ArrayList();
// Problem code
// Attempts to sell if the current price hits a profit or loss bound of 1.5. It doesn't seem to go into this if statement and I am not sure why.
try
{
for (int i = uptrends.Count - 1; i >= 0; i--)
{
Upswing run = uptrends[i];
if (run.sellAt(current, candlesticks, 1.5, 1.5))
{
output = "Count:" + uptrends.Count.ToString() + " i:" + i.ToString();
uptrends.RemoveAt(i);
Process[] proc = Process.GetProcessesByName("Macro Recorder");
proc[0].Kill();
System.Diagnostics.Process.Start("C:\\Users\\Steve\\Documents\\Easy Macro Recorder\\Sell.mac");
Thread.Sleep(20000);
proc = Process.GetProcessesByName("Macro Recorder");
proc[0].Kill();
System.Diagnostics.Process.Start("C:\\Users\\Steve\\Documents\\Easy Macro Recorder\\Export Loop.mac");
output += " Count2:" + uptrends.Count.ToString() + " Price:" + current.getPriceStr() + " Time:" + current.getTime() + System.Environment.NewLine;
}
}
using (StreamWriter outfile = new StreamWriter("C:\\Users\\Steve\\Documents\\log.txt"))
{
outfile.Write(output);
}
}
catch (Exception ex)
{
output += System.Environment.NewLine + "Exception:" + ex.Message;
using (StreamWriter outfile = new StreamWriter("C:\\Users\\Steve\\Documents\\exception.txt"))
{
outfile.Write(output);
}
}
// Brute force possible upswings
for (double upswing = 6.0; upswing >= 2.0; upswing -= .25)
{
Upswing run = new Upswing(candlesticks, upswing);
if (run.checkUpswing(current, previous, "", false))
{
uptrends.Add(run);
previous = current;
Process[] proc = Process.GetProcessesByName("Macro Recorder");
proc[0].Kill();
System.Diagnostics.Process.Start("C:\\Users\\Steve\\Documents\\Easy Macro Recorder\\Buy.mac");
Thread.Sleep(20000);
proc = Process.GetProcessesByName("Macro Recorder");
proc[0].Kill();
System.Diagnostics.Process.Start("C:\\Users\\Steve\\Documents\\Easy Macro Recorder\\Export Loop.mac");
break;
}
}
}
}
Here are my Upswing class methods.
public bool sellAt(Price possibleSellPrice, ArrayList candlesticks, double profit, double loss)
{
if (possibleSellPrice.getPriceDouble() - current.getPriceDouble() >= profit)
{
// This part of code just inserts whether it was Profitable to the DB
string note = "P=" + profit.ToString() + " L=" + loss.ToString();
Upswing currUpswing = new Upswing(candlesticks, profit);
if (!currUpswing.checkUpswing(current, note, false))
current.saveAsSellInBuy(note);
return true;
}
if (current.getPriceDouble() - possibleSellPrice.getPriceDouble() >= loss)
{
// This part of code just inserts whether it was a loss to the DB
string note = "L=" + loss.ToString() + " P=" + profit.ToString();
Upswing currDownswing = new Upswing(candlesticks, loss);
if (!currDownswing.checkDownswing(current, note, false))
current.saveAsSellInBuy(note);
return true;
}
return false;
}
// This code checks the previous 4-10 candles and checks if more than .765% are green and if the current price > the bottom candle's price
public bool checkUpswing(Price current, Price previous, string note, bool saveAsBuyInSell)
{
this.current = current;
for (int i = 4; i < 10; i++)
{
try
{
if (candlesticks.Count > 0)
{
Candlestick bottomCandle = (Candlestick)candlesticks[candlesticks.Count - i];
double bottom = bottomCandle.low;
if (current.getMinutes() - previous.getMinutes() >= 15 && ((double)numGreen(i) / (double)i) >= .765 && current.getPriceDouble() - bottom >= upswing && note == "")
{
current.saveAsBuyInBuy("upswing=" + upswing.ToString());
return true;
}
else if (note != "" && !saveAsBuyInSell)
{
current.saveAsSellInBuy(current, note + " upswing=" + upswing.ToString());
return true;
}
else if (note != "" && saveAsBuyInSell)
{
current.saveAsBuyInSell(current, note + " upswing=" + upswing.ToString());
return true;
}
}
}
catch (Exception e)
{
}
}
return false;
}
// Self Explanitory
private int numGreen(int numCandles)
{
int greens = 0;
try
{
for (int i = candlesticks.Count - 1; i > candlesticks.Count - 1 - numCandles; i--)
{
Candlestick curCandle = (Candlestick)candlesticks[i];
if (curCandle.isGreen())
greens++;
}
}
catch (Exception e)
{
}
return greens;
} | 3 | [
2,
2070,
1135,
625,
13,
8,
3344,
2109,
52,
638,
800,
3726,
3726,
31,
589,
544,
21,
2070,
1135,
8670,
625,
17,
31,
376,
20,
477,
70,
483,
51,
3344,
2070,
2109,
2532,
22,
38,
638,
9,
32,
23,
638,
114,
1123,
21,
310,
509,
1464,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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.