PostId
int64 4
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 1
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -55
461k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
21.5k
| Title
stringlengths 3
250
| BodyMarkdown
stringlengths 5
30k
⌀ | Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 32
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,350,163 | 07/05/2012 18:16:41 | 1,013,651 | 10/25/2011 22:26:04 | 26 | 1 | .NET 4 Web Service Authentication through SOAP Header | I am currently creating a web service using .NET 4 in Visual Studion 2010 where I would like to authenticate requests by adding the username and password to each request. My requirements are to add the username and password to the SOAP Header instead of the DataContract. I've done research and it appears previous versions of .NET were able to handled customizing SOAP Envelopes as shown in the link below.
http://www.codeproject.com/Articles/27365/Authenticate-NET-Web-Service-with-Custom-SOAP-Head
However with .NET 4's implementation of the DataContract I am (or just haven't figured it out) unable to derive from the SoapHeader class because the class is not marked as DataContractSerializable or Serializlable. The previous versions of .NET it looks as if you were able to define web request/response binding all in code and .NET 4 seems to have limited (or obscured from me) some of this functionality. How would I implement the username and password to the SOAP Header in .NET 4? I've only been working with WCF for about a year now so bare with me :) | .net-4.0 | soapheader | null | null | null | null | open | .NET 4 Web Service Authentication through SOAP Header
===
I am currently creating a web service using .NET 4 in Visual Studion 2010 where I would like to authenticate requests by adding the username and password to each request. My requirements are to add the username and password to the SOAP Header instead of the DataContract. I've done research and it appears previous versions of .NET were able to handled customizing SOAP Envelopes as shown in the link below.
http://www.codeproject.com/Articles/27365/Authenticate-NET-Web-Service-with-Custom-SOAP-Head
However with .NET 4's implementation of the DataContract I am (or just haven't figured it out) unable to derive from the SoapHeader class because the class is not marked as DataContractSerializable or Serializlable. The previous versions of .NET it looks as if you were able to define web request/response binding all in code and .NET 4 seems to have limited (or obscured from me) some of this functionality. How would I implement the username and password to the SOAP Header in .NET 4? I've only been working with WCF for about a year now so bare with me :) | 0 |
11,350,164 | 07/05/2012 18:16:51 | 1,044,414 | 11/13/2011 17:47:47 | 34 | 0 | To get a value from the XML tag in C language | How to extract the value from a xml tag?
Below is the XML which is stored in a pointer variable response.
<Response>
<ID>App1</ID>
<operationID>654164615</operationID>
<mainReturnResult>
<returnCode>2000</returnCode>
<returnString> Success – Successful Result </returnString>
</mainReturnResult>
<totalDuration>647</totalDuration>
<Result>
<jobID>job1</jobID>
<mainReturnResult>
<returnCode>2000</returnCode>
<returnString> Success – Successful Result </returnString>
</mainReturnResult>
<duration>78</duration>
/*still more xml tags*/
-Data.to.be.taken
data comes here which have to extracted
-Done.with.data
I need only the return code and the data which is at the end of the xml.
I was using strstr to get the value of the tag return code. But when my friend seeing me doing that he said its a bad way to do it.
But, I need only the
1. return code to know the status and
2. to extract the data from the xml.
So, can you please suggest me which is the efficient way of doing these two activities without using any libraries.
| c | linux | null | null | null | null | open | To get a value from the XML tag in C language
===
How to extract the value from a xml tag?
Below is the XML which is stored in a pointer variable response.
<Response>
<ID>App1</ID>
<operationID>654164615</operationID>
<mainReturnResult>
<returnCode>2000</returnCode>
<returnString> Success – Successful Result </returnString>
</mainReturnResult>
<totalDuration>647</totalDuration>
<Result>
<jobID>job1</jobID>
<mainReturnResult>
<returnCode>2000</returnCode>
<returnString> Success – Successful Result </returnString>
</mainReturnResult>
<duration>78</duration>
/*still more xml tags*/
-Data.to.be.taken
data comes here which have to extracted
-Done.with.data
I need only the return code and the data which is at the end of the xml.
I was using strstr to get the value of the tag return code. But when my friend seeing me doing that he said its a bad way to do it.
But, I need only the
1. return code to know the status and
2. to extract the data from the xml.
So, can you please suggest me which is the efficient way of doing these two activities without using any libraries.
| 0 |
11,430,342 | 07/11/2012 10:11:06 | 1,380,143 | 05/07/2012 15:50:05 | 4 | 0 | Running PHP inside PNG | I just wondered.. <br />
I've seen that some pictures can have "arguments" in an url like this:
http://example.com/images/picture.png?width=120
But when I google it, I get instructions where the result would be like this:
http://example.com/images/picture.php?width=120
(with header("Content-type: image/png") and so on)
(How) can i make a piece of php-code run in a "picture"? | php | image | header | png | gd | null | open | Running PHP inside PNG
===
I just wondered.. <br />
I've seen that some pictures can have "arguments" in an url like this:
http://example.com/images/picture.png?width=120
But when I google it, I get instructions where the result would be like this:
http://example.com/images/picture.php?width=120
(with header("Content-type: image/png") and so on)
(How) can i make a piece of php-code run in a "picture"? | 0 |
11,430,354 | 07/11/2012 10:11:38 | 1,321,399 | 04/09/2012 07:32:39 | 385 | 9 | alternate of Masterpage of ASP.Net in JSF | I got stucked in search of finding alternate of Master page in JSF.I want to convert a web application developed in ASP.Net into JSF.Now when i collided with this application's Master page , then I thought it can be handled by facelets but still I don't know that Is it right approach? <br/>Here's the thing, I found that facelets are alternate of user controls So can I use them for Master page?<br/>Even this thing clicks me that i am going wrong<br/>
Thanks | java | jsp | java-ee | jsf-2.0 | facelets | null | open | alternate of Masterpage of ASP.Net in JSF
===
I got stucked in search of finding alternate of Master page in JSF.I want to convert a web application developed in ASP.Net into JSF.Now when i collided with this application's Master page , then I thought it can be handled by facelets but still I don't know that Is it right approach? <br/>Here's the thing, I found that facelets are alternate of user controls So can I use them for Master page?<br/>Even this thing clicks me that i am going wrong<br/>
Thanks | 0 |
11,430,355 | 07/11/2012 10:11:41 | 818,700 | 06/28/2011 07:22:34 | 465 | 7 | Filter out character out of returned Json Object | I'm busy developing an app for windows phone 7, the app basically calls a web service that then returns json. I use the [newton.json library][1] to then take that Json object that then gets converted to a C# object. For example if the Json looked like this:
{
"FirstName" : "",
"LastName" : "",
"Gender" : ""
}
A class would get created that looks like:
class person{
public string FirstName {get;set;}
public string LastName {get;set;}
public string Gender {get;set;}
}
So as you can see the variables in the generated class matches the variables names in the JSON exactly. e.g. FirstName -> FirstName.
But now I've come to a stage where the returned json has a variable with the name '**ID#**', and if you're a quick thinker you'll see that a C# variable is then going to get generated that will be named 'ID#', but obviously in C# you can't use the hash symbol in a variable name.
So I'm wondering how to get past this obstacle? I was thinking of filtering out the # symbols in the returned JSON, but how exactly do I go about doing this, and is that even the right thing to do?
Thanks in advance!
[1]: http://james.newtonking.com/projects/json-net.aspx | c# | regex | json | windows-phone-7 | newtonsoft | null | open | Filter out character out of returned Json Object
===
I'm busy developing an app for windows phone 7, the app basically calls a web service that then returns json. I use the [newton.json library][1] to then take that Json object that then gets converted to a C# object. For example if the Json looked like this:
{
"FirstName" : "",
"LastName" : "",
"Gender" : ""
}
A class would get created that looks like:
class person{
public string FirstName {get;set;}
public string LastName {get;set;}
public string Gender {get;set;}
}
So as you can see the variables in the generated class matches the variables names in the JSON exactly. e.g. FirstName -> FirstName.
But now I've come to a stage where the returned json has a variable with the name '**ID#**', and if you're a quick thinker you'll see that a C# variable is then going to get generated that will be named 'ID#', but obviously in C# you can't use the hash symbol in a variable name.
So I'm wondering how to get past this obstacle? I was thinking of filtering out the # symbols in the returned JSON, but how exactly do I go about doing this, and is that even the right thing to do?
Thanks in advance!
[1]: http://james.newtonking.com/projects/json-net.aspx | 0 |
11,430,301 | 07/11/2012 10:09:07 | 1,504,214 | 07/05/2012 13:53:57 | 1 | 1 | C# adding methods and checking to see if numbers have been added | have a small program im playing with. need to make sure it checks if number, if not loop untill their is a number on each input and create a main method and calculator method any help?
code is here /////////////////////////////////////////////////////
int num1;
int num2;
string operand;
float answer;
string text1;
////enter first number ////
Console.Write("Please enter a number: ");
text1 = Console.ReadLine();
// if number not integer then fail ////
bool res = int.TryParse(text1, out num1);
if (!res)
{
Console.WriteLine(" FAIL");
////enter first number ////
Console.Write("Please enter a number: ");
text1 = Console.ReadLine();
}
else
{
}
//// enter operand ////
Console.Write("Please enter an operand (+, -, /, *): ");
operand = Console.ReadLine();
// enter second number //
Console.Write("Please enter the second number: ");
text1 = Console.ReadLine();
// if number not integer then fail //
bool eff = int.TryParse(text1, out num2);
if (!eff)
do
{
Console.WriteLine(" FAIL");
// enter second number //
Console.Write("Please enter the second number: ");
text1 = Console.ReadLine();
}
while (eff == true);
{
}
// converts number to integer ///
// makes operand answers from each number ////
switch (operand)
{
case "-":
answer = num1 - num2;
break;
case "+":
answer = num1 + num2;
break;
case "/":
answer = num1 / num2;
break;
case "*":
answer = num1 * num2;
break;
default:
answer = 0;
break;
}
/// converts numbers to string using operand and writes final line ///
Console.WriteLine(num1.ToString() + " " + operand + " " + num2.ToString() + " =
"+ answer.ToString());
Console.ReadLine();
}
}
}
}
/// converts numbers to string using operand and writes final line ///
Console.WriteLine(num1.ToString() + " " + operand + " " + num2.ToString() + " =
" + answer.ToString());
Console.ReadLine(); | c# | methods | int | null | null | null | open | C# adding methods and checking to see if numbers have been added
===
have a small program im playing with. need to make sure it checks if number, if not loop untill their is a number on each input and create a main method and calculator method any help?
code is here /////////////////////////////////////////////////////
int num1;
int num2;
string operand;
float answer;
string text1;
////enter first number ////
Console.Write("Please enter a number: ");
text1 = Console.ReadLine();
// if number not integer then fail ////
bool res = int.TryParse(text1, out num1);
if (!res)
{
Console.WriteLine(" FAIL");
////enter first number ////
Console.Write("Please enter a number: ");
text1 = Console.ReadLine();
}
else
{
}
//// enter operand ////
Console.Write("Please enter an operand (+, -, /, *): ");
operand = Console.ReadLine();
// enter second number //
Console.Write("Please enter the second number: ");
text1 = Console.ReadLine();
// if number not integer then fail //
bool eff = int.TryParse(text1, out num2);
if (!eff)
do
{
Console.WriteLine(" FAIL");
// enter second number //
Console.Write("Please enter the second number: ");
text1 = Console.ReadLine();
}
while (eff == true);
{
}
// converts number to integer ///
// makes operand answers from each number ////
switch (operand)
{
case "-":
answer = num1 - num2;
break;
case "+":
answer = num1 + num2;
break;
case "/":
answer = num1 / num2;
break;
case "*":
answer = num1 * num2;
break;
default:
answer = 0;
break;
}
/// converts numbers to string using operand and writes final line ///
Console.WriteLine(num1.ToString() + " " + operand + " " + num2.ToString() + " =
"+ answer.ToString());
Console.ReadLine();
}
}
}
}
/// converts numbers to string using operand and writes final line ///
Console.WriteLine(num1.ToString() + " " + operand + " " + num2.ToString() + " =
" + answer.ToString());
Console.ReadLine(); | 0 |
11,430,357 | 07/11/2012 10:11:46 | 627,969 | 02/22/2011 08:41:26 | 34 | 1 | Jwplayer plugin gapro-2 throws Object Expected issue in IE-7/8 on closing/refresh window | Gapro2 issue on following line.
function g(){try{window.attachEvent("onbeforeunload",function(u){i()})}catch(t){}
when above event is triggered it gives issue at last line of following code snippet
//jwplayer.js
if(typeof jwplayer=="undefined"){var jwplayer=function(a){if(jwplayer.api){return jwplayer.api.selectPlayer(a)}};var $jw=jwplayer;jwplayer.version="5.10.2295";jwplayer.vid=document.createElement("video");jwplayer.audio=document.createElement("audio");jwplayer.source=document.createElement("source");(function(b){b.utils=function(){};b.utils.typeOf=function(d){var c=typeof d;if(c==="object"){if(d){if(d instanceof Array){c="array"}}else{c="null"}}return c};b.utils.extend=function(){var c=b.utils.extend["arguments"];if(c.length>1){for(var e=1;e<c.length;e++){for(var d in c[e]){c[0][d]=c[e][d]
it occurs when i press refresh/close in IE-8 or ie-7.
it does not occur if first i play video then press refresh.
Exact Error: "Object Expected"
Stack Trace:
JScript anonymous function
> m //gapro
i //gapro
JScript anonymous function
m method calls n.currentItem.. which is always null, if video play button was not clicked.
any workaround of it?
Thx | jwplayer | null | null | null | null | null | open | Jwplayer plugin gapro-2 throws Object Expected issue in IE-7/8 on closing/refresh window
===
Gapro2 issue on following line.
function g(){try{window.attachEvent("onbeforeunload",function(u){i()})}catch(t){}
when above event is triggered it gives issue at last line of following code snippet
//jwplayer.js
if(typeof jwplayer=="undefined"){var jwplayer=function(a){if(jwplayer.api){return jwplayer.api.selectPlayer(a)}};var $jw=jwplayer;jwplayer.version="5.10.2295";jwplayer.vid=document.createElement("video");jwplayer.audio=document.createElement("audio");jwplayer.source=document.createElement("source");(function(b){b.utils=function(){};b.utils.typeOf=function(d){var c=typeof d;if(c==="object"){if(d){if(d instanceof Array){c="array"}}else{c="null"}}return c};b.utils.extend=function(){var c=b.utils.extend["arguments"];if(c.length>1){for(var e=1;e<c.length;e++){for(var d in c[e]){c[0][d]=c[e][d]
it occurs when i press refresh/close in IE-8 or ie-7.
it does not occur if first i play video then press refresh.
Exact Error: "Object Expected"
Stack Trace:
JScript anonymous function
> m //gapro
i //gapro
JScript anonymous function
m method calls n.currentItem.. which is always null, if video play button was not clicked.
any workaround of it?
Thx | 0 |
11,430,358 | 07/11/2012 10:11:47 | 1,340,537 | 04/18/2012 06:40:44 | 110 | 2 | How to get milliseconds from a date picker? | In my project I am saving milliseconds in a sqllite databse, by default I am saving
System.currentTimeMillis()
in the database, but there is an option for the user to select previous date from a date picker? But what sould I save then when user selects a previous or up comming days from the date picker? How can I get that day as a long(milliseconds) format? | java | android | null | null | null | null | open | How to get milliseconds from a date picker?
===
In my project I am saving milliseconds in a sqllite databse, by default I am saving
System.currentTimeMillis()
in the database, but there is an option for the user to select previous date from a date picker? But what sould I save then when user selects a previous or up comming days from the date picker? How can I get that day as a long(milliseconds) format? | 0 |
11,430,361 | 07/11/2012 10:11:53 | 725,516 | 04/26/2011 14:07:49 | 50 | 1 | Open several files in new tabs with VIM | How can I open several files using wildcards in a new tab for each file with VIM?
Similar to http://stackoverflow.com/questions/2023191/how-can-i-open-several-files-at-once-in-vim but in new tabs instead of buffers. | vim | null | null | null | null | null | open | Open several files in new tabs with VIM
===
How can I open several files using wildcards in a new tab for each file with VIM?
Similar to http://stackoverflow.com/questions/2023191/how-can-i-open-several-files-at-once-in-vim but in new tabs instead of buffers. | 0 |
11,430,362 | 07/11/2012 10:11:54 | 539,153 | 12/11/2010 21:01:36 | 830 | 59 | Update column from another table in large mysql db (7 million rows) | ## Description ##
I have 2 tables with the following structure (irrelevant columns removed):
mysql> explain parts;
+-------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+-------+
| code | varchar(32) | NO | PRI | NULL | |
| slug | varchar(255) | YES | | NULL | |
| title | varchar(64) | YES | | NULL | |
+-------------+--------------+------+-----+---------+-------+
4 rows in set (0.00 sec)
and
mysql> explain details;
+-------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+--------------+------+-----+---------+-------+
| sku | varchar(32) | NO | PRI | NULL | |
| description | varchar(700) | YES | | NULL | |
| part_code | varchar(32) | NO | PRI | | |
+-------------------+--------------+------+-----+---------+-------+
3 rows in set (0.00 sec)
Table `parts` contains 184147 rows, and `details` contains 7278870 rows.
The `part_code` column from `details` represents the `code` column from the `parts` table.
Since these columns are `varchar`, I want to add the column `id int(11)` to `parts`, and `part_id int(11)` to `details`. I tried this:
mysql> alter table parts drop primary key;
Query OK, 184147 rows affected (0.66 sec)
Records: 184147 Duplicates: 0 Warnings: 0
mysql> alter table parts add column
id int(11) not null auto_increment primary key first;
Query OK, 184147 rows affected (0.55 sec)
Records: 184147 Duplicates: 0 Warnings: 0
mysql> select id, code from parts limit 5;
+----+-------------------------+
| id | code |
+----+-------------------------+
| 1 | Yhk0KqSMeLcfH1KEfykihQ2 |
| 2 | IMl4iweZdmrBGvSUCtMCJA2 |
| 3 | rAKZUDj1WOnbkX_8S8mNbw2 |
| 4 | rV09rJ3X33-MPiNRcPTAwA2 |
| 5 | LPyIa_M_TOZ8655u1Ls5mA2 |
+----+-------------------------+
5 rows in set (0.00 sec)
So now I have the id column with correct data in `parts` table. After adding `part_id` column to `details` table:
mysql> alter table details add column part_id int(11) not null after part_code;
Query OK, 7278870 rows affected (1 min 17.74 sec)
Records: 7278870 Duplicates: 0 Warnings: 0
Now the big problem is how to update `part_id` accordingly? The following query:
mysql> update details d
join parts p on d.part_code = p.code
set d.part_id = p.id;
was running for about 30 hours until I killed it.
Note that both tables are MyISAM:
mysql> select engine from information_schema.tables where table_schema = 'db_name' and (table_name = 'parts' or table_name = 'details');
+--------+
| ENGINE |
+--------+
| MyISAM |
| MyISAM |
+--------+
2 rows in set (0.01 sec)
I just now realized that one of the problems was that dropping the key on `parts` table I dropped the index on the `code` column. On the other side, I have the following indexes on `details` table (some irrelevant columns are omitted):
mysql> show indexes from details;
+---------+------------+----------+--------------+-------------+-----------+-------------+------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Index_type |
+---------+------------+----------+--------------+-------------+-----------+-------------+------------+
| details | 0 | PRIMARY | 1 | sku | A | NULL | BTREE |
| details | 0 | PRIMARY | 3 | part_code | A | 7278870 | BTREE |
+---------+------------+----------+--------------+-------------+-----------+-------------+------------+
2 rows in set (0.00 sec)
## My questions are: ##
1. Is the update query OK or it can be optimized somehow?
2. I will add the index on the `code` column in `parts` table, will the query run in a reasonable time, or it will run for days again?
3. How can I make a (sql/bash/php) script so I can see the progress of the query execution?
Thank you very much! | mysql | large-data-volumes | null | null | null | null | open | Update column from another table in large mysql db (7 million rows)
===
## Description ##
I have 2 tables with the following structure (irrelevant columns removed):
mysql> explain parts;
+-------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+-------+
| code | varchar(32) | NO | PRI | NULL | |
| slug | varchar(255) | YES | | NULL | |
| title | varchar(64) | YES | | NULL | |
+-------------+--------------+------+-----+---------+-------+
4 rows in set (0.00 sec)
and
mysql> explain details;
+-------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+--------------+------+-----+---------+-------+
| sku | varchar(32) | NO | PRI | NULL | |
| description | varchar(700) | YES | | NULL | |
| part_code | varchar(32) | NO | PRI | | |
+-------------------+--------------+------+-----+---------+-------+
3 rows in set (0.00 sec)
Table `parts` contains 184147 rows, and `details` contains 7278870 rows.
The `part_code` column from `details` represents the `code` column from the `parts` table.
Since these columns are `varchar`, I want to add the column `id int(11)` to `parts`, and `part_id int(11)` to `details`. I tried this:
mysql> alter table parts drop primary key;
Query OK, 184147 rows affected (0.66 sec)
Records: 184147 Duplicates: 0 Warnings: 0
mysql> alter table parts add column
id int(11) not null auto_increment primary key first;
Query OK, 184147 rows affected (0.55 sec)
Records: 184147 Duplicates: 0 Warnings: 0
mysql> select id, code from parts limit 5;
+----+-------------------------+
| id | code |
+----+-------------------------+
| 1 | Yhk0KqSMeLcfH1KEfykihQ2 |
| 2 | IMl4iweZdmrBGvSUCtMCJA2 |
| 3 | rAKZUDj1WOnbkX_8S8mNbw2 |
| 4 | rV09rJ3X33-MPiNRcPTAwA2 |
| 5 | LPyIa_M_TOZ8655u1Ls5mA2 |
+----+-------------------------+
5 rows in set (0.00 sec)
So now I have the id column with correct data in `parts` table. After adding `part_id` column to `details` table:
mysql> alter table details add column part_id int(11) not null after part_code;
Query OK, 7278870 rows affected (1 min 17.74 sec)
Records: 7278870 Duplicates: 0 Warnings: 0
Now the big problem is how to update `part_id` accordingly? The following query:
mysql> update details d
join parts p on d.part_code = p.code
set d.part_id = p.id;
was running for about 30 hours until I killed it.
Note that both tables are MyISAM:
mysql> select engine from information_schema.tables where table_schema = 'db_name' and (table_name = 'parts' or table_name = 'details');
+--------+
| ENGINE |
+--------+
| MyISAM |
| MyISAM |
+--------+
2 rows in set (0.01 sec)
I just now realized that one of the problems was that dropping the key on `parts` table I dropped the index on the `code` column. On the other side, I have the following indexes on `details` table (some irrelevant columns are omitted):
mysql> show indexes from details;
+---------+------------+----------+--------------+-------------+-----------+-------------+------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Index_type |
+---------+------------+----------+--------------+-------------+-----------+-------------+------------+
| details | 0 | PRIMARY | 1 | sku | A | NULL | BTREE |
| details | 0 | PRIMARY | 3 | part_code | A | 7278870 | BTREE |
+---------+------------+----------+--------------+-------------+-----------+-------------+------------+
2 rows in set (0.00 sec)
## My questions are: ##
1. Is the update query OK or it can be optimized somehow?
2. I will add the index on the `code` column in `parts` table, will the query run in a reasonable time, or it will run for days again?
3. How can I make a (sql/bash/php) script so I can see the progress of the query execution?
Thank you very much! | 0 |
11,430,365 | 07/11/2012 10:11:57 | 1,464,780 | 06/18/2012 20:35:41 | 25 | 1 | Registry getValue with C#/WPF | I would like to read value in the registry using C#/WPF, if the values are not in the registry i create it. I have a reading problem :
RegistryKey regKey1 = Registry.CurrentUser;
regKey1 = regKey1.CreateSubKey(@"SOFTWARE\PNMDISPATCHER");
if (regKey1 != null)
{
textBoxTaux1.Text = regKey1.GetValue("Taux1").ToString();
}
I have the NullReferenceException when execute the GetValue function.
My values are in the registry, so why i get this error ?
Thanks a lot :) | c# | wpf | registry | null | null | null | open | Registry getValue with C#/WPF
===
I would like to read value in the registry using C#/WPF, if the values are not in the registry i create it. I have a reading problem :
RegistryKey regKey1 = Registry.CurrentUser;
regKey1 = regKey1.CreateSubKey(@"SOFTWARE\PNMDISPATCHER");
if (regKey1 != null)
{
textBoxTaux1.Text = regKey1.GetValue("Taux1").ToString();
}
I have the NullReferenceException when execute the GetValue function.
My values are in the registry, so why i get this error ?
Thanks a lot :) | 0 |
11,430,366 | 07/11/2012 10:11:58 | 945,945 | 08/02/2011 09:38:05 | 851 | 40 | How to check HTML in a HTTP response? | How to effectively check if an HTTP response contains HTML or not in Java? I am making an HTTP connection like shown below:
URL url = new URL(inputURL);
con = (HttpsURLConnection)url.openConnection(proxy);
con.setRequestMethod(request.getMethod());
con.connect();
con.getResponseCode();
Is there a way to effectively check if the response contains HTML (and not other resources like image,.css or .js files). | java | httpresponse | httpurlconnection | null | null | null | open | How to check HTML in a HTTP response?
===
How to effectively check if an HTTP response contains HTML or not in Java? I am making an HTTP connection like shown below:
URL url = new URL(inputURL);
con = (HttpsURLConnection)url.openConnection(proxy);
con.setRequestMethod(request.getMethod());
con.connect();
con.getResponseCode();
Is there a way to effectively check if the response contains HTML (and not other resources like image,.css or .js files). | 0 |
11,401,483 | 07/09/2012 19:09:18 | 118,091 | 06/05/2009 15:29:18 | 2,187 | 64 | Adding framework to existing Cocoapods setup | I am working with a project where Cocoapods is used. I am unable to find any documentation for adding a framework to an already existing Cocoapods setup. All I can find are example on how to setup Cocoapods from scratch.
Any help? I'd like to add ABContactHelper via Cocoapods.
Thanks! | ios | xcode | cocoapods | null | null | null | open | Adding framework to existing Cocoapods setup
===
I am working with a project where Cocoapods is used. I am unable to find any documentation for adding a framework to an already existing Cocoapods setup. All I can find are example on how to setup Cocoapods from scratch.
Any help? I'd like to add ABContactHelper via Cocoapods.
Thanks! | 0 |
11,401,383 | 07/09/2012 19:01:42 | 1,512,869 | 07/09/2012 18:49:44 | 1 | 0 | Entity Framework SaveChanges not updating db | Using sql server profiler I can see that the initial query for AnswerComment is going to the db but when I get to the ef.SaveChanges() nothing is getting to the db. I'm using sqlexpress 2008 R2.
using (TPRDEntities ef = new TPRDEntities())
{
var ac = ef.AnswerComments.Where(a => a.AnswerCommentID == answercomment.AnswerCommentID).FirstOrDefault();
if (ac == null)
{
ac = new AnswerComment();
ac.AnswerID = answercomment.AnswerID;
ac.DisplayText = answercomment.DisplayText;
ac.InsertDate = answercomment.InsertDate;
ac.InsertUser = "save test user";
ef.SaveChanges();
}
} | .net | entity-framework | null | null | null | null | open | Entity Framework SaveChanges not updating db
===
Using sql server profiler I can see that the initial query for AnswerComment is going to the db but when I get to the ef.SaveChanges() nothing is getting to the db. I'm using sqlexpress 2008 R2.
using (TPRDEntities ef = new TPRDEntities())
{
var ac = ef.AnswerComments.Where(a => a.AnswerCommentID == answercomment.AnswerCommentID).FirstOrDefault();
if (ac == null)
{
ac = new AnswerComment();
ac.AnswerID = answercomment.AnswerID;
ac.DisplayText = answercomment.DisplayText;
ac.InsertDate = answercomment.InsertDate;
ac.InsertUser = "save test user";
ef.SaveChanges();
}
} | 0 |
11,401,491 | 07/09/2012 19:09:50 | 1,440,817 | 06/06/2012 21:12:58 | 1 | 0 | MySQL LOAD DATA INFILE host lookup | I have a CSV file with a timestamp and a host IP address on each row.
The table I would like to load this file into, additionally has a hostname column.
I am trying to load this data using LOAD DATA INFILE. Is there a way I
can lookup the hostname as the data is loaded into the table?
Also as a more general question, how can I lookup the hostname for any given IP address
inside of a stored procedure, for example.
Thanks. | mysql | hostname | loaddata | null | null | null | open | MySQL LOAD DATA INFILE host lookup
===
I have a CSV file with a timestamp and a host IP address on each row.
The table I would like to load this file into, additionally has a hostname column.
I am trying to load this data using LOAD DATA INFILE. Is there a way I
can lookup the hostname as the data is loaded into the table?
Also as a more general question, how can I lookup the hostname for any given IP address
inside of a stored procedure, for example.
Thanks. | 0 |
11,401,492 | 07/09/2012 19:09:52 | 84,167 | 03/29/2009 03:51:34 | 1,842 | 71 | Javascript: Is it safe to delete properties on an object being iterated with 'for' | I'm doing something like this:
var myObj = {a:1, b:2, c:3, d:4};
for (var key in myObj){
if (someCondition){
delete(myObj[key]);
}
}
It works just fine in the samples I've tried, but I'm not sure if it might have an unexpected behavior in certain scenarios/browsers.
Is it ok to modify the object being iterated?
| javascript | null | null | null | null | null | open | Javascript: Is it safe to delete properties on an object being iterated with 'for'
===
I'm doing something like this:
var myObj = {a:1, b:2, c:3, d:4};
for (var key in myObj){
if (someCondition){
delete(myObj[key]);
}
}
It works just fine in the samples I've tried, but I'm not sure if it might have an unexpected behavior in certain scenarios/browsers.
Is it ok to modify the object being iterated?
| 0 |
11,401,500 | 07/09/2012 19:10:23 | 1,216,976 | 02/17/2012 19:14:07 | 1,223 | 55 | How do I load a SVG file that's been generated with PHP? | I want to create a SVG file with PHP, and then include it in a HTML file. Here's what I have so far (following [this tutorial][1])
**svg.php:**
<?php
header("Content-type: image/svg+xml");
?>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/
REC-SVG-20010904/DTD/svg10.dtd">
<svg width="310" height="140" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g style="stroke:black;fill:lightgreen" transform="translate(30,30)">
<rect x="10" y="10" width="100" height="30" style="stroke-width:4"/>
<circle cx="170" cy="25" r="20" style="stroke-width:4"/>
<line x1="265" y1="10" x2="200" y2="70" style="stroke-width:4"/>
<text x="80" y="90" style="font:size: 8">Basic shapes</text>
</g>
</svg>
**index.html**
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
html,body, #MOSVG {
height: 100%;
width: 100%;
padding:0;
margin:0;
}
</style>
</head>
<body>
<object data="svg.php" type="image/svg+xml" id="MOSVG" />
</body>
</html>
When I look at `index.html` all I see is a blank page. There's no warnings/errors on the console. Apache error logs (I'm using XAMPP) give `[Mon Jul 09 14:36:15 2012] [error] [client 127.0.0.1] script 'C:/xampp/htdocs/svgtest/Public/svg.php' not found or unable to stat, referer: http://localhost/svgtest/public/`. They're in the same directory.
[1]: http://www.devx.com/webdev/Article/37004/0/page/1 | php | apache | svg | xampp | null | null | open | How do I load a SVG file that's been generated with PHP?
===
I want to create a SVG file with PHP, and then include it in a HTML file. Here's what I have so far (following [this tutorial][1])
**svg.php:**
<?php
header("Content-type: image/svg+xml");
?>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/
REC-SVG-20010904/DTD/svg10.dtd">
<svg width="310" height="140" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g style="stroke:black;fill:lightgreen" transform="translate(30,30)">
<rect x="10" y="10" width="100" height="30" style="stroke-width:4"/>
<circle cx="170" cy="25" r="20" style="stroke-width:4"/>
<line x1="265" y1="10" x2="200" y2="70" style="stroke-width:4"/>
<text x="80" y="90" style="font:size: 8">Basic shapes</text>
</g>
</svg>
**index.html**
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
html,body, #MOSVG {
height: 100%;
width: 100%;
padding:0;
margin:0;
}
</style>
</head>
<body>
<object data="svg.php" type="image/svg+xml" id="MOSVG" />
</body>
</html>
When I look at `index.html` all I see is a blank page. There's no warnings/errors on the console. Apache error logs (I'm using XAMPP) give `[Mon Jul 09 14:36:15 2012] [error] [client 127.0.0.1] script 'C:/xampp/htdocs/svgtest/Public/svg.php' not found or unable to stat, referer: http://localhost/svgtest/public/`. They're in the same directory.
[1]: http://www.devx.com/webdev/Article/37004/0/page/1 | 0 |
11,401,502 | 07/09/2012 19:10:30 | 39,923 | 11/22/2008 15:06:42 | 6,726 | 216 | Debugging Mono on Windows | I need to debug a Mono assembly on my Windows x64 PC.
My first idea was just loading the assembly in .NET and using Visual Studio. The assembly is `System.Web`. The .NET version is on the GAC and is always loaded from there, maybe there's a way to circumvent that? Tried to uninstall from GAC and got a security/dependency error.
Also tried MonoDevelop with no luck. Cannot use MonoTools for VS because: 1- Won't pay for it, 2- I use VS Express (no plugins).
Any ideas? | .net | debugging | mono | null | null | null | open | Debugging Mono on Windows
===
I need to debug a Mono assembly on my Windows x64 PC.
My first idea was just loading the assembly in .NET and using Visual Studio. The assembly is `System.Web`. The .NET version is on the GAC and is always loaded from there, maybe there's a way to circumvent that? Tried to uninstall from GAC and got a security/dependency error.
Also tried MonoDevelop with no luck. Cannot use MonoTools for VS because: 1- Won't pay for it, 2- I use VS Express (no plugins).
Any ideas? | 0 |
11,660,409 | 07/25/2012 23:52:38 | 1,553,060 | 07/25/2012 23:11:44 | 1 | 0 | Microsoft SQL Server Client Statistics - Client vs total processing time | I am trying to better understand the relationship between client processing time and total processing time. I've always worked with the thought of reducing all the numbers. I have recently run into a situation where I can reduce the total processing time but the client processing time is greater. Is it better or worse to have the client do the work? If one can push processing to the client, wouldn't that be favorable to having the server do it? Providing all other stats ( bytes/packets/round trips/total processing time ) stays the same or is lower.
| sql-server | sql-server-2008 | tsql | sql-server-2005 | null | 07/27/2012 00:25:39 | off topic | Microsoft SQL Server Client Statistics - Client vs total processing time
===
I am trying to better understand the relationship between client processing time and total processing time. I've always worked with the thought of reducing all the numbers. I have recently run into a situation where I can reduce the total processing time but the client processing time is greater. Is it better or worse to have the client do the work? If one can push processing to the client, wouldn't that be favorable to having the server do it? Providing all other stats ( bytes/packets/round trips/total processing time ) stays the same or is lower.
| 2 |
11,660,410 | 07/25/2012 23:52:41 | 1,553,094 | 07/25/2012 23:34:59 | 1 | 0 | SQL Math prob involving averaging values (but not how you think!) | I'm very new to SQL and having trouble getting a SQL query to work.
I have a list of responses that contain the numbers 1 through 4 Example:
Question 1 contains the data Q1: 1,2,1,3,4,1,2,3,4,2
What I need to do is count how many 1's and 2's there are, total them and then average the number. Such as in the above example have a count that there are 6 1's and 2's total and divide that by the total number for a average. 6/10 = .6 (oh gosh I hope that made sense)
I have been trying this code but it is summing the numbers and then dividing by the total.
Select avg(q1) as avg
From db
Where q1 between 1 and 2
And call = 55817
Such as in the above example it's doing this: 1+2+1+1+2+2=9/10 = .9 when again I need it to just "count" how many 1's and 2's there are.
Any help or direction would be greatly appreciated! Thanks. | sql | sqlite | null | null | null | null | open | SQL Math prob involving averaging values (but not how you think!)
===
I'm very new to SQL and having trouble getting a SQL query to work.
I have a list of responses that contain the numbers 1 through 4 Example:
Question 1 contains the data Q1: 1,2,1,3,4,1,2,3,4,2
What I need to do is count how many 1's and 2's there are, total them and then average the number. Such as in the above example have a count that there are 6 1's and 2's total and divide that by the total number for a average. 6/10 = .6 (oh gosh I hope that made sense)
I have been trying this code but it is summing the numbers and then dividing by the total.
Select avg(q1) as avg
From db
Where q1 between 1 and 2
And call = 55817
Such as in the above example it's doing this: 1+2+1+1+2+2=9/10 = .9 when again I need it to just "count" how many 1's and 2's there are.
Any help or direction would be greatly appreciated! Thanks. | 0 |
11,660,412 | 07/25/2012 23:53:13 | 39,189 | 11/20/2008 03:55:18 | 420 | 0 | Android device is already paired with printer, but still keeps asking for pin | I pair the device normally through the Android settings menu then attempt to connect it programmatically to a printer. I search through the paired devices, attempt to connect, and then it prompts me for my pin again. I'm trying to avoid having to type a password everytime a connection is made.
Here is the relevant code:
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
String defaultPrinter = UserSession.getDefaultPrinter( context );
BluetoothDevice preferredDevice = null;
if ( defaultPrinter == null ) {
//start activity regarding selecting a default printer
}
else {
for (BluetoothDevice device : pairedDevices)
if ( device.getAddress().equals( defaultPrinter ) ) {
preferredDevice = device;
break;
}
}
UUID id = UUID.fromString( BLUE_TOOTH_UUID );
try {
selectedDeviceSocket = preferredDevice.createRfcommSocketToServiceRecord( id );
selectedDeviceSocket.connect();
isConnected = true;
return selectedDeviceSocket.getOutputStream();
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
The connection will only happen if I re-enter the correct pin. | android | bluetooth | null | null | null | null | open | Android device is already paired with printer, but still keeps asking for pin
===
I pair the device normally through the Android settings menu then attempt to connect it programmatically to a printer. I search through the paired devices, attempt to connect, and then it prompts me for my pin again. I'm trying to avoid having to type a password everytime a connection is made.
Here is the relevant code:
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
String defaultPrinter = UserSession.getDefaultPrinter( context );
BluetoothDevice preferredDevice = null;
if ( defaultPrinter == null ) {
//start activity regarding selecting a default printer
}
else {
for (BluetoothDevice device : pairedDevices)
if ( device.getAddress().equals( defaultPrinter ) ) {
preferredDevice = device;
break;
}
}
UUID id = UUID.fromString( BLUE_TOOTH_UUID );
try {
selectedDeviceSocket = preferredDevice.createRfcommSocketToServiceRecord( id );
selectedDeviceSocket.connect();
isConnected = true;
return selectedDeviceSocket.getOutputStream();
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
The connection will only happen if I re-enter the correct pin. | 0 |
11,660,413 | 07/25/2012 23:53:35 | 652,297 | 03/09/2011 19:46:09 | 35 | 3 | Titanium and android sdk problems | So I'm trying to do this on osx lion with titanium 2.0. Running my code from Titanium directly gets me to the login screen on the emualtor (i've waited on the emulator for a couple of hours) and then it freezes, there is no interaction what so ever, i cant click anything and my app didnt load. So I tried to start a new AVD from the sdk tools but same result, the emulator fires up, loads the main screen and nothing. I did everything possible, gave it 2 gig of ram for the space, tired it on multiple sdk targets (2.1, 2.2, 4.0. 4.1), reinstalled the sdk, same result. Finally I decided to do a "./emulator -avd <name> -show-kernel" and the output below is the result (i did it both as user and sudo). So what am I missing here? Is it the SDK, Titanium, or the OS? Any help is much appreciated.
s**erial0 console
Uncompressing Linux................................................................................................. done, booting the kernel.
Initializing cgroup subsys cpu
Linux version 2.6.29-gc497e41 ([email protected]) (gcc version 4.4.3 (GCC) ) #2 Thu Dec 8 15:07:43 PST 2011
CPU: ARMv7 Processor [410fc080] revision 0 (ARMv7), cr=10c5387f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: Goldfish
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
Kernel command line: qemu.gles=0 qemu=1 console=ttyS0 android.qemud=ttyS1 android.checkjni=1 ndns=1
Unknown boot option `qemu.gles=0': ignoring
Unknown boot option `android.qemud=ttyS1': ignoring
Unknown boot option `android.checkjni=1': ignoring
PID hash table entries: 2048 (order: 11, 8192 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 512MB = 512MB total
Memory: 515712KB available (2756K code, 683K data, 108K init)
Calibrating delay loop... 432.53 BogoMIPS (lpj=2162688)
Mount-cache hash table entries: 512
Initializing cgroup subsys debug
Initializing cgroup subsys cpuacct
Initializing cgroup subsys freezer
CPU: Testing write buffer coherency: ok
net_namespace: 716 bytes
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
NET: Registered protocol family 2
IP route cache hash table entries: 16384 (order: 4, 65536 bytes)
TCP established hash table entries: 65536 (order: 7, 524288 bytes)
TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 65536 bind 65536)
TCP reno registered
NET: Registered protocol family 1
checking if image is initramfs... it is
Freeing initrd memory: 160K
goldfish_new_pdev goldfish_interrupt_controller at ff000000 irq -1
goldfish_new_pdev goldfish_device_bus at ff001000 irq 1
goldfish_new_pdev goldfish_timer at ff003000 irq 3
goldfish_new_pdev goldfish_rtc at ff010000 irq 10
goldfish_new_pdev goldfish_tty at ff002000 irq 4
goldfish_new_pdev goldfish_tty at ff011000 irq 11
goldfish_new_pdev goldfish_tty at ff012000 irq 12
goldfish_new_pdev smc91x at ff013000 irq 13
goldfish_new_pdev goldfish_fb at ff014000 irq 14
goldfish_new_pdev goldfish_audio at ff004000 irq 15
goldfish_new_pdev goldfish_mmc at ff005000 irq 16
goldfish_new_pdev goldfish_memlog at ff006000 irq -1
goldfish_new_pdev goldfish-battery at ff015000 irq 17
goldfish_new_pdev goldfish_events at ff016000 irq 18
goldfish_new_pdev goldfish_nand at ff017000 irq -1
goldfish_new_pdev qemu_pipe at ff018000 irq 19
goldfish_new_pdev goldfish-switch at ff01a000 irq 20
goldfish_new_pdev goldfish-switch at ff01b000 irq 21
goldfish_pdev_worker registered goldfish_interrupt_controller
goldfish_pdev_worker registered goldfish_device_bus
goldfish_pdev_worker registered goldfish_timer
goldfish_pdev_worker registered goldfish_rtc
goldfish_pdev_worker registered goldfish_tty
goldfish_pdev_worker registered goldfish_tty
goldfish_pdev_worker registered goldfish_tty
goldfish_pdev_worker registered smc91x
goldfish_pdev_worker registered goldfish_fb
goldfish_pdev_worker registered goldfish_audio
goldfish_pdev_worker registered goldfish_mmc
goldfish_pdev_worker registered goldfish_memlog
goldfish_pdev_worker registered goldfish-battery
goldfish_pdev_worker registered goldfish_events
goldfish_pdev_worker registered goldfish_nand
goldfish_pdev_worker registered qemu_pipe
goldfish_pdev_worker registered goldfish-switch
goldfish_pdev_worker registered goldfish-switch
ashmem: initialized
Installing knfsd (copyright (C) 1996 [email protected]).
yaffs Dec 8 2011 15:06:54 Installing.
msgmni has been set to 1008
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
allocating frame buffer 480 * 800, got ffa00000
console [ttyS0] enabled
brd: module loaded
loop: module loaded
nbd: registered device at major 43
goldfish_audio_probe
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <[email protected]>
smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <[email protected]>
eth0 (smc91x): not using net_device_ops yet
eth0: SMC91C11xFD (rev 1) at e080c000 IRQ 13 [nowait]
eth0: Ethernet addr: 52:54:00:12:34:56
goldfish nand dev0: size c200000, page 2048, extra 64, erase 131072
goldfish nand dev1: size c200000, page 2048, extra 64, erase 131072
goldfish nand dev2: size 4000000, page 2048, extra 64, erase 131072
mice: PS/2 mouse device common for all mice
*** events probe ***
events_probe() addr=0xe0814000 irq=18
events_probe() keymap=qwerty2
input: qwerty2 as /devices/virtual/input/input0
goldfish_rtc goldfish_rtc: rtc core: registered goldfish_rtc as rtc0
device-mapper: uevent: version 1.0.3
device-mapper: ioctl: 4.14.0-ioctl (2008-04-23) initialised: [email protected]
logger: created 64K log 'log_main'
logger: created 256K log 'log_events'
logger: created 64K log 'log_radio'
TCP cubic registered
NET: Registered protocol family 10
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
NET: Registered protocol family 15
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
802.1Q VLAN Support v1.8 Ben Greear <[email protected]>
All bugs added by David S. Miller <[email protected]>
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 0
goldfish_rtc goldfish_rtc: setting system clock to 2012-07-25 17:40:43 UTC (1343238043)
Freeing init memory: 108K
mmc0: new SD card at address e118
mmcblk0: mmc0:e118 SU02G 2.00 GiB
mmcblk0:
init: cannot open '/initlogo.rle'
yaffs: dev is 32505856 name is "mtdblock0"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.0, "mtdblock0"
yaffs_read_super: isCheckpointed 0
save exit: isCheckpointed 1
yaffs: dev is 32505857 name is "mtdblock1"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.1, "mtdblock1"
yaffs_read_super: isCheckpointed 0
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs_read_super: isCheckpointed 0
init: cannot find '/system/bin/dbus-daemon', disabling 'dbus'
init: cannot find '/system/etc/install-recovery.sh', disabling 'flash_recovery'
$ eth0: link up
warning: `rild' uses 32-bit capabilities (legacy support in use)
init: sys_prop: permission denied uid:1003 name:service.bootanim.exit** | android | titanium | null | null | null | null | open | Titanium and android sdk problems
===
So I'm trying to do this on osx lion with titanium 2.0. Running my code from Titanium directly gets me to the login screen on the emualtor (i've waited on the emulator for a couple of hours) and then it freezes, there is no interaction what so ever, i cant click anything and my app didnt load. So I tried to start a new AVD from the sdk tools but same result, the emulator fires up, loads the main screen and nothing. I did everything possible, gave it 2 gig of ram for the space, tired it on multiple sdk targets (2.1, 2.2, 4.0. 4.1), reinstalled the sdk, same result. Finally I decided to do a "./emulator -avd <name> -show-kernel" and the output below is the result (i did it both as user and sudo). So what am I missing here? Is it the SDK, Titanium, or the OS? Any help is much appreciated.
s**erial0 console
Uncompressing Linux................................................................................................. done, booting the kernel.
Initializing cgroup subsys cpu
Linux version 2.6.29-gc497e41 ([email protected]) (gcc version 4.4.3 (GCC) ) #2 Thu Dec 8 15:07:43 PST 2011
CPU: ARMv7 Processor [410fc080] revision 0 (ARMv7), cr=10c5387f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: Goldfish
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
Kernel command line: qemu.gles=0 qemu=1 console=ttyS0 android.qemud=ttyS1 android.checkjni=1 ndns=1
Unknown boot option `qemu.gles=0': ignoring
Unknown boot option `android.qemud=ttyS1': ignoring
Unknown boot option `android.checkjni=1': ignoring
PID hash table entries: 2048 (order: 11, 8192 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 512MB = 512MB total
Memory: 515712KB available (2756K code, 683K data, 108K init)
Calibrating delay loop... 432.53 BogoMIPS (lpj=2162688)
Mount-cache hash table entries: 512
Initializing cgroup subsys debug
Initializing cgroup subsys cpuacct
Initializing cgroup subsys freezer
CPU: Testing write buffer coherency: ok
net_namespace: 716 bytes
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
NET: Registered protocol family 2
IP route cache hash table entries: 16384 (order: 4, 65536 bytes)
TCP established hash table entries: 65536 (order: 7, 524288 bytes)
TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 65536 bind 65536)
TCP reno registered
NET: Registered protocol family 1
checking if image is initramfs... it is
Freeing initrd memory: 160K
goldfish_new_pdev goldfish_interrupt_controller at ff000000 irq -1
goldfish_new_pdev goldfish_device_bus at ff001000 irq 1
goldfish_new_pdev goldfish_timer at ff003000 irq 3
goldfish_new_pdev goldfish_rtc at ff010000 irq 10
goldfish_new_pdev goldfish_tty at ff002000 irq 4
goldfish_new_pdev goldfish_tty at ff011000 irq 11
goldfish_new_pdev goldfish_tty at ff012000 irq 12
goldfish_new_pdev smc91x at ff013000 irq 13
goldfish_new_pdev goldfish_fb at ff014000 irq 14
goldfish_new_pdev goldfish_audio at ff004000 irq 15
goldfish_new_pdev goldfish_mmc at ff005000 irq 16
goldfish_new_pdev goldfish_memlog at ff006000 irq -1
goldfish_new_pdev goldfish-battery at ff015000 irq 17
goldfish_new_pdev goldfish_events at ff016000 irq 18
goldfish_new_pdev goldfish_nand at ff017000 irq -1
goldfish_new_pdev qemu_pipe at ff018000 irq 19
goldfish_new_pdev goldfish-switch at ff01a000 irq 20
goldfish_new_pdev goldfish-switch at ff01b000 irq 21
goldfish_pdev_worker registered goldfish_interrupt_controller
goldfish_pdev_worker registered goldfish_device_bus
goldfish_pdev_worker registered goldfish_timer
goldfish_pdev_worker registered goldfish_rtc
goldfish_pdev_worker registered goldfish_tty
goldfish_pdev_worker registered goldfish_tty
goldfish_pdev_worker registered goldfish_tty
goldfish_pdev_worker registered smc91x
goldfish_pdev_worker registered goldfish_fb
goldfish_pdev_worker registered goldfish_audio
goldfish_pdev_worker registered goldfish_mmc
goldfish_pdev_worker registered goldfish_memlog
goldfish_pdev_worker registered goldfish-battery
goldfish_pdev_worker registered goldfish_events
goldfish_pdev_worker registered goldfish_nand
goldfish_pdev_worker registered qemu_pipe
goldfish_pdev_worker registered goldfish-switch
goldfish_pdev_worker registered goldfish-switch
ashmem: initialized
Installing knfsd (copyright (C) 1996 [email protected]).
yaffs Dec 8 2011 15:06:54 Installing.
msgmni has been set to 1008
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
allocating frame buffer 480 * 800, got ffa00000
console [ttyS0] enabled
brd: module loaded
loop: module loaded
nbd: registered device at major 43
goldfish_audio_probe
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <[email protected]>
smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <[email protected]>
eth0 (smc91x): not using net_device_ops yet
eth0: SMC91C11xFD (rev 1) at e080c000 IRQ 13 [nowait]
eth0: Ethernet addr: 52:54:00:12:34:56
goldfish nand dev0: size c200000, page 2048, extra 64, erase 131072
goldfish nand dev1: size c200000, page 2048, extra 64, erase 131072
goldfish nand dev2: size 4000000, page 2048, extra 64, erase 131072
mice: PS/2 mouse device common for all mice
*** events probe ***
events_probe() addr=0xe0814000 irq=18
events_probe() keymap=qwerty2
input: qwerty2 as /devices/virtual/input/input0
goldfish_rtc goldfish_rtc: rtc core: registered goldfish_rtc as rtc0
device-mapper: uevent: version 1.0.3
device-mapper: ioctl: 4.14.0-ioctl (2008-04-23) initialised: [email protected]
logger: created 64K log 'log_main'
logger: created 256K log 'log_events'
logger: created 64K log 'log_radio'
TCP cubic registered
NET: Registered protocol family 10
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
NET: Registered protocol family 15
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
802.1Q VLAN Support v1.8 Ben Greear <[email protected]>
All bugs added by David S. Miller <[email protected]>
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 0
goldfish_rtc goldfish_rtc: setting system clock to 2012-07-25 17:40:43 UTC (1343238043)
Freeing init memory: 108K
mmc0: new SD card at address e118
mmcblk0: mmc0:e118 SU02G 2.00 GiB
mmcblk0:
init: cannot open '/initlogo.rle'
yaffs: dev is 32505856 name is "mtdblock0"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.0, "mtdblock0"
yaffs_read_super: isCheckpointed 0
save exit: isCheckpointed 1
yaffs: dev is 32505857 name is "mtdblock1"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.1, "mtdblock1"
yaffs_read_super: isCheckpointed 0
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs_read_super: isCheckpointed 0
init: cannot find '/system/bin/dbus-daemon', disabling 'dbus'
init: cannot find '/system/etc/install-recovery.sh', disabling 'flash_recovery'
$ eth0: link up
warning: `rild' uses 32-bit capabilities (legacy support in use)
init: sys_prop: permission denied uid:1003 name:service.bootanim.exit** | 0 |
11,660,415 | 07/25/2012 23:53:54 | 1,321,456 | 04/09/2012 08:20:24 | 1 | 1 | How to create Notification which avoid TaskManager's killing? | I want to create Notification in Android.
But, If I kill the application via TaskManager, it terminate the Notification too..
It is the code-snipet.
it is the caller.
Intent intent = new Intent(myActivity, NotificationReciever.class);
String appName = myActivity.getTitle().toString();
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
calendar.add(Calendar.SECOND, time);
AlarmManager alarmManager = (AlarmManager)
myActivity.getSystemService(Context.ALARM_SERVICE);
alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender);
it is the Reciever.
public class NotificationReciever extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
I added the code, but it can't
intent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
I' like to make alive the Notification.
Would you tell me how to avoid the TaskManager's killing? | java | android | null | null | null | null | open | How to create Notification which avoid TaskManager's killing?
===
I want to create Notification in Android.
But, If I kill the application via TaskManager, it terminate the Notification too..
It is the code-snipet.
it is the caller.
Intent intent = new Intent(myActivity, NotificationReciever.class);
String appName = myActivity.getTitle().toString();
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
calendar.add(Calendar.SECOND, time);
AlarmManager alarmManager = (AlarmManager)
myActivity.getSystemService(Context.ALARM_SERVICE);
alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender);
it is the Reciever.
public class NotificationReciever extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
I added the code, but it can't
intent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
I' like to make alive the Notification.
Would you tell me how to avoid the TaskManager's killing? | 0 |
11,660,419 | 07/25/2012 23:54:21 | 778,552 | 06/01/2011 00:08:17 | 469 | 27 | Poor font rendering (Cocoa - Mac) | I've noticed a strange and very noticeable difference in font rendering in my xib and my final program, I've attached screenshots below:
[See here for zoomed out image][1]
[See here for zoomed in][2]
What is going on here and how can I make my app font look like it does in XCode? (Does it have something to do with subpixel rendering???).
[1]: http://cl.ly/image/0Q3W1H0z1w46
[2]: http://cl.ly/image/0I3f34143f3C | objective-c | osx | cocoa | null | null | null | open | Poor font rendering (Cocoa - Mac)
===
I've noticed a strange and very noticeable difference in font rendering in my xib and my final program, I've attached screenshots below:
[See here for zoomed out image][1]
[See here for zoomed in][2]
What is going on here and how can I make my app font look like it does in XCode? (Does it have something to do with subpixel rendering???).
[1]: http://cl.ly/image/0Q3W1H0z1w46
[2]: http://cl.ly/image/0I3f34143f3C | 0 |
11,660,421 | 07/25/2012 23:54:38 | 1,553,053 | 07/25/2012 23:06:48 | 1 | 0 | Installing rails on dreamhost vps | Its embarrasing but who could help me install new version of ruby, rails, gems, on my dreamhost vps and successfully run test_app ? I am tired of trying. I went through each of dreamhost wiki page about rails. I followed http://wiki.dreamhost.com/RVM but sstill my app didn't work. I have been trying from 4 days without eating properly. I will give my username password for that person for a while to let do. I would be so much grateful. I am still on dreamhost trial week and there is not my card information so u don't need to worry. JUST HELP | ruby-on-rails | ruby | rvm | passenger | null | 07/27/2012 00:28:20 | off topic | Installing rails on dreamhost vps
===
Its embarrasing but who could help me install new version of ruby, rails, gems, on my dreamhost vps and successfully run test_app ? I am tired of trying. I went through each of dreamhost wiki page about rails. I followed http://wiki.dreamhost.com/RVM but sstill my app didn't work. I have been trying from 4 days without eating properly. I will give my username password for that person for a while to let do. I would be so much grateful. I am still on dreamhost trial week and there is not my card information so u don't need to worry. JUST HELP | 2 |
11,660,423 | 07/25/2012 23:54:40 | 997,939 | 10/16/2011 15:23:38 | 120 | 6 | string comparison on date format wont work? | Hi for some reason I cant do a string comparison on a date? Take for example:
public List<HireDate> GetHireDate(string anything)
{
List<HireDate> hiredate = hiredates.Where(n =>
string.Equals(n.HireFromDate, anything, StringComparison.CurrentCultureIgnoreCase)
).ToList();
return hiredate;
}
It simply wont work? if I type into a textbox `13/07/2012` which is how its stored it returns a 404 not found???
The output looks like this from a generic list/get request:
<ArrayOfHireDate>
<HireDate>
<HireFromDate>13/07/2012</HireFromDate>
<HireToDate>28/07/2012</HireToDate>
<NumberOfDaysHired>15</NumberOfDaysHired>
</HireDate>
</ArrayOfHireDate>
Is there another way to find certain dates in dd/mm/yy format? | c# | wpf | wcf | linq | web-services | null | open | string comparison on date format wont work?
===
Hi for some reason I cant do a string comparison on a date? Take for example:
public List<HireDate> GetHireDate(string anything)
{
List<HireDate> hiredate = hiredates.Where(n =>
string.Equals(n.HireFromDate, anything, StringComparison.CurrentCultureIgnoreCase)
).ToList();
return hiredate;
}
It simply wont work? if I type into a textbox `13/07/2012` which is how its stored it returns a 404 not found???
The output looks like this from a generic list/get request:
<ArrayOfHireDate>
<HireDate>
<HireFromDate>13/07/2012</HireFromDate>
<HireToDate>28/07/2012</HireToDate>
<NumberOfDaysHired>15</NumberOfDaysHired>
</HireDate>
</ArrayOfHireDate>
Is there another way to find certain dates in dd/mm/yy format? | 0 |
11,660,432 | 07/25/2012 23:56:07 | 1,553,101 | 07/25/2012 23:39:40 | 1 | 0 | Simulate GROUP_CONCAT function in HSQLDB versions < 2? | LO/OOO **Base** doesn't come with an HSQLDB version > 2 which means there is no `GROUP_CONCAT` function.
***Is there a way to simulate this function in HSQLDB versions < 2?***
Here's an example for the columns `name` and `value` before the function is applied:
TIM | 51
TIM | 53
TIM | 55
JOHN | 103
JOHN | 104
I would like to use (H)SQL code in Base that returns something similar to the result of GROUP_CONCAT:
TIM | 51, 53, 55
JOHN | 103, 104
([A similar question][1] has been asked for other DBMS but the answers did't work for me in HSQLDB.)
[1]: http://stackoverflow.com/questions/451415/simulating-group-concat-mysql-function-in-ms-sql-server-2005 | sql | hsqldb | group-concat | openoffice-base | libreoffice-base | null | open | Simulate GROUP_CONCAT function in HSQLDB versions < 2?
===
LO/OOO **Base** doesn't come with an HSQLDB version > 2 which means there is no `GROUP_CONCAT` function.
***Is there a way to simulate this function in HSQLDB versions < 2?***
Here's an example for the columns `name` and `value` before the function is applied:
TIM | 51
TIM | 53
TIM | 55
JOHN | 103
JOHN | 104
I would like to use (H)SQL code in Base that returns something similar to the result of GROUP_CONCAT:
TIM | 51, 53, 55
JOHN | 103, 104
([A similar question][1] has been asked for other DBMS but the answers did't work for me in HSQLDB.)
[1]: http://stackoverflow.com/questions/451415/simulating-group-concat-mysql-function-in-ms-sql-server-2005 | 0 |
11,660,433 | 07/25/2012 23:56:19 | 938,472 | 09/10/2011 18:24:19 | 65 | 5 | t-sql number a partition | This seems an exceedingly simple question but I can't figure out a one-pass (one-pass to my eyes) SQL query that will take the following and add a field `location number` which will be one 1 for the first run of `DAL`, 2 for the `BOS` run, and 3 for the next run of `DAL`. I know how to label the first partition (use two `ROW_NUMBER()`'s).
+---------+--------+-----------+----------+
| ITEM_ID | LOT_ID | ORGN_CODE | TRANS_ID |
+---------+--------+-----------+----------+
| 61 | 15161 | DAL | 992342 |
| 61 | 15161 | DAL | 992347 |
| 61 | 15161 | DAL | 1043941 |
| 61 | 15161 | BOS | 1061565 |
| 61 | 15161 | BOS | 1064997 |
| 61 | 15161 | BOS | 1064998 |
| 61 | 15161 | BOS | 1064999 |
| 61 | 15161 | BOS | 1065000 |
| 61 | 15161 | BOS | 1065036 |
| 61 | 15161 | BOS | 1065062 |
| 61 | 15161 | BOS | 1065063 |
| 61 | 15161 | DAL | 1065184 |
| 61 | 15161 | DAL | 1065185 |
| 61 | 15161 | DAL | 1065186 |
| 61 | 15161 | DAL | 1065197 |
| 61 | 15161 | DAL | 1065198 |
| 61 | 15161 | DAL | 1083864 |
| 61 | 15161 | DAL | 1083865 |
+---------+--------+-----------+----------+ | sql | database | query | tsql | null | null | open | t-sql number a partition
===
This seems an exceedingly simple question but I can't figure out a one-pass (one-pass to my eyes) SQL query that will take the following and add a field `location number` which will be one 1 for the first run of `DAL`, 2 for the `BOS` run, and 3 for the next run of `DAL`. I know how to label the first partition (use two `ROW_NUMBER()`'s).
+---------+--------+-----------+----------+
| ITEM_ID | LOT_ID | ORGN_CODE | TRANS_ID |
+---------+--------+-----------+----------+
| 61 | 15161 | DAL | 992342 |
| 61 | 15161 | DAL | 992347 |
| 61 | 15161 | DAL | 1043941 |
| 61 | 15161 | BOS | 1061565 |
| 61 | 15161 | BOS | 1064997 |
| 61 | 15161 | BOS | 1064998 |
| 61 | 15161 | BOS | 1064999 |
| 61 | 15161 | BOS | 1065000 |
| 61 | 15161 | BOS | 1065036 |
| 61 | 15161 | BOS | 1065062 |
| 61 | 15161 | BOS | 1065063 |
| 61 | 15161 | DAL | 1065184 |
| 61 | 15161 | DAL | 1065185 |
| 61 | 15161 | DAL | 1065186 |
| 61 | 15161 | DAL | 1065197 |
| 61 | 15161 | DAL | 1065198 |
| 61 | 15161 | DAL | 1083864 |
| 61 | 15161 | DAL | 1083865 |
+---------+--------+-----------+----------+ | 0 |
11,660,436 | 07/25/2012 23:56:32 | 1,552,632 | 07/25/2012 19:09:20 | 3 | 0 | can someone suggest an idea on printing blanks in an xls file? | still fairly new to matlab, picked up this data analysis code from someone and I had to add in new functions.
for one function I'm calculating the average of every 3 entries in one column and print the result on another column. so it would be something like this
1 -1
3 -1
5 =(1+3+5)/3
7 -1
1 -1
1 =(7+1+1)/3
4 -1
what I wish to do is to print a blank in the cells that have -1. my first thought was to just assign string values to my results instead of ints. this didn't work because I think there is a line of code in there somewhere that converts everything to ints.
another possible solution is just to reopen the file and loop through all cells replacing any -1's with blank strings, though I'm not sure how to do this, and it's inefficient.
as last resort, I guess I can always tell the user of this xls sheet to use the find/replace function in excel before processing it. | matlab | null | null | null | null | null | open | can someone suggest an idea on printing blanks in an xls file?
===
still fairly new to matlab, picked up this data analysis code from someone and I had to add in new functions.
for one function I'm calculating the average of every 3 entries in one column and print the result on another column. so it would be something like this
1 -1
3 -1
5 =(1+3+5)/3
7 -1
1 -1
1 =(7+1+1)/3
4 -1
what I wish to do is to print a blank in the cells that have -1. my first thought was to just assign string values to my results instead of ints. this didn't work because I think there is a line of code in there somewhere that converts everything to ints.
another possible solution is just to reopen the file and loop through all cells replacing any -1's with blank strings, though I'm not sure how to do this, and it's inefficient.
as last resort, I guess I can always tell the user of this xls sheet to use the find/replace function in excel before processing it. | 0 |
11,660,437 | 07/25/2012 23:56:36 | 1,553,107 | 07/25/2012 23:45:31 | 1 | 0 | Cannot access App Namespace | I created my app's namespace using the wrong FB profile, so I deleted the app. And now I'm trying to recreate the namespace and it won't let me - it says it already exists. It doesn't exist! I deleted it! Help! Another user posted a similar question and got an answer suggesting he pick a different name. I'm hoping you will consider that I can guarantee it doesn't exist because I deleted it. Is it hopeless? This is not a name that can be easily changed with punctuation - this is a trademarked product name. And yes, I own the trademark. Please help! Thanks! | facebook | namespaces | null | null | null | null | open | Cannot access App Namespace
===
I created my app's namespace using the wrong FB profile, so I deleted the app. And now I'm trying to recreate the namespace and it won't let me - it says it already exists. It doesn't exist! I deleted it! Help! Another user posted a similar question and got an answer suggesting he pick a different name. I'm hoping you will consider that I can guarantee it doesn't exist because I deleted it. Is it hopeless? This is not a name that can be easily changed with punctuation - this is a trademarked product name. And yes, I own the trademark. Please help! Thanks! | 0 |
11,320,455 | 07/03/2012 23:09:35 | 1,197,044 | 02/08/2012 11:26:31 | 181 | 4 | Readind NSMutableArray of NSDictionaryes | I read a file in this way:
NSString *filenameMap = [NSString stringWithFormat:@"%@%@Map", destDir, NavBar.topItem.title];
NSString *MapPath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@Map", NavBar.topItem.title]];
[self.restClient loadFile:filenameMap intoPath:MapPath];
NSString *fileContentMap = [[NSString alloc] initWithContentsOfFile:MapPath];
SBJsonParser *parserMap = [[SBJsonParser alloc] init];
NSDictionary *dataMap = (NSDictionary *) [parserMap objectWithString:fileContentMap error:nil];
NSArray *MaparrayLongitude = [dataMap objectForKey:@"longitude"];
NSArray *MaparrayLatitude = [dataMap objectForKey:@"latitude"];
if (MaparrayLongitude.count != MaparrayLatitude.count) {
//Error: Unequal number of longitude/latitude values
} else {
NSMutableArray *pairs = [NSMutableArray array];
for (int i = 0; i < MaparrayLongitude.count; i++) {
NSDictionary *pair = [NSDictionary dictionaryWithObjectsAndKeys:
[MaparrayLongitude objectAtIndex:i], @"longitude",
[MaparrayLatitude objectAtIndex:i], @"latitude", nil];
[pairs addObject:pair];
NSDictionary* DictionaryMap = [NSDictionary dictionaryWithObjects:MaparrayLatitude forKeys:MaparrayLongitude];
This code prints the array:
NSLog(@"Second pair: %@", [pairs objectAtIndex:k]);
..And this is the result:
Second pair: {
latitude = "26.499023";
longitude = "42.326061";
}
How can I attribute the values for an annotation?? I tried this, but on an NSDictionary which contained all the keys and objects:
NSString *key2 = [allKeys2 objectAtIndex:i];
NSObject *obj2 = [DictionaryMap objectForKey:key2];
NSString *address = [NSString stringWithFormat:@"%@", obj2];
float stringFloat = [address floatValue];
float stringFloat2 = [key2 floatValue];
CLLocationCoordinate2D anyLocation;
anyLocation.longitude = stringFloat;
anyLocation.latitude = stringFloat2;
| objective-c | xcode | null | null | null | null | open | Readind NSMutableArray of NSDictionaryes
===
I read a file in this way:
NSString *filenameMap = [NSString stringWithFormat:@"%@%@Map", destDir, NavBar.topItem.title];
NSString *MapPath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@Map", NavBar.topItem.title]];
[self.restClient loadFile:filenameMap intoPath:MapPath];
NSString *fileContentMap = [[NSString alloc] initWithContentsOfFile:MapPath];
SBJsonParser *parserMap = [[SBJsonParser alloc] init];
NSDictionary *dataMap = (NSDictionary *) [parserMap objectWithString:fileContentMap error:nil];
NSArray *MaparrayLongitude = [dataMap objectForKey:@"longitude"];
NSArray *MaparrayLatitude = [dataMap objectForKey:@"latitude"];
if (MaparrayLongitude.count != MaparrayLatitude.count) {
//Error: Unequal number of longitude/latitude values
} else {
NSMutableArray *pairs = [NSMutableArray array];
for (int i = 0; i < MaparrayLongitude.count; i++) {
NSDictionary *pair = [NSDictionary dictionaryWithObjectsAndKeys:
[MaparrayLongitude objectAtIndex:i], @"longitude",
[MaparrayLatitude objectAtIndex:i], @"latitude", nil];
[pairs addObject:pair];
NSDictionary* DictionaryMap = [NSDictionary dictionaryWithObjects:MaparrayLatitude forKeys:MaparrayLongitude];
This code prints the array:
NSLog(@"Second pair: %@", [pairs objectAtIndex:k]);
..And this is the result:
Second pair: {
latitude = "26.499023";
longitude = "42.326061";
}
How can I attribute the values for an annotation?? I tried this, but on an NSDictionary which contained all the keys and objects:
NSString *key2 = [allKeys2 objectAtIndex:i];
NSObject *obj2 = [DictionaryMap objectForKey:key2];
NSString *address = [NSString stringWithFormat:@"%@", obj2];
float stringFloat = [address floatValue];
float stringFloat2 = [key2 floatValue];
CLLocationCoordinate2D anyLocation;
anyLocation.longitude = stringFloat;
anyLocation.latitude = stringFloat2;
| 0 |
11,320,461 | 07/03/2012 23:10:11 | 1,238,965 | 02/28/2012 22:19:51 | 46 | 3 | Import images to Drupal 7 using feeds module | I have to migrate a custom (non CMS) website to **Drupal 7**. In the current website, some tables have image data that is stored as URL in the db.
I have tried the **Feeds** module with the **Feeds Image Grabber** addon, and also the **Media Feeds** plugin without success (for importing data as nodes).
**Questions:**
1. Is there a way to import images from an (external) URL as 'images' into Drupal <b>from a CSV file</b>, using the Feeds module (or any other tool that allows both text and images import with mapping)?
2. If not, is there a way to import them from Drupal's images library, also by the use of the Feeds module and/or Media Feeds plugins?
I have tried importing from CSV either by giving the full external URL path or the public://myimage.jpg path without success.
Thanks for any help on that!
| image | drupal | csv | import | drupal-feeds | null | open | Import images to Drupal 7 using feeds module
===
I have to migrate a custom (non CMS) website to **Drupal 7**. In the current website, some tables have image data that is stored as URL in the db.
I have tried the **Feeds** module with the **Feeds Image Grabber** addon, and also the **Media Feeds** plugin without success (for importing data as nodes).
**Questions:**
1. Is there a way to import images from an (external) URL as 'images' into Drupal <b>from a CSV file</b>, using the Feeds module (or any other tool that allows both text and images import with mapping)?
2. If not, is there a way to import them from Drupal's images library, also by the use of the Feeds module and/or Media Feeds plugins?
I have tried importing from CSV either by giving the full external URL path or the public://myimage.jpg path without success.
Thanks for any help on that!
| 0 |
11,320,311 | 07/03/2012 22:53:14 | 1,020,356 | 10/30/2011 03:42:08 | 39 | 0 | How to limit a certain transaction code for a certain user [ABAP Programming] | i just wanted to know how do you limit a certain user in SAP NetWeaver Developers Kit for using a custom transaction code.
am accessing this code "se80" wherein we can create our own program to customize the SAP system, however my case is that I want it to limit.
For example the General Manager can use this custom transaction code eg(ZBDGEN) wherein he/she can use the custom program/transaction code, while the Sales Clerk can only use the custom program/transaction code eg(ZBDSC)
I created a two program the 1st program was to update/edit/delete privilege used by General Manager, while the 2nd program is a copy of the 1st program but the program can only used for update and used by the Sales Clerk.
And I think it is more better if the transaction code is limited for a certain user, for privilege purposes and security purposes. | abap | null | null | null | null | null | open | How to limit a certain transaction code for a certain user [ABAP Programming]
===
i just wanted to know how do you limit a certain user in SAP NetWeaver Developers Kit for using a custom transaction code.
am accessing this code "se80" wherein we can create our own program to customize the SAP system, however my case is that I want it to limit.
For example the General Manager can use this custom transaction code eg(ZBDGEN) wherein he/she can use the custom program/transaction code, while the Sales Clerk can only use the custom program/transaction code eg(ZBDSC)
I created a two program the 1st program was to update/edit/delete privilege used by General Manager, while the 2nd program is a copy of the 1st program but the program can only used for update and used by the Sales Clerk.
And I think it is more better if the transaction code is limited for a certain user, for privilege purposes and security purposes. | 0 |
11,320,312 | 07/03/2012 22:53:22 | 1,500,100 | 07/03/2012 22:24:22 | 1 | 0 | NumPy/SciPy FFT for voltage/time data | This is a pretty basic question. I'm trying to use SciPy/NumPy to perform fft on voltage vs. time data from an oscilloscope. I am completely lost when it comes to passing the data to scipy for fft processing. I have the data as two lists (x and y values) and obviously can zip the lists to tuple. I am unsure what to do though. I can't seem to find much documentation. Apologies if this has been asked before, I could not locate a relevant question.
To sum up: If a person has x and y data stored in two lists or stored in a tuple, how do they perform FFT on these data? | python | numpy | scipy | fft | null | null | open | NumPy/SciPy FFT for voltage/time data
===
This is a pretty basic question. I'm trying to use SciPy/NumPy to perform fft on voltage vs. time data from an oscilloscope. I am completely lost when it comes to passing the data to scipy for fft processing. I have the data as two lists (x and y values) and obviously can zip the lists to tuple. I am unsure what to do though. I can't seem to find much documentation. Apologies if this has been asked before, I could not locate a relevant question.
To sum up: If a person has x and y data stored in two lists or stored in a tuple, how do they perform FFT on these data? | 0 |
11,320,463 | 07/03/2012 23:10:22 | 996,035 | 10/14/2011 19:09:52 | 126 | 4 | "Object is of Type Website" error when trying to publish custom action | When I try to publish a custom action I am get an error (below) claiming that the URL representing my object is of type website. As you can see from my object html I have included a. og:type '{app_namespace}:{object_name}' tag, in fact this code was mostly generated by the developer app. I have successfully published custom actions in the past for other apps and I cannot figure out what is different this time. Any suggestions would be appreciated.
Facebook Error:
{"error":{"message":"(#3502) Object at URL {URL} has og:type of 'website'. The property 'issue' requires an object of og:type '{app_namespace}:{object_name}'. ","type":"OAuthException","code":3502}}
Object Html:
<html>
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# {app_namespace}: http://ogp.me/ns/fb/{app_namespace}#">
<meta property="og:type" content="{app_namespace}:{object_name}" />
<meta property="fb:app_id" content="{app_id}" />
<meta property="og:url" content={URL for this Html} />
<meta property="og:title" content="Sample title" />
<meta property="og:image" content="https://s-static.ak.fbcdn.net/images/devsite/attachment_blank.png" />
</head>
<body>
</body>
</html>
Code I'm using to publish the action:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ab="http://www.facebook.com/2008/fbml">
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript">
function clickHandler() {
FB.getLoginStatus(function (response) {
if (response.authResponse) {
FB.api('/me/{app_namespace}:{action_name}?{object_name}={object_url}', 'post', function (response) {
alert(JSON.stringify(response));
});
} else {
//If user not logged in initiate login process
FB.login(function (response) {
if (response.authResponse) {
FB.api('/me/{app_namespace}:{action_name}?{object_name}={object_url}', 'post', function (response) {
alert(JSON.stringify(response));
});
//actionPublish();
} else {
//user cancelled login or did not grant authorization
}
}, {
scope: 'publish_actions'
});
}
});
}
$(document).ready(function () {
window.fbAsyncInit = function () {
FB.init({
appId: '{app_id}',
status: true,
cookie: true,
xfbml: true,
oauth: true
});
// run once with current status and whenever the status changes
FB.getLoginStatus(updateButton);
FB.Event.subscribe('auth.statusChange', updateButton);
};
(function () {
var e = document.createElement('script');
e.async = true;
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
$("#fb-root").append(e);
}());
});
</script>
</head>
<body>
<div id="fb-root"></div>
<button id="publishButton" onclick=clickHandler(); return false " >Publish</button>
</body>
</html>
| facebook-graph-api | post | types | website | custom-action | null | open | "Object is of Type Website" error when trying to publish custom action
===
When I try to publish a custom action I am get an error (below) claiming that the URL representing my object is of type website. As you can see from my object html I have included a. og:type '{app_namespace}:{object_name}' tag, in fact this code was mostly generated by the developer app. I have successfully published custom actions in the past for other apps and I cannot figure out what is different this time. Any suggestions would be appreciated.
Facebook Error:
{"error":{"message":"(#3502) Object at URL {URL} has og:type of 'website'. The property 'issue' requires an object of og:type '{app_namespace}:{object_name}'. ","type":"OAuthException","code":3502}}
Object Html:
<html>
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# {app_namespace}: http://ogp.me/ns/fb/{app_namespace}#">
<meta property="og:type" content="{app_namespace}:{object_name}" />
<meta property="fb:app_id" content="{app_id}" />
<meta property="og:url" content={URL for this Html} />
<meta property="og:title" content="Sample title" />
<meta property="og:image" content="https://s-static.ak.fbcdn.net/images/devsite/attachment_blank.png" />
</head>
<body>
</body>
</html>
Code I'm using to publish the action:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ab="http://www.facebook.com/2008/fbml">
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript">
function clickHandler() {
FB.getLoginStatus(function (response) {
if (response.authResponse) {
FB.api('/me/{app_namespace}:{action_name}?{object_name}={object_url}', 'post', function (response) {
alert(JSON.stringify(response));
});
} else {
//If user not logged in initiate login process
FB.login(function (response) {
if (response.authResponse) {
FB.api('/me/{app_namespace}:{action_name}?{object_name}={object_url}', 'post', function (response) {
alert(JSON.stringify(response));
});
//actionPublish();
} else {
//user cancelled login or did not grant authorization
}
}, {
scope: 'publish_actions'
});
}
});
}
$(document).ready(function () {
window.fbAsyncInit = function () {
FB.init({
appId: '{app_id}',
status: true,
cookie: true,
xfbml: true,
oauth: true
});
// run once with current status and whenever the status changes
FB.getLoginStatus(updateButton);
FB.Event.subscribe('auth.statusChange', updateButton);
};
(function () {
var e = document.createElement('script');
e.async = true;
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
$("#fb-root").append(e);
}());
});
</script>
</head>
<body>
<div id="fb-root"></div>
<button id="publishButton" onclick=clickHandler(); return false " >Publish</button>
</body>
</html>
| 0 |
11,320,464 | 07/03/2012 23:10:27 | 1,355,120 | 04/25/2012 02:46:08 | 19 | 0 | Gridview Clickable Rows for Message Inbox | I know there's a few other questions like this but I couldn't figure it out based on their answers.
I'm building a messaging inbox page using gridview. Currently, the gridview shows a user their messages with the column headers being: Sent from, Subject, and Date. I am hoping to make the rows clickable (and highlighted when clicked) and the message to appear in a text box next to the gridview box. I want the row clickable, but not have that "Select" button on the side of each row.
Any help with this would be greatly appreciated. I'm not sure if I need to change the properties of my gridview box or make a completely new method.
Thanks | asp.net | gridview | messaging | clickable | null | null | open | Gridview Clickable Rows for Message Inbox
===
I know there's a few other questions like this but I couldn't figure it out based on their answers.
I'm building a messaging inbox page using gridview. Currently, the gridview shows a user their messages with the column headers being: Sent from, Subject, and Date. I am hoping to make the rows clickable (and highlighted when clicked) and the message to appear in a text box next to the gridview box. I want the row clickable, but not have that "Select" button on the side of each row.
Any help with this would be greatly appreciated. I'm not sure if I need to change the properties of my gridview box or make a completely new method.
Thanks | 0 |
11,320,470 | 07/03/2012 23:11:01 | 1,195,812 | 02/07/2012 21:46:00 | 3 | 0 | PHP Array Sort With Multiple Columbs of Data | Hey I want to make an array sort thing so you can sort some info via price/ID number etc.
So my array is like this:
[1] 1002234985, $123.00, ITEM DESCRIPTION #1
[2] 1034234985, $143.70, ITEM DESCRIPTION #2
[3] 1002467455, $133.06, ITEM DESCRIPTION #3
[4] 1564334985, $883.11, ITEM DESCRIPTION #4
So maybe I want to sort the array by price but have the descriptions and ID numbers match up - how would I do this?
Thanks to all who help! | php | arrays | sorting | multiple | null | null | open | PHP Array Sort With Multiple Columbs of Data
===
Hey I want to make an array sort thing so you can sort some info via price/ID number etc.
So my array is like this:
[1] 1002234985, $123.00, ITEM DESCRIPTION #1
[2] 1034234985, $143.70, ITEM DESCRIPTION #2
[3] 1002467455, $133.06, ITEM DESCRIPTION #3
[4] 1564334985, $883.11, ITEM DESCRIPTION #4
So maybe I want to sort the array by price but have the descriptions and ID numbers match up - how would I do this?
Thanks to all who help! | 0 |
11,541,937 | 07/18/2012 12:57:17 | 1,242,321 | 03/01/2012 09:53:53 | 1 | 0 | the ul-li elements styling is not correct | Hi I am trying to build a list (code shared at: http://jsfiddle.net/jLM4J/).
My question is that though the list elements should not be overlapping, why is my list overlapping the first item, where I am trying to display the user details.
Even if i replace the user li element with a separate div outside/inside ul(http://jsfiddle.net/yYEhS/1/), the ul list still keeps overlapping my element while it should not because my element is div which displays as a block.
Can anyone please help as this is screwing my mind up. | css | div | html-lists | null | null | null | open | the ul-li elements styling is not correct
===
Hi I am trying to build a list (code shared at: http://jsfiddle.net/jLM4J/).
My question is that though the list elements should not be overlapping, why is my list overlapping the first item, where I am trying to display the user details.
Even if i replace the user li element with a separate div outside/inside ul(http://jsfiddle.net/yYEhS/1/), the ul list still keeps overlapping my element while it should not because my element is div which displays as a block.
Can anyone please help as this is screwing my mind up. | 0 |
11,541,939 | 07/18/2012 12:57:19 | 759,076 | 05/18/2011 11:26:45 | 1,449 | 2 | MongoDB - What about Decimal type of value? | I am currently learning and applying MongoDB for a small financial related project.
----------
When I read [MongoDB in Action][1], it says:
> The only other issue that commonly arises with BSON numeric types is
> the lack of decimal support. This means that if you’re planning on
> storing currency values in MongoDB, you need to use an integer type
> and keep the values in cents.
----------
My financial related product will involve some currency values, but I am little bit confused or worried about the above statement. Here are my questions:
1. Can I use `double` for those `currency values` in my project?
2. What will happen or is the consequences if I directly use `double` for them?
3. If decimal type is an must-have thing for financial product, is that a bad idea to use MongoDB?
4. What does it mean `you need to use an integer type and keep the values in cents`? Does it mean that if I am going to store `1.34 dollars`, then I should store `134 cents`?
Thanks
[1]: http://www.manning.com/banker/ | mongodb | decimal | bigdecimal | bson | null | null | open | MongoDB - What about Decimal type of value?
===
I am currently learning and applying MongoDB for a small financial related project.
----------
When I read [MongoDB in Action][1], it says:
> The only other issue that commonly arises with BSON numeric types is
> the lack of decimal support. This means that if you’re planning on
> storing currency values in MongoDB, you need to use an integer type
> and keep the values in cents.
----------
My financial related product will involve some currency values, but I am little bit confused or worried about the above statement. Here are my questions:
1. Can I use `double` for those `currency values` in my project?
2. What will happen or is the consequences if I directly use `double` for them?
3. If decimal type is an must-have thing for financial product, is that a bad idea to use MongoDB?
4. What does it mean `you need to use an integer type and keep the values in cents`? Does it mean that if I am going to store `1.34 dollars`, then I should store `134 cents`?
Thanks
[1]: http://www.manning.com/banker/ | 0 |
11,541,942 | 07/18/2012 12:57:28 | 1,534,817 | 07/18/2012 12:47:51 | 1 | 0 | Silverlight fetching latest version of data from database using WCF RIA Service | One of the ambition of business application is to allows multiple users running the application at the same time to manage huge of data.
How do I get the latest version of data from the database with using WCF RIA Service?
I have tried to use the DomainCollectionView to display list of Product, and allows to perform search, but unfortunately, the search results display on the client is still the old version if I have modified the product name or product code or deleted records directly from the database by using SQL Management Studio or changes made by another user.
To get the latest version of data, I have to refresh my browser.
Sounds like the data are cached on the client side already.
Please advise.
Attached with my coding file using AdventureWorks as a sample,
please navigate to the ProductPage and try to type something on the search box.
http://www.mediafire.com/?l4aee46y3vljuv7
Thanks. | wcf | silverlight | ria | null | null | null | open | Silverlight fetching latest version of data from database using WCF RIA Service
===
One of the ambition of business application is to allows multiple users running the application at the same time to manage huge of data.
How do I get the latest version of data from the database with using WCF RIA Service?
I have tried to use the DomainCollectionView to display list of Product, and allows to perform search, but unfortunately, the search results display on the client is still the old version if I have modified the product name or product code or deleted records directly from the database by using SQL Management Studio or changes made by another user.
To get the latest version of data, I have to refresh my browser.
Sounds like the data are cached on the client side already.
Please advise.
Attached with my coding file using AdventureWorks as a sample,
please navigate to the ProductPage and try to type something on the search box.
http://www.mediafire.com/?l4aee46y3vljuv7
Thanks. | 0 |
11,511,842 | 07/16/2012 20:13:52 | 1,409,078 | 05/22/2012 01:04:54 | 38 | 4 | How do I access an "askpass" program for getting root privileges in a GUI? | I'm building my first sizable Linux program that I plan on uploading to the Ubuntu Software Center, and I've run into a problem: I assumed calling something like `system("sudo mkdir /opt/test");` in a graphical program would automatically bring up the little dialog that asks for the root password, but it doesn't. I get the error: "sudo: no tty present and no askpass program specified"
So is my assumption that this is handled automatically when the user doesn't have access to a terminal incorrect? And if so, what is the default "askpass" program for Ubuntu, and how might I call it?
I would really appreciate some help. Thanks! | c++ | linux | qt | ubuntu | root | null | open | How do I access an "askpass" program for getting root privileges in a GUI?
===
I'm building my first sizable Linux program that I plan on uploading to the Ubuntu Software Center, and I've run into a problem: I assumed calling something like `system("sudo mkdir /opt/test");` in a graphical program would automatically bring up the little dialog that asks for the root password, but it doesn't. I get the error: "sudo: no tty present and no askpass program specified"
So is my assumption that this is handled automatically when the user doesn't have access to a terminal incorrect? And if so, what is the default "askpass" program for Ubuntu, and how might I call it?
I would really appreciate some help. Thanks! | 0 |
11,511,843 | 07/16/2012 20:13:57 | 1,512,957 | 07/09/2012 19:34:42 | 20 | 0 | Select into and Join Problems | My problem stems from this:
http://stackoverflow.com/questions/11420983/vba-excel-vs-sql-comparing-values-in-two-rows-loop
I've modified the script a tad and it looks like this:
;WITH data AS
(
SELECT a.i, a.M, b.M as NextM,
CASE WHEN a.M = 65 AND b.M = 120 THEN 1 ELSE 0 END AS shouldIncreaseQ
FROM MyTable a
LEFT OUTER JOIN MyTable b
ON a.i + 1 = b.i
), test as
(
SELECT data.M, data.NextM,
(SELECT COUNT(*) + 1 FROM data AS ref
WHERE ref.shouldIncreaseQ = 1 AND ref.i <= data.i) as Q FROM data
)
So now lets select * from test. I get something that looks like this.
|M | NextM | Q |
-------------------------
|65 |65 | 1 |
-------------------------
|65 |65 | 1 |
-------------------------
|65 | 120 | 2 |
-------------------------
|120 | 63 | 2 |
-------------------------
|65 | 120 | 3 |
-------------------------
|120 | NULL | 3 |
------------------------
NOW.. all I want to is take the Q column (where Q pertains to the NextM) and put that in my original mytable.
So something like this:
|i | M | Q |
-------------------------
|1 |65 | 1 |
-------------------------
|2 |65 | 1 |
-------------------------
|3 | 120 | 2 |
-------------------------
|4 | 63 | 2 |
-------------------------
|5 | 120 | 3 |
-------------------------
|6 | 55 | 3 |
------------------------
I hope that makes sense. I have been playing with select into, and even insert into all DAY (literally hours) with no luck. (using every type of join you can imagine)
Thank you in advance. (also can someone tell me how to make my tables look nicer.. do you use html to do it or what)? | sql | sql-server-2005 | join | select-into | null | null | open | Select into and Join Problems
===
My problem stems from this:
http://stackoverflow.com/questions/11420983/vba-excel-vs-sql-comparing-values-in-two-rows-loop
I've modified the script a tad and it looks like this:
;WITH data AS
(
SELECT a.i, a.M, b.M as NextM,
CASE WHEN a.M = 65 AND b.M = 120 THEN 1 ELSE 0 END AS shouldIncreaseQ
FROM MyTable a
LEFT OUTER JOIN MyTable b
ON a.i + 1 = b.i
), test as
(
SELECT data.M, data.NextM,
(SELECT COUNT(*) + 1 FROM data AS ref
WHERE ref.shouldIncreaseQ = 1 AND ref.i <= data.i) as Q FROM data
)
So now lets select * from test. I get something that looks like this.
|M | NextM | Q |
-------------------------
|65 |65 | 1 |
-------------------------
|65 |65 | 1 |
-------------------------
|65 | 120 | 2 |
-------------------------
|120 | 63 | 2 |
-------------------------
|65 | 120 | 3 |
-------------------------
|120 | NULL | 3 |
------------------------
NOW.. all I want to is take the Q column (where Q pertains to the NextM) and put that in my original mytable.
So something like this:
|i | M | Q |
-------------------------
|1 |65 | 1 |
-------------------------
|2 |65 | 1 |
-------------------------
|3 | 120 | 2 |
-------------------------
|4 | 63 | 2 |
-------------------------
|5 | 120 | 3 |
-------------------------
|6 | 55 | 3 |
------------------------
I hope that makes sense. I have been playing with select into, and even insert into all DAY (literally hours) with no luck. (using every type of join you can imagine)
Thank you in advance. (also can someone tell me how to make my tables look nicer.. do you use html to do it or what)? | 0 |
11,541,959 | 07/18/2012 12:58:16 | 408,757 | 08/02/2010 14:48:23 | 479 | 1 | AsynTask Determine When Finished | I'm wanting to return a Boolean value from a method which calls an AsyncTask to execute if order to find if it's finished. previously I called the .get() method (which was fine) but this halts all threads and I would like a progress dialog.
I'm toying with the idea of a for loop which sleep/waits say every 100ms and then checks getStatus() to see if it's equal to Status.FINISHED, but this seems like a poor idea.
Below is a small portion of code.
> jData.theTask.execute(url);
>
>
> if(jData.theTask.getStatus() == AsyncTask.Status.FINISHED) {
> if(!WebService.webServiceValid()) {
> showMessage();
> return false;
> }
>
> return true;
> }
>
>
> Log.d("fired", "false fired");
> return false;
The operation isn't going to be instantly complete, so it's just returning false and a race condition is occurring due to the operation has not finished. As mention above I could wrap it in a for loop to periodically check x amount of times, but I'm sure there's probably a better solution out there.
Many thanks | android | asynchronous | android-asynctask | null | null | null | open | AsynTask Determine When Finished
===
I'm wanting to return a Boolean value from a method which calls an AsyncTask to execute if order to find if it's finished. previously I called the .get() method (which was fine) but this halts all threads and I would like a progress dialog.
I'm toying with the idea of a for loop which sleep/waits say every 100ms and then checks getStatus() to see if it's equal to Status.FINISHED, but this seems like a poor idea.
Below is a small portion of code.
> jData.theTask.execute(url);
>
>
> if(jData.theTask.getStatus() == AsyncTask.Status.FINISHED) {
> if(!WebService.webServiceValid()) {
> showMessage();
> return false;
> }
>
> return true;
> }
>
>
> Log.d("fired", "false fired");
> return false;
The operation isn't going to be instantly complete, so it's just returning false and a race condition is occurring due to the operation has not finished. As mention above I could wrap it in a for loop to periodically check x amount of times, but I'm sure there's probably a better solution out there.
Many thanks | 0 |
11,541,961 | 07/18/2012 12:58:27 | 1,485,326 | 06/27/2012 10:30:38 | 31 | 0 | get the value of ID from json response | I am new in iPhone App Development. I wants to get User Id (my id) from Facebook. How can I get the ID? the output in console is below.
thanks
- (void)request:(FBRequest *)request didLoad:(id)result
{
NSLog(@"result is %@",result);
}
Output in console is here:
{
email = "[email protected]";
"first_name" = Gaurav;
gender = male;
hometown = {
id = 1231243212321;
name = Haridwar;
};
id = 1213213231231;
"last_name" = K;
link = "http://www.facebook.com/kestwal.75";
locale = "en_US";
location = {
id = 123123123123;
name = "New Delhi, India";
};
name = "Gaurav Kestwal";
timezone = "5.5";
"updated_time" = "2012-07-10T06:46:25+0000";
username = "gaur.75";
verified = 1;
work = (
{
employer = {
id = 12312312312;
name = "NKAPs Intellects Noida";
};
position = {
id = 213123123213;
name = "iPhone Application Developer";
};
"start_date" = "0000-00";
}
);
} | iphone | ios | facebook | null | null | null | open | get the value of ID from json response
===
I am new in iPhone App Development. I wants to get User Id (my id) from Facebook. How can I get the ID? the output in console is below.
thanks
- (void)request:(FBRequest *)request didLoad:(id)result
{
NSLog(@"result is %@",result);
}
Output in console is here:
{
email = "[email protected]";
"first_name" = Gaurav;
gender = male;
hometown = {
id = 1231243212321;
name = Haridwar;
};
id = 1213213231231;
"last_name" = K;
link = "http://www.facebook.com/kestwal.75";
locale = "en_US";
location = {
id = 123123123123;
name = "New Delhi, India";
};
name = "Gaurav Kestwal";
timezone = "5.5";
"updated_time" = "2012-07-10T06:46:25+0000";
username = "gaur.75";
verified = 1;
work = (
{
employer = {
id = 12312312312;
name = "NKAPs Intellects Noida";
};
position = {
id = 213123123213;
name = "iPhone Application Developer";
};
"start_date" = "0000-00";
}
);
} | 0 |
11,373,120 | 07/07/2012 07:23:11 | 1,208,816 | 02/14/2012 10:19:33 | 88 | 0 | histdel() failing to apply in omap | I have the following mapping in my TeX ftplugin to make `gqip` work better on LaTeX sources, not wrapping environments along with the rest of the paragraph.
omap <buffer> <silent> ip ?^$\\|^\s*\(\\begin\\|\\item\\|\\end\\|\\label\)?1<CR>//-1<CR>.<CR>:call histdel("search", -1)<CR>:let @/ = histget("search", -1)<CR>k^
When I open up a TeX file, this mapping works exactly as it should---formatting paragraphs properly, leaving no trace in search history---but only for a while. After some time has passed, the mapping stops running the `histdel()` and `let` portions; the initial search line is left in history and appears on the command-line.
There's no specific change to configuration I can discern when the mapping breaks down. Sourcing the ftplugin again doesn't fix the issue, but restarting Vim does.
How might I address this problem, keeping the search-modifying hidden as it should be? (Solutions involving replacing the mapping entirely with a less-hacky solution also welcomed.) | vim | null | null | null | null | null | open | histdel() failing to apply in omap
===
I have the following mapping in my TeX ftplugin to make `gqip` work better on LaTeX sources, not wrapping environments along with the rest of the paragraph.
omap <buffer> <silent> ip ?^$\\|^\s*\(\\begin\\|\\item\\|\\end\\|\\label\)?1<CR>//-1<CR>.<CR>:call histdel("search", -1)<CR>:let @/ = histget("search", -1)<CR>k^
When I open up a TeX file, this mapping works exactly as it should---formatting paragraphs properly, leaving no trace in search history---but only for a while. After some time has passed, the mapping stops running the `histdel()` and `let` portions; the initial search line is left in history and appears on the command-line.
There's no specific change to configuration I can discern when the mapping breaks down. Sourcing the ftplugin again doesn't fix the issue, but restarting Vim does.
How might I address this problem, keeping the search-modifying hidden as it should be? (Solutions involving replacing the mapping entirely with a less-hacky solution also welcomed.) | 0 |
11,373,121 | 07/07/2012 07:23:29 | 1,392,189 | 05/13/2012 13:12:47 | 61 | 8 | How best to get List nodes for a cache implementation | Okay first I will preface this with "I am very very new to Java" (i.e., a few days in), but I am a programmer by trade.
I have come across a situation where I want to load data. However, I would like to cache that data to prevent extraneous calls to the API (or, whatever the data source may be). After thinking about it a bit, I have come up with a cache scheme which seems to be pretty reasonable to me: the idea is that the DataCache class has two collections: a hash table that with key type "string" and value type "CacheData". CacheData has 2 data members - the actual result of the api call in string form, and a ref (ListIterator?) to a node of a linked list. Which brings us to the 2nd collection - a linked list of keys. The idea is that when a request comes in for data, we see if it's in the Hash. If not, we fetch from the API, add the resulting key to the front of the linked list, and store a Data object in the hash containing the result, along with a ref to the first node of the linked list (the one we just added). If the data IS found in the hash, we break the node out of the linked list, put it to the front, and return the data from CacheData. The benefit, every operation is guaranteed to execute in O(1), if I'm understanding correctly.
Can I store the integer hash value of the 'request' in the linked list instead of the string (request) as a whole? If so, how can I access the result in the hashmap given that integer? (none of the methods seem to take an 'int' as param). Also...is my approach to this situation sound? Or is there perhaps something in Java that would make this easier?
| java | caching | null | null | null | null | open | How best to get List nodes for a cache implementation
===
Okay first I will preface this with "I am very very new to Java" (i.e., a few days in), but I am a programmer by trade.
I have come across a situation where I want to load data. However, I would like to cache that data to prevent extraneous calls to the API (or, whatever the data source may be). After thinking about it a bit, I have come up with a cache scheme which seems to be pretty reasonable to me: the idea is that the DataCache class has two collections: a hash table that with key type "string" and value type "CacheData". CacheData has 2 data members - the actual result of the api call in string form, and a ref (ListIterator?) to a node of a linked list. Which brings us to the 2nd collection - a linked list of keys. The idea is that when a request comes in for data, we see if it's in the Hash. If not, we fetch from the API, add the resulting key to the front of the linked list, and store a Data object in the hash containing the result, along with a ref to the first node of the linked list (the one we just added). If the data IS found in the hash, we break the node out of the linked list, put it to the front, and return the data from CacheData. The benefit, every operation is guaranteed to execute in O(1), if I'm understanding correctly.
Can I store the integer hash value of the 'request' in the linked list instead of the string (request) as a whole? If so, how can I access the result in the hashmap given that integer? (none of the methods seem to take an 'int' as param). Also...is my approach to this situation sound? Or is there perhaps something in Java that would make this easier?
| 0 |
11,373,122 | 07/07/2012 07:23:32 | 979,715 | 10/05/2011 05:13:26 | 155 | 13 | Best Way to Store a Triangular/Hexagonal Grid in Python | I'm making a game with hexagonal tiles, and have decided upon using a triangular/hexagonal grid. I found [this](http://stackoverflow.com/questions/2049196/generating-triangular-hexagonal-coordinates-xyz) question which helped me generate coordinates, and slightly modified the code to store all the coordinates as keys in a dictionary with values of either "." (floor) or "X" (wall,) and included a function that prints out a string representation of the map where each non-blank character represents a hexagonal tile. This is the new code:
deltas = [[1,0,-1],[0,1,-1],[-1,1,0],[-1,0,1],[0,-1,1],[1,-1,0]]
class HexGrid():
def __init__(self, radius):
self.radius = radius
self.tiles = {(0, 0, 0): "X"}
for r in range(radius):
a = 0
b = -r
c = +r
for j in range(6):
num_of_hexas_in_edge = r
for i in range(num_of_hexas_in_edge):
a = x+deltas[j][0]
b = y+deltas[j][1]
c = z+deltas[j][2]
self.tiles[a,b,c] = "X"
def show(self):
l = []
for y in range(20):
l.append([])
for x in range(60):
l[y].append(".")
for (a,b,c), tile in self.tiles.iteritems():
l[self.radius-1-b][a-c+(2*(self.radius-1))] = self.tiles[a,b,c]
mapString = ""
for y in range(len(l)):
for x in range(len(l[y])):
mapString += l[y][x]
mapString += "\n"
print(mapString)
With this code, I can generate all the coordinates within the radius like so:
import hexgrid
hg = hexgrid.HexGrid(radius)
and access a coordinate like this:
hg.tiles[a,b,c]
This seems to work fine for now, but I'm sure there must be some disadvantages to storing the map this way. If there are any disadvantages, could you please point them out, and maybe present a better way to store the map? Thanks a lot for your time. | python | dictionary | hexagonal-tiles | null | null | null | open | Best Way to Store a Triangular/Hexagonal Grid in Python
===
I'm making a game with hexagonal tiles, and have decided upon using a triangular/hexagonal grid. I found [this](http://stackoverflow.com/questions/2049196/generating-triangular-hexagonal-coordinates-xyz) question which helped me generate coordinates, and slightly modified the code to store all the coordinates as keys in a dictionary with values of either "." (floor) or "X" (wall,) and included a function that prints out a string representation of the map where each non-blank character represents a hexagonal tile. This is the new code:
deltas = [[1,0,-1],[0,1,-1],[-1,1,0],[-1,0,1],[0,-1,1],[1,-1,0]]
class HexGrid():
def __init__(self, radius):
self.radius = radius
self.tiles = {(0, 0, 0): "X"}
for r in range(radius):
a = 0
b = -r
c = +r
for j in range(6):
num_of_hexas_in_edge = r
for i in range(num_of_hexas_in_edge):
a = x+deltas[j][0]
b = y+deltas[j][1]
c = z+deltas[j][2]
self.tiles[a,b,c] = "X"
def show(self):
l = []
for y in range(20):
l.append([])
for x in range(60):
l[y].append(".")
for (a,b,c), tile in self.tiles.iteritems():
l[self.radius-1-b][a-c+(2*(self.radius-1))] = self.tiles[a,b,c]
mapString = ""
for y in range(len(l)):
for x in range(len(l[y])):
mapString += l[y][x]
mapString += "\n"
print(mapString)
With this code, I can generate all the coordinates within the radius like so:
import hexgrid
hg = hexgrid.HexGrid(radius)
and access a coordinate like this:
hg.tiles[a,b,c]
This seems to work fine for now, but I'm sure there must be some disadvantages to storing the map this way. If there are any disadvantages, could you please point them out, and maybe present a better way to store the map? Thanks a lot for your time. | 0 |
11,373,124 | 07/07/2012 07:23:48 | 845,220 | 07/14/2011 18:46:30 | 196 | 8 | Error creating sessionFactory | When I have started my Spring MVC project I have got exception below:
javax.servlet.ServletException: Servlet.init() for servlet appServlet threw exception
And the most important thing is the root cause:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'sessionFactory' defined in ServletContext resource [/WEB-INF/spring/appServlet/servlet-context.xml]:
Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError:
org/hibernate/cfg/EJB3DTDEntityResolver
I have looked up this class: http://docs.jboss.org/hibernate/orm/3.5/api/org/hibernate/cfg/EJB3DTDEntityResolver.html and here http://search.maven.org/#search%7Cga%7C1%7Cfc%3Aorg.hibernate.cfg.EJB3DTDEntityResolver
And I have found out that it is part of hibernate-annotations. But I have some Hibernate dependecies in my `POM.xml` file:
<!-- Hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.1.4.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.5.6-Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.3.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.common</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>4.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
<version>4.1.4.Final</version>
</dependency>
I don't know what's wrong with my project. In general this exception have occured when I have declared this in my Servlet Dispatcher:
<!-- Hibernate session factory -->
<beans:bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<beans:property name="dataSource">
<beans:ref bean="dataSource" />
</beans:property>
<beans:property name="hibernateProperties">
<beans:props>
<beans:prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</beans:prop>
<beans:prop key="hibernate.show_sql">true</beans:prop>
</beans:props>
</beans:property>
<beans:property name="annotatedClasses">
<beans:list>
<beans:value>hutter.pl.dao.Users</beans:value>
</beans:list>
</beans:property>
</beans:bean>
<beans:bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<beans:property name="sessionFactory" ref="sessionFactory" />
</beans:bean>
<!-- Hibernate session factory end -->
Could you give me some advices? | spring | hibernate | maven | spring-mvc | null | null | open | Error creating sessionFactory
===
When I have started my Spring MVC project I have got exception below:
javax.servlet.ServletException: Servlet.init() for servlet appServlet threw exception
And the most important thing is the root cause:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'sessionFactory' defined in ServletContext resource [/WEB-INF/spring/appServlet/servlet-context.xml]:
Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError:
org/hibernate/cfg/EJB3DTDEntityResolver
I have looked up this class: http://docs.jboss.org/hibernate/orm/3.5/api/org/hibernate/cfg/EJB3DTDEntityResolver.html and here http://search.maven.org/#search%7Cga%7C1%7Cfc%3Aorg.hibernate.cfg.EJB3DTDEntityResolver
And I have found out that it is part of hibernate-annotations. But I have some Hibernate dependecies in my `POM.xml` file:
<!-- Hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.1.4.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.5.6-Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.3.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.common</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>4.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
<version>4.1.4.Final</version>
</dependency>
I don't know what's wrong with my project. In general this exception have occured when I have declared this in my Servlet Dispatcher:
<!-- Hibernate session factory -->
<beans:bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<beans:property name="dataSource">
<beans:ref bean="dataSource" />
</beans:property>
<beans:property name="hibernateProperties">
<beans:props>
<beans:prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</beans:prop>
<beans:prop key="hibernate.show_sql">true</beans:prop>
</beans:props>
</beans:property>
<beans:property name="annotatedClasses">
<beans:list>
<beans:value>hutter.pl.dao.Users</beans:value>
</beans:list>
</beans:property>
</beans:bean>
<beans:bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<beans:property name="sessionFactory" ref="sessionFactory" />
</beans:bean>
<!-- Hibernate session factory end -->
Could you give me some advices? | 0 |
11,373,134 | 07/07/2012 07:25:50 | 1,397,978 | 05/16/2012 07:38:02 | 3 | 1 | update panel not working in accordion | I'm having troubles with my ajax accordion and my update panel. It worked a few days ago and I must've moved things around and now it's not working. I have a tabs control and within that, an ajax accordion that holds a gridview. Each time I select my gridview I'd like to have a modalpopup that indicates loading. Mine is not showing though. :( It's loading the page correctly, but just not showing the modalpopup.
Below is my aspx code:
<ajaxToolkit:TabPanel runat="server" ID="TabPanel2" HeaderText="Qualifications">
<ContentTemplate>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
<div style="display: none" id="divBlock">
<img alt="" src="Images/LoadingScript.gif"/>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<ajaxToolkit:ModalPopupExtender ID="ModalProgress" runat="server" TargetControlID="UpdateProgress1" BackgroundCssClass="modalBackground" PopupControlID="UpdateProgress1" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
<ContentTemplate>
....Gidview events.....
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
C# Code:
protected void GridQualifications_SelectedIndexChanged(object sender, EventArgs e)
{
if (IsPostBack)
{
//Gridview events which work
ModalProgress.Show();
System.Threading.Thread.Sleep(1000);
}
}
Could it be because I have two content templates nested within each other? Is it possible to have an update panel within an accordion? Please help, anyone.
Many thanks! | updatepanel | accordion | modalpopupextender | null | null | null | open | update panel not working in accordion
===
I'm having troubles with my ajax accordion and my update panel. It worked a few days ago and I must've moved things around and now it's not working. I have a tabs control and within that, an ajax accordion that holds a gridview. Each time I select my gridview I'd like to have a modalpopup that indicates loading. Mine is not showing though. :( It's loading the page correctly, but just not showing the modalpopup.
Below is my aspx code:
<ajaxToolkit:TabPanel runat="server" ID="TabPanel2" HeaderText="Qualifications">
<ContentTemplate>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
<div style="display: none" id="divBlock">
<img alt="" src="Images/LoadingScript.gif"/>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<ajaxToolkit:ModalPopupExtender ID="ModalProgress" runat="server" TargetControlID="UpdateProgress1" BackgroundCssClass="modalBackground" PopupControlID="UpdateProgress1" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
<ContentTemplate>
....Gidview events.....
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
C# Code:
protected void GridQualifications_SelectedIndexChanged(object sender, EventArgs e)
{
if (IsPostBack)
{
//Gridview events which work
ModalProgress.Show();
System.Threading.Thread.Sleep(1000);
}
}
Could it be because I have two content templates nested within each other? Is it possible to have an update panel within an accordion? Please help, anyone.
Many thanks! | 0 |
11,734,387 | 07/31/2012 06:31:58 | 967,638 | 09/27/2011 17:51:12 | 88 | 13 | Database index creation Vs User creating indexes for a table | I have a mysql database. When I enter the data in a table[T_ID, T_Name, T_AGE] (say around 10k rows.) Will the database implicitly create indexes for this table. If so, then what will happen if I create index my-self using "Create Index .. ON say T_ID". Will both the indexes exists or which one will actually be present. | mysql | oracle | indexes | null | null | null | open | Database index creation Vs User creating indexes for a table
===
I have a mysql database. When I enter the data in a table[T_ID, T_Name, T_AGE] (say around 10k rows.) Will the database implicitly create indexes for this table. If so, then what will happen if I create index my-self using "Create Index .. ON say T_ID". Will both the indexes exists or which one will actually be present. | 0 |
11,734,392 | 07/31/2012 06:32:44 | 1,493,155 | 06/30/2012 14:54:08 | 87 | 1 | Google Maps API - clear markers,polylines before load new data from ajax | I load the markers and polylines from a ajax page , each request data shown on index page , now I want to clear data *(markers,polylines,...)* before get new data from ajaxPage
***Index Page:***
var gmarkers = [];
var map = null;
function initialize() {
var myOptions = {
zoom: 15,
center: new google.maps.LatLng(27.332702, 53.177137),
// mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
google.maps.event.addListener(map, 'click', function() {
infowindow.close();
});
}
var infowindow = new google.maps.InfoWindow(
{
size: new google.maps.Size(150,50)
});
function myclick(i) {
google.maps.event.trigger(gmarkers[i], "click");
}
function createMarker(latlng, name, html) {
var contentString = html;
var marker = new google.maps.Marker({
position: latlng,
map: map,
zIndex: Math.round(latlng.lat()*-100000)<<5
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(contentString);
infowindow.open(map,marker);
});
// save the info we need to use later for the side_bar
gmarkers.push(marker);
}
***Ajax Page:***
var polylines = [];
var beaches = [
['Bondi Beach',10,15, 4],
['Coogee Beach',11,16, 5],
['Cronulla Beach',13,15, 3],
['Manly Beach',13,17, 2],
['Maroubra Beach',12,10, 1]
];
for (var i = 0; i < beaches.length; i++) {
var beach = beaches[i];
var myLatLng = new google.maps.LatLng(beach[1], beach[2]);
// var polylines = new google.maps.LatLng(beach[1], beach[2]);
polylines.push(new google.maps.LatLng(beach[1], beach[2]));
var marker = createMarker(myLatLng,"This place",beach[0])
}
var routes = new google.maps.Polyline({
path: polylines,
strokeColor: "#FF0000",
strokeOpacity: 0.6,
strokeWeight: 4
});
routes.setMap(map);
***Question:*** simple way to clear polylines , markers and etc before load new data from `ajax page` ? | javascript | google-maps | google-maps-api-3 | null | null | null | open | Google Maps API - clear markers,polylines before load new data from ajax
===
I load the markers and polylines from a ajax page , each request data shown on index page , now I want to clear data *(markers,polylines,...)* before get new data from ajaxPage
***Index Page:***
var gmarkers = [];
var map = null;
function initialize() {
var myOptions = {
zoom: 15,
center: new google.maps.LatLng(27.332702, 53.177137),
// mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
google.maps.event.addListener(map, 'click', function() {
infowindow.close();
});
}
var infowindow = new google.maps.InfoWindow(
{
size: new google.maps.Size(150,50)
});
function myclick(i) {
google.maps.event.trigger(gmarkers[i], "click");
}
function createMarker(latlng, name, html) {
var contentString = html;
var marker = new google.maps.Marker({
position: latlng,
map: map,
zIndex: Math.round(latlng.lat()*-100000)<<5
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(contentString);
infowindow.open(map,marker);
});
// save the info we need to use later for the side_bar
gmarkers.push(marker);
}
***Ajax Page:***
var polylines = [];
var beaches = [
['Bondi Beach',10,15, 4],
['Coogee Beach',11,16, 5],
['Cronulla Beach',13,15, 3],
['Manly Beach',13,17, 2],
['Maroubra Beach',12,10, 1]
];
for (var i = 0; i < beaches.length; i++) {
var beach = beaches[i];
var myLatLng = new google.maps.LatLng(beach[1], beach[2]);
// var polylines = new google.maps.LatLng(beach[1], beach[2]);
polylines.push(new google.maps.LatLng(beach[1], beach[2]));
var marker = createMarker(myLatLng,"This place",beach[0])
}
var routes = new google.maps.Polyline({
path: polylines,
strokeColor: "#FF0000",
strokeOpacity: 0.6,
strokeWeight: 4
});
routes.setMap(map);
***Question:*** simple way to clear polylines , markers and etc before load new data from `ajax page` ? | 0 |
11,734,395 | 07/31/2012 06:32:49 | 530,634 | 12/04/2010 18:17:55 | 978 | 39 | Accessing the immediately previous result at the Sqlite3 and Psql prompts | Some interactive shells have a built-in variable that always points to the results of the previous command (for example in the python3 shell this variable is "_").
Does any such variable exist in the Sqlite3 and Psql prompts? | sqlite | postgresql | null | null | null | null | open | Accessing the immediately previous result at the Sqlite3 and Psql prompts
===
Some interactive shells have a built-in variable that always points to the results of the previous command (for example in the python3 shell this variable is "_").
Does any such variable exist in the Sqlite3 and Psql prompts? | 0 |
11,734,398 | 07/31/2012 06:32:55 | 1,147,080 | 01/13/2012 06:25:15 | 17 | 0 | Getting email client does not support HTML messages for Email through Java | I am sending email using **apache-commons-logging.jar**. I am able to send html email successfully, but few people are getting **Your email client does not support HTML messages** message in their mail. The following is the code sample -
HtmlEmail htmlEmail = new HtmlEmail();
htmlEmail.setHostName("localhost");
htmlEmail.addTo(email, "[email protected]");
htmlEmail.setFrom("[email protected]", "Demo2");
htmlEmail.setSubject("Subject Line");
String msg = "<html>Hi Demo1,";
msg += "<br><br> A very warm Welcome";
msg += "</html>";
htmlEmail.setHtmlMsg(msg);
// set the alternative message
htmlEmail.setTextMsg("Your email client does not support HTML messages");
// send the email
htmlEmail.send();
I am not understanding how to resolve this problem.
Please Gurus help me.
Thanks in advance. | java | email | apache-commons-logging | null | null | null | open | Getting email client does not support HTML messages for Email through Java
===
I am sending email using **apache-commons-logging.jar**. I am able to send html email successfully, but few people are getting **Your email client does not support HTML messages** message in their mail. The following is the code sample -
HtmlEmail htmlEmail = new HtmlEmail();
htmlEmail.setHostName("localhost");
htmlEmail.addTo(email, "[email protected]");
htmlEmail.setFrom("[email protected]", "Demo2");
htmlEmail.setSubject("Subject Line");
String msg = "<html>Hi Demo1,";
msg += "<br><br> A very warm Welcome";
msg += "</html>";
htmlEmail.setHtmlMsg(msg);
// set the alternative message
htmlEmail.setTextMsg("Your email client does not support HTML messages");
// send the email
htmlEmail.send();
I am not understanding how to resolve this problem.
Please Gurus help me.
Thanks in advance. | 0 |
11,734,399 | 07/31/2012 06:32:58 | 879,826 | 08/05/2011 03:53:06 | 183 | 4 | Objective-C: how to get 123 from 0.123 or generically xyz... from 0.xyz...? | As title states, if I have a float, I need to get the fraction part as an integer, how do I do it?
I was thinking:
1. get index(position) of decimal point
2. then I can know how many digits after decimal point
3. get those digits as substring
4. convert it to an integer
is there any better/smarter way? | iphone | objective-c | ios | fraction | null | null | open | Objective-C: how to get 123 from 0.123 or generically xyz... from 0.xyz...?
===
As title states, if I have a float, I need to get the fraction part as an integer, how do I do it?
I was thinking:
1. get index(position) of decimal point
2. then I can know how many digits after decimal point
3. get those digits as substring
4. convert it to an integer
is there any better/smarter way? | 0 |
11,734,405 | 07/31/2012 06:33:16 | 555,825 | 12/28/2010 09:21:10 | 352 | 3 | Probem using SenchaTouch 2 | I have just created the default sample app using Sencha Touch 2 by the command "sencha app create FirstApp D:/Sencha/MyFirstApp all"
I tried running the index.html but it keeps showing only the progress bar in my chrome and not the default page. What could be wrong?
| mobile | sencha | sencha-touch-2 | null | null | null | open | Probem using SenchaTouch 2
===
I have just created the default sample app using Sencha Touch 2 by the command "sencha app create FirstApp D:/Sencha/MyFirstApp all"
I tried running the index.html but it keeps showing only the progress bar in my chrome and not the default page. What could be wrong?
| 0 |
11,734,410 | 07/31/2012 06:33:35 | 1,233,802 | 02/26/2012 12:50:40 | 11 | 2 | Adding reference to a DLL doesnt copy all the dependent DLLs in the bin folder in Visual Studio | I have following scenario, Project A is refering A1 and A2 DLLs. Proj A is an library project, containing some common Data releted functionality, which can be used across all the application. Project B in solution X and the Project C in solution Y are dependent on Project A for using its Data related functionality. Now I have following options.
Option 1:
Add project A in Both the solutions X and Y and let the projects B and C in the respective solutions add project A as an "project Reference", this will copy A.dll, A1.dll and A2.dll in the bin folder of project B and C automatically.
Pros:
1. If I change anything in Proj A, it will get reflected automatically in Proj B and C.
2. As I mentioned, it will copy not only A.dll but A1.dll and A2.dll in the bin folder of Proj B and Proj C.
Cons:
1. If i change the location of Proj A, then i need to fix this in Both the solution and need to build all the solutions which are using Proj A as an project Reference.
Option 2:
Create a seperate central solution which include all the common library project. Create a project CommonLib add to that all the library projects as an project Reference, so that the CommonLib is referencing Proj A as an project reference. This will copy A.dll , A1.dll and A2.dll in the bin folder of CommonLib project. Now project B and C in solution X and Y need to refer the A.dll from the bin folder of project CommonLib.
Pros:
1. Change in location of proj A will not impact fixing Sol X and Y, as you need to fix at only one single place that is the CommnLib solution.
Cons:
1. If you refer A.dll from the commonlib bin folder, in the proj B, then it does not automatically copy A1.dll and A2.dll in the bin folder of proj B. So you never come to know what are all DLLs proj A is dependent on.
Why doesnt when i refer A.dll from the bin folder of CommonLib project, doesnt include A1.dll and A2.dll ? Any solution for this.
[Note: I dont want to use GAC] | assembly | null | null | null | null | null | open | Adding reference to a DLL doesnt copy all the dependent DLLs in the bin folder in Visual Studio
===
I have following scenario, Project A is refering A1 and A2 DLLs. Proj A is an library project, containing some common Data releted functionality, which can be used across all the application. Project B in solution X and the Project C in solution Y are dependent on Project A for using its Data related functionality. Now I have following options.
Option 1:
Add project A in Both the solutions X and Y and let the projects B and C in the respective solutions add project A as an "project Reference", this will copy A.dll, A1.dll and A2.dll in the bin folder of project B and C automatically.
Pros:
1. If I change anything in Proj A, it will get reflected automatically in Proj B and C.
2. As I mentioned, it will copy not only A.dll but A1.dll and A2.dll in the bin folder of Proj B and Proj C.
Cons:
1. If i change the location of Proj A, then i need to fix this in Both the solution and need to build all the solutions which are using Proj A as an project Reference.
Option 2:
Create a seperate central solution which include all the common library project. Create a project CommonLib add to that all the library projects as an project Reference, so that the CommonLib is referencing Proj A as an project reference. This will copy A.dll , A1.dll and A2.dll in the bin folder of CommonLib project. Now project B and C in solution X and Y need to refer the A.dll from the bin folder of project CommonLib.
Pros:
1. Change in location of proj A will not impact fixing Sol X and Y, as you need to fix at only one single place that is the CommnLib solution.
Cons:
1. If you refer A.dll from the commonlib bin folder, in the proj B, then it does not automatically copy A1.dll and A2.dll in the bin folder of proj B. So you never come to know what are all DLLs proj A is dependent on.
Why doesnt when i refer A.dll from the bin folder of CommonLib project, doesnt include A1.dll and A2.dll ? Any solution for this.
[Note: I dont want to use GAC] | 0 |
11,734,413 | 07/31/2012 06:33:42 | 554,217 | 12/26/2010 09:29:16 | 1,284 | 7 | server error, apache . Cant trace it | I think my problem is cause by excessive execution time.
I looked in the apaches error log. But I found nothing:
C:\Program Files\Zend\Apache2\logs\error.txt
I also looked at other places to change the execution time. (in php.ini):
Here:
C:\Program Files\Zend\phpMyAdmin\config.inc.php
Changed this to 0 (so it will be unlimited).
$cfg['ExecTimeLimit']=0;
And in php.ini:
changed to:
max_execution_time = 3000
But I am not even sure that it is that kind of error..cause I see no error.. I am sure it is some server timeout..
Where do I see the error.. and how do I extend the execution time error? | php | apache | null | null | null | 07/31/2012 13:51:43 | off topic | server error, apache . Cant trace it
===
I think my problem is cause by excessive execution time.
I looked in the apaches error log. But I found nothing:
C:\Program Files\Zend\Apache2\logs\error.txt
I also looked at other places to change the execution time. (in php.ini):
Here:
C:\Program Files\Zend\phpMyAdmin\config.inc.php
Changed this to 0 (so it will be unlimited).
$cfg['ExecTimeLimit']=0;
And in php.ini:
changed to:
max_execution_time = 3000
But I am not even sure that it is that kind of error..cause I see no error.. I am sure it is some server timeout..
Where do I see the error.. and how do I extend the execution time error? | 2 |
11,499,865 | 07/16/2012 07:30:27 | 1,500,536 | 07/04/2012 04:51:34 | 14 | 0 | use slider captcha(Qaptchav4.1) in .net | i download qaptchav4.1 it has samples for php but my project produced by c# language. i wanna use this plug in .Can anyone help me to change this plugin until be usable in .net?
its jquerycode
jQuery.QapTcha = {
build : function(options)
{
var defaults = {
txtLock : 'Locked : form can\'t be submited',
txtUnlock : 'Unlocked : form can be submited',
disabledSubmit : true,
autoRevert : true,
PHPfile : 'php/Qaptcha.jquery.php',
autoSubmit : false
};
if(this.length>0)
return jQuery(this).each(function(i) {
/** Vars **/
var
opts = $.extend(defaults, options),
$this = $(this),
form = $('form').has($this),
Clr = jQuery('<div>',{'class':'clr'}),
bgSlider = jQuery('<div>',{'class':'bgSlider'}),
Slider = jQuery('<div>',{'class':'Slider'}),
TxtStatus = jQuery('<div>',{'class':' TxtStatus dropError',text:opts.txtLock}),
inputQapTcha = jQuery('<input>',{name:generatePass(32),value:generatePass(7),type:'hidden'});
/** Disabled submit button **/
if(opts.disabledSubmit) form.find('input[type=\'submit\']').attr('disabled','disabled');
/** Construct DOM **/
bgSlider.appendTo($this);
Clr.insertAfter(bgSlider);
TxtStatus.insertAfter(Clr);
inputQapTcha.appendTo($this);
Slider.appendTo(bgSlider);
$this.show();
Slider.draggable({
revert: function(){
if(opts.autoRevert)
{
if(parseInt(Slider.css("left")) > 150) return false;
else return true;
}
},
containment: bgSlider,
axis:'x',
stop: function(event,ui){
if(ui.position.left > 150)
{
// set the SESSION iQaptcha in PHP file
$.post(opts.PHPfile,{
action : 'qaptcha',
qaptcha_key : inputQapTcha.attr('name')
},
function(data) {
if(!data.error)
{
Slider.draggable('disable').css('cursor','default');
inputQapTcha.val('');
TxtStatus.text(opts.txtUnlock).addClass('dropSuccess').removeClass('dropError');
form.find('input[type=\'submit\']').removeAttr('disabled');
if(opts.autoSubmit) form.find('input[type=\'submit\']').trigger('click');
}
},'json');
}
}
});
function generatePass(nb) {
var chars = 'azertyupqsdfghjkmwxcvbn23456789AZERTYUPQSDFGHJKMWXCVBN_-#@';
var pass = '';
for(i=0;i<nb;i++){
var wpos = Math.round(Math.random()*chars.length);
pass += chars.substring(wpos,wpos+1);
}
return pass;
}
});
}
}; jQuery.fn.QapTcha = jQuery.QapTcha.build;
and its code to use in php
if(isset($_POST['iQapTcha']) && empty($_POST['iQapTcha']) && isset($_SESSION['iQaptcha']) && $_SESSION['iQaptcha'])
{
// mail can be sent
}
else
{
// mail can not be sent
}
thanks | c# | jquery | asp.net | jquery-ui | jquery-plugins | null | open | use slider captcha(Qaptchav4.1) in .net
===
i download qaptchav4.1 it has samples for php but my project produced by c# language. i wanna use this plug in .Can anyone help me to change this plugin until be usable in .net?
its jquerycode
jQuery.QapTcha = {
build : function(options)
{
var defaults = {
txtLock : 'Locked : form can\'t be submited',
txtUnlock : 'Unlocked : form can be submited',
disabledSubmit : true,
autoRevert : true,
PHPfile : 'php/Qaptcha.jquery.php',
autoSubmit : false
};
if(this.length>0)
return jQuery(this).each(function(i) {
/** Vars **/
var
opts = $.extend(defaults, options),
$this = $(this),
form = $('form').has($this),
Clr = jQuery('<div>',{'class':'clr'}),
bgSlider = jQuery('<div>',{'class':'bgSlider'}),
Slider = jQuery('<div>',{'class':'Slider'}),
TxtStatus = jQuery('<div>',{'class':' TxtStatus dropError',text:opts.txtLock}),
inputQapTcha = jQuery('<input>',{name:generatePass(32),value:generatePass(7),type:'hidden'});
/** Disabled submit button **/
if(opts.disabledSubmit) form.find('input[type=\'submit\']').attr('disabled','disabled');
/** Construct DOM **/
bgSlider.appendTo($this);
Clr.insertAfter(bgSlider);
TxtStatus.insertAfter(Clr);
inputQapTcha.appendTo($this);
Slider.appendTo(bgSlider);
$this.show();
Slider.draggable({
revert: function(){
if(opts.autoRevert)
{
if(parseInt(Slider.css("left")) > 150) return false;
else return true;
}
},
containment: bgSlider,
axis:'x',
stop: function(event,ui){
if(ui.position.left > 150)
{
// set the SESSION iQaptcha in PHP file
$.post(opts.PHPfile,{
action : 'qaptcha',
qaptcha_key : inputQapTcha.attr('name')
},
function(data) {
if(!data.error)
{
Slider.draggable('disable').css('cursor','default');
inputQapTcha.val('');
TxtStatus.text(opts.txtUnlock).addClass('dropSuccess').removeClass('dropError');
form.find('input[type=\'submit\']').removeAttr('disabled');
if(opts.autoSubmit) form.find('input[type=\'submit\']').trigger('click');
}
},'json');
}
}
});
function generatePass(nb) {
var chars = 'azertyupqsdfghjkmwxcvbn23456789AZERTYUPQSDFGHJKMWXCVBN_-#@';
var pass = '';
for(i=0;i<nb;i++){
var wpos = Math.round(Math.random()*chars.length);
pass += chars.substring(wpos,wpos+1);
}
return pass;
}
});
}
}; jQuery.fn.QapTcha = jQuery.QapTcha.build;
and its code to use in php
if(isset($_POST['iQapTcha']) && empty($_POST['iQapTcha']) && isset($_SESSION['iQaptcha']) && $_SESSION['iQaptcha'])
{
// mail can be sent
}
else
{
// mail can not be sent
}
thanks | 0 |
11,499,872 | 07/16/2012 07:30:42 | 28,841 | 10/17/2008 08:28:10 | 2,622 | 119 | Dividing large image for parallel processing | Let's say I have a very large bitmap and it should be divided into smaller chunks for parallel processing. But in some cases edge pixels from neighboring area should be taken account. Should I simply add some overlap/padding or is there something else to do? | image-processing | parallel-processing | null | null | null | null | open | Dividing large image for parallel processing
===
Let's say I have a very large bitmap and it should be divided into smaller chunks for parallel processing. But in some cases edge pixels from neighboring area should be taken account. Should I simply add some overlap/padding or is there something else to do? | 0 |
11,499,874 | 07/16/2012 07:31:03 | 1,345,862 | 04/20/2012 07:06:28 | 1 | 0 | How do I prevent a UIIMageView from going over another UIImageView? | for a game I'm making, i need to set an area for a moveable UIImageView not to pass through.
There's a ball which can be moved using the accelerometer, basically, i want it to not be able to go past a wall. Does anyone know some code on how to do this?
Thanks | iphone | xcode | uiimageview | accelerometer | null | null | open | How do I prevent a UIIMageView from going over another UIImageView?
===
for a game I'm making, i need to set an area for a moveable UIImageView not to pass through.
There's a ball which can be moved using the accelerometer, basically, i want it to not be able to go past a wall. Does anyone know some code on how to do this?
Thanks | 0 |
11,499,877 | 07/16/2012 07:31:42 | 95,876 | 04/25/2009 07:02:57 | 624 | 1 | Hive hql : aggregating into MAP datatype | I have a table called graph_table with 2 columns
node INT
neighbour INT
I need to run the following select query
SELECT node, aggregater_func( neighbour ) as neighbourhood FROM graph_table GROUP BY node
aggregater_func aggregates neighbours into a `MAP <INT(neighbour), INT(count)>`
What should be this aggregater_func ? | sql | hadoop | hive | null | null | null | open | Hive hql : aggregating into MAP datatype
===
I have a table called graph_table with 2 columns
node INT
neighbour INT
I need to run the following select query
SELECT node, aggregater_func( neighbour ) as neighbourhood FROM graph_table GROUP BY node
aggregater_func aggregates neighbours into a `MAP <INT(neighbour), INT(count)>`
What should be this aggregater_func ? | 0 |
11,499,878 | 07/16/2012 07:31:44 | 656,718 | 03/12/2011 15:59:29 | 6 | 0 | Force scrolling/bouncing edge effect HorizontalScrollView | I would like to allow my HorizontalScrollView to be scrollable even if it doesn't have enough items. If I have say like 5 images on my ScrollView it scrolls. But when I only have 3 it doesn't. Any ideas? Thanks. | android | horizontalscrollview | null | null | null | null | open | Force scrolling/bouncing edge effect HorizontalScrollView
===
I would like to allow my HorizontalScrollView to be scrollable even if it doesn't have enough items. If I have say like 5 images on my ScrollView it scrolls. But when I only have 3 it doesn't. Any ideas? Thanks. | 0 |
11,499,880 | 07/16/2012 07:31:51 | 972,657 | 09/30/2011 07:43:42 | 105 | 0 | match special characters from input to stored in database | I saved some German characters on the database by entity (eg. **föo** => **`föo`**).
Now I have a query that search for a match just using `LIKE %search_word%`. The `search_word` will probably be an input containing special German characters. Can you suggest of the most efficient way to compare my `search_word` to the one stored in the database?
Huge thanks. | php | mysql | diacritics | null | null | null | open | match special characters from input to stored in database
===
I saved some German characters on the database by entity (eg. **föo** => **`föo`**).
Now I have a query that search for a match just using `LIKE %search_word%`. The `search_word` will probably be an input containing special German characters. Can you suggest of the most efficient way to compare my `search_word` to the one stored in the database?
Huge thanks. | 0 |
11,499,881 | 07/16/2012 07:31:52 | 1,410,263 | 05/22/2012 12:56:43 | 3 | 0 | Zend or HTML: how to change default file name on save | I have a link to an image:
http://example.com/img/34-green-tree/0
When user save the file the default name is "0.jpg". Is it possible to change it? For example to 34-green-tree.jpg or something else?
| image | save | name | null | null | null | open | Zend or HTML: how to change default file name on save
===
I have a link to an image:
http://example.com/img/34-green-tree/0
When user save the file the default name is "0.jpg". Is it possible to change it? For example to 34-green-tree.jpg or something else?
| 0 |
11,499,882 | 07/16/2012 07:31:54 | 1,513,547 | 07/10/2012 03:03:20 | 1 | 0 | Android in Local Network without internet connection | I am new to network programming. I intent to create a multiplayer game that multiple android devices connect to a local network without connecting to the internet.
I plan using my laptop as my server, as my laptop can act as a wifi-hotspot , I get this idea from LAN Games.
I have completely no idea on how to start, ie. how to connect android device to my pc? how to create socket in my android phone (what ip address should i be using to access to the server in my laptop? static ip address found in wifi-network i created in my laptop)? how to handle ports if more than one devices is conencted to my laptop? using multicast sockets? (I know nothing about multicast sockets)
i really wish someone out there help me by giving some code examples and explanations..
by the way, if i am using local network without internet connections, do i need to add the INTERNET permissions in the android manifests?
thanks. | android | sockets | network-programming | null | null | null | open | Android in Local Network without internet connection
===
I am new to network programming. I intent to create a multiplayer game that multiple android devices connect to a local network without connecting to the internet.
I plan using my laptop as my server, as my laptop can act as a wifi-hotspot , I get this idea from LAN Games.
I have completely no idea on how to start, ie. how to connect android device to my pc? how to create socket in my android phone (what ip address should i be using to access to the server in my laptop? static ip address found in wifi-network i created in my laptop)? how to handle ports if more than one devices is conencted to my laptop? using multicast sockets? (I know nothing about multicast sockets)
i really wish someone out there help me by giving some code examples and explanations..
by the way, if i am using local network without internet connections, do i need to add the INTERNET permissions in the android manifests?
thanks. | 0 |
11,499,884 | 07/16/2012 07:32:12 | 1,278,654 | 03/19/2012 13:31:18 | 87 | 3 | Tabpanel child remove wont work in Bootstrap GWT | While Using Bootstrap for GWT, i tried to remove a tab(Child) from TabPanel(Parent) with remove function and it doesnt work.
Also i tried with TabPanel ->TabLink->TabPane combo too which doesnt help though
<b:TabPanel tabPosition="left" ui:field="tabPanel">
<b:Tab ui:field="tabA" heading="tabA"></b:Tab>
<b:Tab ui:field="tabB" heading="tabB"></b:Tab>
<b:Tab ui:field="tabC" heading="tabC"></b:Tab>
</b:TabPanel>
tabPanel.remove(tabA);//doesnt work
Any Idea? | gwt | bootstrap | null | null | null | null | open | Tabpanel child remove wont work in Bootstrap GWT
===
While Using Bootstrap for GWT, i tried to remove a tab(Child) from TabPanel(Parent) with remove function and it doesnt work.
Also i tried with TabPanel ->TabLink->TabPane combo too which doesnt help though
<b:TabPanel tabPosition="left" ui:field="tabPanel">
<b:Tab ui:field="tabA" heading="tabA"></b:Tab>
<b:Tab ui:field="tabB" heading="tabB"></b:Tab>
<b:Tab ui:field="tabC" heading="tabC"></b:Tab>
</b:TabPanel>
tabPanel.remove(tabA);//doesnt work
Any Idea? | 0 |
11,499,886 | 07/16/2012 07:32:21 | 1,449,113 | 06/11/2012 14:07:18 | 1 | 0 | TeamCity build fails for a RIA services project | I am using RIA services in one of the projects in my solution, which builds perfectly fine on any dev machine. I've also checked the build order, which too looks fine.
I also have a 64 bit, Windows 7 Server where I have installed TeamCity 7.0.3. The same solution fails to build when I run the build agent, and this is an entry from the build log file -
[CreateRiaClientFilesTask] C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v5.0\Microsoft.Ria.Client.targets(303, 5): The 'xxx.csproj' project must be built before client proxy classes can be generated.
However, the client proxy classes are also generated. I can't understand where is the issue. I've tried using MSBuild and VS sln as "Runner Type" in the build step. | wcf-ria-services | teamcity-7.0 | null | null | null | null | open | TeamCity build fails for a RIA services project
===
I am using RIA services in one of the projects in my solution, which builds perfectly fine on any dev machine. I've also checked the build order, which too looks fine.
I also have a 64 bit, Windows 7 Server where I have installed TeamCity 7.0.3. The same solution fails to build when I run the build agent, and this is an entry from the build log file -
[CreateRiaClientFilesTask] C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v5.0\Microsoft.Ria.Client.targets(303, 5): The 'xxx.csproj' project must be built before client proxy classes can be generated.
However, the client proxy classes are also generated. I can't understand where is the issue. I've tried using MSBuild and VS sln as "Runner Type" in the build step. | 0 |
11,499,869 | 07/16/2012 07:30:34 | 1,324,756 | 04/10/2012 18:03:42 | 374 | 15 | JavaScript does not work different domain? | My project is in two domain. When I open it from my localhost domain scripts are not working. For example in other domain 192.168.1.3/myProject, script are working, but in my localhost for example localhost:49416/myProject, scripts are not working. What could be the problem?
scripts and css refrences like this.Css works.
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.7.2.min.js")" type="text/javascript"></script>
Thanks. | javascript | asp.net-mvc | null | null | null | null | open | JavaScript does not work different domain?
===
My project is in two domain. When I open it from my localhost domain scripts are not working. For example in other domain 192.168.1.3/myProject, script are working, but in my localhost for example localhost:49416/myProject, scripts are not working. What could be the problem?
scripts and css refrences like this.Css works.
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.7.2.min.js")" type="text/javascript"></script>
Thanks. | 0 |
11,320,481 | 07/03/2012 23:12:26 | 992,765 | 10/13/2011 05:46:38 | 1,178 | 93 | Bat script exits unexpectale | I have the following bat script:
@echo off
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_32
set JRE_HOME=C:\Program Files\Java\jdk1.6.0_32\jre
set Path=%JAVA_HOME%\bin;%Path%
cd C:\project
mvn validate compile package db-migration:migrate -DskipTests
REM script exits here, the second line never been executed
java -jar target/compiled_tar.jar
The last line never been executed. The "mvn..." is successfully done, the compiled_tar.jar is created, the output is:
[INFO] BUILD SUCCESS
If I insert the PAUSE command between last and previous lines the PAUSE also never been occurred. Why? | maven | batch-file | null | null | null | null | open | Bat script exits unexpectale
===
I have the following bat script:
@echo off
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_32
set JRE_HOME=C:\Program Files\Java\jdk1.6.0_32\jre
set Path=%JAVA_HOME%\bin;%Path%
cd C:\project
mvn validate compile package db-migration:migrate -DskipTests
REM script exits here, the second line never been executed
java -jar target/compiled_tar.jar
The last line never been executed. The "mvn..." is successfully done, the compiled_tar.jar is created, the output is:
[INFO] BUILD SUCCESS
If I insert the PAUSE command between last and previous lines the PAUSE also never been occurred. Why? | 0 |
11,320,482 | 07/03/2012 23:12:28 | 1,500,154 | 07/03/2012 23:05:58 | 1 | 0 | How to configure Python env for Xcode 4? | I would like to configure my Xcode 4.3 environment to use Python with auto-complete. E.g. if I type import numpy Xcode would be able to complete numpy.
Thank you | python | xcode | autocomplete | null | null | null | open | How to configure Python env for Xcode 4?
===
I would like to configure my Xcode 4.3 environment to use Python with auto-complete. E.g. if I type import numpy Xcode would be able to complete numpy.
Thank you | 0 |
11,319,499 | 07/03/2012 21:31:20 | 258,483 | 01/25/2010 14:19:08 | 794 | 26 | Java bug? Why extra zero byte in utf8 encoding? | The following code
public class CharsetProblem {
public static void main(String[] args) {
//String str = "aaaaaaaaa";
String str = "aaaaaaaaaa";
Charset cs1 = Charset.forName("ASCII");
Charset cs2 = Charset.forName("utf8");
System.out.println(toHex(cs1.encode(str).array()));
System.out.println(toHex(cs2.encode(str).array()));
}
public static String toHex(byte[] outputBytes) {
StringBuilder builder = new StringBuilder();
for(int i=0; i<outputBytes.length; ++i) {
builder.append(String.format("%02x", outputBytes[i]));
}
return builder.toString();
}
}
returns
61616161616161616161
6161616161616161616100
i.e. utf8 encoding returns excess byte. If we take less a-s, then we'll have no excess bytes. If we take more a-s we can get more and more excess bytes.
Why?
How one can workaround this? | java | utf-8 | character-encoding | bugs | null | null | open | Java bug? Why extra zero byte in utf8 encoding?
===
The following code
public class CharsetProblem {
public static void main(String[] args) {
//String str = "aaaaaaaaa";
String str = "aaaaaaaaaa";
Charset cs1 = Charset.forName("ASCII");
Charset cs2 = Charset.forName("utf8");
System.out.println(toHex(cs1.encode(str).array()));
System.out.println(toHex(cs2.encode(str).array()));
}
public static String toHex(byte[] outputBytes) {
StringBuilder builder = new StringBuilder();
for(int i=0; i<outputBytes.length; ++i) {
builder.append(String.format("%02x", outputBytes[i]));
}
return builder.toString();
}
}
returns
61616161616161616161
6161616161616161616100
i.e. utf8 encoding returns excess byte. If we take less a-s, then we'll have no excess bytes. If we take more a-s we can get more and more excess bytes.
Why?
How one can workaround this? | 0 |
11,320,437 | 07/03/2012 23:07:59 | 969,986 | 09/28/2011 21:22:48 | 15 | 0 | Matlab, Class, Can not change instance's attributrs | I declare a class in matlab and here is the constructor and a function.
function Ri = RGBimages(datadir)
if(isempty(dir(datadir)))
warning([datadir, ' is empty']);
return;
end
Ri.dataSrc=datadir;
Ri.twoEnds = load([datadir,'\seIndex.txt']);
Ri.startFrame = Ri.twoEnds(1);
Ri.endFrame = Ri.twoEnds(2);
Ri.numberOfFrames=Ri.twoEnds(2)-Ri.twoEnds(1)+1;
Ri.faceLmks = zeros(68,2,Ri.numberOfFrames);
end
function obtainFaceLmks(Ri)
indx=1;
for i = Ri.startFrame;%:Ri.endFrame
imstr = [Ri.dataSrc,'\rgb_',num2str(i),'.png'];
[status,result] = system(['fitD -m src\my.amf -h src\haarcascade_frontalface_alt2.xml -i ',imstr,' -n 30']);
if(status==-1)
warning(result);
else
temp=flHelper(result(1:size(result,2)-59));
Ri.faceLmks(:,:,indx)=temp;
end
indx=indx+1;
end
return;
end
then I do this:
ims = RGBimages('data\a01_s01_e01');
ims.obtainFaceLmks();
and it seems ims's attributes (ims.faceLmks) didn't change, why?
Thanks for anyhelp | oop | class | matlab | null | null | null | open | Matlab, Class, Can not change instance's attributrs
===
I declare a class in matlab and here is the constructor and a function.
function Ri = RGBimages(datadir)
if(isempty(dir(datadir)))
warning([datadir, ' is empty']);
return;
end
Ri.dataSrc=datadir;
Ri.twoEnds = load([datadir,'\seIndex.txt']);
Ri.startFrame = Ri.twoEnds(1);
Ri.endFrame = Ri.twoEnds(2);
Ri.numberOfFrames=Ri.twoEnds(2)-Ri.twoEnds(1)+1;
Ri.faceLmks = zeros(68,2,Ri.numberOfFrames);
end
function obtainFaceLmks(Ri)
indx=1;
for i = Ri.startFrame;%:Ri.endFrame
imstr = [Ri.dataSrc,'\rgb_',num2str(i),'.png'];
[status,result] = system(['fitD -m src\my.amf -h src\haarcascade_frontalface_alt2.xml -i ',imstr,' -n 30']);
if(status==-1)
warning(result);
else
temp=flHelper(result(1:size(result,2)-59));
Ri.faceLmks(:,:,indx)=temp;
end
indx=indx+1;
end
return;
end
then I do this:
ims = RGBimages('data\a01_s01_e01');
ims.obtainFaceLmks();
and it seems ims's attributes (ims.faceLmks) didn't change, why?
Thanks for anyhelp | 0 |
11,320,483 | 07/03/2012 23:13:25 | 1,345,058 | 04/19/2012 20:35:01 | 93 | 3 | Login integration test with rspec/devise | I'm having troubles making an integration test, for the user login in my rails application, pass.
Here is my code :
requests/authentications_spec.rb
describe 'log in' do
before { visit root_path }
subject { page }
describe 'should be able to log in' do
before do
user = FactoryGirl.create(:user)
fill_in :user_email, with: user.email
fill_in :user_password, with: user.password
click_on 'Log in'
end
it { should have_link 'Log out' }
end
end
factories/user_factory.rb
FactoryGirl.define do
factory :user do
sequence( :first_name ) { |n| "FirstName#{n}" }
sequence( :last_name ) { |n| "LastName#{n}" }
sequence( :email ) { |n| "foo#{n}@example.com" }
password 'foobar'
password_confirmation 'foobar'
created_at Time.now
updated_at Time.now
end
end
_login_form.html.erb,
This form is rendered in the application layout header.
<%= form_for(resource, as: resource_name, url: session_path(resource_name), html: { id: 'login-mini-form' }) do |f| %>
<%= f.email_field :email, placeholder: 'Your email' %>
<%= f.password_field :password, placeholder: '******' %>
<%= f.submit "Log in", id: 'login-button' %>
<%- if devise_mapping.rememberable? -%>
<%= f.check_box :remember_me %> <%= f.label :remember_me %>
<%- end -%>
<% end %>
In the layout I have something like that :
if user_signed_in?
render 'devise/menu/logout_button'
else
render 'devise/menu/login_form'
end
The test is giving me `expected link 'Log out' to return something`.
I don't get why my test is not passing. Any ideas ?
Thanks a lot ! | ruby-on-rails | ruby-on-rails-3 | rspec | devise | null | null | open | Login integration test with rspec/devise
===
I'm having troubles making an integration test, for the user login in my rails application, pass.
Here is my code :
requests/authentications_spec.rb
describe 'log in' do
before { visit root_path }
subject { page }
describe 'should be able to log in' do
before do
user = FactoryGirl.create(:user)
fill_in :user_email, with: user.email
fill_in :user_password, with: user.password
click_on 'Log in'
end
it { should have_link 'Log out' }
end
end
factories/user_factory.rb
FactoryGirl.define do
factory :user do
sequence( :first_name ) { |n| "FirstName#{n}" }
sequence( :last_name ) { |n| "LastName#{n}" }
sequence( :email ) { |n| "foo#{n}@example.com" }
password 'foobar'
password_confirmation 'foobar'
created_at Time.now
updated_at Time.now
end
end
_login_form.html.erb,
This form is rendered in the application layout header.
<%= form_for(resource, as: resource_name, url: session_path(resource_name), html: { id: 'login-mini-form' }) do |f| %>
<%= f.email_field :email, placeholder: 'Your email' %>
<%= f.password_field :password, placeholder: '******' %>
<%= f.submit "Log in", id: 'login-button' %>
<%- if devise_mapping.rememberable? -%>
<%= f.check_box :remember_me %> <%= f.label :remember_me %>
<%- end -%>
<% end %>
In the layout I have something like that :
if user_signed_in?
render 'devise/menu/logout_button'
else
render 'devise/menu/login_form'
end
The test is giving me `expected link 'Log out' to return something`.
I don't get why my test is not passing. Any ideas ?
Thanks a lot ! | 0 |
11,320,408 | 07/03/2012 23:04:50 | 1,500,147 | 07/03/2012 23:00:48 | 1 | 0 | Generate keyword automaticly from post titles | For example I have title "The Battleship Trailer"
so it will generate keyword like this
"best , player, of, the, world"
how can i do it ?
I want to apear in html like this...
First:The
Second:Battleship
Third:Trailer
<meta name="keywords" content="<FirstWord>,<second>,<third>"/>
More exactly i want to split the title in words.
I use Wordpress
| php | wordpress | split | title | null | null | open | Generate keyword automaticly from post titles
===
For example I have title "The Battleship Trailer"
so it will generate keyword like this
"best , player, of, the, world"
how can i do it ?
I want to apear in html like this...
First:The
Second:Battleship
Third:Trailer
<meta name="keywords" content="<FirstWord>,<second>,<third>"/>
More exactly i want to split the title in words.
I use Wordpress
| 0 |
11,650,685 | 07/25/2012 13:20:58 | 165,694 | 08/30/2009 19:53:00 | 707 | 7 | gridview paging is not working | I have a gridview control, however, when I click the page number, I get an error "Page not found". What am I missing here?
**My code is:**
<asp:GridView ID="gvEmployeeResults" Width="900px" CellSpacing="1"
CellPadding="2"
AutoGenerateColumns="false" OnRowDataBound="gvEmployeeResults_OnRowDataBound"
runat="server" AllowPaging="true" >
<Columns>
<asp:TemplateField HeaderText="Last Name, First Name" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="left">
<ItemTemplate>
<asp:LinkButton id="lbtnEmployeeName" OnCommand="EditEmployee_Command" CommandArgument='<%#Eval("EmployeeNum")%>' CommandName="EmployeeName" Visible="true" runat="server" ToolTip="Click to edit Employee."><%# DataBinder.Eval(Container.DataItem, "empLastName") + ", " + DataBinder.Eval(Container.DataItem, "empFirstName")%></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="empAddrLine1" ControlStyle-Width="225px" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="left" HeaderText="Address" />
<asp:BoundField DataField="empCity" ControlStyle-Width="120px" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="left" HeaderText="City" />
<asp:BoundField DataField="empState" ControlStyle-Width="50px" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="left" HeaderText="State" />
<asp:BoundField DataField="empPostalCode" ControlStyle-Width="100px" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="left" HeaderText="Zip" />
<asp:BoundField DataField="empDOB" ControlStyle-Width="100px" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="left" HeaderText="Date Of Birth" />
</Columns>
</asp:GridView>
protected void BindGridview()
{
corpEmployee.Employee emp = new corpEmployee.Employee();
emp.empLastName = tboxLastName.Text.Trim();
emp.empFirstName = tboxFirstName.Text.Trim();
emp.empDOB = tboxDateOfBirth.Text.Trim();
gvEmployeeResults.DataSource = corpEmployeeMgr.GetEmployees(emp);
gvEmployeeResults.DataBind();
}
protected void gvEmployeeResults_OnRowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.Cells[0].Text.Contains("nbsp;"))
{
e.Row.Cells[0].Text = e.Row.Cells[0].Text.Replace("<", "<").Replace(">", ">").Replace("&", "&");
}
}
else
{
return;
}
}
protected void gvEmployeeResults_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gvEmployeeResults.PageIndex = e.NewPageIndex;
gvEmployeeResults.DataBind();
}
| c# | asp.net | gridview | paging | null | null | open | gridview paging is not working
===
I have a gridview control, however, when I click the page number, I get an error "Page not found". What am I missing here?
**My code is:**
<asp:GridView ID="gvEmployeeResults" Width="900px" CellSpacing="1"
CellPadding="2"
AutoGenerateColumns="false" OnRowDataBound="gvEmployeeResults_OnRowDataBound"
runat="server" AllowPaging="true" >
<Columns>
<asp:TemplateField HeaderText="Last Name, First Name" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="left">
<ItemTemplate>
<asp:LinkButton id="lbtnEmployeeName" OnCommand="EditEmployee_Command" CommandArgument='<%#Eval("EmployeeNum")%>' CommandName="EmployeeName" Visible="true" runat="server" ToolTip="Click to edit Employee."><%# DataBinder.Eval(Container.DataItem, "empLastName") + ", " + DataBinder.Eval(Container.DataItem, "empFirstName")%></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="empAddrLine1" ControlStyle-Width="225px" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="left" HeaderText="Address" />
<asp:BoundField DataField="empCity" ControlStyle-Width="120px" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="left" HeaderText="City" />
<asp:BoundField DataField="empState" ControlStyle-Width="50px" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="left" HeaderText="State" />
<asp:BoundField DataField="empPostalCode" ControlStyle-Width="100px" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="left" HeaderText="Zip" />
<asp:BoundField DataField="empDOB" ControlStyle-Width="100px" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="left" HeaderText="Date Of Birth" />
</Columns>
</asp:GridView>
protected void BindGridview()
{
corpEmployee.Employee emp = new corpEmployee.Employee();
emp.empLastName = tboxLastName.Text.Trim();
emp.empFirstName = tboxFirstName.Text.Trim();
emp.empDOB = tboxDateOfBirth.Text.Trim();
gvEmployeeResults.DataSource = corpEmployeeMgr.GetEmployees(emp);
gvEmployeeResults.DataBind();
}
protected void gvEmployeeResults_OnRowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.Cells[0].Text.Contains("nbsp;"))
{
e.Row.Cells[0].Text = e.Row.Cells[0].Text.Replace("<", "<").Replace(">", ">").Replace("&", "&");
}
}
else
{
return;
}
}
protected void gvEmployeeResults_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gvEmployeeResults.PageIndex = e.NewPageIndex;
gvEmployeeResults.DataBind();
}
| 0 |
11,650,669 | 07/25/2012 13:20:16 | 1,167,015 | 01/24/2012 12:45:03 | 48 | 5 | VerificationController #warning Handle the error here | I have been working on integrating Apple's example code for In-App Purchase Receipt Validation on iOS into my app's codebase.
http://developer.apple.com/library/ios/#releasenotes/StoreKit/IAP_ReceiptValidation/_index.html
Does anyone know what to do with the two places in VerificationController.m that having the warning lines:
#warning Handle the error here.
as far as I can see the code is parsing some plist data or json data and turning it into a NSDictionary which then gets used to verify that the transaction info matches the receipt.
I don't know what needs to be done to properly handle the error.
| objective-c | ios | null | null | null | null | open | VerificationController #warning Handle the error here
===
I have been working on integrating Apple's example code for In-App Purchase Receipt Validation on iOS into my app's codebase.
http://developer.apple.com/library/ios/#releasenotes/StoreKit/IAP_ReceiptValidation/_index.html
Does anyone know what to do with the two places in VerificationController.m that having the warning lines:
#warning Handle the error here.
as far as I can see the code is parsing some plist data or json data and turning it into a NSDictionary which then gets used to verify that the transaction info matches the receipt.
I don't know what needs to be done to properly handle the error.
| 0 |
11,650,670 | 07/25/2012 13:20:19 | 1,551,720 | 07/25/2012 13:09:45 | 1 | 0 | how we add subtitle in link module in drupal 7 | i have article with author name. and i apply link on article with the use of link module. But i also show the author name of article with out link. how it is possible through link module . | drupal | null | null | null | null | 07/25/2012 14:46:23 | off topic | how we add subtitle in link module in drupal 7
===
i have article with author name. and i apply link on article with the use of link module. But i also show the author name of article with out link. how it is possible through link module . | 2 |
11,650,692 | 07/25/2012 13:21:40 | 82,368 | 03/25/2009 04:27:50 | 3,244 | 33 | How do I create a Stored Procedure if it doesn't exist in TSQL | I tried this
if object_id('a_proc22') is not null
CREATE PROCEDURE a_proc22 AS SELECT 1
go
but it gives me a syntax error.
But this seemed to compile.
if object_id('a_proc22') is not null
EXEC('CREATE PROCEDURE a_proc22 AS SELECT 1')
go
Why is the first one incorrect?
| sql | sql-server | sql-server-2008 | tsql | null | null | open | How do I create a Stored Procedure if it doesn't exist in TSQL
===
I tried this
if object_id('a_proc22') is not null
CREATE PROCEDURE a_proc22 AS SELECT 1
go
but it gives me a syntax error.
But this seemed to compile.
if object_id('a_proc22') is not null
EXEC('CREATE PROCEDURE a_proc22 AS SELECT 1')
go
Why is the first one incorrect?
| 0 |
11,650,695 | 07/25/2012 13:21:55 | 1,355,338 | 04/25/2012 05:39:10 | 6 | 0 | Do you know a way to convert CopyBook to XSD? | I'm trying to do it quicly with java - get CopyBook file,
and generate xsd from this CopyBook.
(I know there are some open source projects to create xml from cb,
but unfortunately, thay generate xml with items and lot of tags and attributes, and it's not XSD as
well, unfortunately)
Any help will be appreciated.
Thanks.
| xsd | copybook | null | null | null | null | open | Do you know a way to convert CopyBook to XSD?
===
I'm trying to do it quicly with java - get CopyBook file,
and generate xsd from this CopyBook.
(I know there are some open source projects to create xml from cb,
but unfortunately, thay generate xml with items and lot of tags and attributes, and it's not XSD as
well, unfortunately)
Any help will be appreciated.
Thanks.
| 0 |
11,646,653 | 07/25/2012 09:26:42 | 1,125,394 | 01/01/2012 20:49:24 | 607 | 13 | Android, unclickable link inside a jqmobile checkbox label | http://jsfiddle.net/ca11111/M7Bwc/7/ works on PC browsers, but on android, "link" isn't clickable for some reason
any idea, please? | android | jquery-mobile | checkbox | hyperlink | null | null | open | Android, unclickable link inside a jqmobile checkbox label
===
http://jsfiddle.net/ca11111/M7Bwc/7/ works on PC browsers, but on android, "link" isn't clickable for some reason
any idea, please? | 0 |
11,650,002 | 07/25/2012 12:43:36 | 1,551,603 | 07/25/2012 12:33:38 | 1 | 0 | Syntax error on tockens when filling constructor Java | my constructor is
public class Figure{
int[][] x;
Color y;
public Figure(int[][] x , Color y){
this.x=x;
this.y=y;
}
and i am intialize object in follwing way:
Figure s = new Figure({{0,1,1},{1,1,0}},Color.ORANGE);
genntign following error
Type mismach - cannot convert from int[][] to Fogure
Syntax error on tockens: misplaced construct
Variable declarator expected instead
| java | null | null | null | null | null | open | Syntax error on tockens when filling constructor Java
===
my constructor is
public class Figure{
int[][] x;
Color y;
public Figure(int[][] x , Color y){
this.x=x;
this.y=y;
}
and i am intialize object in follwing way:
Figure s = new Figure({{0,1,1},{1,1,0}},Color.ORANGE);
genntign following error
Type mismach - cannot convert from int[][] to Fogure
Syntax error on tockens: misplaced construct
Variable declarator expected instead
| 0 |
11,472,037 | 07/13/2012 14:02:42 | 1,161,405 | 01/20/2012 20:24:24 | 11 | 0 | Where is the extra margin/padding coming from? | **I have an extremely simple layout right now:**
<div class="spacer">
<h1>Finalizing Your Account </h1>
</div>
<div class="greycont60 greycont">
<div class="minispacer"><h5>Almost done! Just a few things left...</h5></div>
</div>
<div class="greycont40 greycont"></div>
<div style="clear:both;"></div>
**Here is the CSS:**
.minispacer {
background: #d9d9d9;
height:30px;
width: 300px;
padding-left:10px;
}
.greycont60 {
width: 56%;
float: left;
}
.greycont40 {
width: 36%;
float: right;
}
.spacer {
height:56px;
background:url(../images/bg2.png) repeat;
padding:0 10px;
margin-top:20px;
margin-bottom:10px;
}
.spacer h1 {
font-size:22px;
padding-top:4px;
color:#727272;
}
.greycont {
background-color:#e8e8e8;
padding:15px;
margin-bottom:10px;
}
Now here is how it turns out:
![enter image description here][1]
[1]: http://i.stack.imgur.com/pvahW.png
Why is their so much space about the MiniSpacer bar? I tried to add 1px of top padding and suddenly the bar was doing some crazy things... | html | margin | padding | float | null | null | open | Where is the extra margin/padding coming from?
===
**I have an extremely simple layout right now:**
<div class="spacer">
<h1>Finalizing Your Account </h1>
</div>
<div class="greycont60 greycont">
<div class="minispacer"><h5>Almost done! Just a few things left...</h5></div>
</div>
<div class="greycont40 greycont"></div>
<div style="clear:both;"></div>
**Here is the CSS:**
.minispacer {
background: #d9d9d9;
height:30px;
width: 300px;
padding-left:10px;
}
.greycont60 {
width: 56%;
float: left;
}
.greycont40 {
width: 36%;
float: right;
}
.spacer {
height:56px;
background:url(../images/bg2.png) repeat;
padding:0 10px;
margin-top:20px;
margin-bottom:10px;
}
.spacer h1 {
font-size:22px;
padding-top:4px;
color:#727272;
}
.greycont {
background-color:#e8e8e8;
padding:15px;
margin-bottom:10px;
}
Now here is how it turns out:
![enter image description here][1]
[1]: http://i.stack.imgur.com/pvahW.png
Why is their so much space about the MiniSpacer bar? I tried to add 1px of top padding and suddenly the bar was doing some crazy things... | 0 |
11,471,930 | 07/13/2012 13:55:16 | 1,169,096 | 01/25/2012 11:37:08 | 561 | 32 | how to wait for starting thread to have executed init code | i'm having trouble synchronizing a master thread to a recently started child thread.
what i want to do is:
- master thread creates a new child thread and blocks
- child thread starts and initializes (might take some time)
- once the child thread is initialized, the main thread continues (and the two threads run in parallel)
my first attempt was something like:
typedef struct threaddata_ {
int running;
} threaddata_t;
void*child_thread(void*arg) {
threaddata_t*x=(threaddata_t)arg;
/* ... INITIALIZE ... */
x->running=1; /* signal that we are running */
/* CHILD THREAD BODY */
return 0;
}
void start_thread(void) {
threaddata_t*x=(threaddata_t*)malloc(sizeof(threaddata_t));
x->running=0;
int result=pthread_create(&threadid, 0, child_thread, &running);
while(!x->running) usleep(100); /* wait till child is initialized */
/* MAIN THREAD BODY */
}
now i didn't like this at all, because it forces the main thread to sleep for probably a longer period than necessary.
so i did a 2nd attempt, using mutexes&conditions
typedef struct threaddata_ {
pthread_mutex_t x_mutex;
pthread_cond_t x_cond;
} threaddata_t;
void*child_thread(void*arg) {
threaddata_t*x=(threaddata_t)arg;
/* ... INITIALIZE ... */
pthread_cond_signal(&x->x_cond); /* signal that we are running */
/* CHILD THREAD BODY */
return 0;
}
void start_thread(void) {
threaddata_t*x=(threaddata_t*)malloc(sizeof(threaddata_t));
pthread_mutex_init(&x->x_mutex, 0);
pthread_cond_init (&x->x_cond , 0);
pthread_mutex_lock(&x->x_mutex);
int result=pthread_create(&threadid, 0, child_thread, &running);
if(!result)pthread_cond_wait(&x->x_cond, &x->x_mutex);
pthread_mutex_unlock(&x->x_mutex);
/* MAIN THREAD BODY */
}
this seemed more sane, that the first attempt (using proper signals rather than rolling my own wait loop), until i discovered, that this includes a race condition:
if the child thread has finished the initialization fast enough (before the main thread waits for the condition), it will deadlock the main thread.
i guess that my case is not so uncommon, so there must be a really easy solution, but i cannot see it right now. | c | multithreading | synchronization | pthreads | null | null | open | how to wait for starting thread to have executed init code
===
i'm having trouble synchronizing a master thread to a recently started child thread.
what i want to do is:
- master thread creates a new child thread and blocks
- child thread starts and initializes (might take some time)
- once the child thread is initialized, the main thread continues (and the two threads run in parallel)
my first attempt was something like:
typedef struct threaddata_ {
int running;
} threaddata_t;
void*child_thread(void*arg) {
threaddata_t*x=(threaddata_t)arg;
/* ... INITIALIZE ... */
x->running=1; /* signal that we are running */
/* CHILD THREAD BODY */
return 0;
}
void start_thread(void) {
threaddata_t*x=(threaddata_t*)malloc(sizeof(threaddata_t));
x->running=0;
int result=pthread_create(&threadid, 0, child_thread, &running);
while(!x->running) usleep(100); /* wait till child is initialized */
/* MAIN THREAD BODY */
}
now i didn't like this at all, because it forces the main thread to sleep for probably a longer period than necessary.
so i did a 2nd attempt, using mutexes&conditions
typedef struct threaddata_ {
pthread_mutex_t x_mutex;
pthread_cond_t x_cond;
} threaddata_t;
void*child_thread(void*arg) {
threaddata_t*x=(threaddata_t)arg;
/* ... INITIALIZE ... */
pthread_cond_signal(&x->x_cond); /* signal that we are running */
/* CHILD THREAD BODY */
return 0;
}
void start_thread(void) {
threaddata_t*x=(threaddata_t*)malloc(sizeof(threaddata_t));
pthread_mutex_init(&x->x_mutex, 0);
pthread_cond_init (&x->x_cond , 0);
pthread_mutex_lock(&x->x_mutex);
int result=pthread_create(&threadid, 0, child_thread, &running);
if(!result)pthread_cond_wait(&x->x_cond, &x->x_mutex);
pthread_mutex_unlock(&x->x_mutex);
/* MAIN THREAD BODY */
}
this seemed more sane, that the first attempt (using proper signals rather than rolling my own wait loop), until i discovered, that this includes a race condition:
if the child thread has finished the initialization fast enough (before the main thread waits for the condition), it will deadlock the main thread.
i guess that my case is not so uncommon, so there must be a really easy solution, but i cannot see it right now. | 0 |
11,472,047 | 07/13/2012 14:03:12 | 696,930 | 04/07/2011 13:52:41 | 1 | 0 | Detect white spaces chars in the begging fo a string | How can I detect a whitspace indentation in a string ?
I need to parse a CSS file: line by line.
Given that i have a line of CSS style:
strong, b { font-weight: normal; color: #000; }
how can i exctract that whitespace and save it into a variable.
| python | null | null | null | null | null | open | Detect white spaces chars in the begging fo a string
===
How can I detect a whitspace indentation in a string ?
I need to parse a CSS file: line by line.
Given that i have a line of CSS style:
strong, b { font-weight: normal; color: #000; }
how can i exctract that whitespace and save it into a variable.
| 0 |
11,472,052 | 07/13/2012 14:03:23 | 773,263 | 05/27/2011 14:27:52 | 909 | 60 | XCode won't accept my 57x57 size icon? | I'm trying to archive my app with XCode. I have 4 different icons (57, 72, 114, 144).
It works fine when I drop them in but when I try to validate it after building I get the following...
![enter image description here][1]
If I go back and try to replace the 57px icon with a 72px icon I get this message.
![enter image description here][2]
Why is this happening?
[1]: http://i.stack.imgur.com/v9Yrj.png
[2]: http://i.stack.imgur.com/s9vpl.png | iphone | xcode | ipad | icons | null | null | open | XCode won't accept my 57x57 size icon?
===
I'm trying to archive my app with XCode. I have 4 different icons (57, 72, 114, 144).
It works fine when I drop them in but when I try to validate it after building I get the following...
![enter image description here][1]
If I go back and try to replace the 57px icon with a 72px icon I get this message.
![enter image description here][2]
Why is this happening?
[1]: http://i.stack.imgur.com/v9Yrj.png
[2]: http://i.stack.imgur.com/s9vpl.png | 0 |
11,472,055 | 07/13/2012 14:03:31 | 1,415,262 | 05/24/2012 14:14:58 | 11 | 1 | preg_replace custom pattern for maps embbed | Basically I receive this:
<iframe width='425' height='350' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='https://maps.google.com.br/maps?f=q&source=s_q&hl=pt-BR&geocode=&q=R.+Alm%C3%A9ria,+242+-+Penha,+S%C3%A3o+Paulo+-+S%C3%A3o+Paulo&aq=0&oq=Rua++Almeria&sll=-14.239424,-53.186502&sspn=79.602428,135.263672&t=h&ie=UTF8&hq=&hnear=R.+Alm%C3%A9ria,+242+-+Penha,+S%C3%A3o+Paulo,+03654-000&z=14&ll=-23.524401,-46.518859&output=embed'></iframe>
What I need to do is to replace any value that is inside the width='' quotes or double quotes with another.
I'm not good with regular expressions, trying to learn by this one seems to be complex.
Any idea?
Thanks.
| php | google-maps | preg-replace | expression | null | null | open | preg_replace custom pattern for maps embbed
===
Basically I receive this:
<iframe width='425' height='350' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='https://maps.google.com.br/maps?f=q&source=s_q&hl=pt-BR&geocode=&q=R.+Alm%C3%A9ria,+242+-+Penha,+S%C3%A3o+Paulo+-+S%C3%A3o+Paulo&aq=0&oq=Rua++Almeria&sll=-14.239424,-53.186502&sspn=79.602428,135.263672&t=h&ie=UTF8&hq=&hnear=R.+Alm%C3%A9ria,+242+-+Penha,+S%C3%A3o+Paulo,+03654-000&z=14&ll=-23.524401,-46.518859&output=embed'></iframe>
What I need to do is to replace any value that is inside the width='' quotes or double quotes with another.
I'm not good with regular expressions, trying to learn by this one seems to be complex.
Any idea?
Thanks.
| 0 |
11,692,839 | 07/27/2012 17:37:24 | 817,774 | 06/27/2011 16:30:01 | 1 | 0 | MVC 3 Entity Framework simple mapping of keys | Model classes:
public class User {
[Key]
public Guid UserId { get; set; }
[Display(Name = "User Name")]
public string UserName { get; set; }
public virtual ICollection<Asp_Membership> CreateDates { get; set; }
}
public class Asp_Membership {
[Key]
public Guid UserId { get; set; }
[Display(Name = "Date Created")]
public DateTime CreateDate { get; set; }
}
DbContext
public class UsersContext : DbContext {
public UsersContext() : base("ApplicationServices") { }
public DbSet<User> Users { get; set; }
public DbSet<Asp_Membership> Asp_Memberships { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder) {
//mapping of Users and Membership
}
My question is a simple one, and as you can probably tell, these are my first attempts into trying to understand how EF actually works. What i am trying to do is join the aspnet_Users table and aspnet_Membership table based on the UserId. How exactly can i do that?
But far more importantly, i really haven't been able to find a good Entity Framework tutorial, any recommendations? | asp.net-mvc | entity-framework | null | null | null | null | open | MVC 3 Entity Framework simple mapping of keys
===
Model classes:
public class User {
[Key]
public Guid UserId { get; set; }
[Display(Name = "User Name")]
public string UserName { get; set; }
public virtual ICollection<Asp_Membership> CreateDates { get; set; }
}
public class Asp_Membership {
[Key]
public Guid UserId { get; set; }
[Display(Name = "Date Created")]
public DateTime CreateDate { get; set; }
}
DbContext
public class UsersContext : DbContext {
public UsersContext() : base("ApplicationServices") { }
public DbSet<User> Users { get; set; }
public DbSet<Asp_Membership> Asp_Memberships { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder) {
//mapping of Users and Membership
}
My question is a simple one, and as you can probably tell, these are my first attempts into trying to understand how EF actually works. What i am trying to do is join the aspnet_Users table and aspnet_Membership table based on the UserId. How exactly can i do that?
But far more importantly, i really haven't been able to find a good Entity Framework tutorial, any recommendations? | 0 |
11,693,183 | 07/27/2012 18:00:15 | 1,542,669 | 07/21/2012 12:56:50 | 11 | 1 | In webkit my css transform seems to have a glitch / is not working properly | Here is my CSS:
#covercontainer:hover {
transform: translate(0,-45px);
-ms-transform: translate(0,-45px);
-webkit-transform: translate(0,-45px);
-o-transform: translate(0,-45px);
-moz-transform: translate(0,-45px);
transition: all 0.2s ease-in;
-webkit-transition: all 0.2s ease-in;
-moz-transition: all 0.2s ease-in;
-o-transition: all 0.2s ease-in;
-ms-transition: all 0.2s ease-in;
height:90px;
}
#covercontainer {
transition: all 1s ease-in-out;
-webkit-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
-ms-transition: all 1s ease-in-out;
height:45px;
}
And this is my HTML:
<div id='covercontainer' style='position:fixed; top: 0; margin-left:33.33%; margin-right:33.33%; width:33.33%; z-index: 5; background: transparent;'>
<div id='Cover' style='position:fixed; top: 0; width:100%; height: 45px; background: url("http://2.bp.blogspot.com/--X2oGCy-gdg/T8pBtNtxt3I/AAAAAAAAAGg/XjK390wm8Y8/s0/main_container_pattern.jpg)") repeat fixed 0% 0% rgb(0, 0, 0);'>
<span class='logo' style='font-family: Lobster; font-size: 24px; color: #444444; position:fixed; right:49.8%; top: 10px;-webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;cursor: default;'>F</span>
</div></div>
[Here][1] is the glitch in action. Hover over the grey "F" in the top bar to see what I mean. When it comes back down, and #covercontainer shrinks to its normal size (45px), #cover is suddenly transparent.
This is only happening in Chrome, not in Safari and happens in Windows and in Mac OSs.
[1]: http://freedomrequireswings-portal.blogspot.com/ | css | google-chrome | webkit | transform | null | null | open | In webkit my css transform seems to have a glitch / is not working properly
===
Here is my CSS:
#covercontainer:hover {
transform: translate(0,-45px);
-ms-transform: translate(0,-45px);
-webkit-transform: translate(0,-45px);
-o-transform: translate(0,-45px);
-moz-transform: translate(0,-45px);
transition: all 0.2s ease-in;
-webkit-transition: all 0.2s ease-in;
-moz-transition: all 0.2s ease-in;
-o-transition: all 0.2s ease-in;
-ms-transition: all 0.2s ease-in;
height:90px;
}
#covercontainer {
transition: all 1s ease-in-out;
-webkit-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
-ms-transition: all 1s ease-in-out;
height:45px;
}
And this is my HTML:
<div id='covercontainer' style='position:fixed; top: 0; margin-left:33.33%; margin-right:33.33%; width:33.33%; z-index: 5; background: transparent;'>
<div id='Cover' style='position:fixed; top: 0; width:100%; height: 45px; background: url("http://2.bp.blogspot.com/--X2oGCy-gdg/T8pBtNtxt3I/AAAAAAAAAGg/XjK390wm8Y8/s0/main_container_pattern.jpg)") repeat fixed 0% 0% rgb(0, 0, 0);'>
<span class='logo' style='font-family: Lobster; font-size: 24px; color: #444444; position:fixed; right:49.8%; top: 10px;-webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;cursor: default;'>F</span>
</div></div>
[Here][1] is the glitch in action. Hover over the grey "F" in the top bar to see what I mean. When it comes back down, and #covercontainer shrinks to its normal size (45px), #cover is suddenly transparent.
This is only happening in Chrome, not in Safari and happens in Windows and in Mac OSs.
[1]: http://freedomrequireswings-portal.blogspot.com/ | 0 |
11,693,185 | 07/27/2012 18:00:19 | 1,558,323 | 07/27/2012 17:17:47 | 1 | 0 | param reference to bean not being passed into composite component | i'm having a bit of trouble with a composite component. the simplified version of my problem is here:
[composite component]
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:cc="http://java.sun.com/jsf/composite">
<!-- INTERFACE -->
<cc:interface>
<cc:attribute name="value" required="true"/>
<cc:attribute name="title" required="false" default=""/>
<cc:editableValueHolder name="inputTarget" targets="labeledInputField"/>
</cc:interface>
<!-- IMPLEMENTATION -->
<cc:implementation>
<p:inputText id="labeledInputField"
label="#{cc.attrs.title}"
value="#{cc.attrs.value}"
title="#{cc.attrs.title}">
<cc:insertChildren/>
</p:inputText>
</cc:implementation>
</html>
[implemented in]
<!-- thisPerson is passed in via ui:param to the facelet containing this code.
it works in other (non-composite) components on the page -->
<comp:labeledInputText
id="baseUsername"
value="#{controller.username}"
title="#{bundle.Username}">
<f:validator for="inputTarget" binding="#{thisPerson.usernameValidator}"/>
<f:converter for="inputTarget" converterId="#{whiteSpaceTrimConverter}"/>
</comp:labeledInputText>
the problem is, the "thisPerson.usernameValidator" is evaluating to NULL, which then causes the com.sun.faces.facelets.tag.jsf.ValidatorTagHandlerDelegateImpl to then skip to the code that attempts to load the validator by "validatorID" which is not set because we're trying to send in the validator by "binding". is there a way to get the composite to evaluate the ui:param value, or a workaround that does not require reworking the validator (it's a huge anti-pattern and i don't have time to reverse the damage right now). assume the validator HAS to come in via binding.
i know the composite works because in a different facelet, i have the validator binding against a concrete bean reference, rather than a "soft" reference, and it works like a champ.
TIA
| jsf | components | composite | null | null | null | open | param reference to bean not being passed into composite component
===
i'm having a bit of trouble with a composite component. the simplified version of my problem is here:
[composite component]
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:cc="http://java.sun.com/jsf/composite">
<!-- INTERFACE -->
<cc:interface>
<cc:attribute name="value" required="true"/>
<cc:attribute name="title" required="false" default=""/>
<cc:editableValueHolder name="inputTarget" targets="labeledInputField"/>
</cc:interface>
<!-- IMPLEMENTATION -->
<cc:implementation>
<p:inputText id="labeledInputField"
label="#{cc.attrs.title}"
value="#{cc.attrs.value}"
title="#{cc.attrs.title}">
<cc:insertChildren/>
</p:inputText>
</cc:implementation>
</html>
[implemented in]
<!-- thisPerson is passed in via ui:param to the facelet containing this code.
it works in other (non-composite) components on the page -->
<comp:labeledInputText
id="baseUsername"
value="#{controller.username}"
title="#{bundle.Username}">
<f:validator for="inputTarget" binding="#{thisPerson.usernameValidator}"/>
<f:converter for="inputTarget" converterId="#{whiteSpaceTrimConverter}"/>
</comp:labeledInputText>
the problem is, the "thisPerson.usernameValidator" is evaluating to NULL, which then causes the com.sun.faces.facelets.tag.jsf.ValidatorTagHandlerDelegateImpl to then skip to the code that attempts to load the validator by "validatorID" which is not set because we're trying to send in the validator by "binding". is there a way to get the composite to evaluate the ui:param value, or a workaround that does not require reworking the validator (it's a huge anti-pattern and i don't have time to reverse the damage right now). assume the validator HAS to come in via binding.
i know the composite works because in a different facelet, i have the validator binding against a concrete bean reference, rather than a "soft" reference, and it works like a champ.
TIA
| 0 |
11,693,171 | 07/27/2012 17:59:36 | 1,470,074 | 06/20/2012 17:57:45 | 7 | 0 | jQuery show setTimeout timer | I'm trying to build a simple countdown application. Is it possible to show the timer value on setTimeout, or would I have to use a for loop?
Thanks! | javascript | jquery | timer | settimeout | null | null | open | jQuery show setTimeout timer
===
I'm trying to build a simple countdown application. Is it possible to show the timer value on setTimeout, or would I have to use a for loop?
Thanks! | 0 |
11,443,304 | 07/12/2012 00:00:00 | 302,318 | 03/26/2010 06:25:58 | 1,073 | 65 | How To Create A Responsive Horizontal Layout Using CSS? | I work for a creative design studio who likes to break paradigms and convention to create unique website layouts and recently we've started developing horizontal website layouts. While horizontal website layouts look "cool" I've yet to work out how to make them fluid and responsive like you can with a vertical grid based website out-of-the-box.
Normally for a vertical website with a container you'd have a percentage based width on your container element, then set a max-width. With a responsive layout your content infinitely scrolls off of the page, it can vary in width especially if the content is unique and therefore the formula target/context * 100 doesn't really work (or does it?).
Is there perhaps a way to have responsive heights, padding and margins on elements to make it work just like you would a grid based responsive website. I don't mind having to use Javascript but a CSS fix would be ideal.
For your reference an example of the type of layout I am trying to create:
![enter image description here][1]
[1]: http://i.stack.imgur.com/3wELV.png | html | css | horizontal-scrolling | null | null | null | open | How To Create A Responsive Horizontal Layout Using CSS?
===
I work for a creative design studio who likes to break paradigms and convention to create unique website layouts and recently we've started developing horizontal website layouts. While horizontal website layouts look "cool" I've yet to work out how to make them fluid and responsive like you can with a vertical grid based website out-of-the-box.
Normally for a vertical website with a container you'd have a percentage based width on your container element, then set a max-width. With a responsive layout your content infinitely scrolls off of the page, it can vary in width especially if the content is unique and therefore the formula target/context * 100 doesn't really work (or does it?).
Is there perhaps a way to have responsive heights, padding and margins on elements to make it work just like you would a grid based responsive website. I don't mind having to use Javascript but a CSS fix would be ideal.
For your reference an example of the type of layout I am trying to create:
![enter image description here][1]
[1]: http://i.stack.imgur.com/3wELV.png | 0 |
11,442,125 | 07/11/2012 21:58:56 | 291,788 | 03/11/2010 18:55:23 | 8,559 | 248 | calculating the destination points for OpenCV's findHomography | I'm using OpenCV's `findHomography()` and `warpPerspective()` methods to "de skew" a photograph of a sheet of paper. I have this largely working but I'm stuck on a detail.
The part I don't understand how to do is to calculate the optimum set of destination points to input to `findHomography()`. I know that I want my output to be rectangular, but I dont know the ratio of the width to height of the rectangle. I also want the output rectangle to be sized such that there is minimal scaling of the output image when I apply the transform via `warpPerspective()`. All I have are the four points that form the quadrilateral I want to transform in the source image. How do I calculate an optimum-sized destination rectangle? | image-processing | opencv | homography | null | null | null | open | calculating the destination points for OpenCV's findHomography
===
I'm using OpenCV's `findHomography()` and `warpPerspective()` methods to "de skew" a photograph of a sheet of paper. I have this largely working but I'm stuck on a detail.
The part I don't understand how to do is to calculate the optimum set of destination points to input to `findHomography()`. I know that I want my output to be rectangular, but I dont know the ratio of the width to height of the rectangle. I also want the output rectangle to be sized such that there is minimal scaling of the output image when I apply the transform via `warpPerspective()`. All I have are the four points that form the quadrilateral I want to transform in the source image. How do I calculate an optimum-sized destination rectangle? | 0 |
11,439,886 | 07/11/2012 19:21:15 | 829,537 | 07/05/2011 10:54:39 | 28 | 0 | custom components within a rich:datatable | Given this datatable (naturally working):
<rich:dataTable var="var" value="#{values}">
<rich:column>
<f:facet name="header">
HEADER
</f:facet>
<h:outputText value="#{var}" />
</rich:column>
</rich:dataTable>
If I define a custom component (also ok in the syntax and at the right place under resources/components):
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:composite="http://java.sun.com/jsf/composite">
<!-- INTERFACE -->
<composite:interface>
<composite:attribute name="val" />
</composite:interface>
<!-- IMPLEMENTATION -->
<composite:implementation>
<rich:column>
<f:facet name="header">
HEADER
</f:facet>
<h:outputText value="#{cc.attrs.val}" />
</rich:column>
</composite:implementation>
</html>
Why does the following does not work?
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition template="/WEB-INF/templates/default.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:my="http://java.sun.com/jsf/composite/components">
<ui:define name="content">
<rich:dataTable var="var" value="#{values}">
<my:mycolumn val="#{var}"/>
</rich:dataTable>
</ui:define>
</ui:composition>
Do you know how could I let it work (I want to define my own column and save code)? Thanks a lot! Bye | jsf | richfaces | null | null | null | null | open | custom components within a rich:datatable
===
Given this datatable (naturally working):
<rich:dataTable var="var" value="#{values}">
<rich:column>
<f:facet name="header">
HEADER
</f:facet>
<h:outputText value="#{var}" />
</rich:column>
</rich:dataTable>
If I define a custom component (also ok in the syntax and at the right place under resources/components):
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:composite="http://java.sun.com/jsf/composite">
<!-- INTERFACE -->
<composite:interface>
<composite:attribute name="val" />
</composite:interface>
<!-- IMPLEMENTATION -->
<composite:implementation>
<rich:column>
<f:facet name="header">
HEADER
</f:facet>
<h:outputText value="#{cc.attrs.val}" />
</rich:column>
</composite:implementation>
</html>
Why does the following does not work?
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition template="/WEB-INF/templates/default.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:my="http://java.sun.com/jsf/composite/components">
<ui:define name="content">
<rich:dataTable var="var" value="#{values}">
<my:mycolumn val="#{var}"/>
</rich:dataTable>
</ui:define>
</ui:composition>
Do you know how could I let it work (I want to define my own column and save code)? Thanks a lot! Bye | 0 |
11,443,322 | 07/12/2012 00:02:53 | 71,422 | 02/26/2009 15:18:52 | 1,371 | 6 | NameSpace Manager or XsltContent to parse aspx page | How can I use NameSpace Manager or XsltContent to parse aspx page?
I am using HtmlAgilityPack.
I am trying to parse aspx page to get Button and Label controls IDs. I am getting the following error when I try to select node with **asp:Button** element.
Here is the error message:
**Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function.**
HtmlAgilityPack.HtmlDocument htmlDoc = new HtmlAgilityPack.HtmlDocument();
string filePath = @"C:\webform4.aspx";
htmlDoc.Load(filePath);
foreach (HtmlNode div in htmlDoc.DocumentNode.SelectNodes("//div"))
{
Response.Write(div.Id);
foreach (HtmlNode asp in div.SelectNodes("asp:Button"))
{
Response.Write(asp.Id);
}
}
My aspx page looks as follows:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="WebApplication1.WebForm4" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div id="mydiv">
<asp:Button ID="Button1" runat="server" Text="Button on page4" />
<br />
<br />
<asp:Label ID="Label1" runat="server" Text="Label on page 4"></asp:Label>
<br />
<br />
<asp:Button ID="Button2" runat="server" Text="second button page 4" />
<br />
<asp:Button ID="Button3" runat="server" Text="second button page 4" />
</div>
</form>
</body>
</html>
| c# | asp.net | linq | html-agility-pack | null | null | open | NameSpace Manager or XsltContent to parse aspx page
===
How can I use NameSpace Manager or XsltContent to parse aspx page?
I am using HtmlAgilityPack.
I am trying to parse aspx page to get Button and Label controls IDs. I am getting the following error when I try to select node with **asp:Button** element.
Here is the error message:
**Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function.**
HtmlAgilityPack.HtmlDocument htmlDoc = new HtmlAgilityPack.HtmlDocument();
string filePath = @"C:\webform4.aspx";
htmlDoc.Load(filePath);
foreach (HtmlNode div in htmlDoc.DocumentNode.SelectNodes("//div"))
{
Response.Write(div.Id);
foreach (HtmlNode asp in div.SelectNodes("asp:Button"))
{
Response.Write(asp.Id);
}
}
My aspx page looks as follows:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="WebApplication1.WebForm4" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div id="mydiv">
<asp:Button ID="Button1" runat="server" Text="Button on page4" />
<br />
<br />
<asp:Label ID="Label1" runat="server" Text="Label on page 4"></asp:Label>
<br />
<br />
<asp:Button ID="Button2" runat="server" Text="second button page 4" />
<br />
<asp:Button ID="Button3" runat="server" Text="second button page 4" />
</div>
</form>
</body>
</html>
| 0 |
11,443,326 | 07/12/2012 00:03:08 | 481,332 | 10/20/2010 06:39:36 | 195 | 1 | CSS in newly-created window | I'm creating a new window using javascript (w/ jQuery), and I add some nodes to the body of the new window using code like this:
var consoleWindow = window.open('','','width=460,height=345');
$(consoleWindow.document).find('body').append($("#debug_console"));
The problem is that I naively assumed the CSS rules for the parent window would apply to the nodes in the child window, instead I get unformatted HTML. How would I apply CSS in the new window? Thanks for your help. | javascript | jquery | html | css | null | null | open | CSS in newly-created window
===
I'm creating a new window using javascript (w/ jQuery), and I add some nodes to the body of the new window using code like this:
var consoleWindow = window.open('','','width=460,height=345');
$(consoleWindow.document).find('body').append($("#debug_console"));
The problem is that I naively assumed the CSS rules for the parent window would apply to the nodes in the child window, instead I get unformatted HTML. How would I apply CSS in the new window? Thanks for your help. | 0 |
11,443,327 | 07/12/2012 00:03:10 | 1,519,265 | 07/11/2012 22:47:14 | 1 | 0 | Model polymorphism and model-view separation | I'm encountering a dilemma of sorts while making my Django application, but I think the problem I'm encountering may apply to the MVC pattern generally. I'm making a `Question` model which can be used to construct quizzes or questionnaires. The `Question` base class would be a simple free response question. I'd like to support different types of questions such as multiple choice questions or sliding scale questions, and these would be subclasses of the `Question` base class with extra fields added such as an array of possible choices. I'd like to be able to extend my question models to support more types of questions in the future, and for that I can rely on polymorphism and pass objects of the `Question` type between the model layer and the view layer for all subclasses of `Question`.
The problem I'm encountering is that the view has to know the type of question it has received in order to render it. If it gets a multiple choice question it needs to draw the radio choice widgets, etc. So now if I extend my models with more types of questions I have to add it to both the model and the view layers. This seems to defeat the point of polymorphism since the views receiving the `Question` objects would always have to know the subclass type of the questions received. I can get around this problem by delegating the responsibility of rendering the question back to the model. If the `Question` model has a virtual function called `render_question()` that its subclasses override then the view layer can call that function to get the right HTML to output without worrying about the type of question. But now I have the problem of having the HTML rendering code bound up with the model.
Could there be a third solution that does not have either of the downsides of the solutions I've thought of? Or is this truly a dilemma about which one has to make a difficult decision? | django | mvc | design-patterns | database-design | null | null | open | Model polymorphism and model-view separation
===
I'm encountering a dilemma of sorts while making my Django application, but I think the problem I'm encountering may apply to the MVC pattern generally. I'm making a `Question` model which can be used to construct quizzes or questionnaires. The `Question` base class would be a simple free response question. I'd like to support different types of questions such as multiple choice questions or sliding scale questions, and these would be subclasses of the `Question` base class with extra fields added such as an array of possible choices. I'd like to be able to extend my question models to support more types of questions in the future, and for that I can rely on polymorphism and pass objects of the `Question` type between the model layer and the view layer for all subclasses of `Question`.
The problem I'm encountering is that the view has to know the type of question it has received in order to render it. If it gets a multiple choice question it needs to draw the radio choice widgets, etc. So now if I extend my models with more types of questions I have to add it to both the model and the view layers. This seems to defeat the point of polymorphism since the views receiving the `Question` objects would always have to know the subclass type of the questions received. I can get around this problem by delegating the responsibility of rendering the question back to the model. If the `Question` model has a virtual function called `render_question()` that its subclasses override then the view layer can call that function to get the right HTML to output without worrying about the type of question. But now I have the problem of having the HTML rendering code bound up with the model.
Could there be a third solution that does not have either of the downsides of the solutions I've thought of? Or is this truly a dilemma about which one has to make a difficult decision? | 0 |
11,349,806 | 07/05/2012 17:53:07 | 1,500,898 | 07/04/2012 07:58:48 | 10 | 0 | Why I get an unknown database error? | I have an amazon Ec2 instance of mysql (rds). It has a database named `locker`. I can access it via from my terminal by following these steps from [here][1].
I have configured my `DataSource.groovy` as :
development {
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:mysql://localhost/locker?useUnicode=yes&characterEncoding=UTF-8"
username = "root"
password = ""
}
}
And when I run `grails run-app`, I get an following an error :
| Error 2012-07-05 23:15:23,818 [Thread-9] ERROR context.GrailsContextLoader - Error executing bootstraps: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'locker')
Message: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'locker')
Line | Method
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 679 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'locker')
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 679 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'locker')
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 679 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'locker')
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 679 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'locker')
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 679 | run . . . in java.lang.Thread
Caused by MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'locker')
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 679 | run . . . in java.lang.Thread
Caused by SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'locker')
->> 1549 | createPoolableConnectionFactory in org.apache.commons.dbcp.BasicDataSource
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1388 | createDataSource in ''
| 1044 | getConnection in ''
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 679 | run in java.lang.Thread
Caused by MySQLSyntaxErrorException: Unknown database 'locker'
->> 411 | handleNewInstance in com.mysql.jdbc.Util
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 386 | getInstance in ''
| 1052 | createSQLException in com.mysql.jdbc.SQLError
| 3597 | checkErrorPacket in com.mysql.jdbc.MysqlIO
| 3529 | checkErrorPacket in ''
| 935 | checkErrorPacket in ''
| 4101 | secureAuth411 in ''
| 1300 | doHandshake in ''
| 2337 | coreConnect in com.mysql.jdbc.ConnectionImpl
| 2370 | connectOneTryOnly in ''
| 2154 | createNewIO in ''
| 792 | <init> in ''
| 47 | <init> . in com.mysql.jdbc.JDBC4Connection
| 411 | handleNewInstance in com.mysql.jdbc.Util
| 381 | getInstance in com.mysql.jdbc.ConnectionImpl
| 305 | connect in com.mysql.jdbc.NonRegisteringDriver
| 38 | createConnection in org.apache.commons.dbcp.DriverConnectionFactory
| 582 | makeObject in org.apache.commons.dbcp.PoolableConnectionFactory
| 1556 | validateConnectionFactory in org.apache.commons.dbcp.BasicDataSource
| 1545 | createPoolableConnectionFactory in ''
| 1388 | createDataSource in ''
| 1044 | getConnection in ''
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 679 | run . . . in java.lang.Thread
But when I change the database from `locker` to `testing`(other database that I have created), everything goes fine and my grails app is running.
Why its not running in the first case?
[1]: http://docs.amazonwebservices.com/AmazonRDS/latest/GettingStartedGuide/ConnectToDBInstance.html | mysql | grails | amazon-ec2 | null | null | null | open | Why I get an unknown database error?
===
I have an amazon Ec2 instance of mysql (rds). It has a database named `locker`. I can access it via from my terminal by following these steps from [here][1].
I have configured my `DataSource.groovy` as :
development {
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:mysql://localhost/locker?useUnicode=yes&characterEncoding=UTF-8"
username = "root"
password = ""
}
}
And when I run `grails run-app`, I get an following an error :
| Error 2012-07-05 23:15:23,818 [Thread-9] ERROR context.GrailsContextLoader - Error executing bootstraps: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'locker')
Message: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'locker')
Line | Method
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 679 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'locker')
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 679 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'locker')
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 679 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'locker')
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 679 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'locker')
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 679 | run . . . in java.lang.Thread
Caused by MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'locker')
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 679 | run . . . in java.lang.Thread
Caused by SQLNestedException: Cannot create PoolableConnectionFactory (Unknown database 'locker')
->> 1549 | createPoolableConnectionFactory in org.apache.commons.dbcp.BasicDataSource
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1388 | createDataSource in ''
| 1044 | getConnection in ''
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 679 | run in java.lang.Thread
Caused by MySQLSyntaxErrorException: Unknown database 'locker'
->> 411 | handleNewInstance in com.mysql.jdbc.Util
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 386 | getInstance in ''
| 1052 | createSQLException in com.mysql.jdbc.SQLError
| 3597 | checkErrorPacket in com.mysql.jdbc.MysqlIO
| 3529 | checkErrorPacket in ''
| 935 | checkErrorPacket in ''
| 4101 | secureAuth411 in ''
| 1300 | doHandshake in ''
| 2337 | coreConnect in com.mysql.jdbc.ConnectionImpl
| 2370 | connectOneTryOnly in ''
| 2154 | createNewIO in ''
| 792 | <init> in ''
| 47 | <init> . in com.mysql.jdbc.JDBC4Connection
| 411 | handleNewInstance in com.mysql.jdbc.Util
| 381 | getInstance in com.mysql.jdbc.ConnectionImpl
| 305 | connect in com.mysql.jdbc.NonRegisteringDriver
| 38 | createConnection in org.apache.commons.dbcp.DriverConnectionFactory
| 582 | makeObject in org.apache.commons.dbcp.PoolableConnectionFactory
| 1556 | validateConnectionFactory in org.apache.commons.dbcp.BasicDataSource
| 1545 | createPoolableConnectionFactory in ''
| 1388 | createDataSource in ''
| 1044 | getConnection in ''
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 679 | run . . . in java.lang.Thread
But when I change the database from `locker` to `testing`(other database that I have created), everything goes fine and my grails app is running.
Why its not running in the first case?
[1]: http://docs.amazonwebservices.com/AmazonRDS/latest/GettingStartedGuide/ConnectToDBInstance.html | 0 |
11,348,652 | 07/05/2012 16:31:05 | 359,317 | 06/05/2010 17:38:34 | 56 | 5 | How does one notify a Google Search Appliance of a clicked link when displaying custom results? | I am performing a web request to a Google Search Appliance (GSA) and returning XML. I then parse that XML to create internal links to an EXTJS web application. My main question is, how do I tell the GSA which link was clicked from my custom results in order to not lose the click rank training? I'd hate to lose the GSA's ability to learn which results are relevant over time, but I must construct links from the XML returned by the GSA. I know I could display the results in an IFrame, but that is not possible given my requirements. I've looked through the documentation, but I haven't found any good leads yet. Any help on this matter will be greatly appreciated. | javascript | google-search-appliance | null | null | null | null | open | How does one notify a Google Search Appliance of a clicked link when displaying custom results?
===
I am performing a web request to a Google Search Appliance (GSA) and returning XML. I then parse that XML to create internal links to an EXTJS web application. My main question is, how do I tell the GSA which link was clicked from my custom results in order to not lose the click rank training? I'd hate to lose the GSA's ability to learn which results are relevant over time, but I must construct links from the XML returned by the GSA. I know I could display the results in an IFrame, but that is not possible given my requirements. I've looked through the documentation, but I haven't found any good leads yet. Any help on this matter will be greatly appreciated. | 0 |
11,348,653 | 07/05/2012 16:31:06 | 1,504,612 | 07/05/2012 16:20:46 | 1 | 0 | Multimedia framework for .Net | Im making a video player in C++ (Using CLR/.NET and Windows Forms). I need a good multimedia framework. If possible something open source and has easy to install codecs. | c++ | .net | frameworks | multimedia | net | null | open | Multimedia framework for .Net
===
Im making a video player in C++ (Using CLR/.NET and Windows Forms). I need a good multimedia framework. If possible something open source and has easy to install codecs. | 0 |
11,348,654 | 07/05/2012 16:31:07 | 1,261,203 | 03/10/2012 15:59:05 | 110 | 11 | choose hosting based on website statistics | I have Google Analytics data of a Website that is currently running on a small server that is also hosting several other sites, and the Website is pretty slow so we want to host it somewhere else, but i need some way of calculating which hosting method is the best and cheapest (vServer/dedicated Server/cloudhosting).
I need something like KPI's for Webhosting to choose the appropriate method based on pageviews/user average, pageviews/user peak, traffic etc.
I did some research myself, also got a book on "Computer Systems Performance Evaluation and Prediction" but i still cant find anything helpful...
I was wondering if any of you guys did this before and could help me, i dont want the entire solution but just point me in the right direction ^^
Thanks in advance,
and sorry for my bad english
| performance | webserver | hosting | null | null | 07/07/2012 11:13:45 | off topic | choose hosting based on website statistics
===
I have Google Analytics data of a Website that is currently running on a small server that is also hosting several other sites, and the Website is pretty slow so we want to host it somewhere else, but i need some way of calculating which hosting method is the best and cheapest (vServer/dedicated Server/cloudhosting).
I need something like KPI's for Webhosting to choose the appropriate method based on pageviews/user average, pageviews/user peak, traffic etc.
I did some research myself, also got a book on "Computer Systems Performance Evaluation and Prediction" but i still cant find anything helpful...
I was wondering if any of you guys did this before and could help me, i dont want the entire solution but just point me in the right direction ^^
Thanks in advance,
and sorry for my bad english
| 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.