for writing images on a html page i want to write only " after closing are anyone tell me about this then how i can write this
means to say that
<img src = " <% code is here %> " />
Hi,
I have a pretty long sqlite query:
const char *sql_query = "SELECT statuses.word_id FROM lang1_words, statuses WHERE statuses.word_id = lang1_words.word_id ORDER BY lang1_words.word ASC";
How can I break it in a number of lines to make it easier to read?
If I do the following:
const char *sql_query = "SELECT word_id
FROM table1, table2
WHERE table2.word_id = table1.word_id
ORDER BY table1.word ASC";
I am getting a error.
Is there a way to write queries in multiple lines?
Thank you.
I'm trying to extract some results from a download manager, the format is:
[#8760e4 4.3MiB/40MiB(10%) CN:2 DL:4.9MiB ETA:7s]
what I'd like to extract from the above example, would be an array that looks like this:
['4.3','MiB','40','MiB','10%','4.9','MiB','7','s']
I've tried to split this in various combinations, but nothing seems to be right. Would anyone happen to know how to do this or be able to offer suggestions?
Thank you!
I need to loop through some elements in the page and then, for each one, if it had a class beginning with, for example, "C", do something.
$('#dialog li').each(function(){
if ($(this).hasClass("^C")){
//do something
}
}
It may sound silly, but what selector/method should I use on the if clause?
Thanks in advance.
PHP newbie here.. I am trying to create a function where the user is redirected back to the previous page after adding an item to their cart. However, when they are redirected back with the code below it leaves a duplicate of the directory (ie. example.com/catalog/garden-tools/garden-tools
function custom_add_to_cart_redirect() {
$_SERVER['REQUEST_URI_PATH'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$url = explode('/', rtrim($_SERVER['REQUEST_URI_PATH'], '/'));
return $url[3];
}
A print_r reveals the following:
Array ( [0] => [1] => thefarmshop [2] => catalog [3] => garden-tools [4] => gardening-glove )
What could the issue be?
Which would be better code:
int pos = file.dmFileDescr.LastIndexOf(".", StringComparison.InvariantCultureIgnoreCase);
or
int pos = file.dmFileDescr.LastIndexOf(".", StringComparison.OrdinalIgnoreCase);
I'm planning on storing the passwords as a sha1, so I need a way to validate that it is a sha1 at another point in my website. I was planning on using preg_match, but I do not know how to make regex patterns. Could someone help me out with one?
Thanks
Hello everyone,
If the title was not clear, I will try to clarify what I am asking:
Imagine I have a variable called counter, I know I can see its current value by doing something like:
std::cout << counter << std::endl;
However, assume I have lots of variables and I don't know which I'm going to want to look at until runtime.
Does anyone know a way I can fetch the value of a variable by using its name, for example:
std::cout << valueOf("counter") << std::endl;
I feel being able to do this might make debugging large complex projects easier.
Thanks in advance for your time.
PS: Please do not respond with 'Google it', I have, though maybe not with the best query to get the answer I'm looking for...
I've installed JCL into Delphi 2010. In the following code
try
raise Exception.Create('Error Message');
except
on E: Exception do
begin
ResultStatus := JclLastExceptStackListToStrings(sl, True, True, True, True);
end;
end;
Also I have this call in the initialization section:
initialization
JclStartExceptionTracking;
ResultStatus is false and sl is empty. I have set options to generate map and .jdbg files. Other functions, like ProcByLevel work fine. Is there something else I need to do to make JclLastExceptStackListToStrings work?
From JclDebug.pas file:
Last modified: $Date:: 2010-09-07 19:43:19 +0200 (mar., 07 sept. 2010)
Revision: $Rev:: 3331
Using the pysnmp framework i get some values doing a snmp walk. Unfortunately for the oid
1.3.6.1.21.69.1.5.8.1.2 (DOCS-CABLE-DEVICE-MIB)
i get a weird result which i cant correctly print here since it contains ascii chars like BEL ACK
When doing a repr i get:
OctetString('\x07\xd8\t\x17\x03\x184\x00')
But the output should look like:
2008-9-23,3:24:52.0
the format is called "DateAndTime". How can i translate the OctetString output to a "human readable" date/time ?
Do we have a standard way of converting a char* to int (or long) in a strict way, i.e. we should get proper result only if all characters are digits and can fit in an int (or long) -- some way by using strtol etc.. ?
Thus "sbc45", "4590k", " 56", "56 ", should be all invalid using that function.
Hello all!
I have an array and variable.
If the variable does not exist in the array to be added, if there is - remove from the array.
Why not work?
$ar = ["a","b","c"];
$vr = "b";
foreach ($ar as $i => $value) {
if ($value == $vr) {
unset ($ar[$i]);
} else {
$ar[] = $vr;
$ar = array_unique($ar);
}
}
Thanks.
I want to insert a text in last p tag which is returning from tinyMCE by the following code
var html = tinyMCE.activeEditor.getContent();
For this I am using the following jquery code
tinyMCE.init({
mode : "textareas",
theme : "advanced"
});
$(document).ready(function(){
$("a[title='click_to_add']").click(function() {
var html = tinyMCE.activeEditor.getContent();
html = $("#p:last").text();
alert(html);
name = $(this).html();
content = html+" "+name;
tinyMCE.activeEditor.setContent(content);
return false;
});
});
But it is not working.The HTML code is given below
<div style="float:left;">
<textarea id="mail_body" name="mail_body" rows="15" cols="80" style="width:575px;"></textarea>
</div>
<div id="aaa">
<a href="#" id="news_user" title="click_to_add"> < name > </a>
</div>
Please give us a solution for this problem.
Say I have my class
@interface Person : NSObject { NSString *name; }
I need to get the name of NSString's within my class
Person *person = [[Person alloc] init];
NSLog(@"Name of variable %s\n", NameofVariable(person.name));
DECLARE @STR_IDS VARCHAR(15)
SET @STR_IDS='7,15,18'
UPDATE TBL_USERS WHERE ID IN @STR_IDS
I know the update statement would not work as the ID is of type INT and i am replacing a varachar value there .How can i change the query so that it will be executed like this in effect ?
UPDATE TBL_USERS WHERE ID IN (7,15,18)
Thanks in advace
Hi,
I've inherited a project which we are trying to migrate to MySQL 5 from MySQL 4.0(!) and from myISAM to InnoDB. Queries are now falling down because they are being constructed using an ADODB connection's -qstr() on all parameters, including ints. Where no value is provided I end up with:
INSERT INTO tablename VALUES ('', 'stuff'...)
where the first column is an auto_increment. This causes an error (fair enough since '' isn't an int). Is there a switch in MySQL to make it behave as it used to (I assume it just silently converted to 0?)
Thanks.
function SimpleSymbols(str) {
var letter =['a','b','c','d','e','f','g','h','i','j',
'k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];
var newstr = "";
for (var i = 0; i<str.length; i++){
if (str.charAt(i).toLowerCase() in letter){
newstr += "M";
}
else{
newstr += "X";
}
}
return newstr;
}
If str is "Argument goes here" it returns XXXXXXXXX. WHy doesn't it return MMMMMMMMMM?
What I have is a C# windows app that reads a bunch of SQL tables and creates a bunch of queries based on the results. What I'm having a small issue with is the final "," on my query
This is what I have
ColumnX,
from
I need to read the entire file, write out exactly what is in the file and just replace the last , before the from with nothing.
I tried .replace(@",\n\nfrom),(@"\n\nfrom) but it's not finding it. Any help is appreciated.
Example:
ColumnX,
from
Result:
ColumnX
from
Hi frns,
Am using the strip_tags() to remove the HTML tags from one content . but i wants to remove the html (<DIV></DIV>,<P></P>,<SPAN></SPAN>) tags apart from the <img> tag and <a> , i don't want to remove the <img ><a> tag from that . but need to remove other all html tags from that content how can i do help me.
thanks