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,430,217 | 07/11/2012 10:04:51 | 794,846 | 06/12/2011 15:09:11 | 156 | 2 | Jquery get fadeIn to work only after image has loaded | How do I get the below to only fade back in after all of the stuff within the fadeOut has fully loaded and is ready to display? Whats happening is the image on the upper right corner of the textbox is jumping and not fadeing in smoothly the first time you load page which is annoying.
P.s dont ask about the webpage design I just built it lol
http://goodeggsafety.com/dev/
//In-car child safety scotland
$("#link_1").click(function(e) {
e.preventDefault();
var img = $("#childbig2").attr('src');//Get current image
if(img != 'images/childbig.png'){ //Check if current image is the clicked image if not carry on..
//Variables
var imgurl = 'images/childbig.png';
var flag = 'images/scotland.png';
var html = 'Visit the Scottish<br /> In-Car child safety<br /> campaign website. <br /><br /> Expert advice on seat and stage selection for your child. <br /><br />';
html = html + 'Car seat checking clinics - check<br /> when and where they are in your<br /> area for you to attend and have<br /> your seat checked by a Good Egg<br /> In-Car Expert. <br /><br /> News updates, competitions and much much more.';
var linkurl = 'http://www.protectchild.co.uk/';//Link url
$("#content_1").fadeOut(600, function(){//fade out
$("#childbig2").attr('src', imgurl);//change image
$("#childbig2").attr('alt', 'In-Car Child Safety');//change image alt tag
$("#title_img").attr('src', flag);//change flag
$("#title_h2").html('Scotland');//change title
$("#text_title").html('In-Car Child Safety'); //Change second title
$("#text_content").html(html);//Change main text content
$("#weblink").attr('href', linkurl);//Change link url
$("#weblink").attr('title', linkurl);//Change link title
$("#arrowlink").attr('href', linkurl);//Change link on arrow url
$("#arrowlink").attr('title', linkurl);//change link on arrow title
}).fadeIn(600);//fade in speed, miliseconds
}
}); | javascript | jquery | fadein | null | null | null | open | Jquery get fadeIn to work only after image has loaded
===
How do I get the below to only fade back in after all of the stuff within the fadeOut has fully loaded and is ready to display? Whats happening is the image on the upper right corner of the textbox is jumping and not fadeing in smoothly the first time you load page which is annoying.
P.s dont ask about the webpage design I just built it lol
http://goodeggsafety.com/dev/
//In-car child safety scotland
$("#link_1").click(function(e) {
e.preventDefault();
var img = $("#childbig2").attr('src');//Get current image
if(img != 'images/childbig.png'){ //Check if current image is the clicked image if not carry on..
//Variables
var imgurl = 'images/childbig.png';
var flag = 'images/scotland.png';
var html = 'Visit the Scottish<br /> In-Car child safety<br /> campaign website. <br /><br /> Expert advice on seat and stage selection for your child. <br /><br />';
html = html + 'Car seat checking clinics - check<br /> when and where they are in your<br /> area for you to attend and have<br /> your seat checked by a Good Egg<br /> In-Car Expert. <br /><br /> News updates, competitions and much much more.';
var linkurl = 'http://www.protectchild.co.uk/';//Link url
$("#content_1").fadeOut(600, function(){//fade out
$("#childbig2").attr('src', imgurl);//change image
$("#childbig2").attr('alt', 'In-Car Child Safety');//change image alt tag
$("#title_img").attr('src', flag);//change flag
$("#title_h2").html('Scotland');//change title
$("#text_title").html('In-Car Child Safety'); //Change second title
$("#text_content").html(html);//Change main text content
$("#weblink").attr('href', linkurl);//Change link url
$("#weblink").attr('title', linkurl);//Change link title
$("#arrowlink").attr('href', linkurl);//Change link on arrow url
$("#arrowlink").attr('title', linkurl);//change link on arrow title
}).fadeIn(600);//fade in speed, miliseconds
}
}); | 0 |
11,372,841 | 07/07/2012 06:31:01 | 1,390,033 | 05/11/2012 17:54:03 | 72 | 0 | Codeigniter: Not inserting data in table | For some reason, the data is not getting inserted into the table. It is however being posted from the form as I could see with var dump, but further than that, won't do. So, here are the 3 modules. It is a very simple test scheme: Just a form with two fields, you press Submit and should be inserted. (I can do all that in ordinary PHP with one page, but, the MVC frameworks are a nightmare in this regard, you write about 30 times more code than you would need in procedural.
<?php
class Inserting_controller extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Inserting_model');
}
public function index ()
{
$this->load->view('inserting_view');
}
// Controller
public function insert()
{
$data = array(
'username' => $this->input->post('username', TRUE),
'password' => sha1($this->input->post('password', TRUE)
));
var_dump($data); // We do get the data posted
exit;
$this->Inserting_model->insertdata($data); // this should forward them to the Model
}
}
?>
==============
MODEL
<?php
class Inserting_model extends CI_Model{
function __construct()
{
// Call the Model constructor
parent::__construct();
$this->load->database();
}
public function insertdata($data)
{
$this->db->insert('users', $data);
}
}
?>
========
VIEW
<div id="inserting_form">
<?php echo form_open('index.php/Inserting_controller/insert/'); ?>
<ul>
<li>
<label>Username</label>
<div><?php echo form_input(array('id' => 'username', 'name' => 'username')); ?></div>
</li>
<li>
<label>Password</label>
<div><?php echo form_password(array('id' => 'password', 'name' => 'password')); ?></div>
</li>
<li><?php echo validation_errors();?></li>
<li><?php echo form_submit(array('name' =>'submit'),'Insert');?> </li>
</ul>
<?php echo form_close(); ?>
</div>
| codeigniter | null | null | null | null | null | open | Codeigniter: Not inserting data in table
===
For some reason, the data is not getting inserted into the table. It is however being posted from the form as I could see with var dump, but further than that, won't do. So, here are the 3 modules. It is a very simple test scheme: Just a form with two fields, you press Submit and should be inserted. (I can do all that in ordinary PHP with one page, but, the MVC frameworks are a nightmare in this regard, you write about 30 times more code than you would need in procedural.
<?php
class Inserting_controller extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Inserting_model');
}
public function index ()
{
$this->load->view('inserting_view');
}
// Controller
public function insert()
{
$data = array(
'username' => $this->input->post('username', TRUE),
'password' => sha1($this->input->post('password', TRUE)
));
var_dump($data); // We do get the data posted
exit;
$this->Inserting_model->insertdata($data); // this should forward them to the Model
}
}
?>
==============
MODEL
<?php
class Inserting_model extends CI_Model{
function __construct()
{
// Call the Model constructor
parent::__construct();
$this->load->database();
}
public function insertdata($data)
{
$this->db->insert('users', $data);
}
}
?>
========
VIEW
<div id="inserting_form">
<?php echo form_open('index.php/Inserting_controller/insert/'); ?>
<ul>
<li>
<label>Username</label>
<div><?php echo form_input(array('id' => 'username', 'name' => 'username')); ?></div>
</li>
<li>
<label>Password</label>
<div><?php echo form_password(array('id' => 'password', 'name' => 'password')); ?></div>
</li>
<li><?php echo validation_errors();?></li>
<li><?php echo form_submit(array('name' =>'submit'),'Insert');?> </li>
</ul>
<?php echo form_close(); ?>
</div>
| 0 |
11,372,835 | 07/07/2012 06:30:11 | 194,982 | 10/22/2009 23:48:30 | 3,715 | 69 | Twitter APIs : update working, but filter does not | Twitter APIs : update working, but filter does not
javascript twitter oauth twitter-api jsoauth
In the following code, I instantiate an instance of `OAuth` from the jsOAuth library by bytespider
// jsoauth API reference:
// http://bytespider.github.com/jsOAuth/api-reference/
var twitter = new OAuth(oauthOptions);
//authentication occurs
console.log('url: ' + url);
console.log('data: ' + JSON.stringify(data));
twitter.post(
url,
data,
success,
failure
);
When I access the stream:
url: https://stream.twitter.com/1/statuses/filter.json
data: {"track":"%40twitterapi"}
--> This does not work, neither the `success` nor `failure` callbacks get called, just hangs
When I tweet:
url: https://api.twitter.com/1/statuses/update.json
data: {"status":"foobar","trim_user":true,"include_entities":true}
--> This works, the `success` callback gets called
My guess is that the authentication details are not getting through to the `stream.twitter.com` API, even though it get through to the `api.twitter.com` API. Can safely rule out OAuth issues as being able to tweet demonstrates that authentication has succeeded.
What am I doing wrong here?
Thanks!
| javascript | twitter | oauth | twitter-api | null | null | open | Twitter APIs : update working, but filter does not
===
Twitter APIs : update working, but filter does not
javascript twitter oauth twitter-api jsoauth
In the following code, I instantiate an instance of `OAuth` from the jsOAuth library by bytespider
// jsoauth API reference:
// http://bytespider.github.com/jsOAuth/api-reference/
var twitter = new OAuth(oauthOptions);
//authentication occurs
console.log('url: ' + url);
console.log('data: ' + JSON.stringify(data));
twitter.post(
url,
data,
success,
failure
);
When I access the stream:
url: https://stream.twitter.com/1/statuses/filter.json
data: {"track":"%40twitterapi"}
--> This does not work, neither the `success` nor `failure` callbacks get called, just hangs
When I tweet:
url: https://api.twitter.com/1/statuses/update.json
data: {"status":"foobar","trim_user":true,"include_entities":true}
--> This works, the `success` callback gets called
My guess is that the authentication details are not getting through to the `stream.twitter.com` API, even though it get through to the `api.twitter.com` API. Can safely rule out OAuth issues as being able to tweet demonstrates that authentication has succeeded.
What am I doing wrong here?
Thanks!
| 0 |
11,372,854 | 07/07/2012 06:34:25 | 1,180,556 | 01/31/2012 14:33:17 | 1 | 0 | Fetching time entries from Freckle API | I want to get time entries of Freckle using its API for some specific dates, but either I get 404 - Not Found and when I change the formation of URL it generates 406 - Not Acceptable. **And when I want to access them without using the date filter It works fine**. The URI I am sending for date filter is:
string dFilter = @"\ -data'search[from]=2012-07-05'";
string uri = @"https://apitest.letsfreckle.com/api/entries.xml"+dFilter;
webRequest = (HttpWebRequest)WebRequest.Create(uri);
webRequest.Headers.Add("X-FreckleToken:lx3gi6pxdjtjn57afp8c2bv1me7g89j");
webRequest.Method = "GET";
WebResponse webResponse = webRequest.GetResponse();
StreamReader sr = new StreamReader(webResponse.GetResponseStream());
responseXML = sr.ReadToEnd();
can you tell me how to use this date Filter correctly? The Documentation of API can be found at:
[Documentation][1]
Thanks in advance.
[1]: http://madrobby.github.com/freckle-apidocs/entries.html | c# | api | null | null | null | null | open | Fetching time entries from Freckle API
===
I want to get time entries of Freckle using its API for some specific dates, but either I get 404 - Not Found and when I change the formation of URL it generates 406 - Not Acceptable. **And when I want to access them without using the date filter It works fine**. The URI I am sending for date filter is:
string dFilter = @"\ -data'search[from]=2012-07-05'";
string uri = @"https://apitest.letsfreckle.com/api/entries.xml"+dFilter;
webRequest = (HttpWebRequest)WebRequest.Create(uri);
webRequest.Headers.Add("X-FreckleToken:lx3gi6pxdjtjn57afp8c2bv1me7g89j");
webRequest.Method = "GET";
WebResponse webResponse = webRequest.GetResponse();
StreamReader sr = new StreamReader(webResponse.GetResponseStream());
responseXML = sr.ReadToEnd();
can you tell me how to use this date Filter correctly? The Documentation of API can be found at:
[Documentation][1]
Thanks in advance.
[1]: http://madrobby.github.com/freckle-apidocs/entries.html | 0 |
11,372,855 | 07/07/2012 06:34:27 | 1,447,257 | 06/10/2012 11:17:57 | 1 | 0 | std::function to std::bind? | I get a compile error using this:
std::vector<std::function<int(int)>> functions;
std::function<int(int, int)> foo = [](int a, int b){};
std::function<int(int)> bar = std::bind(foo, 2);
functions.push_back(bar);
The error i get is:
/usr/include/c++/4.6/functional:1764:40: error: no match for call to '(std::_Bind<std::function<int(int, int)>(int)>) (int)'
Can someone tell me how to convert a std::bind into a std::function? | c++ | function | return | bind | std | null | open | std::function to std::bind?
===
I get a compile error using this:
std::vector<std::function<int(int)>> functions;
std::function<int(int, int)> foo = [](int a, int b){};
std::function<int(int)> bar = std::bind(foo, 2);
functions.push_back(bar);
The error i get is:
/usr/include/c++/4.6/functional:1764:40: error: no match for call to '(std::_Bind<std::function<int(int, int)>(int)>) (int)'
Can someone tell me how to convert a std::bind into a std::function? | 0 |
11,372,856 | 07/07/2012 06:34:28 | 1,349,928 | 04/22/2012 18:50:14 | 158 | 0 | How to start the JavaDB server using codes | When I use the "built-in" database in NetBeans, which is called Derby or JavaDB, I have to right click on it, Start Server, so The following codes can work...
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
myConnection = DriverManager.getConnection("jdbc:derby://localhost:1527/"+database,username , password);
But lets say I finished my java application and I did this "Clean and Build", and now I can double click that Icon to run my Program, when I do, the server doesn't start automatically, means I cannot connect to the Database, how should I do it with coding? or there's other ways? | netbeans | javadb | null | null | null | null | open | How to start the JavaDB server using codes
===
When I use the "built-in" database in NetBeans, which is called Derby or JavaDB, I have to right click on it, Start Server, so The following codes can work...
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
myConnection = DriverManager.getConnection("jdbc:derby://localhost:1527/"+database,username , password);
But lets say I finished my java application and I did this "Clean and Build", and now I can double click that Icon to run my Program, when I do, the server doesn't start automatically, means I cannot connect to the Database, how should I do it with coding? or there's other ways? | 0 |
11,372,857 | 07/07/2012 06:34:32 | 828,647 | 07/04/2011 19:37:12 | 82 | 0 | Replace text in textarea using Javascript | I need to replace all the matches of a regular expression till the caret position in a textarea using Javascript.
For example, if the text in the textarea is: "6 students carry 2 books to 5 classes" and the cursor
is placed on books and the regular expression is /\d/, the numbers 6 and 2 should be replaced by, say, 4.
I know the replace function and I know how to get the caret position, but how do I solve this problem?
Thanks for any help in advance! | javascript | null | null | null | null | null | open | Replace text in textarea using Javascript
===
I need to replace all the matches of a regular expression till the caret position in a textarea using Javascript.
For example, if the text in the textarea is: "6 students carry 2 books to 5 classes" and the cursor
is placed on books and the regular expression is /\d/, the numbers 6 and 2 should be replaced by, say, 4.
I know the replace function and I know how to get the caret position, but how do I solve this problem?
Thanks for any help in advance! | 0 |
11,372,859 | 07/07/2012 06:35:20 | 1,114,959 | 12/24/2011 23:44:41 | 1 | 0 | How do I do a android game screen-cast? | I need to make a video of the game I am developing, but it is accelerometer based and very intense, so it is hard to make a video using another camera.
Is there any decent screen-casting software for Android, or to work with Android via USB? | android | screencasting | null | null | null | null | open | How do I do a android game screen-cast?
===
I need to make a video of the game I am developing, but it is accelerometer based and very intense, so it is hard to make a video using another camera.
Is there any decent screen-casting software for Android, or to work with Android via USB? | 0 |
11,372,861 | 07/07/2012 06:35:39 | 1,161,283 | 01/20/2012 18:59:55 | 79 | 1 | Passing Parameters By Reference In JavaScript? | I have a technical challenge that I'm trying to figure out the best way to solve. Here's the scenario.
I have one HTML page that launches another HTML page...let's call it main.html that has a button which calls test.html Inside test.html the user can answer a series of questions and submit the results to a Learning Management System. Each time they do a test I have a JavaScript variable inside the test.html page that gets incremented from A to B to C, etc. For example, if they take the test the first time it will Be something like 0001A and the second time 0001B.
This works great, but if they close the test.html page, since this JavaScript variable is inside it, the counter will start off at 0001A again if the user tries to take another test. What I would like is for the next test the user submits to be 0001C. Not sure how to do this...
I thought of passing a variable to the test.html page via something like: test.html&id=C
but this means that main.html that calls test.html would need to know that the user has already done two tests and I'm not sure you can pass a value back from an HTML page to the HTML page that called it?
Anyway, I'm wondering what would be the best way to solve this problem?
Thanks
| javascript | null | null | null | null | null | open | Passing Parameters By Reference In JavaScript?
===
I have a technical challenge that I'm trying to figure out the best way to solve. Here's the scenario.
I have one HTML page that launches another HTML page...let's call it main.html that has a button which calls test.html Inside test.html the user can answer a series of questions and submit the results to a Learning Management System. Each time they do a test I have a JavaScript variable inside the test.html page that gets incremented from A to B to C, etc. For example, if they take the test the first time it will Be something like 0001A and the second time 0001B.
This works great, but if they close the test.html page, since this JavaScript variable is inside it, the counter will start off at 0001A again if the user tries to take another test. What I would like is for the next test the user submits to be 0001C. Not sure how to do this...
I thought of passing a variable to the test.html page via something like: test.html&id=C
but this means that main.html that calls test.html would need to know that the user has already done two tests and I'm not sure you can pass a value back from an HTML page to the HTML page that called it?
Anyway, I'm wondering what would be the best way to solve this problem?
Thanks
| 0 |
11,372,862 | 07/07/2012 06:35:46 | 1,508,362 | 07/07/2012 06:31:32 | 1 | 0 | C# net programing by socket | I'm writing a game and i need to send and receive data from other computer in Wireless LAN network my master told me to use socket programing type.
I set computers IP and ping the systems but i don't know socket programing codes and how i should create a socket and use it , can anyone help me please? | c# | null | null | null | null | 07/07/2012 06:38:58 | not a real question | C# net programing by socket
===
I'm writing a game and i need to send and receive data from other computer in Wireless LAN network my master told me to use socket programing type.
I set computers IP and ping the systems but i don't know socket programing codes and how i should create a socket and use it , can anyone help me please? | 1 |
11,372,863 | 07/07/2012 06:36:05 | 1,508,348 | 07/07/2012 06:20:57 | 1 | 0 | EGL_BAD_CONFIG error opengl es 2.0 with egl 1.4 | I have created the shaders and the draw function. At this stage i want to create surface and context using egl to compile the shader.
here is my code.
I am get no error with display ,initialization or getconfigs. when i chooseconfigs it not choosing anything and returning false. Am i giving the wrong attribList and context_attribs.
Can anyone help me out with it.
EGLint err;
EGLBoolean eRetStatus;
EGLContext context;
EGLDisplay dpy;
EGLSurface pbuffer;
EGLint major, minor;
EGLint numConfigs;
EGLConfig config[10];
EGLint context_attribs[] = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE};
EGLint attribList[]=
{ EGL_RED_SIZE,5,EGL_GREEN_SIZE, 6,EGL_BLUE_SIZE,5, EGL_BIND_TO_TEXTURE_RGB,EGL_TRUE};
EGLint red, blue, green,m;
dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
err=eglGetError();
if(err=EGL_NO_DISPLAY)
{
printf("no display");
return EGL_FALSE;
}
eRetStatus = eglInitialize(dpy, &major, &minor);
if(eRetStatus==EGL_TRUE)
printf("initialized kaka");
eRetStatus = eglGetConfigs (dpy, config, 10, &numConfigs);
if(eRetStatus==EGL_BAD_PARAMETER )
printf("configs bad in getconfigs");
printf("\nConfig_count=%d\n",numConfigs);
for( m=0; m<10 ; m++)
{
eglGetConfigAttrib(dpy, config[m], EGL_RED_SIZE, &red);
eglGetConfigAttrib(dpy, config[m], EGL_GREEN_SIZE, &green);
eglGetConfigAttrib(dpy, config[m], EGL_BLUE_SIZE, &blue);
// eglGetConfigAttrib(dpy, configs[m], EGL_ALPHA_SIZE, &alpha);
printf("( Pixel format = %d %d %d %d\n",m+1,red, green, blue);
}
eRetStatus=eglChooseConfig(dpy, attribList, &config, 1, &numConfigs);
if( eRetStatus == EGL_TRUE)
printf("chooseconfig keka");
context=eglCreateContext (dpy, config, EGL_NO_CONTEXT, context_attribs);
if (context == EGL_NO_CONTEXT)
{
printf("context also wasted");
return EGL_FALSE;
}
pbuffer = eglCreatePbufferSurface(dpy, config, attribList);
err=eglGetError();
if(err==EGL_NO_SURFACE)
{
printf("err==EGL_NO_SURFACE");
}
if(err==EGL_BAD_ALLOC)
{
printf("err==EGL_BAD_ALLOC");
}
if(err==EGL_BAD_CONFIG)
{
printf("err==EGL_BAD_CONFIG");
}
if(err==EGL_BAD_PARAMETER)
{
printf("err==EGL_BAD_PARAMETER");
}
if(err==EGL_BAD_MATCH)
{
printf("err==EGL_BAD_MATCH");
}
if(!eglBindAPI(EGL_OPENGL_ES_API))
{
return EGL_FALSE;
}
if(!eglMakeCurrent (dpy, pbuffer,pbuffer, context))
{
return EGL_FALSE;
} | c | opengl-es | opengl-es-2.0 | glut | egl | null | open | EGL_BAD_CONFIG error opengl es 2.0 with egl 1.4
===
I have created the shaders and the draw function. At this stage i want to create surface and context using egl to compile the shader.
here is my code.
I am get no error with display ,initialization or getconfigs. when i chooseconfigs it not choosing anything and returning false. Am i giving the wrong attribList and context_attribs.
Can anyone help me out with it.
EGLint err;
EGLBoolean eRetStatus;
EGLContext context;
EGLDisplay dpy;
EGLSurface pbuffer;
EGLint major, minor;
EGLint numConfigs;
EGLConfig config[10];
EGLint context_attribs[] = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE};
EGLint attribList[]=
{ EGL_RED_SIZE,5,EGL_GREEN_SIZE, 6,EGL_BLUE_SIZE,5, EGL_BIND_TO_TEXTURE_RGB,EGL_TRUE};
EGLint red, blue, green,m;
dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
err=eglGetError();
if(err=EGL_NO_DISPLAY)
{
printf("no display");
return EGL_FALSE;
}
eRetStatus = eglInitialize(dpy, &major, &minor);
if(eRetStatus==EGL_TRUE)
printf("initialized kaka");
eRetStatus = eglGetConfigs (dpy, config, 10, &numConfigs);
if(eRetStatus==EGL_BAD_PARAMETER )
printf("configs bad in getconfigs");
printf("\nConfig_count=%d\n",numConfigs);
for( m=0; m<10 ; m++)
{
eglGetConfigAttrib(dpy, config[m], EGL_RED_SIZE, &red);
eglGetConfigAttrib(dpy, config[m], EGL_GREEN_SIZE, &green);
eglGetConfigAttrib(dpy, config[m], EGL_BLUE_SIZE, &blue);
// eglGetConfigAttrib(dpy, configs[m], EGL_ALPHA_SIZE, &alpha);
printf("( Pixel format = %d %d %d %d\n",m+1,red, green, blue);
}
eRetStatus=eglChooseConfig(dpy, attribList, &config, 1, &numConfigs);
if( eRetStatus == EGL_TRUE)
printf("chooseconfig keka");
context=eglCreateContext (dpy, config, EGL_NO_CONTEXT, context_attribs);
if (context == EGL_NO_CONTEXT)
{
printf("context also wasted");
return EGL_FALSE;
}
pbuffer = eglCreatePbufferSurface(dpy, config, attribList);
err=eglGetError();
if(err==EGL_NO_SURFACE)
{
printf("err==EGL_NO_SURFACE");
}
if(err==EGL_BAD_ALLOC)
{
printf("err==EGL_BAD_ALLOC");
}
if(err==EGL_BAD_CONFIG)
{
printf("err==EGL_BAD_CONFIG");
}
if(err==EGL_BAD_PARAMETER)
{
printf("err==EGL_BAD_PARAMETER");
}
if(err==EGL_BAD_MATCH)
{
printf("err==EGL_BAD_MATCH");
}
if(!eglBindAPI(EGL_OPENGL_ES_API))
{
return EGL_FALSE;
}
if(!eglMakeCurrent (dpy, pbuffer,pbuffer, context))
{
return EGL_FALSE;
} | 0 |
11,734,271 | 07/31/2012 06:22:22 | 1,550,164 | 07/25/2012 00:20:43 | 1 | 0 | invalid column name exception even though when column exists | when i try to access database with this query is says invalid column name 'sandeep' which is the name of the patient ie itemArray[3]
case "patient":
string queryPatientCheck = @"select
*
from
patient
where
[patientID]={0} and
[patientName]={1}";
queryPatientCheck = string.Format(queryPatientCheck, itemArray[2], itemArray[3]);
| c# | null | null | null | null | null | open | invalid column name exception even though when column exists
===
when i try to access database with this query is says invalid column name 'sandeep' which is the name of the patient ie itemArray[3]
case "patient":
string queryPatientCheck = @"select
*
from
patient
where
[patientID]={0} and
[patientName]={1}";
queryPatientCheck = string.Format(queryPatientCheck, itemArray[2], itemArray[3]);
| 0 |
11,734,272 | 07/31/2012 06:22:32 | 124,875 | 06/18/2009 05:59:26 | 860 | 10 | Getting row sum of the Table | Is it possible to take the row sum of the all rows from a datatable in SQL. I have one datatable like this
Date col1 col2 col3
30/7/2012 5 2 3
31/7/2012 2 3 5
01/08/2012 2 4 1
but i want to achieve like this by creating one column name Total
like:
Date Total col1 col2 col3
30/7/2012 10 5 2 3
31/7/2012 9 1 3 5
01/08/2012 7 2 4 1
Is it Possible? If yes please help me for the same. | sql | datatable | null | null | null | null | open | Getting row sum of the Table
===
Is it possible to take the row sum of the all rows from a datatable in SQL. I have one datatable like this
Date col1 col2 col3
30/7/2012 5 2 3
31/7/2012 2 3 5
01/08/2012 2 4 1
but i want to achieve like this by creating one column name Total
like:
Date Total col1 col2 col3
30/7/2012 10 5 2 3
31/7/2012 9 1 3 5
01/08/2012 7 2 4 1
Is it Possible? If yes please help me for the same. | 0 |
11,734,273 | 07/31/2012 06:22:39 | 173,626 | 09/15/2009 09:58:07 | 533 | 6 | javax.faces.application.ViewExpiredException: During load test | We are Using SUN JSF 1.2, WebSphere 7.0 for our application, we are getting ViewExpiredException only during the load testing
I have gone through the below link
[http://stackoverflow.com/questions/3642919/javax-faces-application-viewexpiredexception-view-could-not-be-restored/3642969#3642969][1]
Have followed most of the stuff,
1. Setting the context param,
<context-param>
<param-name>com.sun.faces.enableRestoreView11Compatibility</param-name>
<param-value>true</param-value>
</context-param>
2. Instructed the browser to not cache the dynamic JSF pages by adding the below code at top of all JSP pages,
res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
res.setHeader("Pragma", "no-cache");
res.setDateHeader("Expires", -1);
We are not getting the exception when we manually browse through the application. I am not able to figure out the issue.
Kindly advice.
[1]: http://stackoverflow.com/questions/3642919/javax-faces-application-viewexpiredexception-view-could-not-be-restored/3642969#3642969 | java | jsf | jsf-1.2 | viewexpiredexception | null | null | open | javax.faces.application.ViewExpiredException: During load test
===
We are Using SUN JSF 1.2, WebSphere 7.0 for our application, we are getting ViewExpiredException only during the load testing
I have gone through the below link
[http://stackoverflow.com/questions/3642919/javax-faces-application-viewexpiredexception-view-could-not-be-restored/3642969#3642969][1]
Have followed most of the stuff,
1. Setting the context param,
<context-param>
<param-name>com.sun.faces.enableRestoreView11Compatibility</param-name>
<param-value>true</param-value>
</context-param>
2. Instructed the browser to not cache the dynamic JSF pages by adding the below code at top of all JSP pages,
res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
res.setHeader("Pragma", "no-cache");
res.setDateHeader("Expires", -1);
We are not getting the exception when we manually browse through the application. I am not able to figure out the issue.
Kindly advice.
[1]: http://stackoverflow.com/questions/3642919/javax-faces-application-viewexpiredexception-view-could-not-be-restored/3642969#3642969 | 0 |
11,734,254 | 07/31/2012 06:20:43 | 912,703 | 08/25/2011 17:44:50 | 177 | 0 | Suitable Data Structure for storing and searching the result of tournament | There are 100 players p1, p2, ...... p100, Each player plays a match against every other player. You have to store the result of the matches that is the winner of each combination (Pi, Pj). **What data structure will you use for an efficient store and search of result?**
Given a query (P5, P83), search in the data structure returns 5 or 83 depending on who won. | c++ | homework | data-structures | null | null | null | open | Suitable Data Structure for storing and searching the result of tournament
===
There are 100 players p1, p2, ...... p100, Each player plays a match against every other player. You have to store the result of the matches that is the winner of each combination (Pi, Pj). **What data structure will you use for an efficient store and search of result?**
Given a query (P5, P83), search in the data structure returns 5 or 83 depending on who won. | 0 |
584,983 | 02/25/2009 06:50:53 | 63,051 | 02/05/2009 20:53:34 | 137 | 5 | Is there a plugin or extension that allows to use DWR remote calls as a YUI Data Source? | Is there a plugin or extension that allows to use DWR remote calls as a YUI Data Source? | yui | dwr | javascript | null | null | null | open | Is there a plugin or extension that allows to use DWR remote calls as a YUI Data Source?
===
Is there a plugin or extension that allows to use DWR remote calls as a YUI Data Source? | 0 |
11,734,274 | 07/31/2012 06:22:42 | 1,314,292 | 04/05/2012 03:30:20 | 35 | 4 | Dynamic library not loading libstdc++ in JS-Ctypes plugin | So I built this Firefox plugin with calls to JS-Ctypes. Everything worked fine.
But then I got an email from one of the users that it is not working. I checked it on my computer, and it was not working, indeed. It said `Error: Couldn't load library`.
I guessed that could be because of dynamic dependencies not being loaded. So it did a `otool` on the library.
Rahuls-MacBook-Pro:Debug rahuljiresal$ otool -L libReverbFirefoxExtensionLib.dylib
libReverbFirefoxExtensionLib.dylib:
/usr/local/lib/libReverbFirefoxExtensionLib.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
Clearly, there are these two libraries that are dynamically linked to my Firefox extension library are not getting loaded.
My questions -
1. Is there a way to statically link those libraries? (I couldn't find static versions of those libraries in `/usr/lib`)
2. Or, is there a way to load those libraries when needed by my extension?
3. What does the `compatibility version` and `current version` thing mean in the `otool` output?
4. The original library was built on OS X Lion (like 10 days ago). Now I have upgraded to Mountain Lion. Why did it work then and not working now?
I want this Firefox plugin to work on Snow Leopard, Lion and Mountain Lion. I read somewhere that there are incompatibilities between major versions of `libstdc++` libraries. Is that true? If yes, how do I make my plugin work on all 3 versions of OS X? | osx | firefox | std | jsctypes | null | null | open | Dynamic library not loading libstdc++ in JS-Ctypes plugin
===
So I built this Firefox plugin with calls to JS-Ctypes. Everything worked fine.
But then I got an email from one of the users that it is not working. I checked it on my computer, and it was not working, indeed. It said `Error: Couldn't load library`.
I guessed that could be because of dynamic dependencies not being loaded. So it did a `otool` on the library.
Rahuls-MacBook-Pro:Debug rahuljiresal$ otool -L libReverbFirefoxExtensionLib.dylib
libReverbFirefoxExtensionLib.dylib:
/usr/local/lib/libReverbFirefoxExtensionLib.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
Clearly, there are these two libraries that are dynamically linked to my Firefox extension library are not getting loaded.
My questions -
1. Is there a way to statically link those libraries? (I couldn't find static versions of those libraries in `/usr/lib`)
2. Or, is there a way to load those libraries when needed by my extension?
3. What does the `compatibility version` and `current version` thing mean in the `otool` output?
4. The original library was built on OS X Lion (like 10 days ago). Now I have upgraded to Mountain Lion. Why did it work then and not working now?
I want this Firefox plugin to work on Snow Leopard, Lion and Mountain Lion. I read somewhere that there are incompatibilities between major versions of `libstdc++` libraries. Is that true? If yes, how do I make my plugin work on all 3 versions of OS X? | 0 |
11,734,282 | 07/31/2012 06:23:13 | 309,797 | 04/06/2010 07:13:07 | 227 | 5 | Workflow services and operations not supported by states | I have two workflow services (state machines) that should cooperate and exchange information to accomplish the desired behavior.
The problem I have (but I also had it with only one state machine) is that sometimes I try to send an operation which is not allowed by the current state.
There are two problems: 1) I have to wait the operation timeout to know that the operation was not allowed 2) I'm "masking" real timeouts due to other problems
By now, I found two possible solutions: 1) I can change signatures to return true (allowed) and false (not allowed) and add all operations to all states, (not allowed operations would trigger a self-transition) 2) I always add all transitions to all states (not allowed would trigger a self-transition) but for transitions not allowed I will send an exception
I would like to know which is the best option (and, of course, I'd appreciate other possible solutions too).
I would also like to know how I could reply to a request with an exception (maybe throwing it within a try/catch?).
Thanks | workflow-foundation-4 | workflow-services | null | null | null | null | open | Workflow services and operations not supported by states
===
I have two workflow services (state machines) that should cooperate and exchange information to accomplish the desired behavior.
The problem I have (but I also had it with only one state machine) is that sometimes I try to send an operation which is not allowed by the current state.
There are two problems: 1) I have to wait the operation timeout to know that the operation was not allowed 2) I'm "masking" real timeouts due to other problems
By now, I found two possible solutions: 1) I can change signatures to return true (allowed) and false (not allowed) and add all operations to all states, (not allowed operations would trigger a self-transition) 2) I always add all transitions to all states (not allowed would trigger a self-transition) but for transitions not allowed I will send an exception
I would like to know which is the best option (and, of course, I'd appreciate other possible solutions too).
I would also like to know how I could reply to a request with an exception (maybe throwing it within a try/catch?).
Thanks | 0 |
11,734,284 | 07/31/2012 06:23:15 | 1,358,441 | 04/26/2012 10:37:05 | 116 | 9 | Background Application unable to display UI when receive push notification | Here is my full push notification listener.
public class MyApp extends UiApplication {
public static void main(String[] args) {
PushAgent pa = new PushAgent();
pa.enterEventDispatcher();
}
}
This class is extend correct?
public class PushAgent extends Application {
private static final String PUSH_PORT = "32023";
private static final String BPAS_URL = "http://pushapi.eval.blackberry.com";
private static final String APP_ID = "2727-c55087eR3001rr475448i013212a56shss2";
private static final String CONNECTION_SUFFIX = ";deviceside=false;ConnectionType=mds-public";
public static final long ID = 0x749cb23a75c60e2dL;
private MessageReadingThread messageReadingThread;
public PushAgent() {
if (!CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_BIS_B)) {
return;
}
if (DeviceInfo.isSimulator()) {
return;
}
messageReadingThread = new MessageReadingThread();
messageReadingThread.start();
registerBpas();
}
private static class MessageReadingThread extends Thread {
private boolean running;
private ServerSocketConnection socket;
private HttpServerConnection conn;
private InputStream inputStream;
private PushInputStream pushInputStream;
public MessageReadingThread() {
this.running = true;
}
public void run() {
String url = "http://:" + PUSH_PORT + CONNECTION_SUFFIX;
try {
socket = (ServerSocketConnection) Connector.open(url);
} catch (IOException ex) {
}
while (running) {
try {
Object o = socket.acceptAndOpen();
conn = (HttpServerConnection) o;
inputStream = conn.openInputStream();
pushInputStream = new MDSPushInputStream(conn, inputStream);
PushMessageReader.process(pushInputStream, conn);
} catch (Exception e) {
if (running) {
running = false;
}
} finally {
close(conn, pushInputStream, null);
}
}
}
}
public static void close(Connection conn, InputStream is, OutputStream os) {
if (os != null) {
try {
os.close();
} catch (IOException e) {
}
}
if (is != null) {
try {
is.close();
} catch (IOException e) {
}
}
if (conn != null) {
try {
conn.close();
} catch (IOException e) {
}
}
}
private String formRegisterRequest(String bpasUrl, String appId,
String token) {
StringBuffer sb = new StringBuffer(bpasUrl);
sb.append("/mss/PD_subReg?");
sb.append("serviceid=").append(appId);
sb.append("&osversion=").append(DeviceInfo.getSoftwareVersion());
sb.append("&model=").append(DeviceInfo.getDeviceName());
if (token != null && token.length() > 0) {
sb.append("&").append(token);
}
return sb.toString();
}
private void registerBpas() {
final String registerUrl = formRegisterRequest(BPAS_URL, APP_ID, null)
+ CONNECTION_SUFFIX;
Object theSource = new Object() {
public String toString() {
return "Oriental Daily";
}
};
NotificationsManager.registerSource(ID, theSource,
NotificationsConstants.IMPORTANT);
new Thread() {
public void run() {
try {
HttpConnection httpConnection = (HttpConnection) Connector
.open(registerUrl);
InputStream is = httpConnection.openInputStream();
String response = new String(IOUtilities.streamToBytes(is));
close(httpConnection, is, null);
String nextUrl = formRegisterRequest(BPAS_URL, APP_ID,
response) + CONNECTION_SUFFIX;
HttpConnection nextHttpConnection = (HttpConnection) Connector
.open(nextUrl);
InputStream nextInputStream = nextHttpConnection
.openInputStream();
response = new String(
IOUtilities.streamToBytes(nextInputStream));
close(nextHttpConnection, is, null);
} catch (IOException e) {
}
}
}.start();
}
}
}
This is the `process`;
public class PushMessageReader {
private static final String MESSAGE_ID_HEADER = "Push-Message-ID";
private static final String MESSAGE_TYPE_TEXT = "text";
private static final String MESSAGE_TYPE_IMAGE = "image";
private static final int MESSAGE_ID_HISTORY_LENGTH = 10;
private static String[] messageIdHistory = new String[MESSAGE_ID_HISTORY_LENGTH];
private static byte historyIndex;
private static byte[] buffer = new byte[15 * 1024];
private static byte[] imageBuffer = new byte[10 * 1024];
public static final long ID = 0x749cb23a75c60e2dL;
public static Bitmap popup = Bitmap.getBitmapResource("icon_24.png");
private PushMessageReader() {
}
public static void process(PushInputStream pis, Connection conn) {
try {
HttpServerConnection httpConn;
if (conn instanceof HttpServerConnection) {
httpConn = (HttpServerConnection) conn;
} else {
throw new IllegalArgumentException(
"Can not process non-http pushes, expected HttpServerConnection but have "
+ conn.getClass().getName());
}
String msgId = httpConn.getHeaderField(MESSAGE_ID_HEADER);
String msgType = httpConn.getType();
String encoding = httpConn.getEncoding();
if (!alreadyReceived(msgId)) {
byte[] binaryData;
if (msgId == null) {
msgId = String.valueOf(System.currentTimeMillis());
}
if (msgType.indexOf(MESSAGE_TYPE_TEXT) >= 0) {
int size = pis.read(buffer);
binaryData = new byte[size];
System.arraycopy(buffer, 0, binaryData, 0, size);
NotificationsManager.triggerImmediateEvent(ID, 0, null,
null);
processTextMessage(buffer);
} else if (msgType.indexOf(MESSAGE_TYPE_IMAGE) >= 0) {
int size = pis.read(buffer);
if (encoding != null && encoding.equalsIgnoreCase("base64")) {
Base64InputStream bis = new Base64InputStream(
new ByteArrayInputStream(buffer, 0, size));
size = bis.read(imageBuffer);
}
binaryData = new byte[size];
System.arraycopy(buffer, 0, binaryData, 0, size);
}
}
pis.accept();
} catch (Exception e) {
} finally {
PushAgent.close(conn, pis, null);
}
}
private static boolean alreadyReceived(String id) {
if (id == null) {
return false;
}
if (Arrays.contains(messageIdHistory, id)) {
return true;
}
messageIdHistory[historyIndex++] = id;
if (historyIndex >= MESSAGE_ID_HISTORY_LENGTH) {
historyIndex = 0;
}
return false;
}
private static void processTextMessage(final byte[] data) {
synchronized (Application.getEventLock()) {
UiEngine ui = Ui.getUiEngine();
GlobalDialog screen = new GlobalDialog("New Notification",
"Article ID : " + new String(data), new String(data));
ui.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_QUEUE);
}
}
static class GlobalDialog extends PopupScreen implements
FieldChangeListener {
ButtonField mOKButton = new ButtonField("OK", ButtonField.CONSUME_CLICK
| FIELD_HCENTER);
String data = "";
public GlobalDialog(String title, String text, String data) {
super(new VerticalFieldManager());
this.data = data;
add(new LabelField(title));
add(new SeparatorField(SeparatorField.LINE_HORIZONTAL));
add(new LabelField(text, DrawStyle.HCENTER));
mOKButton.setChangeListener(this);
add(mOKButton);
}
public void fieldChanged(Field field, int context) {
if (mOKButton == field) {
try {
ApplicationManager.getApplicationManager().launch(
"OrientalDailyBB");
ApplicationManager.getApplicationManager().postGlobalEvent(
ID, 0, 0, data, null);
ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry
.getInstance();
reg.unregister();
close();
} catch (ApplicationManagerException e) {
}
}
}
}
}
In this project, I checked `Auto-run on startup` so that this background app listener will run all the time and set the `start tier` to 7 in BB App Descriptor.
However, it cannot display the popup Dialog but I can see the device has received the push notification.
After the dialog popup and user click `OK` will start `OrientalDailyBB` project and display particular `MainScreen`. | blackberry | push-notification | listener | background-application | null | null | open | Background Application unable to display UI when receive push notification
===
Here is my full push notification listener.
public class MyApp extends UiApplication {
public static void main(String[] args) {
PushAgent pa = new PushAgent();
pa.enterEventDispatcher();
}
}
This class is extend correct?
public class PushAgent extends Application {
private static final String PUSH_PORT = "32023";
private static final String BPAS_URL = "http://pushapi.eval.blackberry.com";
private static final String APP_ID = "2727-c55087eR3001rr475448i013212a56shss2";
private static final String CONNECTION_SUFFIX = ";deviceside=false;ConnectionType=mds-public";
public static final long ID = 0x749cb23a75c60e2dL;
private MessageReadingThread messageReadingThread;
public PushAgent() {
if (!CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_BIS_B)) {
return;
}
if (DeviceInfo.isSimulator()) {
return;
}
messageReadingThread = new MessageReadingThread();
messageReadingThread.start();
registerBpas();
}
private static class MessageReadingThread extends Thread {
private boolean running;
private ServerSocketConnection socket;
private HttpServerConnection conn;
private InputStream inputStream;
private PushInputStream pushInputStream;
public MessageReadingThread() {
this.running = true;
}
public void run() {
String url = "http://:" + PUSH_PORT + CONNECTION_SUFFIX;
try {
socket = (ServerSocketConnection) Connector.open(url);
} catch (IOException ex) {
}
while (running) {
try {
Object o = socket.acceptAndOpen();
conn = (HttpServerConnection) o;
inputStream = conn.openInputStream();
pushInputStream = new MDSPushInputStream(conn, inputStream);
PushMessageReader.process(pushInputStream, conn);
} catch (Exception e) {
if (running) {
running = false;
}
} finally {
close(conn, pushInputStream, null);
}
}
}
}
public static void close(Connection conn, InputStream is, OutputStream os) {
if (os != null) {
try {
os.close();
} catch (IOException e) {
}
}
if (is != null) {
try {
is.close();
} catch (IOException e) {
}
}
if (conn != null) {
try {
conn.close();
} catch (IOException e) {
}
}
}
private String formRegisterRequest(String bpasUrl, String appId,
String token) {
StringBuffer sb = new StringBuffer(bpasUrl);
sb.append("/mss/PD_subReg?");
sb.append("serviceid=").append(appId);
sb.append("&osversion=").append(DeviceInfo.getSoftwareVersion());
sb.append("&model=").append(DeviceInfo.getDeviceName());
if (token != null && token.length() > 0) {
sb.append("&").append(token);
}
return sb.toString();
}
private void registerBpas() {
final String registerUrl = formRegisterRequest(BPAS_URL, APP_ID, null)
+ CONNECTION_SUFFIX;
Object theSource = new Object() {
public String toString() {
return "Oriental Daily";
}
};
NotificationsManager.registerSource(ID, theSource,
NotificationsConstants.IMPORTANT);
new Thread() {
public void run() {
try {
HttpConnection httpConnection = (HttpConnection) Connector
.open(registerUrl);
InputStream is = httpConnection.openInputStream();
String response = new String(IOUtilities.streamToBytes(is));
close(httpConnection, is, null);
String nextUrl = formRegisterRequest(BPAS_URL, APP_ID,
response) + CONNECTION_SUFFIX;
HttpConnection nextHttpConnection = (HttpConnection) Connector
.open(nextUrl);
InputStream nextInputStream = nextHttpConnection
.openInputStream();
response = new String(
IOUtilities.streamToBytes(nextInputStream));
close(nextHttpConnection, is, null);
} catch (IOException e) {
}
}
}.start();
}
}
}
This is the `process`;
public class PushMessageReader {
private static final String MESSAGE_ID_HEADER = "Push-Message-ID";
private static final String MESSAGE_TYPE_TEXT = "text";
private static final String MESSAGE_TYPE_IMAGE = "image";
private static final int MESSAGE_ID_HISTORY_LENGTH = 10;
private static String[] messageIdHistory = new String[MESSAGE_ID_HISTORY_LENGTH];
private static byte historyIndex;
private static byte[] buffer = new byte[15 * 1024];
private static byte[] imageBuffer = new byte[10 * 1024];
public static final long ID = 0x749cb23a75c60e2dL;
public static Bitmap popup = Bitmap.getBitmapResource("icon_24.png");
private PushMessageReader() {
}
public static void process(PushInputStream pis, Connection conn) {
try {
HttpServerConnection httpConn;
if (conn instanceof HttpServerConnection) {
httpConn = (HttpServerConnection) conn;
} else {
throw new IllegalArgumentException(
"Can not process non-http pushes, expected HttpServerConnection but have "
+ conn.getClass().getName());
}
String msgId = httpConn.getHeaderField(MESSAGE_ID_HEADER);
String msgType = httpConn.getType();
String encoding = httpConn.getEncoding();
if (!alreadyReceived(msgId)) {
byte[] binaryData;
if (msgId == null) {
msgId = String.valueOf(System.currentTimeMillis());
}
if (msgType.indexOf(MESSAGE_TYPE_TEXT) >= 0) {
int size = pis.read(buffer);
binaryData = new byte[size];
System.arraycopy(buffer, 0, binaryData, 0, size);
NotificationsManager.triggerImmediateEvent(ID, 0, null,
null);
processTextMessage(buffer);
} else if (msgType.indexOf(MESSAGE_TYPE_IMAGE) >= 0) {
int size = pis.read(buffer);
if (encoding != null && encoding.equalsIgnoreCase("base64")) {
Base64InputStream bis = new Base64InputStream(
new ByteArrayInputStream(buffer, 0, size));
size = bis.read(imageBuffer);
}
binaryData = new byte[size];
System.arraycopy(buffer, 0, binaryData, 0, size);
}
}
pis.accept();
} catch (Exception e) {
} finally {
PushAgent.close(conn, pis, null);
}
}
private static boolean alreadyReceived(String id) {
if (id == null) {
return false;
}
if (Arrays.contains(messageIdHistory, id)) {
return true;
}
messageIdHistory[historyIndex++] = id;
if (historyIndex >= MESSAGE_ID_HISTORY_LENGTH) {
historyIndex = 0;
}
return false;
}
private static void processTextMessage(final byte[] data) {
synchronized (Application.getEventLock()) {
UiEngine ui = Ui.getUiEngine();
GlobalDialog screen = new GlobalDialog("New Notification",
"Article ID : " + new String(data), new String(data));
ui.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_QUEUE);
}
}
static class GlobalDialog extends PopupScreen implements
FieldChangeListener {
ButtonField mOKButton = new ButtonField("OK", ButtonField.CONSUME_CLICK
| FIELD_HCENTER);
String data = "";
public GlobalDialog(String title, String text, String data) {
super(new VerticalFieldManager());
this.data = data;
add(new LabelField(title));
add(new SeparatorField(SeparatorField.LINE_HORIZONTAL));
add(new LabelField(text, DrawStyle.HCENTER));
mOKButton.setChangeListener(this);
add(mOKButton);
}
public void fieldChanged(Field field, int context) {
if (mOKButton == field) {
try {
ApplicationManager.getApplicationManager().launch(
"OrientalDailyBB");
ApplicationManager.getApplicationManager().postGlobalEvent(
ID, 0, 0, data, null);
ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry
.getInstance();
reg.unregister();
close();
} catch (ApplicationManagerException e) {
}
}
}
}
}
In this project, I checked `Auto-run on startup` so that this background app listener will run all the time and set the `start tier` to 7 in BB App Descriptor.
However, it cannot display the popup Dialog but I can see the device has received the push notification.
After the dialog popup and user click `OK` will start `OrientalDailyBB` project and display particular `MainScreen`. | 0 |
11,734,286 | 07/31/2012 06:23:33 | 1,312,265 | 04/04/2012 08:06:25 | 14 | 0 | GPU background processing | Just like CPU, does GPU also runs some processing in the background? what I want to get is the current load on the GPU. So, I would like to know if the load on GPU is completely based on what is currently displayed on the the screen or does it also has some processing going on in the background related to other apps which make use of GPU.
thanks in advance. | android | gpu | background-process | null | null | null | open | GPU background processing
===
Just like CPU, does GPU also runs some processing in the background? what I want to get is the current load on the GPU. So, I would like to know if the load on GPU is completely based on what is currently displayed on the the screen or does it also has some processing going on in the background related to other apps which make use of GPU.
thanks in advance. | 0 |
11,471,603 | 07/13/2012 13:37:14 | 1,247,395 | 03/03/2012 22:01:50 | 17 | 2 | Max Date on PalmOS | I have a customer that still has an application running on PalmOS.
What is the maximum date value for PalmOS? | date | maximum | palm-os | null | null | null | open | Max Date on PalmOS
===
I have a customer that still has an application running on PalmOS.
What is the maximum date value for PalmOS? | 0 |
11,471,604 | 07/13/2012 13:37:22 | 872,975 | 08/01/2011 14:45:52 | 880 | 46 | Getting "405 - Request method 'GET' not supported when calling" method=DELETE | I have a Spring MVC web app. In it a form with a button that's supposed to delete a resource from another resource:
<td>
<form action="/product-bases/${productBase.id}/positions/${position.id}" method="DELETE">
<input type="submit" value="delete" />
</form>
</td>
My controller:
@Controller
@RequestMapping(value = "/product-bases/{id}/positions")
public class ProductBasePositionController {
@RequestMapping(value = "/{positionId}", method = RequestMethod.DELETE)
public ModelAndView delete(@PathVariable Integer productBaseId, @PathVariable Integer positionId) {
So in theory the server should route to the controller. But alas it does not, hence the post ;)
I'm getting
HTTP Status 405 - Request method 'GET' not supported
type Status report
message Request method 'GET' not supported
description The specified HTTP method is not allowed for the requested resource (Request method 'GET' not supported).
Apache Tomcat/7.0.19
Obviously I don't have a get for /positions/id defined yet, but why should I, I want to do a delete for now..
(I'm also trying to run this from my spring-test-mvc framework on a mock servlet without any tomcat implementation in between and it gives me a 400 - bad request..
)
So what am I missing here?
Oh, just to cut some corners: post and get will work for other resources, so the rest of my setup is fine.
The booting server even tells me:
RequestMappingHandlerMapping [INFO] Mapped "{[/product-bases/{id}/positions/{positionId}],methods=[DELETE],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.ModelAndView our.view.controller.ProductBasePositionController.delete(java.lang.Integer,java.lang.Integer)
Anyone as confused as I am? If less so, please enlighten me! | java | http | servlets | spring-mvc | null | null | open | Getting "405 - Request method 'GET' not supported when calling" method=DELETE
===
I have a Spring MVC web app. In it a form with a button that's supposed to delete a resource from another resource:
<td>
<form action="/product-bases/${productBase.id}/positions/${position.id}" method="DELETE">
<input type="submit" value="delete" />
</form>
</td>
My controller:
@Controller
@RequestMapping(value = "/product-bases/{id}/positions")
public class ProductBasePositionController {
@RequestMapping(value = "/{positionId}", method = RequestMethod.DELETE)
public ModelAndView delete(@PathVariable Integer productBaseId, @PathVariable Integer positionId) {
So in theory the server should route to the controller. But alas it does not, hence the post ;)
I'm getting
HTTP Status 405 - Request method 'GET' not supported
type Status report
message Request method 'GET' not supported
description The specified HTTP method is not allowed for the requested resource (Request method 'GET' not supported).
Apache Tomcat/7.0.19
Obviously I don't have a get for /positions/id defined yet, but why should I, I want to do a delete for now..
(I'm also trying to run this from my spring-test-mvc framework on a mock servlet without any tomcat implementation in between and it gives me a 400 - bad request..
)
So what am I missing here?
Oh, just to cut some corners: post and get will work for other resources, so the rest of my setup is fine.
The booting server even tells me:
RequestMappingHandlerMapping [INFO] Mapped "{[/product-bases/{id}/positions/{positionId}],methods=[DELETE],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.ModelAndView our.view.controller.ProductBasePositionController.delete(java.lang.Integer,java.lang.Integer)
Anyone as confused as I am? If less so, please enlighten me! | 0 |
11,471,606 | 07/13/2012 13:37:27 | 1,272,060 | 03/15/2012 16:26:19 | 1 | 0 | how to add new datatable to dataset at first position | i have one dataset with 3 data tables again i have to add one more data table in same dataset at first position(Ex:mydataset.tables[0]th position) .can any one help me regarding this. | c# | asp.net | null | null | null | null | open | how to add new datatable to dataset at first position
===
i have one dataset with 3 data tables again i have to add one more data table in same dataset at first position(Ex:mydataset.tables[0]th position) .can any one help me regarding this. | 0 |
11,471,608 | 07/13/2012 13:37:39 | 9,140 | 09/15/2008 17:49:56 | 1,022 | 6 | How to run mercurial changegroup hook only after a rebase? | We have a simple mercurial hook that runs every time we pull remote changes. We use changegroup hook. Our hook rebuilds some dlls and copy them to a folder. We automatically rebase when we do a pull. This causes our hook to be run two times, first when we do the pull, then after the automatic rebase.
Is there any easy way to detect if there's going to be a rebase and only run the hook once at the end of the rebase?
Thanks, | mercurial | mercurial-hook | null | null | null | null | open | How to run mercurial changegroup hook only after a rebase?
===
We have a simple mercurial hook that runs every time we pull remote changes. We use changegroup hook. Our hook rebuilds some dlls and copy them to a folder. We automatically rebase when we do a pull. This causes our hook to be run two times, first when we do the pull, then after the automatic rebase.
Is there any easy way to detect if there's going to be a rebase and only run the hook once at the end of the rebase?
Thanks, | 0 |
11,471,614 | 07/13/2012 13:38:00 | 1,523,671 | 07/13/2012 13:26:31 | 1 | 0 | MySQL JOIN, only get max value | I'm struggling with the following situation:
I have a users table with authors of plugins in it. I have a plugins table with plugins in it (name and id). I also have a version table. This version table holds all the versions of a plugin released, for example 1.0, 1.1 etcetera.Now the version records also holds mcversions, which is a version of the engine that the plugin is made for.
Here is the query I made:
SELECT
`plugins`.`name`,
users.username,
versions.version,
mcversions.version
FROM
users
INNER JOIN `plugins` ON `plugins`.author = users.id
INNER JOIN versions ON versions.id = `plugins`.id AND versions.time
INNER JOIN mcversions ON versions.mcversion = mcversions.id
Now there is one problem: I only want to get the version and the mcversion that belongs to the version where the versions.time is the highest (it's a timestamp).
So I want a list of plugins with the name, the author, the latest version and the mcversion that the latest version is made for.
I anyone could help me, I would be very happy!
~Bas | mysql | query | join | timestamp | null | null | open | MySQL JOIN, only get max value
===
I'm struggling with the following situation:
I have a users table with authors of plugins in it. I have a plugins table with plugins in it (name and id). I also have a version table. This version table holds all the versions of a plugin released, for example 1.0, 1.1 etcetera.Now the version records also holds mcversions, which is a version of the engine that the plugin is made for.
Here is the query I made:
SELECT
`plugins`.`name`,
users.username,
versions.version,
mcversions.version
FROM
users
INNER JOIN `plugins` ON `plugins`.author = users.id
INNER JOIN versions ON versions.id = `plugins`.id AND versions.time
INNER JOIN mcversions ON versions.mcversion = mcversions.id
Now there is one problem: I only want to get the version and the mcversion that belongs to the version where the versions.time is the highest (it's a timestamp).
So I want a list of plugins with the name, the author, the latest version and the mcversion that the latest version is made for.
I anyone could help me, I would be very happy!
~Bas | 0 |
11,471,615 | 07/13/2012 13:38:00 | 1,474,819 | 06/22/2012 12:34:04 | 3 | 0 | Need help completing android menu screen | I am developing this app which opens a webview on a page on an internal web server. I need to add the option to set the IP address of that server (this is because it is running from a PA system and will be different to each install).
I have started the app by creating the default (WebView) activity called MainActivity and a seperate class for the menu called mySettings. I can successfully open the app and open the menu options screen where there is a box and submit button. I just need help saving the ip address preference on button press and moving back to the main screen (WebView) and connecting to said IP address.
Rather than paste a load of code which you may/may not need, let me know what you require to help ,e and I will update the post accordingly.
Yes, this is probably a noob question, but I have scoured the internet trying to find a *complete* tutorial with no avail.
You guys are my last hope!
Thank you in advance | android | menu | save | preferences | options | null | open | Need help completing android menu screen
===
I am developing this app which opens a webview on a page on an internal web server. I need to add the option to set the IP address of that server (this is because it is running from a PA system and will be different to each install).
I have started the app by creating the default (WebView) activity called MainActivity and a seperate class for the menu called mySettings. I can successfully open the app and open the menu options screen where there is a box and submit button. I just need help saving the ip address preference on button press and moving back to the main screen (WebView) and connecting to said IP address.
Rather than paste a load of code which you may/may not need, let me know what you require to help ,e and I will update the post accordingly.
Yes, this is probably a noob question, but I have scoured the internet trying to find a *complete* tutorial with no avail.
You guys are my last hope!
Thank you in advance | 0 |
11,471,617 | 07/13/2012 13:38:26 | 1,523,513 | 07/13/2012 12:19:37 | 1 | 0 | (Dynamic Jasper Reports) Importing parameters from a custom .jrxml fil | I'm developing a Java project with JasperReports(v.4.0.6) and DynamicJasperReports(v.4.0.1). I have generated a custom .jrxml with the most recent iReport plugin for Eclipse.
In my .jrxml report, I define two parameters which will be filled by the Java program according to some input given by the user.
<parameter name="ReportTitle" class="java.lang.String"/>
<parameter name="DataFile" class="java.lang.String"/>
Then, as this [tutorial][1] states, and since I want to maintain a couple of parameters predefined, I invoke the *setTemplate()* method from my code.
String table_template = "report_templates/TableTemplate.jrxml";
Map<String, String> params;
...
DynamicReportBuilder drb = new DynamicReportBuilder();
drb.setTemplateFile(table_template, true, true, true, true);
DynamicReport dr = drb.build();
I pass the parameters to the template doing the following:
params.put("ReportTitle", "CustomTitle");
params.put("DataFile", "CustomSubtitle");
However, when I genereate de report, these two fields appear blank, as if the DJ library hadn't save the places in which to insert the values beforehand. I don't get any other errors or exceptions.
I've tried downgrading the Jasper library to al older version, but to no avail either.
I'd appreciate if someone could give me some insight to what I am doing wrong.
Thanks in advance.
[1]: http://dynamicjasper.com/2010/10/06/how-to-use-custom-jrxml-templates/ | templates | parameters | jasper-reports | dynamic-jasper | null | null | open | (Dynamic Jasper Reports) Importing parameters from a custom .jrxml fil
===
I'm developing a Java project with JasperReports(v.4.0.6) and DynamicJasperReports(v.4.0.1). I have generated a custom .jrxml with the most recent iReport plugin for Eclipse.
In my .jrxml report, I define two parameters which will be filled by the Java program according to some input given by the user.
<parameter name="ReportTitle" class="java.lang.String"/>
<parameter name="DataFile" class="java.lang.String"/>
Then, as this [tutorial][1] states, and since I want to maintain a couple of parameters predefined, I invoke the *setTemplate()* method from my code.
String table_template = "report_templates/TableTemplate.jrxml";
Map<String, String> params;
...
DynamicReportBuilder drb = new DynamicReportBuilder();
drb.setTemplateFile(table_template, true, true, true, true);
DynamicReport dr = drb.build();
I pass the parameters to the template doing the following:
params.put("ReportTitle", "CustomTitle");
params.put("DataFile", "CustomSubtitle");
However, when I genereate de report, these two fields appear blank, as if the DJ library hadn't save the places in which to insert the values beforehand. I don't get any other errors or exceptions.
I've tried downgrading the Jasper library to al older version, but to no avail either.
I'd appreciate if someone could give me some insight to what I am doing wrong.
Thanks in advance.
[1]: http://dynamicjasper.com/2010/10/06/how-to-use-custom-jrxml-templates/ | 0 |
11,471,621 | 07/13/2012 13:38:32 | 356,514 | 06/02/2010 14:09:56 | 520 | 14 | Image caching and performance | I'm currently trying to improve the performances of a map rendering library. In the case of punctual symbols, the library is really often jsut drawing the same image again and again on each location. the drawing process may be really complex, though, because the parametrization of the symbol is really very rich. For each point, I have a tree structure that computes the image about to be drawn. When parameters are not dependant on the data I'm processing, as I said earlier, I just draw a complex symbol several times.
I've tried to implement a caching mechanism. I store the images that have already be drawn, and if I encounter a configuration that has already been met, I get the image and draw it again. The first test I've made is for a very simple symbol. It's a circle whose both shape and interior are filled.
As I know the symbol will be constant in all locations, I cache it and draw it again from the cached image then. That works... but I face two important problems :
- The quality of the drawn symbols is hardly damaged.
- More problematic : the time needed to render the map is reaally higher with caching than without caching. That's pretty disappointing for a cache ^_^
The core code when the caching mechanism is on is the following :
if(pc.isCached(map)){
BufferedImage bi = pc.getCachedValue(map);
drawCachedImageOnGeometry(g2, sds, fid, selected, mt, the_geom, bi);
} else {
BufferedImage bi = g2.getDeviceConfiguration().createCompatibleImage(200, 200);
Graphics2D tg2 = bi.createGraphics();
graphic.draw(tg2, map, selected, mt, AffineTransform.getTranslateInstance(100, 100));
drawCachedImageOnGeometry(g2, sds, fid, selected, mt, the_geom, bi);
pc.cacheSymbol(map, bi);
}
The only interesting call made in drawCachedImageOnGeometry is
g2.drawRenderedImage(bi, AffineTransform.getTranslateInstance(x-100,y-100));
I've made some attempts to use VolatileImage instances rather than BufferedImage... but that causes deeper problems (I've not been able to be sure that the image will be correctly rendered each time it is needed).
I've made some profiling too and it appears that when using my cache, the operations that take the longest time are the rendering operations made in awt.
That said, I guess my strategy is wrong... Consequently, my questions are :
- Are there any efficient way to achieve the goal I've explained ?
- More accurately, would it be faster to store the AWT instructions used to draw my symbols and to translate them as needed ? I make the assumption that it may be possible to retrieve the "commands" used to build the symbol... I didn't find many informations about that on the world wide web, though... If it is possible, that would save me both the computation time of the symbol (that can be really complex, as said earlier) and the quality of my symbols.
Thanks in advance for all the informations and resources you'll give me :-)
Agemen. | java | performance | caching | awt | null | null | open | Image caching and performance
===
I'm currently trying to improve the performances of a map rendering library. In the case of punctual symbols, the library is really often jsut drawing the same image again and again on each location. the drawing process may be really complex, though, because the parametrization of the symbol is really very rich. For each point, I have a tree structure that computes the image about to be drawn. When parameters are not dependant on the data I'm processing, as I said earlier, I just draw a complex symbol several times.
I've tried to implement a caching mechanism. I store the images that have already be drawn, and if I encounter a configuration that has already been met, I get the image and draw it again. The first test I've made is for a very simple symbol. It's a circle whose both shape and interior are filled.
As I know the symbol will be constant in all locations, I cache it and draw it again from the cached image then. That works... but I face two important problems :
- The quality of the drawn symbols is hardly damaged.
- More problematic : the time needed to render the map is reaally higher with caching than without caching. That's pretty disappointing for a cache ^_^
The core code when the caching mechanism is on is the following :
if(pc.isCached(map)){
BufferedImage bi = pc.getCachedValue(map);
drawCachedImageOnGeometry(g2, sds, fid, selected, mt, the_geom, bi);
} else {
BufferedImage bi = g2.getDeviceConfiguration().createCompatibleImage(200, 200);
Graphics2D tg2 = bi.createGraphics();
graphic.draw(tg2, map, selected, mt, AffineTransform.getTranslateInstance(100, 100));
drawCachedImageOnGeometry(g2, sds, fid, selected, mt, the_geom, bi);
pc.cacheSymbol(map, bi);
}
The only interesting call made in drawCachedImageOnGeometry is
g2.drawRenderedImage(bi, AffineTransform.getTranslateInstance(x-100,y-100));
I've made some attempts to use VolatileImage instances rather than BufferedImage... but that causes deeper problems (I've not been able to be sure that the image will be correctly rendered each time it is needed).
I've made some profiling too and it appears that when using my cache, the operations that take the longest time are the rendering operations made in awt.
That said, I guess my strategy is wrong... Consequently, my questions are :
- Are there any efficient way to achieve the goal I've explained ?
- More accurately, would it be faster to store the AWT instructions used to draw my symbols and to translate them as needed ? I make the assumption that it may be possible to retrieve the "commands" used to build the symbol... I didn't find many informations about that on the world wide web, though... If it is possible, that would save me both the computation time of the symbol (that can be really complex, as said earlier) and the quality of my symbols.
Thanks in advance for all the informations and resources you'll give me :-)
Agemen. | 0 |
11,627,892 | 07/24/2012 09:26:02 | 634,545 | 02/25/2011 17:02:05 | 589 | 18 | onOptionsItemSelected not called when using actionLayout (SherlockActionBar) | The method onOptionsItemSelected isn't being called when using actionLayout in a menu item.
Am I missing something, or is it a known problem with SherlockActionBar?
Activity
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getSupportMenuInflater();
inflater.inflate(R.menu.article, menu);
super.onCreateOptionsMenu(menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
Log.d(TAG, "onOptionsItemSelected()");
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
case R.id.menu_item_comment:
return true;
default:
return super.onOptionsItemSelected(item);
}
}
Menu
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/menu_item_comment"
android:showAsAction="ifRoom"
android:actionLayout="@layout/action_bar_comment_layout"/>
</menu>
| android | null | null | null | null | null | open | onOptionsItemSelected not called when using actionLayout (SherlockActionBar)
===
The method onOptionsItemSelected isn't being called when using actionLayout in a menu item.
Am I missing something, or is it a known problem with SherlockActionBar?
Activity
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getSupportMenuInflater();
inflater.inflate(R.menu.article, menu);
super.onCreateOptionsMenu(menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
Log.d(TAG, "onOptionsItemSelected()");
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
case R.id.menu_item_comment:
return true;
default:
return super.onOptionsItemSelected(item);
}
}
Menu
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/menu_item_comment"
android:showAsAction="ifRoom"
android:actionLayout="@layout/action_bar_comment_layout"/>
</menu>
| 0 |
11,627,824 | 07/24/2012 09:22:31 | 1,548,107 | 07/24/2012 08:57:30 | 1 | 0 | Highcharts - Custom CSS classes for Data Labels in Donut Pie Chart | I'm working on this donut chart
http://jsfiddle.net/NDstudio/qkJtk/1/
I was wondering if it's possible to assign a different custom CSS class to each data label in order to style each one with a different icon and to correct the positioning issues.
I tried to put the classes in an array, but I get unexpected results.
In particular, after the definition of the array (like this)
classes=new Array('bho0',
'bho1',
'bho2',
'bho3',
'bho4',
'bho5',
'bho6',
'bho7',
'bho8',
'bho9',
'bho10',
'bho11',
'bho12',
'bho13'
);
I try to pass the array values to the formatter function
formatter: function() {
//assign classes from array
return this.y > 1 ? '<div class="'+classes[this.y]+'">'+'<b>'+ this.point.name +'</b></div>' : null;
}
There, keeping `classes[this.y]` I get no results (the output is a div with a class "undefined")
If i set `classes[this.y+1]` instead, i get more than one element with the same class (eg: three elements with the "bho3" class).
Anyone has any idea?
Is there a better solution to achieve the results?
Thanx in advance | javascript | css | arrays | class | highcharts | null | open | Highcharts - Custom CSS classes for Data Labels in Donut Pie Chart
===
I'm working on this donut chart
http://jsfiddle.net/NDstudio/qkJtk/1/
I was wondering if it's possible to assign a different custom CSS class to each data label in order to style each one with a different icon and to correct the positioning issues.
I tried to put the classes in an array, but I get unexpected results.
In particular, after the definition of the array (like this)
classes=new Array('bho0',
'bho1',
'bho2',
'bho3',
'bho4',
'bho5',
'bho6',
'bho7',
'bho8',
'bho9',
'bho10',
'bho11',
'bho12',
'bho13'
);
I try to pass the array values to the formatter function
formatter: function() {
//assign classes from array
return this.y > 1 ? '<div class="'+classes[this.y]+'">'+'<b>'+ this.point.name +'</b></div>' : null;
}
There, keeping `classes[this.y]` I get no results (the output is a div with a class "undefined")
If i set `classes[this.y+1]` instead, i get more than one element with the same class (eg: three elements with the "bho3" class).
Anyone has any idea?
Is there a better solution to achieve the results?
Thanx in advance | 0 |
11,410,313 | 07/10/2012 09:26:23 | 429,377 | 05/18/2010 13:03:58 | 1,986 | 60 | java.lang.IllegalStateException: getOutputStream() has already been called for this response in JSF 2 | i have a legacy code that writes a jsp page in xml, and i am trying to convert it to JSF 2
but i am getting the following exception:
java.lang.IllegalStateException: getOutputStream() has already been called for this response
**JSP/XML:**
<%@ page language="java" import="java.net.* ,weather.*, XMLObjects.*,beans.*,daos.*,java.util.*,CampaignManipulation.*, adstreamer.*, java.net.*"%>
<%
response.setContentType("text/xml");
response.addDateHeader("Expires", 0);
XMLExecute exe = new XMLExecute();
out.print(exe.GetXMLObject()); // String representation of xml code <CiscoIPPhoneExecute> .... </CiscoIPPhoneExecute>
%>
**JSF/XHTML:**
<?xml version="1.0" encoding="UTF-8"?>
<f:view contentType="text/xml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core">
<f:event type="preRenderView" listener="#{sendPicController.preRender}"/>
</f:view>
**JSF/Backing Bean:**
public void preRender() throws Exception {
log.debug("preRender");
FacesContext ctx = FacesContext.getCurrentInstance();
HttpServletRequest request = GeneralUtils.getHttpServlettRequest();
HttpServletResponse response = GeneralUtils.getHttpServlettResponse();
response.setContentType("text/xml");
response.addDateHeader("Expires", 0);
response.getOutputStream().write(exe.GetXMLObject().getBytes()); // bytes representation of xml
response.getOutputStream().flush();
response.getOutputStream().close();
ctx.responseComplete();
}
please advise why i am getting this exception and how to fix it. | xml | jsp | java-ee | jsf-2.0 | null | null | open | java.lang.IllegalStateException: getOutputStream() has already been called for this response in JSF 2
===
i have a legacy code that writes a jsp page in xml, and i am trying to convert it to JSF 2
but i am getting the following exception:
java.lang.IllegalStateException: getOutputStream() has already been called for this response
**JSP/XML:**
<%@ page language="java" import="java.net.* ,weather.*, XMLObjects.*,beans.*,daos.*,java.util.*,CampaignManipulation.*, adstreamer.*, java.net.*"%>
<%
response.setContentType("text/xml");
response.addDateHeader("Expires", 0);
XMLExecute exe = new XMLExecute();
out.print(exe.GetXMLObject()); // String representation of xml code <CiscoIPPhoneExecute> .... </CiscoIPPhoneExecute>
%>
**JSF/XHTML:**
<?xml version="1.0" encoding="UTF-8"?>
<f:view contentType="text/xml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core">
<f:event type="preRenderView" listener="#{sendPicController.preRender}"/>
</f:view>
**JSF/Backing Bean:**
public void preRender() throws Exception {
log.debug("preRender");
FacesContext ctx = FacesContext.getCurrentInstance();
HttpServletRequest request = GeneralUtils.getHttpServlettRequest();
HttpServletResponse response = GeneralUtils.getHttpServlettResponse();
response.setContentType("text/xml");
response.addDateHeader("Expires", 0);
response.getOutputStream().write(exe.GetXMLObject().getBytes()); // bytes representation of xml
response.getOutputStream().flush();
response.getOutputStream().close();
ctx.responseComplete();
}
please advise why i am getting this exception and how to fix it. | 0 |
11,410,315 | 07/10/2012 09:26:29 | 1,242,958 | 03/01/2012 14:59:25 | 51 | 4 | CSS3 Animation Rotate, removing animate property makes the animation revert back to its origin position | When I'm rotating a graphic with CSS3 using the code below (this is just the webkit version but have the other browser specific versions in my style sheet).
.bottomSmallCogStopAnimating {
-webkit-animation-name: rotate;
-webkit-animation-duration: 5000ms;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
}
I'm using jQuery to add this css class to stop the animation by removing the animation name.
.stopAnimating {
-moz-animation: none;
-webkit-animation: none;
animation: none;
}
Removing this property appears to reset the graphic back to its pre rotated state, so what I'm seeing is the graphic pop back to its original rotation which looks pretty bad.
Is there a way to stop this from happening, so the browser will remember its last position and stop animating at this point?
Cheers,
Stefan | css3 | css-transitions | null | null | null | null | open | CSS3 Animation Rotate, removing animate property makes the animation revert back to its origin position
===
When I'm rotating a graphic with CSS3 using the code below (this is just the webkit version but have the other browser specific versions in my style sheet).
.bottomSmallCogStopAnimating {
-webkit-animation-name: rotate;
-webkit-animation-duration: 5000ms;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
}
I'm using jQuery to add this css class to stop the animation by removing the animation name.
.stopAnimating {
-moz-animation: none;
-webkit-animation: none;
animation: none;
}
Removing this property appears to reset the graphic back to its pre rotated state, so what I'm seeing is the graphic pop back to its original rotation which looks pretty bad.
Is there a way to stop this from happening, so the browser will remember its last position and stop animating at this point?
Cheers,
Stefan | 0 |
11,410,321 | 07/10/2012 09:26:42 | 1,514,317 | 07/10/2012 09:21:22 | 1 | 0 | How to capture photo via HP or tablet and automatically upload it using PHP? | Can you help me for this problem, I want to make program with PHP using Jquery mobile, and it can capture the photo (via tablet camera or handphone)?
What methode or function for fix it. Library php or something?
Thanks you.
| php | javascript | jquery | null | null | null | open | How to capture photo via HP or tablet and automatically upload it using PHP?
===
Can you help me for this problem, I want to make program with PHP using Jquery mobile, and it can capture the photo (via tablet camera or handphone)?
What methode or function for fix it. Library php or something?
Thanks you.
| 0 |
11,410,323 | 07/10/2012 09:26:54 | 471,628 | 10/10/2010 17:01:57 | 414 | 8 | PHP array gets converted to int when using json_encode | I have the following array structure:
Array
(
[t] => 812
[0] => Array
(
[5] => 649
[6] => 12
)
[2] => Array
(
[0] => 10
)
[3] => Array
(
[0] => 1
)
[4] => Array
(
[0] => 152
)
)
At the moment all the array indexes (apart from t) are integers.
I want to convert it to it's JSON equivalent using json_encode(), but when I do so any of the arrays that have just one index in them (index 0) get converted into an integer rather than an array.
E.g.
[2] => Array
(
[0] => 10
)
gets converted to..
{"2":[10]
instead of..
{"2":[0:10]
It'd be fine for the JSON to use string indexes rather than integers if that fixed the problem..
{"2":["0":10]}
Any thoughts on how I can solve this one?
| php | null | null | null | null | 07/19/2012 02:33:28 | too localized | PHP array gets converted to int when using json_encode
===
I have the following array structure:
Array
(
[t] => 812
[0] => Array
(
[5] => 649
[6] => 12
)
[2] => Array
(
[0] => 10
)
[3] => Array
(
[0] => 1
)
[4] => Array
(
[0] => 152
)
)
At the moment all the array indexes (apart from t) are integers.
I want to convert it to it's JSON equivalent using json_encode(), but when I do so any of the arrays that have just one index in them (index 0) get converted into an integer rather than an array.
E.g.
[2] => Array
(
[0] => 10
)
gets converted to..
{"2":[10]
instead of..
{"2":[0:10]
It'd be fine for the JSON to use string indexes rather than integers if that fixed the problem..
{"2":["0":10]}
Any thoughts on how I can solve this one?
| 3 |
11,410,333 | 07/10/2012 09:27:15 | 363,274 | 06/10/2010 09:15:02 | 331 | 3 | Select distinct and inner join a image data type | I'm trying to select all the unique customers how have placed an Order, but when I try to include the Photo I get and error.
Order Table
ID | CustomerID
-----------------------
1 | 2
2 | 1
3 | 2
Customer Table
ID | Name | Photo (image, null)
--------------------------
1 | John | image
2 | Adam | image
3 | Jack | image
Expected result
CustomerID | Name | Photo
--------------------------------
1 | John | image
2 | Adam | image
And my query so far.
SELECT o.CustomerID, c.Name, c.Photo
FROM Order o
inner join Customer c on o.CustomerID = o.ID
This gives the following error
> **The image data type cannot be selected as DISTINCT because it is not
> comparable.** | sql | distinct | sql-server-2012 | null | null | null | open | Select distinct and inner join a image data type
===
I'm trying to select all the unique customers how have placed an Order, but when I try to include the Photo I get and error.
Order Table
ID | CustomerID
-----------------------
1 | 2
2 | 1
3 | 2
Customer Table
ID | Name | Photo (image, null)
--------------------------
1 | John | image
2 | Adam | image
3 | Jack | image
Expected result
CustomerID | Name | Photo
--------------------------------
1 | John | image
2 | Adam | image
And my query so far.
SELECT o.CustomerID, c.Name, c.Photo
FROM Order o
inner join Customer c on o.CustomerID = o.ID
This gives the following error
> **The image data type cannot be selected as DISTINCT because it is not
> comparable.** | 0 |
11,410,342 | 07/10/2012 09:27:48 | 540,422 | 12/13/2010 11:05:58 | 11 | 1 | Are there any good style guides arguing for how much one should round corners with css? | I was having a discussion with a co-worker about what amount of rounding to put on elements on the web page we were designing, and it made me wonder if there are any good style guides or design manuals for these types of design questions? | css | css3 | null | null | null | null | open | Are there any good style guides arguing for how much one should round corners with css?
===
I was having a discussion with a co-worker about what amount of rounding to put on elements on the web page we were designing, and it made me wonder if there are any good style guides or design manuals for these types of design questions? | 0 |
11,410,343 | 07/10/2012 09:28:00 | 864,245 | 07/26/2011 20:22:33 | 107 | 6 | Analysing connections to diagnose "too many connections" error | My website is currently receiving the following error message: `Error establishing a database connection`. If I go on /phpma, I receive this: `#1040 - Too many connections`.
If I restart `mysqld`, the problem temporarily goes away.
Unfortunately, it has now come back three times.
My dedicated box is also down to less than 1Gb of memory, from 8Gb.
Total Memory 8181984 kB
Free Memory 99344 kB
Total Swap Memory 1051064
kB Free Swap Memory 0 kB
If I go into `mysql` on the server and perform `SHOW PROCESSLIST`, I receive the following information:
| 17181 | sfish_dev | localhost | sfish_dev | Query | 35117 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'boraras-brigittae' AND wp_po |
| 17182 | sfish_dev | localhost | sfish_dev | Query | 35118 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17183 | sfish_dev | localhost | sfish_dev | Query | 35117 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'boraras-brigittae' AND wp_po |
| 17184 | sfish_dev | localhost | sfish_dev | Query | 35117 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'boraras-brigittae' AND wp_po |
| 17185 | sfish_dev | localhost | sfish_dev | Query | 35041 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'akysis-vespa' AND wp_posts.p |
| 17186 | sfish_dev | localhost | sfish_dev | Query | 35050 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('images','profiledotline-gif') A |
| 17187 | sfish_dev | localhost | sfish_dev | Query | 35050 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('images','picarrow-gif') AND (po |
| 17188 | sfish_dev | localhost | sfish_dev | Query | 35043 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17189 | sfish_dev | localhost | sfish_dev | Query | 35041 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('m','marginal') AND (post_type = |
| 17190 | sfish_dev | localhost | sfish_dev | Query | 34989 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'piaractus-brachypomus' AND w |
| 17191 | sfish_dev | localhost | sfish_dev | Query | 34989 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('w','wet-dry-filter') AND (post_ |
| 17192 | sfish_dev | localhost | sfish_dev | Query | 34990 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17193 | sfish_dev | localhost | sfish_dev | Query | 34954 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'corydoras-sterbai' AND wp_po |
| 17194 | sfish_dev | localhost | sfish_dev | Query | 34954 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'piaractus-brachypomus' AND w |
| 17195 | sfish_dev | localhost | sfish_dev | Query | 34955 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17196 | sfish_dev | localhost | sfish_dev | Query | 34954 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'piaractus-brachypomus' AND w |
| 17197 | sfish_dev | localhost | sfish_dev | Query | 34897 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17198 | sfish_dev | localhost | sfish_dev | Query | 34955 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17199 | sfish_dev | localhost | sfish_dev | Query | 34898 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17200 | sfish_dev | localhost | sfish_dev | Query | 34897 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17201 | sfish_dev | localhost | sfish_dev | Query | 34898 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums','lofiversion','index-ph |
| 17202 | sfish_dev | localhost | sfish_dev | Query | 34897 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums') AND (post_type = 'page |
| 17204 | sfish_dev | localhost | sfish_dev | Query | 34897 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17205 | sfish_dev | localhost | sfish_dev | Query | 34897 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'sawbwa-resplendens' AND wp_p |
| 17206 | sfish_dev | localhost | sfish_dev | Query | 34897 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'badis-sp-buxar' AND wp_posts |
| 17207 | sfish_dev | localhost | sfish_dev | Query | 34898 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'melanotaenia-boesemani' AND |
| 17208 | sfish_dev | localhost | sfish_dev | Query | 34898 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'betta-prima' AND wp_posts.po |
| 17209 | sfish_dev | localhost | sfish_dev | Query | 34865 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums') AND (post_type = 'page |
| 17210 | sfish_dev | localhost | sfish_dev | Query | 34897 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17211 | sfish_dev | localhost | sfish_dev | Query | 34898 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17213 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'piaractus-brachypomus' AND w |
| 17214 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17215 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('knowledge-base') AND (post_type |
| 17216 | sfish_dev | localhost | sfish_dev | Query | 34865 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17217 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'piaractus-brachypomus' AND w |
| 17218 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'badis-sp-buxar' AND wp_posts |
| 17219 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums','lofiversion','index-ph |
| 17220 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'betta-prima' AND wp_posts.po |
| 17221 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17222 | sfish_dev | localhost | sfish_dev | Query | 34865 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'piaractus-brachypomus' AND w |
| 17223 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'piaractus-brachypomus' AND w |
| 17224 | sfish_dev | localhost | sfish_dev | Query | 34865 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'hemichromis-lifalili' AND wp |
| 17225 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17226 | sfish_dev | localhost | sfish_dev | Query | 34862 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'apistogramma-borellii' AND w |
| 17227 | sfish_dev | localhost | sfish_dev | Query | 34863 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'melanotaenia-lacustris' AND |
| 17228 | sfish_dev | localhost | sfish_dev | Query | 34862 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'melanotaenia-lacustris' AND |
| 17229 | sfish_dev | localhost | sfish_dev | Query | 34861 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'mikrogeophagus-altispinosus' |
| 17230 | sfish_dev | localhost | sfish_dev | Query | 34861 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.ID = 25503 AND wp_posts.post_type = 'atta |
| 17231 | sfish_dev | localhost | sfish_dev | Query | 34803 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'piaractus-brachypomus' AND w |
| 17232 | sfish_dev | localhost | sfish_dev | Query | 34803 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17233 | sfish_dev | localhost | sfish_dev | Query | 34803 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('knowledge-base') AND (post_type |
| 17234 | sfish_dev | localhost | sfish_dev | Query | 34803 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17235 | sfish_dev | localhost | sfish_dev | Query | 34803 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums') AND (post_type = 'page |
| 17236 | sfish_dev | localhost | sfish_dev | Query | 34803 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17237 | sfish_dev | localhost | sfish_dev | Query | 34803 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums') AND (post_type = 'page |
| 17238 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('m','migrate') AND (post_type = |
| 17239 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'hemichromis-lifalili' AND wp |
| 17240 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17241 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums') AND (post_type = 'page |
| 17242 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17243 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17244 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums','lofiversion','index-ph |
| 17245 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17246 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17247 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums') AND (post_type = 'page |
| 17248 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'geophagus-brokopondo' AND wp |
| 17249 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'hyphessobrycon-amandae' AND |
| 17253 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17255 | sfish_dev | localhost | sfish_dev | Query | 34786 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('knowledge-base') AND (post_type |
| 17260 | sfish_dev | localhost | sfish_dev | Query | 34786 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('s','silver-sand') AND (post_typ |
| 17262 | sfish_dev | localhost | sfish_dev | Query | 34786 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums') AND (post_type = 'page |
| 25505 | root | localhost | NULL | Query | 2 | NULL | SHOW PROCESSLIST
I tried running `mysql` with the `--log-slow-queries[slow-queries]` flag but it doesn't seem to have done anything - I can't find a file called `slow-queries` anywhere on my box, at least.
I'm guessing this is a suspect query somewhere, but I have no idea where to begin looking! | mysql | null | null | null | null | null | open | Analysing connections to diagnose "too many connections" error
===
My website is currently receiving the following error message: `Error establishing a database connection`. If I go on /phpma, I receive this: `#1040 - Too many connections`.
If I restart `mysqld`, the problem temporarily goes away.
Unfortunately, it has now come back three times.
My dedicated box is also down to less than 1Gb of memory, from 8Gb.
Total Memory 8181984 kB
Free Memory 99344 kB
Total Swap Memory 1051064
kB Free Swap Memory 0 kB
If I go into `mysql` on the server and perform `SHOW PROCESSLIST`, I receive the following information:
| 17181 | sfish_dev | localhost | sfish_dev | Query | 35117 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'boraras-brigittae' AND wp_po |
| 17182 | sfish_dev | localhost | sfish_dev | Query | 35118 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17183 | sfish_dev | localhost | sfish_dev | Query | 35117 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'boraras-brigittae' AND wp_po |
| 17184 | sfish_dev | localhost | sfish_dev | Query | 35117 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'boraras-brigittae' AND wp_po |
| 17185 | sfish_dev | localhost | sfish_dev | Query | 35041 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'akysis-vespa' AND wp_posts.p |
| 17186 | sfish_dev | localhost | sfish_dev | Query | 35050 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('images','profiledotline-gif') A |
| 17187 | sfish_dev | localhost | sfish_dev | Query | 35050 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('images','picarrow-gif') AND (po |
| 17188 | sfish_dev | localhost | sfish_dev | Query | 35043 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17189 | sfish_dev | localhost | sfish_dev | Query | 35041 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('m','marginal') AND (post_type = |
| 17190 | sfish_dev | localhost | sfish_dev | Query | 34989 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'piaractus-brachypomus' AND w |
| 17191 | sfish_dev | localhost | sfish_dev | Query | 34989 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('w','wet-dry-filter') AND (post_ |
| 17192 | sfish_dev | localhost | sfish_dev | Query | 34990 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17193 | sfish_dev | localhost | sfish_dev | Query | 34954 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'corydoras-sterbai' AND wp_po |
| 17194 | sfish_dev | localhost | sfish_dev | Query | 34954 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'piaractus-brachypomus' AND w |
| 17195 | sfish_dev | localhost | sfish_dev | Query | 34955 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17196 | sfish_dev | localhost | sfish_dev | Query | 34954 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'piaractus-brachypomus' AND w |
| 17197 | sfish_dev | localhost | sfish_dev | Query | 34897 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17198 | sfish_dev | localhost | sfish_dev | Query | 34955 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17199 | sfish_dev | localhost | sfish_dev | Query | 34898 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17200 | sfish_dev | localhost | sfish_dev | Query | 34897 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17201 | sfish_dev | localhost | sfish_dev | Query | 34898 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums','lofiversion','index-ph |
| 17202 | sfish_dev | localhost | sfish_dev | Query | 34897 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums') AND (post_type = 'page |
| 17204 | sfish_dev | localhost | sfish_dev | Query | 34897 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17205 | sfish_dev | localhost | sfish_dev | Query | 34897 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'sawbwa-resplendens' AND wp_p |
| 17206 | sfish_dev | localhost | sfish_dev | Query | 34897 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'badis-sp-buxar' AND wp_posts |
| 17207 | sfish_dev | localhost | sfish_dev | Query | 34898 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'melanotaenia-boesemani' AND |
| 17208 | sfish_dev | localhost | sfish_dev | Query | 34898 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'betta-prima' AND wp_posts.po |
| 17209 | sfish_dev | localhost | sfish_dev | Query | 34865 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums') AND (post_type = 'page |
| 17210 | sfish_dev | localhost | sfish_dev | Query | 34897 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17211 | sfish_dev | localhost | sfish_dev | Query | 34898 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17213 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'piaractus-brachypomus' AND w |
| 17214 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17215 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('knowledge-base') AND (post_type |
| 17216 | sfish_dev | localhost | sfish_dev | Query | 34865 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17217 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'piaractus-brachypomus' AND w |
| 17218 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'badis-sp-buxar' AND wp_posts |
| 17219 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums','lofiversion','index-ph |
| 17220 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'betta-prima' AND wp_posts.po |
| 17221 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17222 | sfish_dev | localhost | sfish_dev | Query | 34865 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'piaractus-brachypomus' AND w |
| 17223 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'piaractus-brachypomus' AND w |
| 17224 | sfish_dev | localhost | sfish_dev | Query | 34865 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'hemichromis-lifalili' AND wp |
| 17225 | sfish_dev | localhost | sfish_dev | Query | 34864 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17226 | sfish_dev | localhost | sfish_dev | Query | 34862 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'apistogramma-borellii' AND w |
| 17227 | sfish_dev | localhost | sfish_dev | Query | 34863 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'melanotaenia-lacustris' AND |
| 17228 | sfish_dev | localhost | sfish_dev | Query | 34862 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'melanotaenia-lacustris' AND |
| 17229 | sfish_dev | localhost | sfish_dev | Query | 34861 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'mikrogeophagus-altispinosus' |
| 17230 | sfish_dev | localhost | sfish_dev | Query | 34861 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.ID = 25503 AND wp_posts.post_type = 'atta |
| 17231 | sfish_dev | localhost | sfish_dev | Query | 34803 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'piaractus-brachypomus' AND w |
| 17232 | sfish_dev | localhost | sfish_dev | Query | 34803 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17233 | sfish_dev | localhost | sfish_dev | Query | 34803 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('knowledge-base') AND (post_type |
| 17234 | sfish_dev | localhost | sfish_dev | Query | 34803 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17235 | sfish_dev | localhost | sfish_dev | Query | 34803 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums') AND (post_type = 'page |
| 17236 | sfish_dev | localhost | sfish_dev | Query | 34803 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17237 | sfish_dev | localhost | sfish_dev | Query | 34803 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums') AND (post_type = 'page |
| 17238 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('m','migrate') AND (post_type = |
| 17239 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'hemichromis-lifalili' AND wp |
| 17240 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17241 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums') AND (post_type = 'page |
| 17242 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17243 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17244 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums','lofiversion','index-ph |
| 17245 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17246 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT post_modified_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page |
| 17247 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums') AND (post_type = 'page |
| 17248 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'geophagus-brokopondo' AND wp |
| 17249 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'hyphessobrycon-amandae' AND |
| 17253 | sfish_dev | localhost | sfish_dev | Query | 34788 | Waiting for table level lock | SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AN |
| 17255 | sfish_dev | localhost | sfish_dev | Query | 34786 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('knowledge-base') AND (post_type |
| 17260 | sfish_dev | localhost | sfish_dev | Query | 34786 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('s','silver-sand') AND (post_typ |
| 17262 | sfish_dev | localhost | sfish_dev | Query | 34786 | Waiting for table level lock | SELECT ID, post_name, post_parent FROM wp_posts WHERE post_name IN ('forums') AND (post_type = 'page |
| 25505 | root | localhost | NULL | Query | 2 | NULL | SHOW PROCESSLIST
I tried running `mysql` with the `--log-slow-queries[slow-queries]` flag but it doesn't seem to have done anything - I can't find a file called `slow-queries` anywhere on my box, at least.
I'm guessing this is a suspect query somewhere, but I have no idea where to begin looking! | 0 |
11,410,345 | 07/10/2012 09:28:06 | 1,366,654 | 04/30/2012 20:36:01 | 21 | 0 | How to find runtime of other c programs | I want to find the time taken by another program to run ;
I am using following code;
system("time ./a.out > garb");
it is giving very weird output.
#include <stdio.h>
int main()
{
long int i;
for ( i = 0; i < 10000000; i++ ) {
printf("Hello World!\n");
}
printf("C Program\n");
return 0;
}
output
0.31user 0.10system 0:00.41elapsed 99%CPU (0avgtext+0avgdata 1744maxresident)k
0inputs+253912outputs (0major+149minor)pagefaults 0swaps
| c++ | c | time | null | null | null | open | How to find runtime of other c programs
===
I want to find the time taken by another program to run ;
I am using following code;
system("time ./a.out > garb");
it is giving very weird output.
#include <stdio.h>
int main()
{
long int i;
for ( i = 0; i < 10000000; i++ ) {
printf("Hello World!\n");
}
printf("C Program\n");
return 0;
}
output
0.31user 0.10system 0:00.41elapsed 99%CPU (0avgtext+0avgdata 1744maxresident)k
0inputs+253912outputs (0major+149minor)pagefaults 0swaps
| 0 |
11,571,545 | 07/20/2012 01:11:47 | 1,539,460 | 07/20/2012 01:01:00 | 1 | 0 | Can I get the child class name in Java | public class Dog extends Animal {
.....
}
public class Animal {
public static String getName() {
String callerClassName = ????; //How to get the class Dog, when I call from TestCase
return "Animal";
}
}
when I use TestCase class to Dog.getName(), how to get the className Dog instead of Animal when I use Thread.currentThread().getStackTrace()[1].getClassName()
public class TestCase {
public static String getName(){
return Dog.getName();
}
}
| java | null | null | null | null | null | open | Can I get the child class name in Java
===
public class Dog extends Animal {
.....
}
public class Animal {
public static String getName() {
String callerClassName = ????; //How to get the class Dog, when I call from TestCase
return "Animal";
}
}
when I use TestCase class to Dog.getName(), how to get the className Dog instead of Animal when I use Thread.currentThread().getStackTrace()[1].getClassName()
public class TestCase {
public static String getName(){
return Dog.getName();
}
}
| 0 |
11,571,551 | 07/20/2012 01:12:44 | 633,251 | 02/24/2011 22:43:02 | 672 | 16 | Tab Bar Icon does not appear (what are the restrictions on these?) | Well, this is no doubt silly, but I can't get my tab bar icon to show up. Here is the code:
- (id) initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
// Misc stuff deleted
[self.nibBundle loadNibNamed:nibNameOrNil owner:self options:nibOptions];
if (self) {
self.title = NSLocalizedString(@"Play Game", @"Play Game");
self.tabBarItem.image = [UIImage imageNamed:@"GVC.png"];
}
[self awakeFromNib];
return self;
}
Which, if I give it the name of a too-large icon, the system inserts a blue placeholder. So I think my code is fine (and it looks like everyone elses'). This is for iOS 5 and I have a non-retina display. I have experimented with sizes, including the ideal 30 x 30 size. By the way, all other icons & images are performing properly. The icons are listed in the plist under Icon Files (iOS 5) -> Primary Icon -> Icon Files and the names include .png If I change "Play Game" the app changes accordingly. I've been using Inkscape to make the icons.
So my questions are 1. Any ideas generally? and 2. What are the restrictions on the tab bar icon? I know size, I gather it must be b/w but have a hard time finding documentation that says so. Any limitations on name, must it be square or can it be rectangular, etc? I've read too that they must be used like an alpha mask but I'm not sure what that really means when I'm making the image. | ios | uitabbar | uitabbaritem | null | null | null | open | Tab Bar Icon does not appear (what are the restrictions on these?)
===
Well, this is no doubt silly, but I can't get my tab bar icon to show up. Here is the code:
- (id) initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
// Misc stuff deleted
[self.nibBundle loadNibNamed:nibNameOrNil owner:self options:nibOptions];
if (self) {
self.title = NSLocalizedString(@"Play Game", @"Play Game");
self.tabBarItem.image = [UIImage imageNamed:@"GVC.png"];
}
[self awakeFromNib];
return self;
}
Which, if I give it the name of a too-large icon, the system inserts a blue placeholder. So I think my code is fine (and it looks like everyone elses'). This is for iOS 5 and I have a non-retina display. I have experimented with sizes, including the ideal 30 x 30 size. By the way, all other icons & images are performing properly. The icons are listed in the plist under Icon Files (iOS 5) -> Primary Icon -> Icon Files and the names include .png If I change "Play Game" the app changes accordingly. I've been using Inkscape to make the icons.
So my questions are 1. Any ideas generally? and 2. What are the restrictions on the tab bar icon? I know size, I gather it must be b/w but have a hard time finding documentation that says so. Any limitations on name, must it be square or can it be rectangular, etc? I've read too that they must be used like an alpha mask but I'm not sure what that really means when I'm making the image. | 0 |
11,571,556 | 07/20/2012 01:14:16 | 1,505,463 | 07/06/2012 00:21:39 | 6 | 0 | Combobox help in Microsoft Access 2010 | I have been trying to figure out this problem out for the last two hours to no avail:
I have a contact form and one of the fields in a the form is a Contact_Type_ID. This field is a number field which also corresponds to a text field in another table (e.g. 1 = expatriate). Right now, when I cycle through the contacts, their Contact_Type_ID is 1,2,3... instead of say Non-profit, CEO, Vice-president, etc... This is a problem because looking at the form right now, one has no idea what number 3 means...
What I would like to be able to do is create a combo box that only displays the text correspondence. Before everyone suggests the two columns and 0;1" format, I can't get this to work. My hunch is that it's because I'm drawing information from two different tables. I can generate the correct list, but then the main entry doesn't change as I cycle through the contacts to reflect the current contact's [Contact_Type_ID]. Also, I can't edit any of the current tables because I am supposed to apply this application to a much larger scale database.
I also tried setting the SQL for the row source:
'Populate the connection combo box
Dim typeSQL As String
typeSQL = "SELECT DISTINCT Contacts.[ContactTypeID], Contact_Types.[ContactType] " & _
"FROM Contacts, Contact_Types " & _
"ORDER BY Contact_Types.[ContactType];"
Me.cbo_ContactType.RowSource = typeSQL
However, I then have the same problem: the combobox won't update as I cycle through the contacts. I will admit that I am rather new to Microsoft Access and still don't really understand the difference between the rowsource and the controlsource (I feel that this distinction might be key here).
Any suggestions would be greatly appreciated. | sql | ms-access | vba | combobox | access-vba | null | open | Combobox help in Microsoft Access 2010
===
I have been trying to figure out this problem out for the last two hours to no avail:
I have a contact form and one of the fields in a the form is a Contact_Type_ID. This field is a number field which also corresponds to a text field in another table (e.g. 1 = expatriate). Right now, when I cycle through the contacts, their Contact_Type_ID is 1,2,3... instead of say Non-profit, CEO, Vice-president, etc... This is a problem because looking at the form right now, one has no idea what number 3 means...
What I would like to be able to do is create a combo box that only displays the text correspondence. Before everyone suggests the two columns and 0;1" format, I can't get this to work. My hunch is that it's because I'm drawing information from two different tables. I can generate the correct list, but then the main entry doesn't change as I cycle through the contacts to reflect the current contact's [Contact_Type_ID]. Also, I can't edit any of the current tables because I am supposed to apply this application to a much larger scale database.
I also tried setting the SQL for the row source:
'Populate the connection combo box
Dim typeSQL As String
typeSQL = "SELECT DISTINCT Contacts.[ContactTypeID], Contact_Types.[ContactType] " & _
"FROM Contacts, Contact_Types " & _
"ORDER BY Contact_Types.[ContactType];"
Me.cbo_ContactType.RowSource = typeSQL
However, I then have the same problem: the combobox won't update as I cycle through the contacts. I will admit that I am rather new to Microsoft Access and still don't really understand the difference between the rowsource and the controlsource (I feel that this distinction might be key here).
Any suggestions would be greatly appreciated. | 0 |
11,571,557 | 07/20/2012 01:14:22 | 1,273,160 | 03/16/2012 03:44:38 | 1 | 0 | jquery-ui datepicker multiple language integration | hi guys im trying to combine the different jquery-ui datepicker options into one function i can get most of the script working appart from the language i have all the il8n files and i am using a select element to change the value but nothing seems to be working can anyone tell me what im doing wrong
<script>
$(function() {
$.datepicker.setDefaults( $.datepicker.regional[ "" ] );
$( "#from" ).datepicker({
defaultDate: "+4w",
changeMonth: true,
numberOfMonths: 3,
showButtonPanel: true,
showOn: "button",
buttonImage: "../images/calendar.gif",
buttonImageOnly: true,
minDate:"+1d",
dateFormat:"yy/mm/dd",
showAnim:"bounce",
onSelect: function( selectedDate ) {
$( "#from" ).datepicker( $.datepicker.regional[ "en-GB" ] );
$( "#locale" ).change(function() {
$( "#from" ).datepicker( "option",
$.datepicker.regional[ $( this ).val() ] );
});
}
});
$( "#to" ).datepicker({
defaultDate: "+2w",
changeMonth: true,
numberOfMonths: 3,
showButtonPanel: true,
showOn: "button",
buttonImage: "../images/calendar.gif",
buttonImageOnly: true,
minDate:"+1d",
dateFormat:"yy/mm/dd",
showAnim:"bounce",
onSelect: function( selectedDate ) {
$( "#to" ).datepicker( $.datepicker.regional[ "en-GB" ] );
$( "#locale" ).change(function() {
$( "#to" ).datepicker( "option",
$.datepicker.regional[ $( this ).val() ] );
});
}
});
});
</script> | jquery-ui | datepicker | null | null | null | null | open | jquery-ui datepicker multiple language integration
===
hi guys im trying to combine the different jquery-ui datepicker options into one function i can get most of the script working appart from the language i have all the il8n files and i am using a select element to change the value but nothing seems to be working can anyone tell me what im doing wrong
<script>
$(function() {
$.datepicker.setDefaults( $.datepicker.regional[ "" ] );
$( "#from" ).datepicker({
defaultDate: "+4w",
changeMonth: true,
numberOfMonths: 3,
showButtonPanel: true,
showOn: "button",
buttonImage: "../images/calendar.gif",
buttonImageOnly: true,
minDate:"+1d",
dateFormat:"yy/mm/dd",
showAnim:"bounce",
onSelect: function( selectedDate ) {
$( "#from" ).datepicker( $.datepicker.regional[ "en-GB" ] );
$( "#locale" ).change(function() {
$( "#from" ).datepicker( "option",
$.datepicker.regional[ $( this ).val() ] );
});
}
});
$( "#to" ).datepicker({
defaultDate: "+2w",
changeMonth: true,
numberOfMonths: 3,
showButtonPanel: true,
showOn: "button",
buttonImage: "../images/calendar.gif",
buttonImageOnly: true,
minDate:"+1d",
dateFormat:"yy/mm/dd",
showAnim:"bounce",
onSelect: function( selectedDate ) {
$( "#to" ).datepicker( $.datepicker.regional[ "en-GB" ] );
$( "#locale" ).change(function() {
$( "#to" ).datepicker( "option",
$.datepicker.regional[ $( this ).val() ] );
});
}
});
});
</script> | 0 |
11,571,560 | 07/20/2012 01:14:51 | 1,107,384 | 12/20/2011 08:20:09 | 25 | 0 | Iphone automatic take picture programmatically while playing video | I want to take picture on the iphone programmatically while playing video.
I try to use MPMediaPlayController.view as overlay view of the UIImagePickerController, but when I try to take a picture, media player stops and not working anymore.
- How can I do this?
- Apple approve these style apps?
Any advices will be appreciated. | iphone | uiimagepickercontroller | mpmovieplayercontroller | null | null | null | open | Iphone automatic take picture programmatically while playing video
===
I want to take picture on the iphone programmatically while playing video.
I try to use MPMediaPlayController.view as overlay view of the UIImagePickerController, but when I try to take a picture, media player stops and not working anymore.
- How can I do this?
- Apple approve these style apps?
Any advices will be appreciated. | 0 |
11,571,561 | 07/20/2012 01:15:07 | 694,449 | 04/06/2011 08:36:56 | 50 | 2 | Compress html using apache | I'm using apache to compress render compress html files but it's not work.. why ? .. I'm usng hostmonster servers and Yii php framework
**.htaccess:**
<IfModule deflate_module>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css application/json application/javascript
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Do NOT compress localhost
#SetEnvIf Remote_Host 127.0.0.1 no-gzip
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule> | php | apache | .htaccess | null | null | 07/20/2012 15:23:33 | off topic | Compress html using apache
===
I'm using apache to compress render compress html files but it's not work.. why ? .. I'm usng hostmonster servers and Yii php framework
**.htaccess:**
<IfModule deflate_module>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css application/json application/javascript
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Do NOT compress localhost
#SetEnvIf Remote_Host 127.0.0.1 no-gzip
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule> | 2 |
11,571,562 | 07/20/2012 01:15:24 | 1,535,724 | 07/18/2012 18:04:29 | 6 | 1 | Memory sharing in parallelized python code | I am a college freshman and Python newbie so bear with me. I am trying to parallelize some matrix operations. Here is my attempt using the ParallelPython module:
def testfunc(connectionMatrix, qCount, iCount, Htry, tStepCount):
test = connectionMatrix[0:qCount,0:iCount].dot(Htry[tStepCount-1, 0:iCount])
return test
f1 = job_server.submit(testfunc, (self.connectionMatrix, self.qCount, self.iCount, self.iHtry, self.tStepCount), modules = ("scipy.sparse",))
f2 = job_server.submit(testfunc, (self.connectionMatrix, self.qCount, self.iCount, self.didtHtry, self.tStepCount), modules = ("scipy.sparse",))
r1 = f1()
r2 = f2()
self.qHtry[self.tStepCount, 0:self.qCount] = self.qHtry[self.tStepCount-1, 0:self.qCount] + self.delT * r1 + 0.5 * (self.delT**2) * r2
It seems that there is a normal curve with size of the matrix on the x-axis and the percent speed-up on the y-axis. It seems to cap out at a 30% speed increase at 100x100 matrices. Smaller and larger matrices result in less increase and with small enough and large enough matrices, the serial code is faster. My guess is that the problem lies within the passing of the arguments. The overhead of copying the large matrix is actually taking longer than the job itself. What can I do to get around this? Is there some way to incorporate memory sharing and passing the matrix by reference? As you can see, none of the arguments are modified so it could be read-only access.
Thanks. | python | matrix | parallel-processing | pass-by-reference | shared-memory | null | open | Memory sharing in parallelized python code
===
I am a college freshman and Python newbie so bear with me. I am trying to parallelize some matrix operations. Here is my attempt using the ParallelPython module:
def testfunc(connectionMatrix, qCount, iCount, Htry, tStepCount):
test = connectionMatrix[0:qCount,0:iCount].dot(Htry[tStepCount-1, 0:iCount])
return test
f1 = job_server.submit(testfunc, (self.connectionMatrix, self.qCount, self.iCount, self.iHtry, self.tStepCount), modules = ("scipy.sparse",))
f2 = job_server.submit(testfunc, (self.connectionMatrix, self.qCount, self.iCount, self.didtHtry, self.tStepCount), modules = ("scipy.sparse",))
r1 = f1()
r2 = f2()
self.qHtry[self.tStepCount, 0:self.qCount] = self.qHtry[self.tStepCount-1, 0:self.qCount] + self.delT * r1 + 0.5 * (self.delT**2) * r2
It seems that there is a normal curve with size of the matrix on the x-axis and the percent speed-up on the y-axis. It seems to cap out at a 30% speed increase at 100x100 matrices. Smaller and larger matrices result in less increase and with small enough and large enough matrices, the serial code is faster. My guess is that the problem lies within the passing of the arguments. The overhead of copying the large matrix is actually taking longer than the job itself. What can I do to get around this? Is there some way to incorporate memory sharing and passing the matrix by reference? As you can see, none of the arguments are modified so it could be read-only access.
Thanks. | 0 |
11,571,564 | 07/20/2012 01:15:53 | 240,443 | 12/29/2009 20:22:18 | 17,937 | 692 | Looking for Regexp#match_all | I've been trying to find something like this in the docs, but failed. What I want is to iterate over regular expression matches in a string, and passing `MatchData` to the block.
* There's `Regexp#match`, but it only finds one match;
* There's `String#scan`, but the block receives only the captures array or the match string, not full `MatchData`. This especially sucks with Oniguruma, as you lose the named capture capability.
* There's also `Regexp::last_match`, so I could actually go the `scan` route, but it seems ugly and inelegant.
Am I missing something?
| ruby | null | null | null | null | null | open | Looking for Regexp#match_all
===
I've been trying to find something like this in the docs, but failed. What I want is to iterate over regular expression matches in a string, and passing `MatchData` to the block.
* There's `Regexp#match`, but it only finds one match;
* There's `String#scan`, but the block receives only the captures array or the match string, not full `MatchData`. This especially sucks with Oniguruma, as you lose the named capture capability.
* There's also `Regexp::last_match`, so I could actually go the `scan` route, but it seems ugly and inelegant.
Am I missing something?
| 0 |
11,571,569 | 07/20/2012 01:16:27 | 438,091 | 08/26/2010 07:30:55 | 40 | 0 | Google Analytics E-Commerce Tracking without visible thankyou page | I use Google E-Commerce Tracking to track sales and offer different payment methods.
For credit card payment and Paypal the user is redirected to a thankyou page after successful payment and the Google E-Commerce Tracking code is executed there. That works fine.
I also offer barcode bills and ibon as payment method. That means the user prints a bill with a barcode or ibon code and goes to a 7-11 to pay it with cash. The information about the payment is sent from 7-11 to my payment provider and they send me a notification about a successful payment back to my notification url. It normally takes 2 days until I receive this notification.
My problem is:
In this case there is no website displayed to the user where I can enter the E-Commerce Tracking code. The notification url is a page with php only and updates the database.
So, how do I execute the Google E-Commerce Javascript on a php page which is not displayed in the browser? | php | google-analytics | null | null | null | null | open | Google Analytics E-Commerce Tracking without visible thankyou page
===
I use Google E-Commerce Tracking to track sales and offer different payment methods.
For credit card payment and Paypal the user is redirected to a thankyou page after successful payment and the Google E-Commerce Tracking code is executed there. That works fine.
I also offer barcode bills and ibon as payment method. That means the user prints a bill with a barcode or ibon code and goes to a 7-11 to pay it with cash. The information about the payment is sent from 7-11 to my payment provider and they send me a notification about a successful payment back to my notification url. It normally takes 2 days until I receive this notification.
My problem is:
In this case there is no website displayed to the user where I can enter the E-Commerce Tracking code. The notification url is a page with php only and updates the database.
So, how do I execute the Google E-Commerce Javascript on a php page which is not displayed in the browser? | 0 |
11,571,570 | 07/20/2012 01:16:28 | 142,923 | 07/22/2009 15:02:44 | 418 | 29 | No Begin Async method | I'm new to WCF and Async. I have a service with a Begin and End on a long running method.
[ServiceContract]
public interface IDocImagingStatusService
{
[OperationContract(AsyncPattern = true)]
IAsyncResult BeginGetDirectoryCount(AsyncCallback callback, object state);
IList<DirectoryCounts> EndGetDirectoryCount(IAsyncResult result);
}
My client needs to call BeginGetDirectoryCount but all I see is a GetDirectoryCount() method. Where did they go?
var docImgSvc = new DocImagingService.DocImagingStatusServiceClient( "WSHttpBinding_IDocImagingStatusService");
docImgSvc.GetDirectoryCount();
| c# | wcf | null | null | null | null | open | No Begin Async method
===
I'm new to WCF and Async. I have a service with a Begin and End on a long running method.
[ServiceContract]
public interface IDocImagingStatusService
{
[OperationContract(AsyncPattern = true)]
IAsyncResult BeginGetDirectoryCount(AsyncCallback callback, object state);
IList<DirectoryCounts> EndGetDirectoryCount(IAsyncResult result);
}
My client needs to call BeginGetDirectoryCount but all I see is a GetDirectoryCount() method. Where did they go?
var docImgSvc = new DocImagingService.DocImagingStatusServiceClient( "WSHttpBinding_IDocImagingStatusService");
docImgSvc.GetDirectoryCount();
| 0 |
11,521,448 | 07/17/2012 11:24:13 | 1,531,527 | 07/17/2012 11:02:43 | 1 | 0 | Narrow Full-text Search to a Specific Dataset (Using Solr, other methods welcome) | We are using Solr for it's full text search capability, lets say we are indexing the text of various news articles.
Searching through all of the articles is as simple as simple can be; however, users can 'like' articles they find interesting.
A separate MySQL database holds the id of the user and the article liked by the user.
How would one go about narrowing Solr's search results only to articles with the ids retrieve from the MySQL database?
If this is not possible using Solr, could you recommend another method of doing something of this nature?
Thanks a head of time for any light you can shed on my issue. | php | solr | full-text-search | null | null | null | open | Narrow Full-text Search to a Specific Dataset (Using Solr, other methods welcome)
===
We are using Solr for it's full text search capability, lets say we are indexing the text of various news articles.
Searching through all of the articles is as simple as simple can be; however, users can 'like' articles they find interesting.
A separate MySQL database holds the id of the user and the article liked by the user.
How would one go about narrowing Solr's search results only to articles with the ids retrieve from the MySQL database?
If this is not possible using Solr, could you recommend another method of doing something of this nature?
Thanks a head of time for any light you can shed on my issue. | 0 |
11,567,624 | 07/19/2012 19:06:05 | 1,207,272 | 02/13/2012 16:39:21 | 3 | 1 | Prevent telerik window from Closing in onClose client event | I am trying to display a confirm dialog when a user tries to close a window by click the 'X' in the top right corner. If the user goes for 'OK' option, I would like to continue closing the window but if the user presses the 'Cancel' button I would like to prevent the window from closing. Is there a way to do that?
Thanks.
| mvc | events | telerik | window | null | null | open | Prevent telerik window from Closing in onClose client event
===
I am trying to display a confirm dialog when a user tries to close a window by click the 'X' in the top right corner. If the user goes for 'OK' option, I would like to continue closing the window but if the user presses the 'Cancel' button I would like to prevent the window from closing. Is there a way to do that?
Thanks.
| 0 |
11,567,625 | 07/19/2012 19:06:12 | 181,772 | 09/30/2009 11:51:21 | 11,441 | 427 | Tying the knot in Clojure | In my answer at http://stackoverflow.com/questions/11530574/clojure-for-comprehension-example/11553140#11553140 I have a function that processes its own output:
(defn stream [seed]
(defn helper [slow]
(concat (map #(str (first slow) %) seed) (lazy-seq (helper (rest slow)))))
(declare delayed)
(let [slow (cons "" (lazy-seq delayed))]
(def delayed (helper slow))
delayed))
(take 25 (stream ["a" "b" "c"]))
("a" "b" "c" "aa" "ab" "ac" "ba" "bb" "bc" "ca" "cb" "cc" "aaa" "aab" "aac" "aba" "abb" "abc" "aca" "acb" "acc" "baa" "bab" "bac" "bba")
It works by creating a forward reference (`delayed`) which is used as the second entry in a lazy sequence (`slow`). That sequence is passed to the function, which is lazy, and the output from that function (the very first part of the lazy sequence, which does not require the evaluation of `delayed`) is then used to set the value of `delayed`.
In this way I "tie the knot". But this is done much more elegantly in Haskell (eg. http://stackoverflow.com/questions/357956/explanation-of-tying-the-knot). Given that Clojure has `delay` and `force`, I wondered if there was a better way to do the above?
The question then: can the mutation (of `delayed`) somehow be avoided in the code above?
[I had a question last night with a similar title when I was still trying to understand how to do this; no one replied before the code above worked, so I deleted it, but I am not really happy with this approach so am trying again.] | recursion | clojure | lazy-evaluation | null | null | null | open | Tying the knot in Clojure
===
In my answer at http://stackoverflow.com/questions/11530574/clojure-for-comprehension-example/11553140#11553140 I have a function that processes its own output:
(defn stream [seed]
(defn helper [slow]
(concat (map #(str (first slow) %) seed) (lazy-seq (helper (rest slow)))))
(declare delayed)
(let [slow (cons "" (lazy-seq delayed))]
(def delayed (helper slow))
delayed))
(take 25 (stream ["a" "b" "c"]))
("a" "b" "c" "aa" "ab" "ac" "ba" "bb" "bc" "ca" "cb" "cc" "aaa" "aab" "aac" "aba" "abb" "abc" "aca" "acb" "acc" "baa" "bab" "bac" "bba")
It works by creating a forward reference (`delayed`) which is used as the second entry in a lazy sequence (`slow`). That sequence is passed to the function, which is lazy, and the output from that function (the very first part of the lazy sequence, which does not require the evaluation of `delayed`) is then used to set the value of `delayed`.
In this way I "tie the knot". But this is done much more elegantly in Haskell (eg. http://stackoverflow.com/questions/357956/explanation-of-tying-the-knot). Given that Clojure has `delay` and `force`, I wondered if there was a better way to do the above?
The question then: can the mutation (of `delayed`) somehow be avoided in the code above?
[I had a question last night with a similar title when I was still trying to understand how to do this; no one replied before the code above worked, so I deleted it, but I am not really happy with this approach so am trying again.] | 0 |
11,567,626 | 07/19/2012 19:06:12 | 207,069 | 11/09/2009 16:15:32 | 479 | 29 | Re-write link for temporary virtual hosting | I'm moving a site that was previously set up as tempsite.somedomain.com. I have links for things like the home page, etc. set up to "/" or "/some-directory".
They work on the current server, but the production server is currently setup without any DNS entry, so it's just he IP number and the virtual host directory on the end like...
123.123.123.123/~tempsite/
My links to "/" go to the base IP, and NOT into the /~tempsite/ folder. Is there some kind of rewrite or config change I can make to get this to work temporarily until I have the domain moved over?
It's a php solution if that helps.
thanks,
D. | mod-rewrite | virtualhost | null | null | null | null | open | Re-write link for temporary virtual hosting
===
I'm moving a site that was previously set up as tempsite.somedomain.com. I have links for things like the home page, etc. set up to "/" or "/some-directory".
They work on the current server, but the production server is currently setup without any DNS entry, so it's just he IP number and the virtual host directory on the end like...
123.123.123.123/~tempsite/
My links to "/" go to the base IP, and NOT into the /~tempsite/ folder. Is there some kind of rewrite or config change I can make to get this to work temporarily until I have the domain moved over?
It's a php solution if that helps.
thanks,
D. | 0 |
11,567,628 | 07/19/2012 19:06:21 | 1,152,375 | 01/16/2012 17:39:39 | 8 | 0 | Waking android device on arrival of GCM push notificaion | After setting up GCM on the app that I am working on for push status-bar notifications, i was wondering what the correct method of waking the device on arrival of the notification would be? I understand I may require a wake-lock, but have failed to understand the correct implementation. I have a standard GCMintentservice running that handles the arrival of a message from GCM and then creates the status-bar notification. thanks. | android | service | push-notification | wakelock | google-cloud-messaging | null | open | Waking android device on arrival of GCM push notificaion
===
After setting up GCM on the app that I am working on for push status-bar notifications, i was wondering what the correct method of waking the device on arrival of the notification would be? I understand I may require a wake-lock, but have failed to understand the correct implementation. I have a standard GCMintentservice running that handles the arrival of a message from GCM and then creates the status-bar notification. thanks. | 0 |
11,567,629 | 07/19/2012 19:06:26 | 1,507,552 | 07/06/2012 18:27:37 | 24 | 0 | Accessing Resolution Class with JIRA SOAP API | When a user closes a JIRA issue, they select a "resolution class" such as "User error", "service request", etc.
Is it possible to look at this field's value using the SOAP API? I looked at the "resolution" fields of my issues, but they are always blank if the issue is open and "6" if closed (so "resolution class" must not be the same as "resolution").
Any information would be much appreciated. | c# | api | soap | jira | null | null | open | Accessing Resolution Class with JIRA SOAP API
===
When a user closes a JIRA issue, they select a "resolution class" such as "User error", "service request", etc.
Is it possible to look at this field's value using the SOAP API? I looked at the "resolution" fields of my issues, but they are always blank if the issue is open and "6" if closed (so "resolution class" must not be the same as "resolution").
Any information would be much appreciated. | 0 |
11,567,638 | 07/19/2012 19:06:45 | 263,832 | 02/01/2010 20:13:16 | 646 | 34 | Custom SharePoint 2007 Subsite Navigation Control | I've been asked to create an asp.net UserControl that allows custom navigation between subsites of a SharePoint 2007 website. The sites mimics a school structure with semesters that have different groups of classes. Here is a simplified version of the site structure:
Site Root
Search
Semester1
Class Group 1
Class 1
Page1.aspx
Page2.aspx
Class 2
Page1.aspx
Page2.aspx
Class Group 2
Class 3
Page1.aspx
Page2.aspx
Class 4
Page1.aspx
Page2.aspx
Semester2
Class Group 1
Class 1
Page1.aspx
Page2.aspx
Class 2
Page1.aspx
Page2.aspx
Class Group 2
Class 3
Page1.aspx
Page2.aspx
Class 4
Page1.aspx
Page2.aspx
Some Other Subsites
The UserControl will be placed on the classes' .aspx pages. It's purpose is to allow a user to navigate to identical pages between the different Class Groups.
E.G. Let's say I'm on Semester1/Class Group 1/Class 1/Page2.aspx. The UserControl would allow me to choose any of the other classes under Semester1. When chosen, it would automatically navigate to the [selected class]/Page2.aspx (because I am currently on Page2.aspx).
Before today I have never used a SiteMapProvider. So far I've only managed to programmatically walk through the site structure and print out a simple site map to a page using the default CombinedNavSiteMapProvider PortalSiteMapProvider. What I think I need but am not sure how to do is:
* Get/build a partial site map data structure where root node is the parent Semester of the current page. This can be my own data structure built in code if necessary. I want to bind this to a menu control. Additionally, I'd like the root menu item to have custom text like "Change Class" instead of Semester1.
From there, I think I can use the menu events to handle navigation. Example of UserControl's menu if I am on Semester1/Class Group 1/Class 1/Page2.aspx:
Change Class
Class Group 1
Class 1
Class 2
Class Group 2
Class 3
Class 4
How can I accomplish the bulleted item above? | c# | sharepoint2007 | navigation | sitemapprovider | null | null | open | Custom SharePoint 2007 Subsite Navigation Control
===
I've been asked to create an asp.net UserControl that allows custom navigation between subsites of a SharePoint 2007 website. The sites mimics a school structure with semesters that have different groups of classes. Here is a simplified version of the site structure:
Site Root
Search
Semester1
Class Group 1
Class 1
Page1.aspx
Page2.aspx
Class 2
Page1.aspx
Page2.aspx
Class Group 2
Class 3
Page1.aspx
Page2.aspx
Class 4
Page1.aspx
Page2.aspx
Semester2
Class Group 1
Class 1
Page1.aspx
Page2.aspx
Class 2
Page1.aspx
Page2.aspx
Class Group 2
Class 3
Page1.aspx
Page2.aspx
Class 4
Page1.aspx
Page2.aspx
Some Other Subsites
The UserControl will be placed on the classes' .aspx pages. It's purpose is to allow a user to navigate to identical pages between the different Class Groups.
E.G. Let's say I'm on Semester1/Class Group 1/Class 1/Page2.aspx. The UserControl would allow me to choose any of the other classes under Semester1. When chosen, it would automatically navigate to the [selected class]/Page2.aspx (because I am currently on Page2.aspx).
Before today I have never used a SiteMapProvider. So far I've only managed to programmatically walk through the site structure and print out a simple site map to a page using the default CombinedNavSiteMapProvider PortalSiteMapProvider. What I think I need but am not sure how to do is:
* Get/build a partial site map data structure where root node is the parent Semester of the current page. This can be my own data structure built in code if necessary. I want to bind this to a menu control. Additionally, I'd like the root menu item to have custom text like "Change Class" instead of Semester1.
From there, I think I can use the menu events to handle navigation. Example of UserControl's menu if I am on Semester1/Class Group 1/Class 1/Page2.aspx:
Change Class
Class Group 1
Class 1
Class 2
Class Group 2
Class 3
Class 4
How can I accomplish the bulleted item above? | 0 |
11,298,018 | 07/02/2012 16:58:45 | 1,003,537 | 10/19/2011 15:49:33 | 56 | 6 | Can anyone tell me why this would be a circular reference? Or at least point me to what a circular reference is? | I have this code snippet, which works great somewhere else, but gives me a circular reference error when I move it to a different section. I can't even find a good reference on what a circular reference is anywhere.
// Create a new array to hold each of the Properties from the custom search pane
// This array will eventually be converted to JSON and become a List<Property>
propertyTables = [];
// Create new Object to hold a row - we have to construct these
// Property objects manually for each row
propertyRow = {};
// This needs to be rewritten to include all of hidden input elements from the custom object that is clicked
// For each of the data elements the properties table, add it to the Object
$(this).parent().find('.editablePropertyList .customPropertyPrompt, .editablePropertyList .customPropertyDataType, .editablePropertyList .customPropertyInquirySearchType, .editablePropertyList .customPropertyID, .editablePropertyList .customPropertyText').each(function(index) {
propertyValue = $(this).val();
propertyText = $(this).text();
switch ($(this).attr("class")) {
case "customPropertyID":
propertyRow.propertyID = propertyValue;
break;
case "customPropertyDataType":
propertyRow.dataType = propertyValue;
break;
case "customPropertyPrompt":
propertyRow.prompt = propertyText;
break;
case "customPropertyInquirySearchType":
propertyRow.inquirySearchType = propertyValue;
break;
case "customPropertyText":
// Whenever it reaches this data element, this means
// that the iteration is at the end of a row. Push the
// newly filled propertyRow object (typeof Property) on
// the PropertyTable array. Then reinstance the propertyRow
// object and it will start populating with the next row
// as the next iteration occurs with propertyID
propertyRow.inquirySearchText = propertyValue;
if (propertyRow.inquirySearchText !== "") {
propertyTables.push(propertyRow);
}
propertyRow = {};
break;
}
});
var statusFilter = [];
var limitAnnotation = [];
searchCriteria = {}; // Created the object
searchCriteria.topFolderListBox = topFoldersWithSomeSelected; // Add the List<topLevelFolders> as the first property
searchCriteria.docTypesListBox = docTypesWithSomeSelected; // Add the List<DocumentType> as the second property
searchCriteria.propertyTable = propertyTables; // Add the List<Property> as the third property
searchCriteria.statusFilter = statusFilter; // Add the List<statusFilter> as the fourth property
searchCriteria.limitAnnotation = limitAnnotation; // Add the List<limitAnnotation> as the fifth property
searchCriteria.fromDate = ""; // Add the string fromDate as the sixth property
searchCriteria.toDate = ""; // Add the string toDate as the seventh property
searchCriteria.dateRangeRelativeToday = false;
searchCriteria.annotationText = ""; // Add the string annotationText as the eigth and final property
// Convert to JSON String - craps out here with circular reference error
textToSend = JSON.stringify(searchCriteria, null, "");
| javascript | json | circular | null | null | null | open | Can anyone tell me why this would be a circular reference? Or at least point me to what a circular reference is?
===
I have this code snippet, which works great somewhere else, but gives me a circular reference error when I move it to a different section. I can't even find a good reference on what a circular reference is anywhere.
// Create a new array to hold each of the Properties from the custom search pane
// This array will eventually be converted to JSON and become a List<Property>
propertyTables = [];
// Create new Object to hold a row - we have to construct these
// Property objects manually for each row
propertyRow = {};
// This needs to be rewritten to include all of hidden input elements from the custom object that is clicked
// For each of the data elements the properties table, add it to the Object
$(this).parent().find('.editablePropertyList .customPropertyPrompt, .editablePropertyList .customPropertyDataType, .editablePropertyList .customPropertyInquirySearchType, .editablePropertyList .customPropertyID, .editablePropertyList .customPropertyText').each(function(index) {
propertyValue = $(this).val();
propertyText = $(this).text();
switch ($(this).attr("class")) {
case "customPropertyID":
propertyRow.propertyID = propertyValue;
break;
case "customPropertyDataType":
propertyRow.dataType = propertyValue;
break;
case "customPropertyPrompt":
propertyRow.prompt = propertyText;
break;
case "customPropertyInquirySearchType":
propertyRow.inquirySearchType = propertyValue;
break;
case "customPropertyText":
// Whenever it reaches this data element, this means
// that the iteration is at the end of a row. Push the
// newly filled propertyRow object (typeof Property) on
// the PropertyTable array. Then reinstance the propertyRow
// object and it will start populating with the next row
// as the next iteration occurs with propertyID
propertyRow.inquirySearchText = propertyValue;
if (propertyRow.inquirySearchText !== "") {
propertyTables.push(propertyRow);
}
propertyRow = {};
break;
}
});
var statusFilter = [];
var limitAnnotation = [];
searchCriteria = {}; // Created the object
searchCriteria.topFolderListBox = topFoldersWithSomeSelected; // Add the List<topLevelFolders> as the first property
searchCriteria.docTypesListBox = docTypesWithSomeSelected; // Add the List<DocumentType> as the second property
searchCriteria.propertyTable = propertyTables; // Add the List<Property> as the third property
searchCriteria.statusFilter = statusFilter; // Add the List<statusFilter> as the fourth property
searchCriteria.limitAnnotation = limitAnnotation; // Add the List<limitAnnotation> as the fifth property
searchCriteria.fromDate = ""; // Add the string fromDate as the sixth property
searchCriteria.toDate = ""; // Add the string toDate as the seventh property
searchCriteria.dateRangeRelativeToday = false;
searchCriteria.annotationText = ""; // Add the string annotationText as the eigth and final property
// Convert to JSON String - craps out here with circular reference error
textToSend = JSON.stringify(searchCriteria, null, "");
| 0 |
11,298,275 | 07/02/2012 17:22:41 | 1,496,478 | 07/02/2012 15:29:46 | 1 | 0 | VirtualBox Issue: sharing files between host and virtual machine | I am not able to share files from host machine (windows 7) to virtual machine (windows 8).
VirtualBox Version: 4.1
"Guest additions" is not installed because when I try to install it the VM with win 8 crashes.
| vm | null | null | null | null | null | open | VirtualBox Issue: sharing files between host and virtual machine
===
I am not able to share files from host machine (windows 7) to virtual machine (windows 8).
VirtualBox Version: 4.1
"Guest additions" is not installed because when I try to install it the VM with win 8 crashes.
| 0 |
11,298,280 | 07/02/2012 17:22:54 | 1,431,059 | 06/01/2012 15:40:13 | 27 | 3 | jQueryMobile Datebox/ASP.NET MVC data-ajax=false script not working | I've got a little problem: I have an Edit View with this time-picker inside
<label for="mytimeedit">Time</label>
<input name="Time" id="mytimeedit" type="text" data-role="datebox" data-options='{"mode": "timebox", "overrideTimeFormat": 24}'>
@Html.ValidationMessageFor(model => model.Time)
Then (in the same view) I have this script to replace every ":" character inserted on the early described text input with a comma (","):
<script type="text/javascript">
$("#mytimeedit").change(function () {
var val = $("#mytimeedit").val();
$("#mytimeedit").val(val.replace(':', ','));
});
</script>
Everything worked, until I had to insert a **data-ajax=false** attribute (and I cannot remove it, for the consistency of my site) in the link calling the Edit controller: this way the replacing doesn't work anymore.
My question is: is there a way to "translate"/rewrite my script avoiding Ajax, which is now disabled?
Hope for your help,thanks! | asp.net-mvc | jquery-ajax | jquery-mobile | razor | datebox | null | open | jQueryMobile Datebox/ASP.NET MVC data-ajax=false script not working
===
I've got a little problem: I have an Edit View with this time-picker inside
<label for="mytimeedit">Time</label>
<input name="Time" id="mytimeedit" type="text" data-role="datebox" data-options='{"mode": "timebox", "overrideTimeFormat": 24}'>
@Html.ValidationMessageFor(model => model.Time)
Then (in the same view) I have this script to replace every ":" character inserted on the early described text input with a comma (","):
<script type="text/javascript">
$("#mytimeedit").change(function () {
var val = $("#mytimeedit").val();
$("#mytimeedit").val(val.replace(':', ','));
});
</script>
Everything worked, until I had to insert a **data-ajax=false** attribute (and I cannot remove it, for the consistency of my site) in the link calling the Edit controller: this way the replacing doesn't work anymore.
My question is: is there a way to "translate"/rewrite my script avoiding Ajax, which is now disabled?
Hope for your help,thanks! | 0 |
11,383,305 | 07/08/2012 12:52:15 | 407,503 | 07/31/2010 14:59:49 | 90 | 1 | Check which <div>'s dont have a </div> | I recently was handed an old template to make changes to. Its a really long horribly indented one. In the process of adding new design, I seem to have deleted </div> tags in several places, and the whole thing now seems to have taken an entirely new shape. Is it possible to easily identify which <div>'s don't have a </div>. Dreamweaver was good at this, but we don't use it anymore. Can you please suggest tools, browser add-ons or anything else that can help do this.
Thanks | html5 | css3 | null | null | null | null | open | Check which <div>'s dont have a </div>
===
I recently was handed an old template to make changes to. Its a really long horribly indented one. In the process of adding new design, I seem to have deleted </div> tags in several places, and the whole thing now seems to have taken an entirely new shape. Is it possible to easily identify which <div>'s don't have a </div>. Dreamweaver was good at this, but we don't use it anymore. Can you please suggest tools, browser add-ons or anything else that can help do this.
Thanks | 0 |
11,387,014 | 07/08/2012 21:53:08 | 1,024,973 | 11/02/2011 05:14:28 | 107 | 3 | Getting Started with crypto++ decryption with AES | I'm trying to learn a bit about cryptography and am trying to use AES decryption with the crypto++ library in c++. I have a ciphertext string and a key string. Using these two, I'd like to decrypt this ciphertext. Here is my code:
#include "mycrypto.h"
#include <stdio.h>
#include <cstdlib>
#include <string>
#include <aes.h>
#include <config.h>
#include <hex.h>
#include <files.h>
#include <cryptlib.h>
#include <modes.h>
#include <osrng.h>
#include <filters.h>
#include <sha.h>
#include <rijndael.h>
using namespace std;
using namespace CryptoPP;
int main()
{
string myPlainText;
string myKey = "140b41b22a29beb4061bda66b6747e14";
string myCipherText = "4ca00ff4c898d61e1edbf1800618fb2828a226d160dad07883d04e008a7897ee2e4b7465d5290d0c0e6c6822236e1daafb94ffe0c5da05d9476be028ad7c1d81";
byte key[AES::DEFAULT_KEYLENGTH];
byte iv[AES::BLOCKSIZE];
CryptoPP::CBC_Mode<AES>::DECRYPTION decryptor;
decryptor.SetKeyWithIV(key, sizeof(key), iv);
StringSource(myCipherText, true, new StreamTransformationFilter( decryptor, new StringSink(myPlainText)));
return 0;
}
I get a number of errors with this code. The most immediate is this one:
> 'DECRYPTION' is not a member of 'CryptoPP::CBC_Mode<CryptoPP::Rijndael>'
Can anyone straighten me out with this code. I've been all over the crypto++ documentation, but I don't see what I am doing wrong.
Thank you! | c++ | encryption | cryptography | aes | crypto++ | null | open | Getting Started with crypto++ decryption with AES
===
I'm trying to learn a bit about cryptography and am trying to use AES decryption with the crypto++ library in c++. I have a ciphertext string and a key string. Using these two, I'd like to decrypt this ciphertext. Here is my code:
#include "mycrypto.h"
#include <stdio.h>
#include <cstdlib>
#include <string>
#include <aes.h>
#include <config.h>
#include <hex.h>
#include <files.h>
#include <cryptlib.h>
#include <modes.h>
#include <osrng.h>
#include <filters.h>
#include <sha.h>
#include <rijndael.h>
using namespace std;
using namespace CryptoPP;
int main()
{
string myPlainText;
string myKey = "140b41b22a29beb4061bda66b6747e14";
string myCipherText = "4ca00ff4c898d61e1edbf1800618fb2828a226d160dad07883d04e008a7897ee2e4b7465d5290d0c0e6c6822236e1daafb94ffe0c5da05d9476be028ad7c1d81";
byte key[AES::DEFAULT_KEYLENGTH];
byte iv[AES::BLOCKSIZE];
CryptoPP::CBC_Mode<AES>::DECRYPTION decryptor;
decryptor.SetKeyWithIV(key, sizeof(key), iv);
StringSource(myCipherText, true, new StreamTransformationFilter( decryptor, new StringSink(myPlainText)));
return 0;
}
I get a number of errors with this code. The most immediate is this one:
> 'DECRYPTION' is not a member of 'CryptoPP::CBC_Mode<CryptoPP::Rijndael>'
Can anyone straighten me out with this code. I've been all over the crypto++ documentation, but I don't see what I am doing wrong.
Thank you! | 0 |
11,387,015 | 07/08/2012 21:53:11 | 396,404 | 07/20/2010 02:56:37 | 453 | 20 | Calling a v8 javascript function from c++ with an argument | I am working with c++ and v8, and have run into the following challenge: I want to be able to define a function in javascript using v8, then call the function later on through c++. Additionally, I want to be able to pass an argument to the javascript function from c++. I think the following sample source code would explain it best. Check towards the end of the sample code to see what I am trying to accomplish.
#include <v8.h>
#include <iostream>
#include <string>
#include <array>
using namespace v8;
int main(int argc, char* argv[]) {
// Create a stack-allocated handle scope.
HandleScope handle_scope;
// Create a new context.
Persistent<Context> context = Context::New();
Context::Scope context_scope(context);
Handle<String> source;
Handle<Script> script;
Handle<Value> result;
// Create a string containing the JavaScript source code.
source = String::New("function test_function(test_arg) { var match = 0;if(test_arg[0] == test_arg[1]) { match = 1; }");
// Compile the source code.
script = Script::Compile(source);
// What I want to be able to do (this part isn't valid code..
// it just represents what I would like to do.
// An array is defined in c++ called pass_arg,
// then passed to the javascript function test_function() as an argument
std::array< std::string, 2 > pass_arg = {"value1", "value2"};
int result = script->callFunction("test_function", pass_arg);
}
Any tips?
| c++ | v8 | embedded-v8 | null | null | null | open | Calling a v8 javascript function from c++ with an argument
===
I am working with c++ and v8, and have run into the following challenge: I want to be able to define a function in javascript using v8, then call the function later on through c++. Additionally, I want to be able to pass an argument to the javascript function from c++. I think the following sample source code would explain it best. Check towards the end of the sample code to see what I am trying to accomplish.
#include <v8.h>
#include <iostream>
#include <string>
#include <array>
using namespace v8;
int main(int argc, char* argv[]) {
// Create a stack-allocated handle scope.
HandleScope handle_scope;
// Create a new context.
Persistent<Context> context = Context::New();
Context::Scope context_scope(context);
Handle<String> source;
Handle<Script> script;
Handle<Value> result;
// Create a string containing the JavaScript source code.
source = String::New("function test_function(test_arg) { var match = 0;if(test_arg[0] == test_arg[1]) { match = 1; }");
// Compile the source code.
script = Script::Compile(source);
// What I want to be able to do (this part isn't valid code..
// it just represents what I would like to do.
// An array is defined in c++ called pass_arg,
// then passed to the javascript function test_function() as an argument
std::array< std::string, 2 > pass_arg = {"value1", "value2"};
int result = script->callFunction("test_function", pass_arg);
}
Any tips?
| 0 |
11,386,999 | 07/08/2012 21:50:32 | 1,394,871 | 05/14/2012 23:16:21 | 8 | 0 | PHP MySQL Not Connecting and Posting | I'm probably missing something basic, so at this point, I just need a second pair of eyes. I'm constructing a simple input form on my website so that visitors can submit some information. Right now, im just calling them jobs (i just want to get it working). Here is my PHP and my HTML.
<?php
$con = mysql_connect("localhost","projedl8_Jason","/////");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("projedl8_quicktern", $con);
$sql="INSERT INTO jobListForm (NAME, Email, JobTitle, JobDescription)
VALUES ('JASON', '$_POST[email]','$_POST[job_title]','$_POST[job_description]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con);
?>
And lastly:
<form name="submitjobform" method="post" action="job_submit.php">
<table width="450px">
<tr>
<td valign="top">
<label for="name">Name</label>
</td>
<td valign="top">
<input type="text" name="first_name" maxlength="100" size="30">
</td>
</tr>
<tr>
<td valign="top">
<label for="email">Email Address</label>
</td>
<td valign="top">
<input type="text" name="email" maxlength="80" size="30">
</td>
</tr>
<tr>
<td valign="top">
<label for="job_title">Job Title</label>
</td>
<td valign="top">
<input type="text" name="job_title" maxlength="30" size="30">
</td>
</tr>
<tr>
<td valign="top">
<label for="comments">Job Description</label>
</td>
<td valign="top">
<textarea name="job_description" maxlength="1000" cols="25" rows="6"></textarea>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:left">
<input type="submit" name="submit" value="Submit" size="100"></td>
</tr>
</table>
</form>
thanks!
| php | html | null | null | null | 07/09/2012 00:34:25 | not a real question | PHP MySQL Not Connecting and Posting
===
I'm probably missing something basic, so at this point, I just need a second pair of eyes. I'm constructing a simple input form on my website so that visitors can submit some information. Right now, im just calling them jobs (i just want to get it working). Here is my PHP and my HTML.
<?php
$con = mysql_connect("localhost","projedl8_Jason","/////");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("projedl8_quicktern", $con);
$sql="INSERT INTO jobListForm (NAME, Email, JobTitle, JobDescription)
VALUES ('JASON', '$_POST[email]','$_POST[job_title]','$_POST[job_description]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con);
?>
And lastly:
<form name="submitjobform" method="post" action="job_submit.php">
<table width="450px">
<tr>
<td valign="top">
<label for="name">Name</label>
</td>
<td valign="top">
<input type="text" name="first_name" maxlength="100" size="30">
</td>
</tr>
<tr>
<td valign="top">
<label for="email">Email Address</label>
</td>
<td valign="top">
<input type="text" name="email" maxlength="80" size="30">
</td>
</tr>
<tr>
<td valign="top">
<label for="job_title">Job Title</label>
</td>
<td valign="top">
<input type="text" name="job_title" maxlength="30" size="30">
</td>
</tr>
<tr>
<td valign="top">
<label for="comments">Job Description</label>
</td>
<td valign="top">
<textarea name="job_description" maxlength="1000" cols="25" rows="6"></textarea>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:left">
<input type="submit" name="submit" value="Submit" size="100"></td>
</tr>
</table>
</form>
thanks!
| 1 |
11,387,020 | 07/08/2012 21:54:05 | 1,510,309 | 07/08/2012 16:59:40 | 3 | 0 | Youtube api playlist number of videos | i'm using this script: https://github.com/badsyntax/jquery-youtube-player
Now i get only the 24 first video's from the playlist, if i read the [YT api manual][1] they say it can be up to 200 video's. Is there something wrong with the script, or does the api only give 24 video's back?
[1]: https://developers.google.com/youtube/2.0/developers_guide_protocol_playlists | api | youtube | playlist | null | null | null | open | Youtube api playlist number of videos
===
i'm using this script: https://github.com/badsyntax/jquery-youtube-player
Now i get only the 24 first video's from the playlist, if i read the [YT api manual][1] they say it can be up to 200 video's. Is there something wrong with the script, or does the api only give 24 video's back?
[1]: https://developers.google.com/youtube/2.0/developers_guide_protocol_playlists | 0 |
11,387,027 | 07/08/2012 21:54:16 | 1,056,130 | 11/20/2011 07:33:35 | 14 | 1 | Wordpress - using multiple resizable backgrounds on different pages | I've gotten myself into a jiffy here.
I'm building a site with a loaded background on each page (even though i'm compressing these to less than 250k, i'm dealing with super long load times with all the other images being loaded on each page. My first attempt to deal with this (especially on the iPhone) was to precache or preload these backgrounds, but the lag is still too long with any type of wireless connect, so my goal here is to load a smaller version of the background for different devices.
I'm hoping someone here can help me find some type of solution.
Currently I'm loading backgrounds through an if (is_page()) elseif (is_page()) statement with the javascript for ez bg resize passing the image for each page.
<?php
if( is_page('About') ) { $img = 'images/img1.jpg'; }
elseif( is_page('Home') ) { $img = 'images/img2.jpg'; }
elseif( is_page('Page_Name') ) { $img = 'images/img3.jpg'; }
elseif( is_page('Videos') ) { $img = 'images/img4.jpg'; }
else { $img = 'images/img5.jpg'; }
?>
<script type="text/javascript">
$("body").ezBgResize({
img : "<?php echo $img; ?>",
opacity : 1,
center : true
});
</script>
What i'd like to do is include some type of variable that says
**"If is this page, show this image, if is iphone / ipad version, show this image"** | jquery | iphone | background | resize | width | null | open | Wordpress - using multiple resizable backgrounds on different pages
===
I've gotten myself into a jiffy here.
I'm building a site with a loaded background on each page (even though i'm compressing these to less than 250k, i'm dealing with super long load times with all the other images being loaded on each page. My first attempt to deal with this (especially on the iPhone) was to precache or preload these backgrounds, but the lag is still too long with any type of wireless connect, so my goal here is to load a smaller version of the background for different devices.
I'm hoping someone here can help me find some type of solution.
Currently I'm loading backgrounds through an if (is_page()) elseif (is_page()) statement with the javascript for ez bg resize passing the image for each page.
<?php
if( is_page('About') ) { $img = 'images/img1.jpg'; }
elseif( is_page('Home') ) { $img = 'images/img2.jpg'; }
elseif( is_page('Page_Name') ) { $img = 'images/img3.jpg'; }
elseif( is_page('Videos') ) { $img = 'images/img4.jpg'; }
else { $img = 'images/img5.jpg'; }
?>
<script type="text/javascript">
$("body").ezBgResize({
img : "<?php echo $img; ?>",
opacity : 1,
center : true
});
</script>
What i'd like to do is include some type of variable that says
**"If is this page, show this image, if is iphone / ipad version, show this image"** | 0 |
11,387,028 | 07/08/2012 21:54:22 | 1,510,571 | 07/08/2012 21:05:35 | 1 | 0 | jdbcRealm secured folders in JSF2.0 accessed by adding "/faces/faces" | I have web app project (NetBeans 7.1.2+GlassFish 3.1.2) with jdbcRealm secured folders secureuser, and secureadmin. The jdbc security is usual form login, with added security constraints. Glassfish deployment descriptor, and web.xml defined as usual. Servlet configuration is default "/faces/*".
Security works as expected when trying to access urls of the form "localhost8080/app/faces/secureduser/<filename>". However, if alternatively "localhost8080/app/faces/faces/secureduser/<filename>" is used, security is bypassed. Same goes for the other secured folder.
Adding a "/faces" to the url patterns defined in security constraints, [so that if defined pattern is "/faces/secureduser", then added "/faces/faces/secureduser"] seems to always override the security.
Since the login form is JSF, or the design requirement of the initial page at least being outside security, using a filter on context of the form "app/faces/" cannot be used.
How can security be maintained even if user types in an added prefix "/faces"?
| jsf-2.0 | null | null | null | null | null | open | jdbcRealm secured folders in JSF2.0 accessed by adding "/faces/faces"
===
I have web app project (NetBeans 7.1.2+GlassFish 3.1.2) with jdbcRealm secured folders secureuser, and secureadmin. The jdbc security is usual form login, with added security constraints. Glassfish deployment descriptor, and web.xml defined as usual. Servlet configuration is default "/faces/*".
Security works as expected when trying to access urls of the form "localhost8080/app/faces/secureduser/<filename>". However, if alternatively "localhost8080/app/faces/faces/secureduser/<filename>" is used, security is bypassed. Same goes for the other secured folder.
Adding a "/faces" to the url patterns defined in security constraints, [so that if defined pattern is "/faces/secureduser", then added "/faces/faces/secureduser"] seems to always override the security.
Since the login form is JSF, or the design requirement of the initial page at least being outside security, using a filter on context of the form "app/faces/" cannot be used.
How can security be maintained even if user types in an added prefix "/faces"?
| 0 |
11,387,030 | 07/08/2012 21:54:57 | 1,290,356 | 03/24/2012 18:31:25 | 8 | 0 | C - How to limit the number of inbound connections in a server when using select() | I'm still new to C socket programming but I was able to create some simple client and server programs.
I'm programming a server that listens for TCP connections, its duty is answering to clients' requests and then close the communication when the client sends a special sequence of bytes (or when it disconnects, of course).
I started coding the server using the `accept()` function inside an endless loop: the server waits for a client, accept()'s it, does all the stuff, close()'s the socket descriptor at the end and goes back again waiting to accept a new client.
Since I want to serve one client at a time I called the listen function in this way: `listen(mysocket, 1);`
Everything worked pretty well, but then a new problem came out. The server part explained above runs in a separated thread (let's call it thread #2) and the main thread (thread #1) must be able to tell it to terminate. I created a global variable then, if this variable is set to 1 (by thread #1) thread #2 must terminate. The problem is that thread #2 gets stuck when the `accept()` function is called, thus it can't periodically check the global variable.
I clearly needed a timeout value for that function: "if there isn't a connection to accept, check the value of the global variable, continue waiting for new connection if set to 0 or terminate if set to 1".
I googled for a solution then and found that the `select()` function does the thing that I need. It's a little bit different though, I discovered for the first time the `fd_set` and all the FD_* macros. I modified the server part to make it work with the `select()` function and everything works really nice, but here comes the last problem, the one that I'm not able to solve.
If call the listen function this way: `listen(socket, 1);` but the server still accepts and serves multiple connections at the same time. Does this depend because `select()` works with fd_set's? I'm using some examples I found on the web and, when a connection is accepted, it creates a new socket descriptor that goes in the set with all the others.
I'd like to accept the connection of just one client, I wrote a simple code that recognizes if the connecting client should be served or not, but is there a way to disconnect it server side? I know that I have to use the `close()` function to close a socket descriptor, but when using `select()` I'm working with fd_set's and I don't really know what to do to close them.
Or, is there a way to limit the number of socket descriptors in a set? I found the FD_SETSIZE macro, but I wasn't able to make it work and I'm not even sure if it fixes the problem.
Thank you for your time! | c | sockets | tcp | server | null | null | open | C - How to limit the number of inbound connections in a server when using select()
===
I'm still new to C socket programming but I was able to create some simple client and server programs.
I'm programming a server that listens for TCP connections, its duty is answering to clients' requests and then close the communication when the client sends a special sequence of bytes (or when it disconnects, of course).
I started coding the server using the `accept()` function inside an endless loop: the server waits for a client, accept()'s it, does all the stuff, close()'s the socket descriptor at the end and goes back again waiting to accept a new client.
Since I want to serve one client at a time I called the listen function in this way: `listen(mysocket, 1);`
Everything worked pretty well, but then a new problem came out. The server part explained above runs in a separated thread (let's call it thread #2) and the main thread (thread #1) must be able to tell it to terminate. I created a global variable then, if this variable is set to 1 (by thread #1) thread #2 must terminate. The problem is that thread #2 gets stuck when the `accept()` function is called, thus it can't periodically check the global variable.
I clearly needed a timeout value for that function: "if there isn't a connection to accept, check the value of the global variable, continue waiting for new connection if set to 0 or terminate if set to 1".
I googled for a solution then and found that the `select()` function does the thing that I need. It's a little bit different though, I discovered for the first time the `fd_set` and all the FD_* macros. I modified the server part to make it work with the `select()` function and everything works really nice, but here comes the last problem, the one that I'm not able to solve.
If call the listen function this way: `listen(socket, 1);` but the server still accepts and serves multiple connections at the same time. Does this depend because `select()` works with fd_set's? I'm using some examples I found on the web and, when a connection is accepted, it creates a new socket descriptor that goes in the set with all the others.
I'd like to accept the connection of just one client, I wrote a simple code that recognizes if the connecting client should be served or not, but is there a way to disconnect it server side? I know that I have to use the `close()` function to close a socket descriptor, but when using `select()` I'm working with fd_set's and I don't really know what to do to close them.
Or, is there a way to limit the number of socket descriptors in a set? I found the FD_SETSIZE macro, but I wasn't able to make it work and I'm not even sure if it fixes the problem.
Thank you for your time! | 0 |
11,541,369 | 07/18/2012 12:29:02 | 1,534,698 | 07/18/2012 12:01:06 | 1 | 0 | In XCode 4.3.3 (4E3002): Ctrl-Dragging from a button into a .h file in Storyboard causes XCode to crash | I have a big problem: Whenever I'm in storyboard and Ctrl-Drag from a button into its .h file, give a random name and click enter to create an action, XCode crashes - always.
I already restarted Mac OS, reinstalled XCode, made a new storyboard from scratch, but it all doesn't help, the error doesn't change the tiniest bit.
Has anyone any idea what is wrong with my setup? | xcode | storyboard | null | null | null | null | open | In XCode 4.3.3 (4E3002): Ctrl-Dragging from a button into a .h file in Storyboard causes XCode to crash
===
I have a big problem: Whenever I'm in storyboard and Ctrl-Drag from a button into its .h file, give a random name and click enter to create an action, XCode crashes - always.
I already restarted Mac OS, reinstalled XCode, made a new storyboard from scratch, but it all doesn't help, the error doesn't change the tiniest bit.
Has anyone any idea what is wrong with my setup? | 0 |
11,541,535 | 07/18/2012 12:36:49 | 525,544 | 11/30/2010 18:11:41 | 1 | 0 | What are the "mystery" Likes on Facebook? | On my FB account's Timeline, under Likes there's number 4, and when you try to drill down through it, there's absolutely nothing.
Also, Graph API Explorer also shows 0 likes.
Where are these likes?
| facebook | facebook-graph-api | facebook-like | null | null | null | open | What are the "mystery" Likes on Facebook?
===
On my FB account's Timeline, under Likes there's number 4, and when you try to drill down through it, there's absolutely nothing.
Also, Graph API Explorer also shows 0 likes.
Where are these likes?
| 0 |
11,541,538 | 07/18/2012 12:36:57 | 590,761 | 01/26/2011 14:50:12 | 870 | 25 | Safari 5.1.7 mixing headers from content to page? | I've a really weird problem with the following simple php page saved at the root of my webserver as `test.php`:
<?
if( $_GET['img'] ) {
header('HTTP/1.0 304 Not Modified');
die();
} else {
header("Cache-Control: no-store, no-cache, must-revalidate");
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<body>
<img src="/test.php?img=1">
<a href="/not_existent_page.php">Dead link</a>
</body>
</html>
So when the page gets loaded, my server responds with the following headers:
Status Code 200
Cache-Control no-store, no-cache, must-revalidate
Content-Type text/html; charset=utf-8
Date Wed, 18 Jul 2012 12:00:43 GMT
Server Apache/2.2.22 (Ubuntu)
Strict-Transport-Security max-age=172800, includeSubDomains
Vary Accept-Encoding
x-frame-options sameorigin
x-powered-by PHP/5.4.4-1~precise+1
x-ua-compatible IE=edge
The interesting part are the cache headers: It says, do not cache!
The request for the picture after loading the page has the following response headers:
Status Code 304
Date Wed, 18 Jul 2012 12:02:20 GMT
Server Apache/2.2.22 (Ubuntu)
It does not say anything about caching (but that doesn't matter anyway, I tested it).
With firefox and chrome the site behaves like it should: Each time I reload the page it gets reloaded as it should. If I click on the link, I get a 404 apache error.
With safari, the following happens:
If I open the page first, I see it.
When I reload the page within a short time (see below what "short time" means) it *always* gives me a blank site, when I click and the dead link it *sometimes* gives me a blank site, but I see the following headers in the web developer console of safari:
Status Code 304
Connection:Keep-Alive
Date:Wed, 18 Jul 2012 12:07:41 GMT
Keep-Alive:timeout=15, max=99
Server:Apache/2.2.22 (Ubuntu)
Vary:Accept-Encoding
Now the page stays blank! But: In my apache server logs, it says it returned all good with status code 200 on page reload:
// first page load
[18/Jul/2012:14:10:12 +0200] "GET /test.php HTTP/1.1" 200 979 "url/test.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2"
// request of picture with answer 304
[18/Jul/2012:14:10:12 +0200] "GET /test.php?img=1 HTTP/1.1" 304 266 "url/test.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2"
// reload within 10 seconds
[18/Jul/2012:14:10:19 +0200] "GET /test.php HTTP/1.1" 200 777 "url/test.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2"
and a 404 when clicking the dead link.
And now comes the interesting part: **If I wait approx. 10+ seconds after loading the page**, Safari behaves as expected: It simply loads the page again on reload without a 304 header (or displays a 404 on the dead link).
I have no problem with firefox and chrome at all.
So my question: **Is safari mixing up the headers of the page, but only when loading the page again / clicking on a link within 10 seconds**? How can I prevent this? Is this a bug in safari?
Btw: If I change the header to something else, Safari caches that header. So if I change test.php like this:
...
if( $_GET['img'] ) {
header('HTTP/1.0 204 No Content');
die();
} else {
....
The page reload now simply aborts without doing anything, but headers I see in safari console are `204 No Content`.
One last thing: Reloading the page within 10 seconds triggers the error constantly, while *sometimes* clicking on the link works in safari, sometimes not. | safari | http-headers | browser-cache | null | null | null | open | Safari 5.1.7 mixing headers from content to page?
===
I've a really weird problem with the following simple php page saved at the root of my webserver as `test.php`:
<?
if( $_GET['img'] ) {
header('HTTP/1.0 304 Not Modified');
die();
} else {
header("Cache-Control: no-store, no-cache, must-revalidate");
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<body>
<img src="/test.php?img=1">
<a href="/not_existent_page.php">Dead link</a>
</body>
</html>
So when the page gets loaded, my server responds with the following headers:
Status Code 200
Cache-Control no-store, no-cache, must-revalidate
Content-Type text/html; charset=utf-8
Date Wed, 18 Jul 2012 12:00:43 GMT
Server Apache/2.2.22 (Ubuntu)
Strict-Transport-Security max-age=172800, includeSubDomains
Vary Accept-Encoding
x-frame-options sameorigin
x-powered-by PHP/5.4.4-1~precise+1
x-ua-compatible IE=edge
The interesting part are the cache headers: It says, do not cache!
The request for the picture after loading the page has the following response headers:
Status Code 304
Date Wed, 18 Jul 2012 12:02:20 GMT
Server Apache/2.2.22 (Ubuntu)
It does not say anything about caching (but that doesn't matter anyway, I tested it).
With firefox and chrome the site behaves like it should: Each time I reload the page it gets reloaded as it should. If I click on the link, I get a 404 apache error.
With safari, the following happens:
If I open the page first, I see it.
When I reload the page within a short time (see below what "short time" means) it *always* gives me a blank site, when I click and the dead link it *sometimes* gives me a blank site, but I see the following headers in the web developer console of safari:
Status Code 304
Connection:Keep-Alive
Date:Wed, 18 Jul 2012 12:07:41 GMT
Keep-Alive:timeout=15, max=99
Server:Apache/2.2.22 (Ubuntu)
Vary:Accept-Encoding
Now the page stays blank! But: In my apache server logs, it says it returned all good with status code 200 on page reload:
// first page load
[18/Jul/2012:14:10:12 +0200] "GET /test.php HTTP/1.1" 200 979 "url/test.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2"
// request of picture with answer 304
[18/Jul/2012:14:10:12 +0200] "GET /test.php?img=1 HTTP/1.1" 304 266 "url/test.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2"
// reload within 10 seconds
[18/Jul/2012:14:10:19 +0200] "GET /test.php HTTP/1.1" 200 777 "url/test.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2"
and a 404 when clicking the dead link.
And now comes the interesting part: **If I wait approx. 10+ seconds after loading the page**, Safari behaves as expected: It simply loads the page again on reload without a 304 header (or displays a 404 on the dead link).
I have no problem with firefox and chrome at all.
So my question: **Is safari mixing up the headers of the page, but only when loading the page again / clicking on a link within 10 seconds**? How can I prevent this? Is this a bug in safari?
Btw: If I change the header to something else, Safari caches that header. So if I change test.php like this:
...
if( $_GET['img'] ) {
header('HTTP/1.0 204 No Content');
die();
} else {
....
The page reload now simply aborts without doing anything, but headers I see in safari console are `204 No Content`.
One last thing: Reloading the page within 10 seconds triggers the error constantly, while *sometimes* clicking on the link works in safari, sometimes not. | 0 |
11,541,540 | 07/18/2012 12:37:02 | 591,486 | 01/26/2011 23:37:26 | 508 | 1 | open vimeo url in colorbox using jQuery filter | The jQuery selector works with this link:
http://vimeo.com/44799432
// vimeo in colorbox ##
jQuery("a").filter(function(){ // filter all as ##
return jQuery(this).text().match(/vimeo\.com/igm); // match text with vimeo.com ##
}).colorbox({iframe:true, innerWidth: "80%", innerHeight: "80%"}) // assign to colorbox ##
.addClass("button vimeo"); // add class to style ##
However, vimeo pushes the content out of the iframe and reloads the page - so I need a regex that will match this url - that can be embedded via an iframe:
http://player.vimeo.com/video/44799432
match(/player.vimeo\.com/);
does not do it - any ideas?
Thanks! | jquery | regex | embed | vimeo | null | null | open | open vimeo url in colorbox using jQuery filter
===
The jQuery selector works with this link:
http://vimeo.com/44799432
// vimeo in colorbox ##
jQuery("a").filter(function(){ // filter all as ##
return jQuery(this).text().match(/vimeo\.com/igm); // match text with vimeo.com ##
}).colorbox({iframe:true, innerWidth: "80%", innerHeight: "80%"}) // assign to colorbox ##
.addClass("button vimeo"); // add class to style ##
However, vimeo pushes the content out of the iframe and reloads the page - so I need a regex that will match this url - that can be embedded via an iframe:
http://player.vimeo.com/video/44799432
match(/player.vimeo\.com/);
does not do it - any ideas?
Thanks! | 0 |
11,541,541 | 07/18/2012 12:37:03 | 670,740 | 03/22/2011 07:12:18 | 754 | 63 | automatic transalation of django.po files using google translator | I am having a very big django.po file with all msgids populated. Now i need to substitute msgstr with the equivalent translated string.Every time i need to copy the string to google translator get the translated string and paste it to the file. Is there any too that can get the target language and populate all the msgstr's with the translated string? | python | django | internationalization | null | null | null | open | automatic transalation of django.po files using google translator
===
I am having a very big django.po file with all msgids populated. Now i need to substitute msgstr with the equivalent translated string.Every time i need to copy the string to google translator get the translated string and paste it to the file. Is there any too that can get the target language and populate all the msgstr's with the translated string? | 0 |
11,541,542 | 07/18/2012 12:37:06 | 1,272,898 | 03/15/2012 23:51:30 | 5 | 1 | Android app launch performance | When I run my App on the android emulator log-cat tells me that it skipped 70 frames (when the app starts launching) and that it might be doing too much in on the main thread. How can I spread the load, or improve my app's performance. Do I need a load screen on start-up.
This is my launch activity,
package com.the.maze;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class TheMazeActivity extends ListActivity{
String list[]={"New Game","Highscores","How to play","Settings","About"};
Class classes[]={GameActivity.class,null,Instructions.class,null,null};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, list));
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
try{
Intent intent= new Intent(TheMazeActivity.this,classes[position]);
startActivity(intent);
}catch(Exception e){
e.printStackTrace();
}
}
}
| android | performance | android-asynctask | android-activity | null | null | open | Android app launch performance
===
When I run my App on the android emulator log-cat tells me that it skipped 70 frames (when the app starts launching) and that it might be doing too much in on the main thread. How can I spread the load, or improve my app's performance. Do I need a load screen on start-up.
This is my launch activity,
package com.the.maze;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class TheMazeActivity extends ListActivity{
String list[]={"New Game","Highscores","How to play","Settings","About"};
Class classes[]={GameActivity.class,null,Instructions.class,null,null};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, list));
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
try{
Intent intent= new Intent(TheMazeActivity.this,classes[position]);
startActivity(intent);
}catch(Exception e){
e.printStackTrace();
}
}
}
| 0 |
11,541,544 | 07/18/2012 12:37:08 | 1,245,631 | 03/02/2012 17:20:42 | 11 | 5 | $('#element').css("CssProperty") is not loading | i am using jquery .css() function to get 'margin-left' property using `var divMargin= $('#DivId').css('margin-left')` but i am getting `undefined` in `divMargin` some times this works perfectly and some times causes problem
var divMargin= $('#DivId').css('margin-left');
what is cause of such unexpected behavior? | javascript | jquery | css | margin | null | null | open | $('#element').css("CssProperty") is not loading
===
i am using jquery .css() function to get 'margin-left' property using `var divMargin= $('#DivId').css('margin-left')` but i am getting `undefined` in `divMargin` some times this works perfectly and some times causes problem
var divMargin= $('#DivId').css('margin-left');
what is cause of such unexpected behavior? | 0 |
11,541,547 | 07/18/2012 12:37:10 | 330,417 | 05/01/2010 15:11:30 | 849 | 54 | Server side data bindings in javascript client | What is the best way to consume complex json objects in this day and age?
When doing data binding, in javascript, so far I have used Sencha's Ext.Js/ Sencha touch model
Eg:
Store = Ext.create('Ext.data.Store',{
Constructor: function (config) {
var config = Ext.apply({}, config, {
model: 'BasicModel',
proxy: {
type: 'ajax',
url: 'myServerUrl.json',
reader: {
type: 'json'
}
}
});
}
});
Which allows me to consume server data quite easily, and also has convenience methods for all sorts of cool magic around the store ( REST/sorting etc invisibly).
Currently, I am experimenting with using less ExtJs, in some projects I doing, because in some respects its a bit heavy, and as such am looking for something that has similar/better functionality to Ext's data store, is NOT ExtJS (Eg not Ext-Core)
| javascript | data-binding | null | null | null | null | open | Server side data bindings in javascript client
===
What is the best way to consume complex json objects in this day and age?
When doing data binding, in javascript, so far I have used Sencha's Ext.Js/ Sencha touch model
Eg:
Store = Ext.create('Ext.data.Store',{
Constructor: function (config) {
var config = Ext.apply({}, config, {
model: 'BasicModel',
proxy: {
type: 'ajax',
url: 'myServerUrl.json',
reader: {
type: 'json'
}
}
});
}
});
Which allows me to consume server data quite easily, and also has convenience methods for all sorts of cool magic around the store ( REST/sorting etc invisibly).
Currently, I am experimenting with using less ExtJs, in some projects I doing, because in some respects its a bit heavy, and as such am looking for something that has similar/better functionality to Ext's data store, is NOT ExtJS (Eg not Ext-Core)
| 0 |
11,541,550 | 07/18/2012 12:37:23 | 1,534,747 | 07/18/2012 12:16:15 | 1 | 0 | Entity types after upgrading Magento from 1.5.1.0 to 1.7.0.0 | I’ve done upgrade of magento from version 1.5.1.0 to 1.7.0, over svn, by using, at most, instructions from [this article][1]. After few tweaks, site was upgraded, and seems to work well ie. no error has been noticed after short period of user testing.
But I am in doubt about new entity types that are exists in fresh installation of 1.7 (I think that most of them are introduced in 1.6.x versions), and does not exists in my upgrade.
Here is the list of those entity types that are exists in fresh installation of 1.7 version and does not exists in my upgraded version:
'creditmemo_comment'
'creditmemo_item'
'customer_payment'
'invoice_comment'
'invoice_item'
'invoice_shipment'
'order_address'
'order_item'
'order_payment'
'order_status'
'order_status_history'
'quote'
'quote_address'
'quote_address_item'
'quote_address_rate'
'quote_item'
'quote_payment'
'shipment_comment'
'shipment_item'
'shipment_track'
I want to ask if anyone else has this issue, and if anyone has solution for this?
I am in doubt about this because, even site seems to work fine, i’m afraid that this difference in entity types could couse some error, later, on production.
Thanks!
[1]: http://www.magentocommerce.com/wiki/groups/174/changing_and_customizing_magento_code#upgrading_to_a_newer_version | magento | upgrade-issue | null | null | null | null | open | Entity types after upgrading Magento from 1.5.1.0 to 1.7.0.0
===
I’ve done upgrade of magento from version 1.5.1.0 to 1.7.0, over svn, by using, at most, instructions from [this article][1]. After few tweaks, site was upgraded, and seems to work well ie. no error has been noticed after short period of user testing.
But I am in doubt about new entity types that are exists in fresh installation of 1.7 (I think that most of them are introduced in 1.6.x versions), and does not exists in my upgrade.
Here is the list of those entity types that are exists in fresh installation of 1.7 version and does not exists in my upgraded version:
'creditmemo_comment'
'creditmemo_item'
'customer_payment'
'invoice_comment'
'invoice_item'
'invoice_shipment'
'order_address'
'order_item'
'order_payment'
'order_status'
'order_status_history'
'quote'
'quote_address'
'quote_address_item'
'quote_address_rate'
'quote_item'
'quote_payment'
'shipment_comment'
'shipment_item'
'shipment_track'
I want to ask if anyone else has this issue, and if anyone has solution for this?
I am in doubt about this because, even site seems to work fine, i’m afraid that this difference in entity types could couse some error, later, on production.
Thanks!
[1]: http://www.magentocommerce.com/wiki/groups/174/changing_and_customizing_magento_code#upgrading_to_a_newer_version | 0 |
11,401,174 | 07/09/2012 18:47:28 | 1,157,509 | 01/19/2012 01:41:02 | 373 | 2 | Fullscreen application option (hide app title bar) | Hello I would like to know if there is a way to have my application run, without a title bar, essentially maximized so that only the body is visible on the screen. I'm sure I can work things like a show/hide option for a `menuStrip` on `mouseOver` or something like that, but for the title bar, I'm not sure. If there was a way to show/hide that on a `mouseOver` can someone provide an example? This is for a WinForms application. | c# | titlebar | null | null | null | null | open | Fullscreen application option (hide app title bar)
===
Hello I would like to know if there is a way to have my application run, without a title bar, essentially maximized so that only the body is visible on the screen. I'm sure I can work things like a show/hide option for a `menuStrip` on `mouseOver` or something like that, but for the title bar, I'm not sure. If there was a way to show/hide that on a `mouseOver` can someone provide an example? This is for a WinForms application. | 0 |
11,401,155 | 07/09/2012 18:46:17 | 928,001 | 09/04/2011 21:41:28 | 389 | 8 | GIT: How to protect the branch from being removed by other developers? | After the first release of our product, we will be switching to a different branches for the main development and feature development. Is there a way to create a branch in such a way, so that we can protect it from being removed (accidentally or on purpose)?
I tried to create a sample git repository in our local gitlab machine, then protected one of the branches from the option on the website, but then I was able to remove it with `git push origin :branch_name`. Thanks in advance! | git | github | branch | git-branch | gitlab | null | open | GIT: How to protect the branch from being removed by other developers?
===
After the first release of our product, we will be switching to a different branches for the main development and feature development. Is there a way to create a branch in such a way, so that we can protect it from being removed (accidentally or on purpose)?
I tried to create a sample git repository in our local gitlab machine, then protected one of the branches from the option on the website, but then I was able to remove it with `git push origin :branch_name`. Thanks in advance! | 0 |
11,382,355 | 07/08/2012 10:18:54 | 1,509,842 | 07/08/2012 10:02:20 | 1 | 0 | Enable a PHP folder within a Rails app? | I need to run some scripts written in PHP in a Rails app through some JS ajax calls. I am having a cross-domains issue where my scripts are active on localhost/scripts and my app is active on localhost:3000/myapplication. Ajax requests to localhost return a cross domain error.
I was able to implement the jsonp workaround, and it works fine but I would ideally like to access the php file from within the rails folders. I read that its possible to configure the apache server to enable PHP on a folder within the framework. I am running Apache2 on Linux.
[Attempted solution][1]
[1]: http://blog.hulihanapplications.com/browse/view/27-running-php-inside-a-rails-app
I'm not 100% sure where to find the .htaccess file, so I just made one in the directory. Not sure if that works though... | php | ruby-on-rails | ajax | apache | .htaccess | null | open | Enable a PHP folder within a Rails app?
===
I need to run some scripts written in PHP in a Rails app through some JS ajax calls. I am having a cross-domains issue where my scripts are active on localhost/scripts and my app is active on localhost:3000/myapplication. Ajax requests to localhost return a cross domain error.
I was able to implement the jsonp workaround, and it works fine but I would ideally like to access the php file from within the rails folders. I read that its possible to configure the apache server to enable PHP on a folder within the framework. I am running Apache2 on Linux.
[Attempted solution][1]
[1]: http://blog.hulihanapplications.com/browse/view/27-running-php-inside-a-rails-app
I'm not 100% sure where to find the .htaccess file, so I just made one in the directory. Not sure if that works though... | 0 |
11,401,180 | 07/09/2012 18:48:13 | 1,477,541 | 06/24/2012 01:39:31 | 3 | 0 | How to bind data column to textbox? | I have datagridview and textboxes on form. I load records from different tables when user clicks any one radiobutton. Data in grid is shown perfectly. I want to show values of the row in those textboxes.
One solution can be: binding data from dataset.
Second one can be: transfer values of each cell of row to respective textbox.
Please help me. And, please tell me which one is better or is there any other method which is even better than these two.
Thanks in advance. | data-binding | binding | null | null | null | null | open | How to bind data column to textbox?
===
I have datagridview and textboxes on form. I load records from different tables when user clicks any one radiobutton. Data in grid is shown perfectly. I want to show values of the row in those textboxes.
One solution can be: binding data from dataset.
Second one can be: transfer values of each cell of row to respective textbox.
Please help me. And, please tell me which one is better or is there any other method which is even better than these two.
Thanks in advance. | 0 |
11,401,182 | 07/09/2012 18:48:21 | 291,701 | 03/11/2010 17:11:24 | 2,059 | 6 | GCM - Unclear on how app update works? | I'm taking a look at GCM, I'm not sure what we need to do in the case of application update. The doc says:
"When an application is updated, it should invalidate its existing registration ID, as it is not guaranteed to work with the new version. Because there is no lifecycle method called when the application is updated, the best way to achieve this validation is by storing the current application version when a registration ID is stored. Then when the application is started, compare the stored value with the current application version. If they do not match, invalidate the stored data and start the registration process again."
So what should that look like? Something like:
public class MyActivity extends Activity {
@Override
public void onCreate(...) {
if (we are a new app version) {
// calling register() force-starts the process of getting a new
// gcm token?
GCMRegistrar.register(context, SENDER_ID);
saveLastVersionUpdateCodeToDisk();
}
}
so we just need to make sure we call GCMRegistrar.register() again ourselves in case we're a new app version?
Thanks | android | android-gcm | null | null | null | null | open | GCM - Unclear on how app update works?
===
I'm taking a look at GCM, I'm not sure what we need to do in the case of application update. The doc says:
"When an application is updated, it should invalidate its existing registration ID, as it is not guaranteed to work with the new version. Because there is no lifecycle method called when the application is updated, the best way to achieve this validation is by storing the current application version when a registration ID is stored. Then when the application is started, compare the stored value with the current application version. If they do not match, invalidate the stored data and start the registration process again."
So what should that look like? Something like:
public class MyActivity extends Activity {
@Override
public void onCreate(...) {
if (we are a new app version) {
// calling register() force-starts the process of getting a new
// gcm token?
GCMRegistrar.register(context, SENDER_ID);
saveLastVersionUpdateCodeToDisk();
}
}
so we just need to make sure we call GCMRegistrar.register() again ourselves in case we're a new app version?
Thanks | 0 |
11,401,183 | 07/09/2012 18:48:26 | 1,077,685 | 12/02/2011 15:26:57 | 74 | 0 | How can I reset all object values with only one method call? | Basically, I want to create Counter objects, all they have to do is hold number values. And in my resetCounters method, I would like to reset each object's values. This is probably very easy, but I'm a newb.
public class Counter
{
Random number = new Random();
Counter()
{
Random number = new Random();
}
public Random getNumber()
{
return number;
}
public void setNumber(Random number)
{
this.number = number;
}
public static void main(String[] args)
{
Counter counter1 = new Counter();
Counter counter2 = new Counter();
Counter counter3 = new Counter();
Counter counter4 = new Counter();
Counter counter5 = new Counter();
}
public static void resetCounters()
{
}
} | java | null | null | null | null | null | open | How can I reset all object values with only one method call?
===
Basically, I want to create Counter objects, all they have to do is hold number values. And in my resetCounters method, I would like to reset each object's values. This is probably very easy, but I'm a newb.
public class Counter
{
Random number = new Random();
Counter()
{
Random number = new Random();
}
public Random getNumber()
{
return number;
}
public void setNumber(Random number)
{
this.number = number;
}
public static void main(String[] args)
{
Counter counter1 = new Counter();
Counter counter2 = new Counter();
Counter counter3 = new Counter();
Counter counter4 = new Counter();
Counter counter5 = new Counter();
}
public static void resetCounters()
{
}
} | 0 |
11,401,191 | 07/09/2012 18:48:56 | 100,747 | 05/04/2009 08:49:24 | 986 | 14 | Return Multiple calendar events | The answer [here][1] by @hmjd helped me to set the text of multiple objects. But I have run into a problem now. A date can have multiple events and I would like to show all the events and their details on the same event details page. How can I do this?
Code:
public class Event
{
public final String name;
public final String title;
public final String details;
public Event(final String a_name,
final String a_title,
final String a_details)
{
name = a_name;
title = a_title;
details = a_details;
}
};
final Event e = eventDetails(1, 4);
name.setText(e.name);
title.setText(e.title);
details.setText(e.details);
//event details
public Event eventDetails(int m, int d) {
switch (m) {
case 1:
if (d == 10) {
return new Event("event1", "my-title1", "mydetails1");
}
if (d == 28) {
return new Event("event2", "my-title1", "mydetails1");
return new Event("event3", "my-title2", "mydetails2"); //add another event on this date; obviously this is not the right way.
}
break;
}
return new Event("default_my-name2", "default_my-title2", "default_mydetails2");
}
[1]: http://stackoverflow.com/a/11386687/100747
| java | android | calendar | null | null | null | open | Return Multiple calendar events
===
The answer [here][1] by @hmjd helped me to set the text of multiple objects. But I have run into a problem now. A date can have multiple events and I would like to show all the events and their details on the same event details page. How can I do this?
Code:
public class Event
{
public final String name;
public final String title;
public final String details;
public Event(final String a_name,
final String a_title,
final String a_details)
{
name = a_name;
title = a_title;
details = a_details;
}
};
final Event e = eventDetails(1, 4);
name.setText(e.name);
title.setText(e.title);
details.setText(e.details);
//event details
public Event eventDetails(int m, int d) {
switch (m) {
case 1:
if (d == 10) {
return new Event("event1", "my-title1", "mydetails1");
}
if (d == 28) {
return new Event("event2", "my-title1", "mydetails1");
return new Event("event3", "my-title2", "mydetails2"); //add another event on this date; obviously this is not the right way.
}
break;
}
return new Event("default_my-name2", "default_my-title2", "default_mydetails2");
}
[1]: http://stackoverflow.com/a/11386687/100747
| 0 |
11,401,193 | 07/09/2012 18:49:06 | 1,306,207 | 04/01/2012 11:20:51 | 149 | 0 | iOS Objective-C - for-loop issue | The code below produces and error in the line `[myArray objectAtIndex:i];` and I can't seem to figure out why?
Any ideas?
int total = 0;
for (int i = 0; i < myArray.count; i++) {
int tempNumber = [myArray objectAtIndex:i];
total = total + tempNumber;
} | objective-c | ios | null | null | null | null | open | iOS Objective-C - for-loop issue
===
The code below produces and error in the line `[myArray objectAtIndex:i];` and I can't seem to figure out why?
Any ideas?
int total = 0;
for (int i = 0; i < myArray.count; i++) {
int tempNumber = [myArray objectAtIndex:i];
total = total + tempNumber;
} | 0 |
11,280,381 | 07/01/2012 07:52:04 | 495,466 | 11/03/2010 02:35:09 | 58 | 4 | Google Drive API JavaScript - Insert file | Im trying to "insert" a Drive file.
Ive made the auth and it works right :)
But when i try to create (insert) a nuew file from JS, it creates, but a file named "Untitled" with no extension at all. (i have a sync folder on my file system, and it is the same thing)
My code is this:
function createNewFile( ) {
gapi.client.load('drive', 'v2', function() {
var request = gapi.client.drive.files.insert ( {
"title" : "cat.jpg",
"mimeType" : "image/jpeg",
"description" : "Some"
} );
request.execute(function(resp) { console.log(resp); });
});
}
Any idea about what is wrong?
I can list files from my drive from JS, and this code creates this "untitled" and no extensioned file.
Thank you!
Gustavo | javascript | google-drive-sdk | null | null | null | null | open | Google Drive API JavaScript - Insert file
===
Im trying to "insert" a Drive file.
Ive made the auth and it works right :)
But when i try to create (insert) a nuew file from JS, it creates, but a file named "Untitled" with no extension at all. (i have a sync folder on my file system, and it is the same thing)
My code is this:
function createNewFile( ) {
gapi.client.load('drive', 'v2', function() {
var request = gapi.client.drive.files.insert ( {
"title" : "cat.jpg",
"mimeType" : "image/jpeg",
"description" : "Some"
} );
request.execute(function(resp) { console.log(resp); });
});
}
Any idea about what is wrong?
I can list files from my drive from JS, and this code creates this "untitled" and no extensioned file.
Thank you!
Gustavo | 0 |
11,280,382 | 07/01/2012 07:52:12 | 347,727 | 05/22/2010 09:01:49 | 457 | 10 | Python Mongodb Pymongo Json encoding and decoding | I'm having some trouble with Mongodb and Python (Flask).
I have this api.py file, and I want all requests and responses to be in JSON, so I implement as such.
#
# Imports
#
from datetime import datetime
from flask import Flask
from flask import g
from flask import jsonify
from flask import json
from flask import request
from flask import url_for
from flask import redirect
from flask import render_template
from flask import make_response
import pymongo
from pymongo import Connection
from bson import BSON
from bson import json_util
#
# App Create
#
app = Flask(__name__)
app.config.from_object(__name__)
#
# Database
#
# connect
connection = Connection()
db = connection['storage']
units = db['storage']
#
# Request Mixins
#
@app.before_request
def before_request():
#before
return
@app.teardown_request
def teardown_request(exception):
#after
return
#
# Functions
#
def isInt(n):
try:
num = int(n)
return True
except ValueError:
return False
def isFloat(n):
try:
num = float(n)
return True
except ValueError:
return False
def jd(obj):
return json.dumps(obj, default=json_util.default)
def jl(obj):
return json.loads(obj, object_hook=json_util.object_hook)
#
# Response
#
def response(data={}, code=200):
resp = {
"code" : code,
"data" : data
}
response = make_response(jd(resp))
response.headers['Status Code'] = resp['code']
response.headers['Content-Type'] = "application/json"
return response
#
# REST API calls
#
# index
@app.route('/')
def index():
return response()
# search
@app.route('/search', methods=['POST'])
def search():
return response()
# add
@app.route('/add', methods=['POST'])
def add():
unit = request.json
_id = units.save(unit)
return response(_id)
# get
@app.route('/show', methods=['GET'])
def show():
import pdb; pdb.set_trace();
return response(db.units.find())
#
# Error handing
#
@app.errorhandler(404)
def page_not_found(error):
return response({},404)
#
# Run it!
#
if __name__ == '__main__':
app.debug = True
app.run()
The problem here is json encoding data coming to and from mongo. It seems I've been able to "hack" the add route by passing the request.json as the dictionary for save, so thats good... the problem is /show. This code does not work... When I do some logging I get
TypeError: <pymongo.cursor.Cursor object at 0x109bda150> is not JSON serializable
Any ideas? I also welcome any suggestions on the rest of the code, but the JSON is killing me.
Thanks in advance!
| python | json | mongodb | flask | pymongo | null | open | Python Mongodb Pymongo Json encoding and decoding
===
I'm having some trouble with Mongodb and Python (Flask).
I have this api.py file, and I want all requests and responses to be in JSON, so I implement as such.
#
# Imports
#
from datetime import datetime
from flask import Flask
from flask import g
from flask import jsonify
from flask import json
from flask import request
from flask import url_for
from flask import redirect
from flask import render_template
from flask import make_response
import pymongo
from pymongo import Connection
from bson import BSON
from bson import json_util
#
# App Create
#
app = Flask(__name__)
app.config.from_object(__name__)
#
# Database
#
# connect
connection = Connection()
db = connection['storage']
units = db['storage']
#
# Request Mixins
#
@app.before_request
def before_request():
#before
return
@app.teardown_request
def teardown_request(exception):
#after
return
#
# Functions
#
def isInt(n):
try:
num = int(n)
return True
except ValueError:
return False
def isFloat(n):
try:
num = float(n)
return True
except ValueError:
return False
def jd(obj):
return json.dumps(obj, default=json_util.default)
def jl(obj):
return json.loads(obj, object_hook=json_util.object_hook)
#
# Response
#
def response(data={}, code=200):
resp = {
"code" : code,
"data" : data
}
response = make_response(jd(resp))
response.headers['Status Code'] = resp['code']
response.headers['Content-Type'] = "application/json"
return response
#
# REST API calls
#
# index
@app.route('/')
def index():
return response()
# search
@app.route('/search', methods=['POST'])
def search():
return response()
# add
@app.route('/add', methods=['POST'])
def add():
unit = request.json
_id = units.save(unit)
return response(_id)
# get
@app.route('/show', methods=['GET'])
def show():
import pdb; pdb.set_trace();
return response(db.units.find())
#
# Error handing
#
@app.errorhandler(404)
def page_not_found(error):
return response({},404)
#
# Run it!
#
if __name__ == '__main__':
app.debug = True
app.run()
The problem here is json encoding data coming to and from mongo. It seems I've been able to "hack" the add route by passing the request.json as the dictionary for save, so thats good... the problem is /show. This code does not work... When I do some logging I get
TypeError: <pymongo.cursor.Cursor object at 0x109bda150> is not JSON serializable
Any ideas? I also welcome any suggestions on the rest of the code, but the JSON is killing me.
Thanks in advance!
| 0 |
11,280,390 | 07/01/2012 07:53:33 | 1,493,970 | 07/01/2012 07:14:13 | 1 | 0 | can i use protobuf-c both in C++ and C? | i'm new one to protobuf-c
i have altered protobuf-c client and server example program as per my requirement and i got this program through this link
> [code.google.com/p/protobuf-c/wiki/RPC_Example][1]
now i have to write server side programing in c++ and i want to use the client side program in c itself this my new requirement
can any one please help me how to use the .h and .c proto file that is compiled using protobuf-c in c++ server side program file
any suggestions will be appreciated
[1]: http://code.google.com/p/protobuf-c/wiki/RPC_Example | c++ | c | null | null | null | null | open | can i use protobuf-c both in C++ and C?
===
i'm new one to protobuf-c
i have altered protobuf-c client and server example program as per my requirement and i got this program through this link
> [code.google.com/p/protobuf-c/wiki/RPC_Example][1]
now i have to write server side programing in c++ and i want to use the client side program in c itself this my new requirement
can any one please help me how to use the .h and .c proto file that is compiled using protobuf-c in c++ server side program file
any suggestions will be appreciated
[1]: http://code.google.com/p/protobuf-c/wiki/RPC_Example | 0 |
11,280,391 | 07/01/2012 07:54:01 | 836,026 | 07/08/2011 20:10:32 | 345 | 9 | Domain user removed from local administrator group in Windows 7 Enterprise | I have computer with Windows 7 Enterprise Edition. I added my domain user account to local administrator group. it works for some time. however, once I restart the machine, In notice the domain user is no longer in administrator group & I have to redo it again.
is there away to make my domain user in the local administrator group forever. | windows-7 | null | null | null | null | 07/01/2012 23:50:32 | off topic | Domain user removed from local administrator group in Windows 7 Enterprise
===
I have computer with Windows 7 Enterprise Edition. I added my domain user account to local administrator group. it works for some time. however, once I restart the machine, In notice the domain user is no longer in administrator group & I have to redo it again.
is there away to make my domain user in the local administrator group forever. | 2 |
11,280,392 | 07/01/2012 07:54:11 | 1,150,207 | 01/15/2012 09:08:20 | 23 | 0 | External Database access in Android | Can I talk to the database of another application from inside my code? | android | database | null | null | null | null | open | External Database access in Android
===
Can I talk to the database of another application from inside my code? | 0 |
11,248,617 | 06/28/2012 16:07:15 | 1,489,064 | 06/28/2012 15:37:27 | 1 | 0 | complex MySQL five table join | I have following five table:
<p><b>Table name: Fields</b></p>
<p><b>dba_acc:</b> account_id, username<br/>
<b>user_inst:</b> account_id, instance_name, host_name<br/>
<b>instances:</b> instance_key, instance_name<br/>
<b>db_inst:</b> db_key, instance_key<br/>
<b>dbs:</b> db, db_key</p>
All the tables are inter connected.
I want to develop a query that displays account_id, username, instance_name, host_name, and db of a specific user.
For example, if I select username = 'Joe' then it should display account_id of 'Joe', instance_name and host_name that are related to 'Joe', and db related to each instance_name.
Relation between instance_name and host_name is many to many.
It is so complicated. I am stuck! Any help is appreciated. | mysql | table | join | complex | null | null | open | complex MySQL five table join
===
I have following five table:
<p><b>Table name: Fields</b></p>
<p><b>dba_acc:</b> account_id, username<br/>
<b>user_inst:</b> account_id, instance_name, host_name<br/>
<b>instances:</b> instance_key, instance_name<br/>
<b>db_inst:</b> db_key, instance_key<br/>
<b>dbs:</b> db, db_key</p>
All the tables are inter connected.
I want to develop a query that displays account_id, username, instance_name, host_name, and db of a specific user.
For example, if I select username = 'Joe' then it should display account_id of 'Joe', instance_name and host_name that are related to 'Joe', and db related to each instance_name.
Relation between instance_name and host_name is many to many.
It is so complicated. I am stuck! Any help is appreciated. | 0 |
11,280,398 | 07/01/2012 07:55:07 | 1,493,992 | 07/01/2012 07:39:14 | 1 | 0 | What is the equivalent of "webkit-tap-highlight-color" in Fennec? | I want to disable the orange highlighting displayed when the user taps a link. I think iOS and Android Browsers support this by using "webkit-tap-highlight-color". Is there a way to do this? | javascript | html | css | mobile | fennec | null | open | What is the equivalent of "webkit-tap-highlight-color" in Fennec?
===
I want to disable the orange highlighting displayed when the user taps a link. I think iOS and Android Browsers support this by using "webkit-tap-highlight-color". Is there a way to do this? | 0 |
11,280,399 | 07/01/2012 07:55:15 | 1,311,941 | 04/04/2012 04:41:39 | 3 | 2 | Grails: Rendering two Views simultaneously with one Controller Action | One action of one of my controllers needs to generate(redirect/render) two separate views simultaneously and show both the pages to the client. It will be like when the user submits his info, the page will redirect to a new page with a list. **At the same time** another page needs to **pop up in a new window** containing some additional info (user would print this page). I know, I can resolve the issue with a single page, but I was wondering whether there is any ways to produce two separate pages/windows simultaneously from a single controller action.
Thanks in anticipation | grails | view | controller | multiple | null | null | open | Grails: Rendering two Views simultaneously with one Controller Action
===
One action of one of my controllers needs to generate(redirect/render) two separate views simultaneously and show both the pages to the client. It will be like when the user submits his info, the page will redirect to a new page with a list. **At the same time** another page needs to **pop up in a new window** containing some additional info (user would print this page). I know, I can resolve the issue with a single page, but I was wondering whether there is any ways to produce two separate pages/windows simultaneously from a single controller action.
Thanks in anticipation | 0 |
11,280,388 | 07/01/2012 07:52:55 | 1,494,003 | 07/01/2012 07:48:46 | 1 | 0 | Python - Delete column from a matrix without numPy | this is my first question on here. The question is simple -
# this removes the top list from the list of lists
triangle = [
[3, 0, 0],
[2, 0, 0],
[1, 0, 0]]
del triangle[0]
I want to have a similarly easy way to remove a 'column'. I can of course do this using a for loop, but is there something equivalent to
del triangle[0]
Thankyou | python | null | null | null | null | null | open | Python - Delete column from a matrix without numPy
===
this is my first question on here. The question is simple -
# this removes the top list from the list of lists
triangle = [
[3, 0, 0],
[2, 0, 0],
[1, 0, 0]]
del triangle[0]
I want to have a similarly easy way to remove a 'column'. I can of course do this using a for loop, but is there something equivalent to
del triangle[0]
Thankyou | 0 |
11,280,389 | 07/01/2012 07:53:25 | 1,265,960 | 03/13/2012 08:18:27 | 58 | 1 | Remove files not containing a specific string | I want to find the files not containing a specific string (in a directory and its sub-directories) and remove those files. How I can do this? | linux | bash | sed | grep | null | null | open | Remove files not containing a specific string
===
I want to find the files not containing a specific string (in a directory and its sub-directories) and remove those files. How I can do this? | 0 |
11,226,737 | 06/27/2012 12:57:24 | 1,485,680 | 06/27/2012 12:45:14 | 1 | 0 | iOS 6 turn by turn navagation API | Is there anyone who can give me same reference, support, example link or other info about iOS 6 Map API?
(I made a long search on the web finding only the apple reference)
First of all I'm intresting to "turn by turn navagation" feature and their integration in custom app.
Thanks to all
| ios | api | mapkit | navigator | ios6 | null | open | iOS 6 turn by turn navagation API
===
Is there anyone who can give me same reference, support, example link or other info about iOS 6 Map API?
(I made a long search on the web finding only the apple reference)
First of all I'm intresting to "turn by turn navagation" feature and their integration in custom app.
Thanks to all
| 0 |
11,226,738 | 06/27/2012 12:57:26 | 1,309,986 | 04/03/2012 09:03:23 | 501 | 54 | How can I check if npm packages support Node.js v0.8.x? | I have a deployed version 0.6 of Node.js with a considerable number of packages installed for various projects.
Is there a straight-forward way to check all of the packages that were installed using NPM to see if they support Node.js v 0.8.x?
I can see that the package.json files *should* say what version of Node they are for though I'm guessing that many will not include this - so I'm really only interested in packages that say they are definately **not** compatible with Node v 0.8.x
e.g. They have something like this in package.json:
"engines": {
"node": "<0.8.0"
},
or
"engines": {
"node": "=0.6.*"
},
I just want a simple list of packages that are incompatible. | node.js | npm | upgrading | null | null | null | open | How can I check if npm packages support Node.js v0.8.x?
===
I have a deployed version 0.6 of Node.js with a considerable number of packages installed for various projects.
Is there a straight-forward way to check all of the packages that were installed using NPM to see if they support Node.js v 0.8.x?
I can see that the package.json files *should* say what version of Node they are for though I'm guessing that many will not include this - so I'm really only interested in packages that say they are definately **not** compatible with Node v 0.8.x
e.g. They have something like this in package.json:
"engines": {
"node": "<0.8.0"
},
or
"engines": {
"node": "=0.6.*"
},
I just want a simple list of packages that are incompatible. | 0 |
11,226,739 | 06/27/2012 12:57:28 | 1,004,685 | 10/20/2011 07:40:11 | 31 | 8 | wpf print scrollview content with full window | in wpf window there is scroll view ,on taking the print out of window whole scroll view didn't come ,only the window size print is coming ,is there any way to take the printout of whole scrollview with the window | wpf | printing | scrollbar | null | null | null | open | wpf print scrollview content with full window
===
in wpf window there is scroll view ,on taking the print out of window whole scroll view didn't come ,only the window size print is coming ,is there any way to take the printout of whole scrollview with the window | 0 |
11,226,043 | 06/27/2012 12:19:43 | 1,063,254 | 11/24/2011 05:18:32 | 134 | 0 | Sha256 + salt algorithem in windows phone 7 | I want to encrypt my userid and password using SHA256 algorithm and salt key for sending to the server through a xml. How can I achieve this ?
I did a sample code with SHA256 and pasted bleow. How I use salt key in this ?
void myBtn_Click(object sender, RoutedEventArgs e)
{
var sha = new SHA256Managed();
var bytes = System.Text.Encoding.UTF8.GetBytes(testPass.Text);
byte[] resultHash = sha.ComputeHash(bytes);
string sha256 = ConvertToString(resultHash);
}
public static string ConvertToString(byte[] buff)
{
string sbinary = "";
for (int i = 0; i < buff.Length; i++)
{
//hex-formatted
sbinary += buff[i].ToString("X2");
}
return (sbinary);
} | windows-phone-7 | encryption | salt | sha | sha256 | null | open | Sha256 + salt algorithem in windows phone 7
===
I want to encrypt my userid and password using SHA256 algorithm and salt key for sending to the server through a xml. How can I achieve this ?
I did a sample code with SHA256 and pasted bleow. How I use salt key in this ?
void myBtn_Click(object sender, RoutedEventArgs e)
{
var sha = new SHA256Managed();
var bytes = System.Text.Encoding.UTF8.GetBytes(testPass.Text);
byte[] resultHash = sha.ComputeHash(bytes);
string sha256 = ConvertToString(resultHash);
}
public static string ConvertToString(byte[] buff)
{
string sbinary = "";
for (int i = 0; i < buff.Length; i++)
{
//hex-formatted
sbinary += buff[i].ToString("X2");
}
return (sbinary);
} | 0 |
11,185,150 | 06/25/2012 07:32:21 | 607,781 | 02/08/2011 08:18:11 | 608 | 36 | IBMDB2 simple query error 901 - system error | I'm working on a IBM iseries v6r1m0 system.
I'm trying to execute a very simple query :
select * from XG.ART where DOS = 998 and (DES like 'ALB%' or DESABR like 'ALB%')
DOS -> numeric (3,0)
DES -> Graphic(80) CCSID 1200
DESABR -> Garphic(25) CCSID 1200
I get :
Etat SQL : 58004
Code fournisseur : -901
Message : [SQL0901] Erreur système SQL. Cause . . . . . : Une erreur système SQL est intervenue. L'instruction SQL en cours ne peut s'exécuter avec succès. Cette erreur n'empêchera pas cependant l'exécution des instructions suivantes. Il se peut que des messages précédents aient signalé un incident lié à cette instruction SQL et que SQL n'ait pas correctement diagnostiqué l'erreur. Les messages précédents indiquent peut-être qu'un incident s'est produit sur cette instruction SQL, mais que le diagnostic n'a pas été correctement effectué par SQL. L'ID message précédent est CPF4204. Une erreur interne de type 3107 s'est produite. S'il s'agit d'une précompilation, le traitement s'interrompra sur cette instruction. Que faire . . . : Consultez les messages précédents pour déterminer si un incident s'est produit sur cette instruction SQL. Pour consulter les messages, utilisez la commande DSPJOBLOG en mode interactif, ou la commande WRKJOB pour visualiser la sortie d'une précompilation. Un programme d'application recevant ce code retour peut tenter de lancer de nouvelles instructions SQL. Corrigez les erreurs éventuelles et renouvelez votre demande.
L'instruction mise en évidence a échoué, entraînant l'interruption du traitement
If I change DES into REF (graphic(25)), it works...
| sql | db2 | ibm | null | null | null | open | IBMDB2 simple query error 901 - system error
===
I'm working on a IBM iseries v6r1m0 system.
I'm trying to execute a very simple query :
select * from XG.ART where DOS = 998 and (DES like 'ALB%' or DESABR like 'ALB%')
DOS -> numeric (3,0)
DES -> Graphic(80) CCSID 1200
DESABR -> Garphic(25) CCSID 1200
I get :
Etat SQL : 58004
Code fournisseur : -901
Message : [SQL0901] Erreur système SQL. Cause . . . . . : Une erreur système SQL est intervenue. L'instruction SQL en cours ne peut s'exécuter avec succès. Cette erreur n'empêchera pas cependant l'exécution des instructions suivantes. Il se peut que des messages précédents aient signalé un incident lié à cette instruction SQL et que SQL n'ait pas correctement diagnostiqué l'erreur. Les messages précédents indiquent peut-être qu'un incident s'est produit sur cette instruction SQL, mais que le diagnostic n'a pas été correctement effectué par SQL. L'ID message précédent est CPF4204. Une erreur interne de type 3107 s'est produite. S'il s'agit d'une précompilation, le traitement s'interrompra sur cette instruction. Que faire . . . : Consultez les messages précédents pour déterminer si un incident s'est produit sur cette instruction SQL. Pour consulter les messages, utilisez la commande DSPJOBLOG en mode interactif, ou la commande WRKJOB pour visualiser la sortie d'une précompilation. Un programme d'application recevant ce code retour peut tenter de lancer de nouvelles instructions SQL. Corrigez les erreurs éventuelles et renouvelez votre demande.
L'instruction mise en évidence a échoué, entraînant l'interruption du traitement
If I change DES into REF (graphic(25)), it works...
| 0 |
11,185,151 | 06/25/2012 07:32:24 | 4,495 | 09/04/2008 07:45:31 | 1,085 | 38 | How do I see outgoing changes with fossil | With veracity and mercurial you can do a "outgoing" command to see what changes would be pushed to the server. How can I do that with fossil? | fossil | null | null | null | null | null | open | How do I see outgoing changes with fossil
===
With veracity and mercurial you can do a "outgoing" command to see what changes would be pushed to the server. How can I do that with fossil? | 0 |
11,185,152 | 06/25/2012 07:32:29 | 457,971 | 09/25/2010 05:42:25 | 24 | 0 | VS 2010 - Add Service Reference Error | ![H][1]
[1]: http://i.stack.imgur.com/D9Dua.png
As you can see that from the above screenshot, VS 2010 "Add service reference" adds the standard library class as well. I tried using svcutil and we dont want to use svcutil for a while. Any solution for this ?
For your information : I have used "reuse referenced libraries" and selected only the our own data contract library dll which is shared between wcf and client
Note: In the above GQDPService is the namespace for the service. | wcf | visual-studio-2010 | wcf-client | null | null | null | open | VS 2010 - Add Service Reference Error
===
![H][1]
[1]: http://i.stack.imgur.com/D9Dua.png
As you can see that from the above screenshot, VS 2010 "Add service reference" adds the standard library class as well. I tried using svcutil and we dont want to use svcutil for a while. Any solution for this ?
For your information : I have used "reuse referenced libraries" and selected only the our own data contract library dll which is shared between wcf and client
Note: In the above GQDPService is the namespace for the service. | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.