How to change a link button's text on grid view when clicks on it
I have grid view with link button named 'CLICK'. when clicks on this link
button I wants to change its text to "CLICKED" I have done like this, on
row command
if (e.CommandName == "ARCHIVE") //FOR SETTING THE VIEW LINK BUTTON
{
LinkButton lnkbtn = (LinkButton)sender;
lnkbtn.Text = "viewed";
lnkbtn.Enabled = false;
}
but its not working. please help
Thursday, 3 October 2013
Wednesday, 2 October 2013
using hello.js not able to post on twiiter
using hello.js not able to post on twiiter
I am using Hello.js to access/post social network data. Hello.JS
standardizes paths and responses to common API's.This question in
particular is about posting to twitter.
On twitter demo page, I logged in with the button and tried hello.api in
firebug console. I am able to get the response for
>>> hello.api('/me',function(resp) {console.log(resp);})
and able to see the response object in console. While '/me/share' doesn't
seem to work, here is the cmd
>>> hello.api('/me/share','post',{message:'Hi to all'},
function(resp) {
console.log(resp);
})
for above reques the response is
{"errors":[{"code":170,"message":"Missing required parameter: status"}]}
while I see in the Post data as
status=Hi%20to%20all
and Params are
access_token
1690287512-eB8IocvynmqSmnMlpxoh0VBJxWhff86sYHTBqKo:DRT4zO8pTbMjY8yblG9RtSqRMD3oKEyP8kAGG6cpo9w@eQuyZuECKWPiv3D7E4qdg
path https://api.twitter.com/1.1/statuses/update.json?include_entities=1
The Hello.js uses auth-server for server side OAuth authentication and
authorization. And auth-server is implimentation of node-oauth-shim
Any hint what could be going wrong? Well this may be very wage question.
So my second question to be very specific. In node-oauth-shim proxy is
used to request to twiiter. In proxy.js if somebody can help me how to
debug if it sends the data to twitter with request or not. Somewhere in
code can I do the console log what request(with data) is being sent to
twitter?
I am using Hello.js to access/post social network data. Hello.JS
standardizes paths and responses to common API's.This question in
particular is about posting to twitter.
On twitter demo page, I logged in with the button and tried hello.api in
firebug console. I am able to get the response for
>>> hello.api('/me',function(resp) {console.log(resp);})
and able to see the response object in console. While '/me/share' doesn't
seem to work, here is the cmd
>>> hello.api('/me/share','post',{message:'Hi to all'},
function(resp) {
console.log(resp);
})
for above reques the response is
{"errors":[{"code":170,"message":"Missing required parameter: status"}]}
while I see in the Post data as
status=Hi%20to%20all
and Params are
access_token
1690287512-eB8IocvynmqSmnMlpxoh0VBJxWhff86sYHTBqKo:DRT4zO8pTbMjY8yblG9RtSqRMD3oKEyP8kAGG6cpo9w@eQuyZuECKWPiv3D7E4qdg
path https://api.twitter.com/1.1/statuses/update.json?include_entities=1
The Hello.js uses auth-server for server side OAuth authentication and
authorization. And auth-server is implimentation of node-oauth-shim
Any hint what could be going wrong? Well this may be very wage question.
So my second question to be very specific. In node-oauth-shim proxy is
used to request to twiiter. In proxy.js if somebody can help me how to
debug if it sends the data to twitter with request or not. Somewhere in
code can I do the console log what request(with data) is being sent to
twitter?
How to make counter count in multiple methods in java?
How to make counter count in multiple methods in java?
A robot starts at location (0,0) facing east. Several beeper stacks are
randomly placed along that row, each containing a number of beepers. A
robot starts at location (0,0) facing east. Several beeper stacks are
randomly placed along that row, each containing a number of beepers. There
may be different numbers of beepers stacks. But there is always a beeper
stack at location (0,0) and always a beeper stack at location (16,0)-(the
end of robot world).
Need to write a method that makes the robot move along the row, picking up
each beeper stack as it goes. The method should return no value and take
no parameters. After the robot has picked up the last stack, the program
should print how many beepers were picked up in total. The message should
look like this: Picked up n beepers, where n is the number of beepers
picked up. The program must define and use these two additional methods:
moveRobotToNextStack() , which moves the robot forwards until it finds the
next stack and pickUpBeeperStack(), which picks up all the beepers in a
stack. My code:
public class Q4 {
void pickUpAllStacks() {
int counter=0;
pickUpBeeperStack();
moveRobotToNextStack();
counter += pickUpBeeperStack();
print("Picked up "+ counter +" beepers");
}
void moveRobotToNextStack() {
while(isSpaceInFrontOfRobotClear()) {
moveRobotForwards();
pickUpBeeperStack();
}
}
int pickUpBeeperStack() {
int counter=0;
while(isItemOnGroundAtRobot()) {
pickUpItemWithRobot();
counter++;
}
return counter;
}
}
I can't make counter count beepers in all stacks.
A robot starts at location (0,0) facing east. Several beeper stacks are
randomly placed along that row, each containing a number of beepers. A
robot starts at location (0,0) facing east. Several beeper stacks are
randomly placed along that row, each containing a number of beepers. There
may be different numbers of beepers stacks. But there is always a beeper
stack at location (0,0) and always a beeper stack at location (16,0)-(the
end of robot world).
Need to write a method that makes the robot move along the row, picking up
each beeper stack as it goes. The method should return no value and take
no parameters. After the robot has picked up the last stack, the program
should print how many beepers were picked up in total. The message should
look like this: Picked up n beepers, where n is the number of beepers
picked up. The program must define and use these two additional methods:
moveRobotToNextStack() , which moves the robot forwards until it finds the
next stack and pickUpBeeperStack(), which picks up all the beepers in a
stack. My code:
public class Q4 {
void pickUpAllStacks() {
int counter=0;
pickUpBeeperStack();
moveRobotToNextStack();
counter += pickUpBeeperStack();
print("Picked up "+ counter +" beepers");
}
void moveRobotToNextStack() {
while(isSpaceInFrontOfRobotClear()) {
moveRobotForwards();
pickUpBeeperStack();
}
}
int pickUpBeeperStack() {
int counter=0;
while(isItemOnGroundAtRobot()) {
pickUpItemWithRobot();
counter++;
}
return counter;
}
}
I can't make counter count beepers in all stacks.
SQL Replace blank value in case statement
SQL Replace blank value in case statement
I have two tables:
Student (ks2en, ks2ma, ks2av)
Subject (name)
I have the following conditional statement which depending on the subject
lists the values in the student columns. These are then subsequently
grouped by their respective student column.
In any combination I would like to replace '' blank values in the result
set with 'No KS2'.
Here is my case statement which conditionally selects the appropriate
column from the student table base on the subject name in the subject
table.
CASE
WHEN COALESCE(Name, '') = 'English' THEN
[Ks2en]
WHEN COALESCE(Name, '') = 'Mathematics' THEN
[Ks2ma]
ELSE
[Ks2av]
END AS KS2
Example data:
ks2en
2a
2a
3a
4c
5a
3a
2a
1c
When the subject name is 'English' then the following results are displayed:
KS2
No KS2
1c
2a
3a
4c
5a
Just to be clear, don't worry about ordering, grouping or the conditional
element of the statement as I have got these all working. It's just
replacing blank values with 'No KS2' so that it displays as one of the
groups of values in the results set as above.
I have two tables:
Student (ks2en, ks2ma, ks2av)
Subject (name)
I have the following conditional statement which depending on the subject
lists the values in the student columns. These are then subsequently
grouped by their respective student column.
In any combination I would like to replace '' blank values in the result
set with 'No KS2'.
Here is my case statement which conditionally selects the appropriate
column from the student table base on the subject name in the subject
table.
CASE
WHEN COALESCE(Name, '') = 'English' THEN
[Ks2en]
WHEN COALESCE(Name, '') = 'Mathematics' THEN
[Ks2ma]
ELSE
[Ks2av]
END AS KS2
Example data:
ks2en
2a
2a
3a
4c
5a
3a
2a
1c
When the subject name is 'English' then the following results are displayed:
KS2
No KS2
1c
2a
3a
4c
5a
Just to be clear, don't worry about ordering, grouping or the conditional
element of the statement as I have got these all working. It's just
replacing blank values with 'No KS2' so that it displays as one of the
groups of values in the results set as above.
Negative margin on an image with a 100% width in CSS
Negative margin on an image with a 100% width in CSS
I have this (simplified) situation :
<div class="page-content">
<p>text</p>
<p><img src="" /></p>
<p>text</p>
<!-- ... -->
</div>
And :
.page-content {
padding: 0 20px;
}
.page-content img {
display: block;
margin: 0 auto;
max-width: 100%;
}
This way, I always have a padding inside my .page-content div (which
contains a lot more than what I have copied here). The images cannot take
more than the width of the page, minus the padding.
It works great on any screen size.
Example :
However, I want to make the images full-width when on a phone screen
(bypassing the parent 20px padding).
i.e. :
I could resolve my problem if the parent (the <p>) had a negative margin
(margin: 0 -20px;), but the html file is generated by Jekyll from a
markdown file, and I can't add classes in it.
I can't find a a way to do this, apart from removing the padding of
.page-content and setting it on each child. Which I would rather not do.
I can't set a fixed width either because I want that to work on every
screen size.
Is there a way to select the parent in CSS ? Or another feature I'm
unaware of ?
Thanks.
I have this (simplified) situation :
<div class="page-content">
<p>text</p>
<p><img src="" /></p>
<p>text</p>
<!-- ... -->
</div>
And :
.page-content {
padding: 0 20px;
}
.page-content img {
display: block;
margin: 0 auto;
max-width: 100%;
}
This way, I always have a padding inside my .page-content div (which
contains a lot more than what I have copied here). The images cannot take
more than the width of the page, minus the padding.
It works great on any screen size.
Example :
However, I want to make the images full-width when on a phone screen
(bypassing the parent 20px padding).
i.e. :
I could resolve my problem if the parent (the <p>) had a negative margin
(margin: 0 -20px;), but the html file is generated by Jekyll from a
markdown file, and I can't add classes in it.
I can't find a a way to do this, apart from removing the padding of
.page-content and setting it on each child. Which I would rather not do.
I can't set a fixed width either because I want that to work on every
screen size.
Is there a way to select the parent in CSS ? Or another feature I'm
unaware of ?
Thanks.
Tuesday, 1 October 2013
How to amend an entry on a form without eliciting an EConvertError?
How to amend an entry on a form without eliciting an EConvertError?
I have two labeled edit boxes - one for a min value (named
lbleRangeCalcMin) and the other for a max value (lbleRangeCalcMax). I want
to make sure that the user does not enter a zero for the max value and
also that the min value is less than the max value (not equal to, but less
than - I need the range of values: max - min).
I want to catch the error as soon as it happens (for e.g., as soon as the
user enters a zero for the max value). I also don't want the user to be
able to move away from the max value if s/he has entered a zero. So I have
programmed exception calls on the two events, OnChange and OnExit.
It works fine except when the user tries to reenter another value instead
of the zero that he entered. Then it gives me an EConvertError with the
message: '' is not a floating point value.
How do I allow the user to amend his entry without raising this exception?
Here is my code. Thanks.
procedure TfrmAnalysisOptions.lbleRangeCalcMaxChange(Sender: TObject);
begin
if ((StrToFloat((lbleRangeCalcMax.Text) = 0) or
(StrToFloat((lbleRangeCalcMax.Text) <
StrToFloat((lbleRangeCalcMin.Text))) then
MessageDlg('Max value cannot be zero or less than Min value.', mtError,
[mbOK], 0);
end;
procedure TfrmAnalysisOptions.lbleRangeCalcMaxExit(Sender: TObject);
begin
if ((StrToFloat(lbleRangeCalcMax.Text) = 0) or
(StrToFloat(lbleRangeCalcMax.Text) <
StrToFloat(lbleRangeCalcMin.Text))) then
MessageDlg('Max value cannot be zero or less than Min value.', mtError,
[mbOK], 0);
end;
I have two labeled edit boxes - one for a min value (named
lbleRangeCalcMin) and the other for a max value (lbleRangeCalcMax). I want
to make sure that the user does not enter a zero for the max value and
also that the min value is less than the max value (not equal to, but less
than - I need the range of values: max - min).
I want to catch the error as soon as it happens (for e.g., as soon as the
user enters a zero for the max value). I also don't want the user to be
able to move away from the max value if s/he has entered a zero. So I have
programmed exception calls on the two events, OnChange and OnExit.
It works fine except when the user tries to reenter another value instead
of the zero that he entered. Then it gives me an EConvertError with the
message: '' is not a floating point value.
How do I allow the user to amend his entry without raising this exception?
Here is my code. Thanks.
procedure TfrmAnalysisOptions.lbleRangeCalcMaxChange(Sender: TObject);
begin
if ((StrToFloat((lbleRangeCalcMax.Text) = 0) or
(StrToFloat((lbleRangeCalcMax.Text) <
StrToFloat((lbleRangeCalcMin.Text))) then
MessageDlg('Max value cannot be zero or less than Min value.', mtError,
[mbOK], 0);
end;
procedure TfrmAnalysisOptions.lbleRangeCalcMaxExit(Sender: TObject);
begin
if ((StrToFloat(lbleRangeCalcMax.Text) = 0) or
(StrToFloat(lbleRangeCalcMax.Text) <
StrToFloat(lbleRangeCalcMin.Text))) then
MessageDlg('Max value cannot be zero or less than Min value.', mtError,
[mbOK], 0);
end;
Cache-control: Is it possible to ignore query parameters when validating the cache?
Cache-control: Is it possible to ignore query parameters when validating
the cache?
Is it possible to set a cache-control header communicating with a reverse
proxy to ignore query parameters in a unique uri or basically: validate a
cache even if some query parameters have changed?
Sometimes query parameters have nothing to do with the rendering of the
page at least from a server side perspective. For instance all utm_*
variables from Google Adwords. These are needed for the javascript on your
page so you don't want to strip them away and redirect to a cached page
but at the same time it would be advantageous not to treat two uri's which
are basically the same but have different utm_* parameters as unique when
communicating with a reverse proxy.
An example:
http://www.example.com/search?sort=price
http://www.example.com/search?sort=price&utm_campaign=shoes
Is there anyway to tell the reverse proxy using the HTTP 1.1 (i.e. some
type of http header) spec that it can just treat these two pages as the
same?
the cache?
Is it possible to set a cache-control header communicating with a reverse
proxy to ignore query parameters in a unique uri or basically: validate a
cache even if some query parameters have changed?
Sometimes query parameters have nothing to do with the rendering of the
page at least from a server side perspective. For instance all utm_*
variables from Google Adwords. These are needed for the javascript on your
page so you don't want to strip them away and redirect to a cached page
but at the same time it would be advantageous not to treat two uri's which
are basically the same but have different utm_* parameters as unique when
communicating with a reverse proxy.
An example:
http://www.example.com/search?sort=price
http://www.example.com/search?sort=price&utm_campaign=shoes
Is there anyway to tell the reverse proxy using the HTTP 1.1 (i.e. some
type of http header) spec that it can just treat these two pages as the
same?
cannot connect to oracle after server crash
cannot connect to oracle after server crash
Our test server (based on windows 2008) crashed because of a power loss
during the weekend.
After the restart, all services started successfully but Oracle 11.2 didn't.
I tried to start all services manually and it seems to be all right (I can
log on SQL*Plus from Powershell)
But when we try to connect with Oracle SQL developer we got this
I tried Googling the error code but I can't figure out what the problem is
(I'm just a developer and I don't know much about system administration).
Our test server (based on windows 2008) crashed because of a power loss
during the weekend.
After the restart, all services started successfully but Oracle 11.2 didn't.
I tried to start all services manually and it seems to be all right (I can
log on SQL*Plus from Powershell)
But when we try to connect with Oracle SQL developer we got this
I tried Googling the error code but I can't figure out what the problem is
(I'm just a developer and I don't know much about system administration).
what is another operation for making real numbers a R-modules?
what is another operation for making real numbers a R-modules?
we know that real numbers are a R-modules with natural operations,do we
have another operations that make real numbers another R-modules?please
tell me what is it?
we know that real numbers are a R-modules with natural operations,do we
have another operations that make real numbers another R-modules?please
tell me what is it?
Subscribe to:
Comments (Atom)