Unnamed: 0 int64 65 6.03M | Id int64 66 6.03M | Title stringlengths 10 191 | input stringlengths 23 4.18k | output stringclasses 10 values | Tag_Number stringclasses 10 values |
|---|---|---|---|---|---|
589,761 | 589,762 | User defined exception are checked or unchecked exceptions | <p>In my web application created a User defined exception extends with Exception.Is it Checked or unchecked exception</p>
<pre><code>public class InvalidDataException extends Exception{
public InvalidDataException() {
super();
// TODO Auto-generated constructor stub
}
/**
* @param arg0
*/
public InvalidDataException(String message) {
super(message);
// TODO Auto-generated constructor stub
}
}
</code></pre>
| java | [1] |
1,321,604 | 1,321,605 | Customizing Android ListView Items with Custom ArrayAdapter | <p>I've been browsing to the following example:</p>
<p><a href="http://www.ezzylearning.com/tutorial.aspx?tid=1763429" rel="nofollow">http://www.ezzylearning.com/tutorial.aspx?tid=1763429</a></p>
<p>It's a Customizing Android <code>ListView</code> Items with <code>Custom ArrayAdapter</code>.
<hr/>
Everything static is working, but I don't get it dynamically:</p>
<pre><code>Weather weather_data[] = new Weather[]
{
new Weather(R.drawable.weather_cloudy, "Cloudy"),
new Weather(R.drawable.weather_showers, "Showers"),
new Weather(R.drawable.weather_snow, "Snow"),
new Weather(R.drawable.weather_storm, "Storm"),
new Weather(R.drawable.weather_sunny, "Sunny")
};
</code></pre>
<p><hr/>
For dynamically data it says:</p>
<pre><code>Weather weather_data[] = youservice.GetWeatherData();
</code></pre>
<p><hr/>
Can you someone please give an example how to implement the <code>youservice.GetWeatherData();</code></p>
<p>I've tried a lot of things, but don't manage it.</p>
| android | [4] |
2,254,434 | 2,254,435 | ascending order foreach | <p>I am trying to check for ascending order in this array
But not sure how to use a foreach </p>
<pre><code> foreach (double d in dSize)
{
if (dSize.ToString() != null)
{
double dSize1;
string str1 = dSize.ToString();
bool success1 = double.TryParse(str1, out dSize1);
if ( dSize < 0.0)
{
errMsg1 = " data grid should contain number >= 0";
}
//else
//{
// errMsg1 = " data grid must be entered";
//}
}
*if (inputs.dSize[rowCount] <= inputs.dSize[rowCount - 1])
{
errMsg = "value in row " + (rowCount + 1) + " should be greater than the value in row " + rowCount;
}
}*
swRpt.WriteLine(errMsg);
}
</code></pre>
<p>I've done the second part using a for loop. Would like to change it to a foreach </p>
<p>Thanks
Sun</p>
| c# | [0] |
113,611 | 113,612 | Creating a draggable object in android | <p>I'm pretty new to android development. I need to create a very simple app, which has a background image, and an image of a ball, which the user can drag across the screen.
I've been trying to create this for hours now, following the lunar lander example, but failed miserably. I'm just looking for a nice, short tutorial which will enable me to create this. If anyone has any suggestions, I would love to hear.</p>
<p>Thanks!</p>
| android | [4] |
3,175,078 | 3,175,079 | Getting More Than 1 Select Box to Work with jQuery | <p>I have a select drop down that processes the options with jQuery code below: </p>
<pre><code> <script>
function InsertContentBlockForm() {
var content_id = jQuery("#add-content-block-id").val();
if(content_id == "") {
alert("<?php _e( 'Please select a Content Block', 'custom-post-widget' ); ?>");
return;
}
var win = window.dialogArguments || opener || parent || top;
win.send_to_editor("" + content_id + "");
}
</script>
</code></pre>
<p>HTML Code:</p>
<pre><code> <select id="add-content-block-id" >
<option value=""> ...
...<input type="button" value="Add Option" onclick="InsertContentBlockForm();"/>
</code></pre>
<p>That works fine by itself but what I'm trying to do is have numerous select boxes on one page and have the same jQuery code process it and display that specific select boxes values. </p>
<p>I tried adding an array in the jQuery code but I am not having any luck getting the output from the second select box - which I've tried adding a new ID to. Any thoughts? Thanks.</p>
| jquery | [5] |
1,776,035 | 1,776,036 | comma operator returns the value of the second operand? | <p>The links </p>
<p><a href="https://developer.mozilla.org/en/Core%5FJavaScript%5F1.5%5FReference/Operators/Special%5FOperators/Comma%5FOperator" rel="nofollow">https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Operators/Special_Operators/Comma_Operator</a></p>
<p>says</p>
<blockquote>
<p>The comma operator evaluates both of
its operands (from left to right) and
returns the value of the second
operand.</p>
</blockquote>
<p>and as an example</p>
<pre><code>for (var i=0, j=9; i <= 9; i++, j--)
document.writeln("a["+i+"]["+j+"]= " + a[i][j]);
</code></pre>
<p>Unable to understand the point exactly. "returns the value of the second operand" - What it means?</p>
<p>Thanks for any help in advance.</p>
| javascript | [3] |
3,892,559 | 3,892,560 | Help regarding android 1.5 and 2.1 (beginner, issue of Book Version) | <p>I am new to android and last year i bought two books of <strong>android 1.5</strong>. But at that time i was busy in my project so was not able to work on android. Now i want to start android again. Should i go for those books or should i buy new editions
Is there any major change regarding basic learnings?
Two books i am having are:-</p>
<p><a href="http://pragprog.com/titles/eband2/hello-android" rel="nofollow">Pragmatic Hello Android</a> (New addition of this book is available, But still in beta phase)</p>
<p><a href="http://apress.com/book/view/9781430224198" rel="nofollow">Apress begining Android</a> (Dont know about this whether new edition is available or not)</p>
<p>Please let me know.
Thanks</p>
<p><strong>EDIT</strong>
here i am not asking about the good books of android, as there are lot of questions regarding that. I can find out from them.
My question is purely related to <strong>change in version</strong></p>
| android | [4] |
5,472,378 | 5,472,379 | Preserving Linebreaks in textarea.value | <p>I have to use textarea.value text but it does not preserve line breaks as input by the user. I don't want to use <code>replace(/\n\r?/g, '<br />')</code> trick as it is useful only to render text as html.</p>
<p>Is there any other way to access textarea.value as it is?</p>
| javascript | [3] |
2,931,326 | 2,931,327 | From an Android service, how to determine whether screen WAS on or off | <p>From an Android service (for example at onCreate time) how can I determine whether screen was on or off before receiving the first broadcast screen intent (that may never be triggered if screen was already off and user does not use its phone) ?</p>
| android | [4] |
932,912 | 932,913 | Checkbox not unchecking | <p>I have this code and it works fine, but the problem is the checkbox does not get removed when you click it again, it only gets removed when the span.removePortfolio is clicked. Thanks!</p>
<pre><code><input type="checkbox" name="portfolio"/>
<div>
Has Portfolio <span class="removePortfolio">X</span>
</div>
$("input[name=portfolio]").change(function() {
loadResults();
checkPortStatus();
});
$('span.removePortfolio').live("click", function() {
$("input[name=portfolio]").removeAttr("checked");
$('#portfolioRemove').hide();
});
var portChecked = false;
function checkPortStatus() {
if((portChecked) == true) {
$("input[name=portfolio]").removeAttr("checked");
}
}
function loadResults() {
if($("input[name=portfolio]").attr("checked", "checked")) {
portChecked = true;
}
}
</code></pre>
<p>I simply need the checkbox to be checked when the user clicks it, unchecked when they click it again, and unchecked if it was checked and the user clicks the span.removePortfolio.</p>
| jquery | [5] |
1,686,969 | 1,686,970 | javascript multiple forms on the same rendered screen | <p>I'm working with classic ASP.</p>
<p>I have an 2 includes that have 2 different forms on them. They are both unique in name. However, when I try to read the value of the one the elements in the 2nd form I get an error saying it is null. However, when I view the source in Firebug I can see that in face there is a value in that element.</p>
<p>My javascript code:</p>
<pre><code>console.log(document.getElementById('focusValue').value);
</code></pre>
<p>Output from firebug:</p>
<pre><code><input id="focusValue" type="hidden" value="1006" name="focusValue">
</code></pre>
<p>Is there something I need to do because there are 2 forms on this "rendered" screen? The only other thing I think I should mention is that these pages are in an iFrame. Not sure if that really matters...</p>
| javascript | [3] |
5,274,650 | 5,274,651 | Validation for checkboxes | <p>Hello<br>
I have a JS function which says </p>
<pre><code>for(var i = 0; i < document.calDailyBlock.selFilCheckBox.length; i++)
{
if(document.calDailyBlock.selFilCheckBox[i].checked)
{
filteredInitId += document.calDailyBlock.selFilCheckBox[i].value + ",";
alert(filteredInitId);
isProjCheck = true;
}
}
document.calDailyBlock.filteredComId.value = filteredInitId;
</code></pre>
<p>When there are no checkboxes on the page and I try to click on Filter button which calls this function, I receive an error "document.calDailyBlock.selFilCheckBox.length' is null or not an object" </p>
<p>Is there any simple thing which I can add in this function ? </p>
<p>Also can anyone help me how to check if there is only one checkbox on one page ? </p>
<p>Thanks in advance</p>
| javascript | [3] |
4,208,580 | 4,208,581 | Warning while using file_get_contents | <p>I used the following code.</p>
<p>$homepage = file_get_contents('http://www.google.co.in/');
echo $homepage;</p>
<p>But it display the following warning message</p>
<p>Warning: file_get_contents(http://www.google.co.in/) [function.file-get-contents]: failed to open stream: HTTP request failed! in /home/web/cron/sample.php on line 47</p>
| php | [2] |
2,828,961 | 2,828,962 | Echoing variables in PHP without calling them | <p>Let's say I have something like this:</p>
<pre><code>echo "This is a $variable";
echo "<?php echo $var; ?>";
</code></pre>
<p>How can I make it simply output:</p>
<pre><code>This is a $variable
<?php echo $var; ?>
</code></pre>
<p>Instead of trying to parse the variables?</p>
| php | [2] |
3,772,923 | 3,772,924 | updating value of modal view variable | <p>I'm trying to make a modal view which displays the champion of my app.
there's a NSMutableString variable called champ in modal view,
which is supposed to be updated by returnChamp function in main view.
the champ string is correctly set in main view,
but in modal view, the champ value appears as (null).
In fact, it seems it doesn't even go into the returnChamp function.
so apparently something wrong with my calling or implementing returnChamp,
but I have another function that does the similar, and that works fine.</p>
<p>could anyone please help me?</p>
<pre><code>-(void) mainView{
.....
champ = [[currentPlayers objectAtIndex:playerIndex] retain];
NSLog(@"%@",champ);
modalWinner = [[winner alloc] init];
modalWinner.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:modalWinner animated:YES];
</code></pre>
<p>}</p>
<pre><code>- (NSMutableString *) returnChamp{
NSLog(@"returnChamp");
return champ;
</code></pre>
<p>}</p>
<pre><code>//in modalWinner
-(void) modalView{
..............
champName = [[NSMutableString alloc] init];
NSLog(@"%@", [(MainViewController *)self.parentViewController returnChamp]);
champName = [(MainViewController *)self.parentViewController returnChamp];
UIImage *champImage = [UIImage imageNamed:champName];
}
</code></pre>
| iphone | [8] |
1,013,118 | 1,013,119 | Unable to attach file name | <pre><code><?php
$con = mysql_connect("localhost","root","");
mysql_select_db("image", $con);
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
$result = mysql_query("SELECT * FROM image ORDER BY file_name DESC LIMIT 1");
$row = mysql_fetch_array($result);
$src = '"'.$row['file_name'].'"';
$targ_w = $targ_h = 300;
$jpeg_quality = 90;
$img_r = imagecreatefromjpeg($src);
$dst_r = ImageCreateTrueColor( $targ_w, $targ_h );
imagecopyresampled($dst_r,$img_r,0,0,$_POST['x'],$_POST['y'],
$targ_w,$targ_h,$_POST['w'],$_POST['h']);
header('Content-type: image/jpg');
imagejpeg($dst_r,null,$jpeg_quality);
exit;
}
?>
</code></pre>
<p>I am able to retrieve the file_name from the database by echoing, but i am unable to attach the file at this part <code>$img_r = imagecreatefromjpeg($src);</code> this is where it causes errors?
any idea?</p>
| php | [2] |
3,110,712 | 3,110,713 | value of local variable is gone? | <p>I have this implementation: </p>
<pre><code>//header file:
InfoTables* localInforTable;
typedef txdr_int32 InfoTable;
typedef struct
{
int sendID;
InfoTable *data;
} InfoTables;
// in cpp file
void Retrieval::InfoTableCallBack(int sendID,
InfoTables& infoTables)
{
localInforTable = new InfoTables();
localInforTable.sendId=sendID;
localInforTable->data = infoTables.data;
printf("Data %d, %d\n", localInforTable.sendId, localInforTable->data[0]); // correct data
}
void Retrieval::CheckInfoData()
{
printf("Data %d, %d\n", localInforTable.sendId, localInforTable->data[0]); // sendID is OK but data9[0] is just printing the address
}
</code></pre>
<p>I want to copy inforTables in the method InforTableCallBack to a local variable that I can use for other methods. However the data is clean up in CheckInfoData()?</p>
| c++ | [6] |
2,580,472 | 2,580,473 | Repeatedly Calling System.currentTimeMillis()/nanoTime() | <p>I'm trying create a Thread that keeps track of the time elapsed if a certain event has occurred/is happening. I want to be able to use the elapsed time outside of the thread, like:</p>
<pre><code>if(theChecker.elapsedTime > 5)
doThis();
</code></pre>
<p>The code that I have basically looks like this:</p>
<pre><code>public class Checker extends Thread {
public int startTime, elapsedTime;
@Override
public void run() {
while(true) {
if(check()) {
if(startTime == 0)
startTime = System.currentTimeMillis();
elapsedTime = System.currentTimeMillis() - startTime;
}
else {
startTime = 0;
elapsedTime = 0;
}
}
}
private boolean check() {
return isSomethingHappening();
}
}
</code></pre>
<p>As you can probably guess, this leads to horrendous issues with performance. I've gone as far as making the thread sleep for 250 ms after it calculates the elapsedTime, but performance is still problematic.</p>
<p>Is there a much more performance efficient way to go about this? I'm pretty sure it's something to do with the while loop continuously firing into oblivion, coupled with the fact that System.currentTimeMillis() isn't exactly a free call, memory wise. </p>
<p>Thanks for any replies.</p>
| java | [1] |
4,375,640 | 4,375,641 | When is the release of JAVA8. What are the majour features | <p>I am too exited to know about the features and release dates of JDK8. Is there any site available to provide the basic features of JDK8 ??</p>
| java | [1] |
5,343,421 | 5,343,422 | Php code for getting the first frame of a video(flv) | <p>I have using flow player for playing my .flv videos.How i can create a thumbnail from the first frame.Is their any inbuilt Php code for doing this one.
Thanks in advance.</p>
| php | [2] |
3,956,531 | 3,956,532 | About asp.net client side program | <p>when i am disabling a textbox its value becoming null .is there any way to solve this issue</p>
| asp.net | [9] |
1,478,299 | 1,478,300 | javascript password generator | <p>What would be the best approach to creating a 8 character random password containing <code>a-z</code>, <code>A-Z</code> and <code>0-9</code>?</p>
<p>Absolutely no security issues, this is merely for prototyping, I just want data that looks realistic.</p>
<p>I was thinking a <code>for (0 to 7) Math.random</code> to produce ASCII codes and convert them to characters. Do you have any other suggestions?</p>
| javascript | [3] |
271,344 | 271,345 | Distance Routing Vector Implementation | <p>I am trying to implement Distance Vector Routing algorithm, using <a href="http://www.cs.bu.edu/fac/byers/courses/791/F99/scribe_notes/cs791-notes-990923.html" rel="nofollow">http://www.cs.bu.edu/fac/byers/courses/791/F99/scribe_notes/cs791-notes-990923.html</a><br>
(in C++). </p>
<p>Here is what I have done so </p>
<p>far:</p>
<pre><code>i) Read no. of nodes.
ii) Implement the points 1 to 4 in the article as:
for(i = 0; i < nodes; i++) //nodes is the no. of nodes
{
for(j = 0; j < nodes; j++)
{
if(distanceVector[i][j] != 0) //distanceVector holds the cost value between every pair of links, 0 if no link exists
{
for(k = 0; k < nodes; k++)
{
if((distanceVector[i][j] + distanceVector[j][k]) < distanceVector[i][k])
{
distanceVector[i][k] = distanceVector[i][j] + distanceVector[j][k];
via[i][j] = i; // intermediate node, in case no link exists
via[j][i] = j;
}
}
}
}
}
</code></pre>
<p>I get the same array / matrix as it is. I have also tried juggling <strong>i, j, and k</strong>, but of no use.</p>
<p>Am I right in my implementation...???</p>
| c++ | [6] |
3,185,719 | 3,185,720 | Free memory in python run time | <p>I have a python server running on tornado , there is request that uses lots of memory (using a gdata library) . I deleted those object after using them and even did gc.collect() , But when i see the system memory using free -m , I could see memory increase in memory when i do those operations using gdata . But the memory does not get freed up , after i delete the object . The memory gets freed up only after the main python program is killed . I want to know if there is any way to free up the memory .</p>
| python | [7] |
2,741,977 | 2,741,978 | javascript function for php in_array() like non numeric Index | <p>i want a function for javascript like in_array in PHP to look for the special characters in an array. if that special character is in the array it returns true.</p>
| javascript | [3] |
1,911,318 | 1,911,319 | logging exception in c# | <p><strong>logging exception</strong>
this is below code which is used for logging exception in a text file.
here i am getting only the decription of the error.</p>
<p><strong>but it is not telling me where the exception occured at which line.</strong>
would any onr tell me howi can achive that so that i get even the line number where the exception occured.</p>
<pre><code> try
{
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
#region WriteLogError
/// <summary>
/// Write an error Log in File
/// </summary>
/// <param name="errorMessage"></param>
public void WriteLogError(string errorMessage)
{
try
{
string path = "~/Error/" + DateTime.Today.ToString("dd-mm-yy") + ".txt";
if (!File.Exists(System.Web.HttpContext.Current.Server.MapPath(path)))
{
File.Create(System.Web.HttpContext.Current.Server.MapPath(path)).Close();
}
using (StreamWriter w = File.AppendText(System.Web.HttpContext.Current.Server.MapPath(path)))
{
w.WriteLine("\r\nLog Entry : ");
w.WriteLine("{0}", DateTime.Now.ToString(CultureInfo.InvariantCulture));
string err = "Error in: " + System.Web.HttpContext.Current.Request.Url.ToString() +
". Error Message:" + errorMessage;
w.WriteLine(err);
w.WriteLine("__________________________");
w.Flush();
w.Close();
}
}
catch (Exception ex)
{
WriteLogError(ex.Message);
}
}
#endregion
</code></pre>
| c# | [0] |
5,344,439 | 5,344,440 | 3 tier architecture Obj Issue | <p>Im pretty new to 3 tier arch.
I've been reading questions around this topic here at SO and a user response, this page, helped me a lot with a quick an easy example. <a href="http://www.beansoftware.com/ASP.NET-Tutorials/Three-Tier-Architecture.aspx" rel="nofollow">http://www.beansoftware.com/ASP.NET-Tutorials/Three-Tier-Architecture.aspx</a></p>
<p>When it explains Business Layer and DAL, the example uses <strong>objdt</strong> but I don't see it initialized anywhere. It calls a method from DAL so I assume it's a DAL object but again, I can't see the initialization. Then the same object calls a SQL function which is not described in the example but I assume it should go in the DAL class.</p>
<p>Am I wrong or the example is missing something? It would clear my doubts to know what that obj is.
Thanks a lot.</p>
| c# | [0] |
3,105,847 | 3,105,848 | How to execute unmanaged assembly in AppDomain? | <p>I got the following error when executing an unmanaged assembly:</p>
<blockquote>
<p>Could not load file or assembly
'file:///C:\Program
Files\Maxima-5.21.1\lib\maxima\5.21.1\binary-gcl\maxima.exe'
or one of its dependencies. The
module was expected to contain an
assembly manifest.</p>
</blockquote>
<p>What should I do? Is it impossible to execute an unmanaged assembly
using AppDomain?</p>
| c# | [0] |
14,277 | 14,278 | How can I report an error if the existing dictionary sees another item in python with the same key but different value | <p>Firstly, Suppose I have a dictionary like given below:</p>
<pre><code>temp = {'A': 3, 'S': 1}
</code></pre>
<p>Now if I encounter an item like <code>'A': 4</code> will it be added to the dictionary something like:</p>
<pre><code>temp = {'A': 4, 'S': 1}
</code></pre>
<p>leaving behind the previously value of key <code>A</code> which was <code>3</code></p>
<p>Secondly, if my dictionary is </p>
<pre><code>{'A': 3, 'S': 1}
</code></pre>
<p>How can I report an error if the dictionary sees another item like <code>'A': 4</code> or <code>'S': 5</code></p>
| python | [7] |
3,349,364 | 3,349,365 | How to Read and Write Calendar event in Froyo And above Froyo OS in Android | <p>I have some problem of inserting new or edit event by grammatically. Android Foryo os 2.2 working fine but same things is not run in ICS. I know the <code>ContentProvider</code> url but error is on Column field.</p>
<p>Please help me or post your Code or samples.</p>
| android | [4] |
5,820,112 | 5,820,113 | Javascript - Calling a function | <pre><code><div id='dependent'>
<input type="button" value="Add" id='btn' onclick='addfunction()' />
</div>
<script type="text/javascript">
var a = 1;
var b = 1;
var c = 1;
function addfunction() {
var c1 = document.createElement('input');
c1.type = "checkbox";
c1.id = "a" + a++;
var c2 = document.createElement('input');
c2.type = "checkbox";
c2.id = "b" + b++;
var c3 = document.createElement('input');
c3.type = "checkbox";
c3.id = "c" + c++;
var c4 = document.createElement('br');
document.getElementById("dependent").appendChild(c1);
document.getElementById("dependent").appendChild(c2);
document.getElementById("dependent").appendChild(c3);
document.getElementById("dependent").appendChild(c4);
// c1.onclick = dep();
// function dep() { alert(this.id); }
c1.onclick = function () { alert(this.id); };
}
</script>
</code></pre>
<p>When i call the function like this,</p>
<pre><code>c1.onclick = function () { alert(this.id); };
</code></pre>
<p>it works as expected. i.e, when i click on the checkbox, the alert appears with its id.</p>
<p>But if i call the function in this way, </p>
<pre><code>c1.onclick = dep();
function dep() { alert(this.id); }
</code></pre>
<p>The alert appears, when i click on 'Add' button(on calling addfunction()). why?</p>
| javascript | [3] |
5,492,116 | 5,492,117 | jQuery hover over part of an image | <p>I have an image and a span overlapping the image. When I mouse over the image, the span pops up, and on mouse out it retreats back down.
<br /> <strong>Here is a simplified demo: <a href="http://jsfiddle.net/cCYHp/" rel="nofollow">http://jsfiddle.net/cCYHp/</a></strong>
<br /> The problem:
<br /> I would like the spans to only popup when the SPAN area is moused over, not the image. I tried to do a <code>.hide()</code> effect but it did not work (it is commented out in the demo). I think this is because once the span is hidden, it is not able to be moused over anymore. What is the correct way to achieve this effect?</p>
| jquery | [5] |
4,095,245 | 4,095,246 | How to do Button click and list view item click in customize list view in android | <p>I have 4 items in my list view in these 3 are text view and one is button in my case i have to open 2 new activities from a single list </p>
<p>1st from on button click
2nd from on list view item click </p>
<p>but when i add the button in list view list click is not working, also i am not able to handle the click of button.</p>
<p>I am using BaseAdapter class to set the data in list view.</p>
<p>Please help me to solve this.</p>
<p>Thanks.</p>
| android | [4] |
1,000,754 | 1,000,755 | Implicit conversion for pointer to data member vs. non-member | <p>Most discussion I've seen about member pointers focus on conversions permitted on the type to which the member belongs. My question is about conversions on the type of the member.</p>
<pre><code>struct Base{};
struct Derived : public Base{};
struct Foo{ Derived m_Derived; };
</code></pre>
<p>Given these declarations, the following code produces an error (MSVC 2008):</p>
<pre><code>// error C2440: 'initializing' : cannot convert from 'Derived Foo::* ' to 'Base Foo::* '
Base Foo::*p = &Foo::m_Derived;
</code></pre>
<p>Conversion from Derived* to Base* is normally allowed - why the difference here?</p>
| c++ | [6] |
4,797,996 | 4,797,997 | Insert hyperlink and remove hyperlink in Javascript | <p>I want to create 2 simple button look like:
<img src="http://i.stack.imgur.com/1IAlZ.png" alt="http://i.stack.imgur.com/1IAlZ.png"></p>
<p>For insert and remove hyperlink to my HTML in textarea.</p>
<p>My code is:</p>
<pre><code>function formatDoc(sCmd, sValue) {
oDoc = document.getElementById("textBox");
document.execCommand(sCmd, false, sValue); oDoc.focus();
}
</code></pre>
<p>and on body :</p>
<pre><code><div><img class="intLink" title="Hyperlink" onclick="var sLnk=prompt('Inserire lURL','http://');if(sLnk&&sLnk!=''&&sLnk!='http://'){formatDoc('createlink',sLnk)}" src="link.gif" /></div>
<textarea id="textBox"><p>Lorem ipsum</p></textarea>
</code></pre>
<p>But that can't create and add Hyperlink to my element.
What is wrong?</p>
<p>ps: is there simple way to remove link from element?</p>
| javascript | [3] |
443,454 | 443,455 | open image from the web with python image library | <p>I am new to python and am working with python image library. I just want to be able to open an image from the web and get the histogram from this image. Unfortunately I get the error <code>File "new.py", line 1
from PIL import Image import urllib</code> and it does not work. Any idea how to get this working?</p>
<pre><code>from PIL
import Image
import urllib
im = Image.open(urllib.urlopen("http://fmforums.com/forum/uploads/profile/photo-thumb-57725.jpg"))
im = im.convert("P")
print im.histogram()
</code></pre>
| python | [7] |
3,223,401 | 3,223,402 | Need Configuration Settings | <p>I have developed flex based application with php. My client is using Windows 2003 Server. I installed IIS Server and Php Installer into my client machine. I configured php into IIS Server and its working fine.</p>
<p>Query:
I wrote a mail code for sending mail to my application user. My client is using internal mail server. I want to send a mail through my application. I used smtp.gmail.com into my application and Its working perfectly. But when I am using client internal mail server. It is showing below mentioned error.</p>
<p>"Failed to set sender [SMTP: Invalid response code received from server. (Code: 554, response: Mail from mail-id rejected for policy reasons.]"</p>
<p>Please help me out to solve this query. Thanks in advance.</p>
| php | [2] |
930,805 | 930,806 | Jquery if div has value1-10 add class | <p>So I am trying to build this reputation bar for my site which will solely depend only on given number. The functionality should be something like this.</p>
<p>If div has value 1-10, add <code>class="beginner"</code>
If div has value 11-20, add <code>class="mediocre"</code>
If div has value 21-30, add <code>class="hardcore"</code>
and so on..</p>
<p>I have this:</p>
<pre><code><div><a>7</a></div>
</code></pre>
<p>What I want is this:</p>
<pre><code><div class="beginner"><a>7</a></div>
</code></pre>
<p>I thought I should start with something like this:</p>
<pre><code>$("div:contains('0>10')").addClass("begginer");
</code></pre>
<p>but I am pretty much sure that's not going to work. Can anyone help me with this? I am pretty lost here :(</p>
| jquery | [5] |
2,555,069 | 2,555,070 | Viewable Table [android] | <p>I'm wondering if there is anything that would let me use a table, much like Microsoft excel, for my android app but not editable by users.</p>
<p>I've look at the layouts in eclipse but none of them seem to function well.</p>
<p>Im developing on android 2.2</p>
| android | [4] |
3,845,444 | 3,845,445 | Making the output of an operation to display 2 decimal points | <p>Here's my current code:</p>
<p>import java.util.Scanner;</p>
<pre><code>public class Addition
{
// main method begins execution of Java application
public static void main( String args[] )
{
// create Scanner to obtain input from command window
Scanner input = new Scanner( System.in );
int area;
int number1;
int number2;
System.out.print( "Input base value = " ); // prompt
number1 = input.nextInt(); // read first number from user
System.out.print( "Input height value = " ); // prompt
number2 = input.nextInt(); // read second number from user
area = 1/2*(number1*number2); // add numbers
System.out.printf( "The Area of the right triangle is %d\n", area ); // display sum
} // end method main
} // end class Addition
</code></pre>
<p>I would like to make it display the decimal point when i input 5 as the first and second number. i tried replacing <strong>int area</strong> with <strong>double area</strong> but doesn't work..</p>
| java | [1] |
3,722,267 | 3,722,268 | __int64 on a 32-Bit machine? | <p>I just tried something in MSVC 2010 on my 32-bit machine here and found out that I can use __int64 in my programs - which actually work!</p>
<ul>
<li>How is that possible?</li>
</ul>
| c++ | [6] |
4,130,314 | 4,130,315 | Streaming Webcam Video to PHP5 Server | <p>I have an urgent requirement as below
1) end user will be taking a online test
2) an admin will send instruction or command or request to this end user
3) upon this instruction webcam should be switched on , video should start recording
4) this video should now go to server from where admin can see who is taking the test.</p>
<p>There may be at a time 300 people taking the online test and 1 or few may be triggered for step 2 to 4.</p>
<p>online test part we are building in php/mysql.</p>
<p>we are not sure how to start this webcam and record video and send it back to server in a cost-effective manner.</p>
<p>If somebody can really throw some light , it will be a great deal.</p>
<p>Looking forward</p>
| php | [2] |
3,943,037 | 3,943,038 | refresh data after entering a foreground | <p>After changing the default settings, I would like to refresh data of myViewController when I enter the foreground in AppDelegate. What I do is</p>
<p>AppDelegate.m</p>
<pre><code>- (void)applicationDidFinishLaunching:(UIApplication *)application
{
[window addSubview:[navigationController view]];
NSLog(@"APPLICATION DID FINISH LAUNCHING");
// listen for changes to our preferences when the Settings app does so,
// when we are resumed from the backround, this will give us a chance to update our UI
//
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(defaultsChanged:)
name:NSUserDefaultsDidChangeNotification
object:nil];
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
/*
Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
*/
NSLog(@"APPLICATION WILL ENTER BACKGROUND");
[myViewController viewDidLoad];
}
</code></pre>
<p>myViewController.m</p>
<pre><code>- (void)viewDidLoad
{
NSLog(@"VIEW DID LOAD IN MY VIEW CONTROLLER");
// watch when the app has finished launching so we can update our preference settings and apply them to the UI
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateSettings:)
name:UIApplicationDidFinishLaunchingNotification object:nil];
}
- (void)updateSettings:(NSNotification *)notif
{
myLabel.text = @"data has just been modified";
}
</code></pre>
<p>However, there is nothing changed at all.
If you experienced it before please help.. Any comments are welcomed here. Thanks</p>
| iphone | [8] |
2,482,341 | 2,482,342 | Android App How to Force Clean Install instead of Upgrade | <p>After an upgrade on my app, I'm having problems with freezing. If I do clean install (uninstall and then install), the problem doesn't happen.</p>
<p>Does anyone have any idea what could be causing this? Or, how to force a clean install on upgrade rather than upgrade?</p>
<p>Or any other ideas/solutions...</p>
<p>Thanks!</p>
| android | [4] |
4,972,777 | 4,972,778 | Using new Image().src for click tracking | <p>I am attempting to figure out why this click tracker isn't working. The code was written by another developer so I am not entirely sure if this ever did work.</p>
<pre><code>function trackSponsor(o, p) {
(new Image()).src = PATH_BASE + 'click/' + p + '/' + o + "?_cache=" + (+(new Date()));
return false;
}
</code></pre>
<p>From what I can gather is that when this function is called it 'creates a new image' to fire a php script asynchronously. According to Firebug, the request is made however it is 'aborted' ~30ms in. The odd thing is that it will 'sometimes' work as in 1 in every 10+ regardless of the browser.</p>
<p>I would much rather fix this so that it works instead of re-writing it as an ajax request. </p>
<p>Any help is appreciated.</p>
<p>Thanks in advance.</p>
<p><strong>EDIT</strong></p>
<p>Because of tvanfosson's post that got me thinking. I have included the line which calls the click tracker below.</p>
<pre><code><a onclick="trackSponsor(60, 15077); goToNextStep(1988, 15077, 0); return false;" href="#">view</a>
</code></pre>
<p>the goToNextStep() actually changes the page. I am under the impression that it would only be executed after trackSponsor() had finished. </p>
| javascript | [3] |
1,185,313 | 1,185,314 | PHP Static Variables | <p>I have a class which does some API (REST) functions. I'd like to declare the variable class-wide variable and static, so I won't fetch the data over and over again. (This is what I think in theory, could be wrong) Many methods in the class will need that data.</p>
<p>I am using this type of class but something doesn't look right. It is working, but
(this is just an example class, not the real code);</p>
<pre><code>class Some_Process {
private static $tickets = array();
private function _get_tickets () {
if(!self::$tickets) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_URL, 'http://someurl');
self::$tickets = json_decode(curl_exec($curl));
if(!self::$tickets) {
return FALSE;
}
return TRUE;
}
}
function process_tickets () {
self::_get_tickets();
//here I start using the varible
do some job on .. self::$tickets;
}
}
</code></pre>
| php | [2] |
3,335,097 | 3,335,098 | JQuery Dither on Animation | <p>I have a problem with certain jquery effects that I'm currently displaying on a page.</p>
<p>I'm not an expert at coding so I modify whatever I can with what is already available and see how it works.</p>
<p>This is barely noticeable, but if you go to the page <a href="http://www.expresscomputers.net/webservices" rel="nofollow">http://www.expresscomputers.net/webservices</a> and click on any of the images, you can see this dither that occurs on the rest of the images (especially the rounded blue one) which disappears right after the toggle effect is complete.</p>
<p>I have been trying to figure out what is causing this ditcher but have so far no clue! Could it be CSS or the effect itself?</p>
<p>Any help or a nudge in the right direction would be appreciated.</p>
| jquery | [5] |
3,565,953 | 3,565,954 | Problem in hello world in php | <p>Its a <code>hello world</code> code snippet. I have tried to run it using <code>Xampp</code> and I am using <code>DreamWeawer</code> to write the code. Upon execution, the page does not display Hello World. Can anyone point out what would have went wrong.</p>
<pre><code><!DOCTYPE html>
<head>
<title>Hello World | Hello and Welcome</title>
</head>
<body>
<?php
Echo "Hello, World!";
?>
</body>
</html>
</code></pre>
<p>Thanks in advance.</p>
| php | [2] |
4,622,782 | 4,622,783 | Lazy Loading in UITableViewCell | <p>I have a quick question, I want to use lazy loading in my application so searched on net and found a very good following library:</p>
<p><a href="https://github.com/rs/SDWebImage/tree/b357e8210c2a1c96ea768b16fd0c003baef77a04" rel="nofollow">https://github.com/rs/SDWebImage/tree/b357e8210c2a1c96ea768b16fd0c003baef77a04</a></p>
<p>Its very simple to integrate in the code and working perfectly.</p>
<p>Now,my question is that if I use it in my application and release the app then can Apple have any issue on the same and can they reject my App on the basis of this?</p>
<p>I'm sure that many people must have used this library,so please advise me.</p>
<p>Many Thanks in advance for your help!</p>
<p>R's</p>
<p>Ben</p>
| iphone | [8] |
5,244,927 | 5,244,928 | Undefined offset when writing to a file | <p>I am attempting to write to a file using PHP. I am writing data from arrays. </p>
<p>Here's my code: </p>
<pre><code> $subject = $_SESSION['subject'];
$section = $_SESSION['section'];
$exam1 = $_SESSION['exam1'];
$exam2 = $_SESSION['exam2'];
$finalexam = $_SESSION['finalexam'];
$average = $_SESSION['average'];
$studentArray = $_SESSION['stringArray'];
$file = $subject . "-" . $section . ".txt";
$fh = fopen($file, 'a');
$size = sizeof($studentArray);
for($i = 0; $i<$size; $i++){
fwrite($fh, $studentArray[$i] . " " . $exam1[$i] . " " . $exam2[$i] . " " . $finalexam[$i] . " " . $average[$i] . " ");
}
</code></pre>
<p>I always get this notice when I try to access this page:</p>
<pre><code> Notice: Undefined offset: 5 in C:\xampp\htdocs\CS120\MP\Grades.php on line 26
</code></pre>
<p>Line 26 is the one with the fwrite in the for-loop.
There's always a notice but the code writes to the file correctly.
Is there anything that can be done to remove/solve the notice/error?</p>
| php | [2] |
2,156,165 | 2,156,166 | Using a variable retrieved with $.post outside this $.post function | <p>I'm looking to load a set of data from a mysql database and use it in a calendar function written in jquery, but I'm having trouble using the retrieved data outside the $.post function.
Right now, I've hardcoded the data in the function and this works fine, looks (simplified, I off course need more than just alerting the data) like this:</p>
<pre><code>onRender: function(date) {
var redArray = ['2011815','2011820','2011824','2011825'];
alert(redArray);
}
</code></pre>
<p>Now I'd like to retrieve those numbers from my database with something like:</p>
<pre><code>onRender: function(date) {
$.post("../actions/calendar.php", {datetype: "1"}, function(data){
if(data.length >0) {
redArray = data;
}
},"json");
alert(redArray);
}
</code></pre>
<p>But the alert gives nothing, or undefined. How can I use what I got from my php-file, outside of this $.post-thing? I need the variable later on, I cannot stay in the $.post function!</p>
| jquery | [5] |
976,987 | 976,988 | Dangerous php functions | <p>I'm storing php functions to a mySQL database from user input, these functions need to be able to be executed.</p>
<p>As we know, this could and will allow Mr hacker to turn a pretty website into Swiss cheese!</p>
<p>These functions are meant to be simple and don't require any advanced php coding. They are more about handling a single array of data. </p>
<p>So if Mr hacker gets into the administrator section id like to filter out any php functions that could do serious damage before saving to the database.</p>
<p>Things like "exec, shell_exec, system, passthru, popen, proc_open, proc_close", anything that can allow outside input like curl need to be removed.</p>
<p>So what else could be dangerous and should be removed?</p>
<p>I found this list as well:
<a href="http://blog.eukhost.com/webhosting/dangerous-php-functions-must-be-disabled/" rel="nofollow">http://blog.eukhost.com/webhosting/dangerous-php-functions-must-be-disabled/</a></p>
<pre><code>apache_child_terminate
apache_setenv
define_syslog_variables
escapeshellarg
escapeshellcmd
eval
exec
fp
fput
ftp_connect
ftp_exec
ftp_get
ftp_login
ftp_nb_fput
ftp_put
ftp_raw
ftp_rawlist
highlight_file
ini_alter
ini_get_all
ini_restore
inject_code
mysql_pconnect
openlog
passthru
php_uname
phpAds_remoteInfo
phpAds_XmlRpc
phpAds_xmlrpcDecode
phpAds_xmlrpcEncode
popen
posix_getpwuid
posix_kill
posix_mkfifo
posix_setpgid
posix_setsid
posix_setuid
posix_setuid
posix_uname
proc_close
proc_get_status
proc_nice
proc_open
proc_terminate
shell_exec
syslog
system
xmlrpc_entity_decode
</code></pre>
| php | [2] |
4,609,854 | 4,609,855 | this class is not key value coding-compliant for the key givenName | <p>SO i have this </p>
<pre><code>- (void)loadView {
BOOL success;
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString* documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString* databasePath = [documentsPath stringByAppendingPathComponent:@"ProxDeals.db"];
NSError *error;
BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:databasePath];
if (fileExists==TRUE) {
[[NSBundle mainBundle] loadNibNamed:@"ProxDealsViewController" owner:self options:nil];
}
else {
NSString *defaultDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ProxDeals.db"];
NSLog(@"%@",defaultDBPath);
success = [fileManager copyItemAtPath:defaultDBPath toPath:databasePath error:&error];
if (!success) {
NSAssert1(0, @"Failed to create writable database file with message '%@/.", [error localizedDescription]);
}
[[NSBundle mainBundle] loadNibNamed:@"UserRegistration" owner:self options:nil];
}
</code></pre>
<p>}</p>
<p>and this error: </p>
<blockquote>
<p>Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key givenName.'</p>
</blockquote>
<p>I know that i don't do something wright in the initialization of the UserRegistration nib but i don't know how to fix this.</p>
| iphone | [8] |
4,745,673 | 4,745,674 | How to Create Wizard Page With JavaScript | <p>i want to create wizard page like this:</p>
<p><a href="http://i39.tinypic.com/14v0k9h.jpg" rel="nofollow">http://i39.tinypic.com/14v0k9h.jpg</a></p>
<p>Now I want to complete these steps from another page.</p>
<p>and this is code for Next Step :</p>
<pre><code>function NextRow() {
var tbl = document.getElementById("tbl1");
while (count < tbl.rows.length) {
if (tbl.rows[count].bgColor != "lightblue") {
tbl.rows[count].bgColor = "lightblue";
tbl.rows[count].innerHTML = "<td>step " + (count + 1) + "</td>";
var dv = document.getElementById("dvText").innerText = tbl.rows[count].title + " ";
if (count >= 0) {
tbl.rows[count - 1].bgColor = "white";
tbl.rows[count-1].innerHTML = "<td></td>";
}
}
count++;
break;
}
}
</code></pre>
| javascript | [3] |
4,545,108 | 4,545,109 | On studying Android | <p>What is the best way to learn Android? I'm reading Rogers's at al.'s book Android Application Development. However, as I tried the following code, nothing outputs except a mobile phone:</p>
<pre><code>package org.qwerty.com;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HelloWorld extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
}
}
</code></pre>
<p>I tried also search for the Dalvik Debug Monitor <a href="http://stackoverflow.com/questions/1108820/android-emulator-output">http://stackoverflow.com/questions/1108820/android-emulator-output</a> but I couldn't find the option where I can open my hello android project.</p>
| android | [4] |
4,184,670 | 4,184,671 | Why doesn't NullReferenceException contain information about what is null? | <p>What was the design decision behind NullReferenceException not containing any runtime specific information except base class data (like a stacktrace)? And is there an extension for Visual Studio that can tell you straight away which part of an expression was null?</p>
| c# | [0] |
3,232,250 | 3,232,251 | Can't combine strpos and !empty in PHP, why? | <p>I have two lines in PHP that if I combine causes my page to stop loading...Unfortunately, I have no error message using <code>error_reporting(E_ALL | E_STRICT); ini_set('display_errors', true);</code>, and nothing in my apache error.log file.</p>
<p><strong>this works:</strong></p>
<pre><code>$user_setup = strpos($_SESSION['user'], "@");
if (!empty($user_setup)) {....
</code></pre>
<p><strong>But, this does not:</strong></p>
<pre><code>if (!empty(strpos($_SESSION['user'], "@"))) {....
</code></pre>
<p>Is there something about the <code>strpos</code> function causing this to not work? </p>
<p>Thanks for your help!</p>
| php | [2] |
3,357,577 | 3,357,578 | Hiding OK button for jAlert in jQuery | <p>I wanted to show a jquery alert box to user, which will just show a message for few seconds and hides automatically. </p>
<p>This alert should not have any buttons for the user to select. After it hides, i should redirect the user to another page.</p>
<p>I can see things like this in modal dialogs. But i need it in jalert. Can anyone help me? Thanks in advance.</p>
| jquery | [5] |
3,740,005 | 3,740,006 | Moving stream operator >> to the next position | <p>Say I have a string object called line which contains:</p>
<pre><code>Number: 3423
</code></pre>
<p>and I want to do the following:</p>
<pre><code>string keyword;
int number;
stringstream(line) >> keyword >> number;
</code></pre>
<p>But I only want to extract the number, and am not interested in the keyword.</p>
<p>is there a way of doing this without having to declare a string object?</p>
| c++ | [6] |
3,205,536 | 3,205,537 | Staring whole code in a variable -- Javascript | <p>I want to store javascript code in a javascript variable.
To explain clearly, please consider example:</p>
<pre><code><html>
<body>
<script type="text/javascript">
<!--
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}
//-->
</script>
<a onclick="toggle_visibility('1');toggle_visibility('2');">Click here to toggle visibility of element </a>
<div id="1">This is 1</div>
<div id="2">This is 2</div>
<script type="text/javascript">
//document.getElementById('2').style.display='none';
</script>
</body>
</html>
</code></pre>
<p>Now suppose all this code is in a variable as a string or something. (i want to do this because i am exporting file to another html page where the code should get copied.)
I used all variables such as
using \ before ' and so on. referring to <a href="http://www.w3schools.com/js/js_special_characters.asp" rel="nofollow">http://www.w3schools.com/js/js_special_characters.asp</a></p>
| javascript | [3] |
3,944,435 | 3,944,436 | SimpleDateFormat Unparseable date Exception | <p>I am trying to parse datetime string with SimpleDateFormat.parse() but I keep receiving Unparseable date exceptions.</p>
<p>Here is the date format I am trying to parse: <code>2011-10-06T12:00:00-08:00</code></p>
<p>Here is the code I am using:</p>
<pre><code>try {
String dateStr = "2011-10-06T12:00:00-08:00";
SimpleDateFormat dateParser = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
SimpleDateFormat dateFormatter = new SimpleDateFormat("MMM d, yyyy");
Date date = dateParser.parse(dateStr);
System.out.println(dateFormatter.format(date));
} catch(Exception e) {
System.out.println(e.getMessage());
}
</code></pre>
<p>Which returns this error: <code>java.text.ParseException: Unparseable date: "2011-10-06T12:00:00-08:00"</code></p>
<p>As far as I know this is the correct way to use the SimpleDateFormat class but I'm not fluent in Java so I could be mistaken. Any one know what my issue is?</p>
| java | [1] |
2,932,788 | 2,932,789 | confusing Page_Load behavior | <p>This is what I'm trying:</p>
<p>public partial class _Default : System.Web.UI.Page<br>
{</p>
<pre><code>String test = "hi ";
protected void Page_Load(object sender, EventArgs e)
{
test = test + test;
Button1.Value = test;
}
protected void Button2_Click(object sender, EventArgs e)
{
Button1.Value = "u're trolled !";
}
protected void Button1_Click(object sender, EventArgs e)
{
}
</code></pre>
<p>}</p>
<p>when the page is first loaded it shows "hi hi " as the Button1's value. But whenever I click Button2, it shows "u're trolled !" as Button1's value. My question is if the page is postback every time I click the button and the Page_Load is called, then why does it shows "u're trolled !" instead of appending "hi" ?? Isn't the Page_Load called every time the page reloads ?</p>
| asp.net | [9] |
1,490,224 | 1,490,225 | How do I replace all "[", "]" and double quotes in Java | <p>I'm am having difficulty using the replaceAll method to replace square brackets and double quotes. Any ideas?</p>
<p>Edit:</p>
<p>So far I've tried:</p>
<pre><code>replace("\[", "some_thing") // returns illegal escape character
replace("[[", "some_thing") // returns Unclosed character class
replace("^[", "some_thing") // returns Unclosed character class
</code></pre>
| java | [1] |
5,277,198 | 5,277,199 | PHP - Server code and html code | <p>I'm programming a website and I have seen two approaches when programming in PHP:</p>
<ul>
<li>To mix php and html in one .php file.</li>
</ul>
<p>or</p>
<ul>
<li>To have html code in .html file and php code in .php file.</li>
</ul>
<p>Which one is the best way to go?</p>
<p>I guess each one have their pros and cons. So, which one should I choose?</p>
<p>Thanks.</p>
| php | [2] |
5,026,175 | 5,026,176 | android read contacts details using ContactsContract | <p>i am querying contacts through</p>
<pre><code>private Cursor cursor;
private static final String SORT_ORDER = ContactsContract.Contacts.DISPLAY_NAME + " ASC ";
String[] myProjection = new String[] { ContactsContract.Contacts._ID,
ContactsContract.Contacts.DISPLAY_NAME,
ContactsContract.Contacts.PHOTO_ID,
ContactsContract.Contacts.HAS_PHONE_NUMBER,
ContactsContract.Contacts.STARRED};
cursor = managedQuery(ContactsContract.Contacts.CONTENT_URI, myProjection, null, null, SORT_ORDER);
</code></pre>
<p>and its giving me all contacts details.But my issue is with the duplicate contact details.
Like i am getting a few contacts details multiple times. i think one is from my phone contact another is from facebook contact and from other sites as well.How can i show only one contact of same person in my details.</p>
<p>i have read in some blogs stating a different projection like</p>
<pre><code>ContactsContract.Contacts.Data.RAW_CONTACT_ID
</code></pre>
<p>and different URI</p>
<pre><code>RawContacts.CONTENT_URI
</code></pre>
<p>Can anyone suggest me what is the diff between the two URI.i need to query id,name,photo,phone number,email,starred.</p>
<p>Thanks</p>
| android | [4] |
363,481 | 363,482 | is there a way to join them? | <p>file A has some data as this:</p>
<pre><code>$_ADMINLANG['global']['hometitle'] =
$_ADMINLANG['global']['searchfilter'] =
.....
</code></pre>
<p>file B has some data as this:</p>
<pre><code>"test a";
"test B";
</code></pre>
<p>is there a way to join them in file C as this:</p>
<pre><code>$_ADMINLANG['global']['hometitle'] = "test a";
$_ADMINLANG['global']['searchfilter'] = "test B";
.....
</code></pre>
<p>thank you.</p>
| php | [2] |
667,847 | 667,848 | Transfer Python setup accross different PC | <p>My scenario is I have two laptops with <code>fresh installation</code> of <code>windows</code>. Now I use both of them for programming.</p>
<p>So, lets suppose I install various python modules/packages in one of the laptop. So is there a way I can <code>clone</code> this complete python setup on my other laptop. The reason for this is my internet connection currently is very slow so I don't want to download the same module or packages twice and than install them again.</p>
<p>I know I can download the modules in zip file, transfer them on other and than run <code>python setup.py install</code> but I am going to use <code>pip</code> to install modules.</p>
<p>Anyways, I was wondering if <code>cloning</code> of python setup is possible.</p>
| python | [7] |
5,484,707 | 5,484,708 | slideUp fails on dynamically attached div | <p>Here is the code I use to attach the div:</p>
<pre><code>$("#sessions").prepend(tempct);
$("#sessions>div:first-child").hide().slideDown(1000).delay(100,function(){
$("#sessions>div:first-child").click();
$("#renamemeeting").click();
});
</code></pre>
<p>here <code>tempct</code> is some HTML I wrote, for a simple div structure. The div does get attached and slides down properly.</p>
<p>Next I try to delete the div, like this:</p>
<pre><code>console.info("Starting call for element #tr"+chidcl+" and element is "+$("#tr"+chidcl));
/*$("#tr"+chidcl).slideUp(500,function(){
console.log("slideUp was fired");
});*/
$("#trOF7VFS").slideUp(500,function(){
console.log("slideUp was fired");
});
console.warn("Finished call for element #tr"+chidcl+" and element is "+$("#tr"+chidcl));
</code></pre>
<p>Here the <code>Starting call...</code> and <code>Finished call...</code> lines are being displayed, but for some weird reason, slideUp doesn't work, neither is the message displayed.</p>
<p>You can see the page here: <a href="http://mpsinfoservices.com/projects/sudipta/liveminutes/minutes.html" rel="nofollow">http://mpsinfoservices.com/projects/sudipta/liveminutes/minutes.html</a></p>
<p>When the page is loaded, the <code>div</code> <code>trOF7VFS</code> is automatically attached, now try going to actions menu, and hitting <code>delete</code>, and you should see the problem.</p>
| jquery | [5] |
1,956,082 | 1,956,083 | Basic question in assigning value to unordered_map | <p>I have an unordered_map which stores the int as key an pointer as value. I need to check the existence of the key. If the key is not available, I need to insert the key and value. Which one is the better approach?</p>
<p>Thanks.</p>
<pre><code>unordered_map<int, classA*>testMap;
classA* ptr = testMap[1];
if(ptr == NULL)
testMap[1] = new classA;
OR
unordered_map<int, classA*>::iterator it = testMap.find(1);
if(it == testMap.end())
{
testMap.insert(make_pair(1, new classA));
}
</code></pre>
| c++ | [6] |
388,258 | 388,259 | How To Read OPDS Catalog (ex : http://feedbooks.com/catalog.atom) | <p>I'm new in PHP. I want to read OPDS catalog (ex : <a href="http://feedbooks.com/catalog.atom" rel="nofollow">http://feedbooks.com/catalog.atom</a>) and then store the catalogs into json file. </p>
<p>Could someone suggest me how to do it, or point me to usefull article/source code to do it?</p>
| php | [2] |
3,651,194 | 3,651,195 | How To Add .ui Files To Python | <p>1: i create main window in QtCreator.</p>
<p>how i use this form in my python code in eclipse.</p>
<p>2: can write python and build complete python application in QtCreator ? (How).</p>
<p>thanks.</p>
| python | [7] |
3,874,432 | 3,874,433 | compressing a folder into different formats in php | <p>hey guys , im dealing with a script that it should compress and folder and make it ready in 3 versions :</p>
<p>7z
zip
tar.gz </p>
<p>surely i did found a way on how to make a zip file out of a folder in php by using a zip compression class </p>
<p><a href="http://www.phpclasses.org/package/2322-PHP-Create-ZIP-file-archives-and-serve-for-download.html" rel="nofollow">http://www.phpclasses.org/package/2322-PHP-Create-ZIP-file-archives-and-serve-for-download.html</a></p>
<p>but for <strong>7z</strong> and tar.gz format no idea on how to do the compression </p>
<p>is there any way to make an 7z or tar.gz compressed file !?</p>
<p>specially 7z format</p>
| php | [2] |
3,953,345 | 3,953,346 | Make List items unfocusable | <p>The default behavior of a list when one of it's items is touched is for that item to gain focus while it is being touched. I need a way to make the list items unfocusable ,so that when they are being touched , nothing should happen.</p>
| android | [4] |
2,637,607 | 2,637,608 | Static variable accessed from different compilation units potentially problematic? | <p>When I started as at my first job as software developer I was assigned to create a system for that allows writing and reading C++ values (or objects) from and to a PDF document. This required a system for mapping types to an id and vice versa. The codebase was huge and there were several 'layers' of code (basic framework layer, tools-layer, view-layers, etc..). The proposed solution was to add a header file to each layer with an enum that contains ids for types defined in the particular layer. To avoid conflicts, each the first value of each enum would start with a offset value (1000, 2000, 3000, ...).</p>
<p>As this system seemed a bit clumsy to me I decided to try something else, and came up with class for representing unique ids:</p>
<pre><code>// UniqueId.h
class UniqueId
{
public:
UniqueId();
operator int() const;
private:
int mId;
static int sCounter;
};
// UniqueId.cpp
int UniqueId::sCounter = 0;
UniqueId::UniqueId()
{
mId = ++sCounter;
}
UniqueId::operator int() const
{
return mId;
}
</code></pre>
<p>Instead of an enum, now simply a list of UniqueId objects could be created without fearing for conflicting ids.</p>
<p>The person reviewing my code (software architect of the company) agreed with this at first. However, a day later he changed his mind and told me this system won't work. I vaguely remember him mentioning that there would be problems resulting from multiple compilation units.</p>
<p>Today, some four years later, I still don't understand what the problem could have been. For as far as I know, the static variable will only be defined in one compilation unit (the one for UniqeId.cpp).</p>
<p>So.. since StackOverflow is so abundant with veteran developers I'd like to take the opportunity to ask for some clarification. Would this indeed have been a problem? Or was my idea ok?</p>
| c++ | [6] |
3,986,422 | 3,986,423 | Local/Production Crypt Returning Different Hashes | <p>PHP <code>crypt</code> function is returning different hashes on local and production server.
On localhost the crypt hash validation is working fine, but on production its not.</p>
<pre><code>Local: PHP 5.4.4
Procution: PHP 5.3.10-1ubuntu3.5
</code></pre>
<hr>
<p>Code:</p>
<pre><code>echo crypt('123123123');
</code></pre>
<p>Local Example Response:</p>
<pre><code>$1$7ymnm8q/$M6HLj2JEvzWGElqlwjAKm0
</code></pre>
<p>Production Example Response:</p>
<pre><code>$6$sbttg2v6$2YAU3dNKR/.MRGmbBV4sR8vEhr/L8aOMTej1u3gArhgIiCiJ5IFJ
</code></pre>
| php | [2] |
5,954,617 | 5,954,618 | How to ask confirmation when closing a window? | <p>I want to pop up a message asking for confirmation if the user wants to leave the current page, exactly like stackoverflow does it when you are typing a question.</p>
<p>Could someone help me on this, by giving me a script or redirecting me to an answer (on this site or elsewhere) ?</p>
<p>Thanks</p>
| javascript | [3] |
1,935,530 | 1,935,531 | Bouncing object in Android | <p>I want a program where an object (sphere) falls from top of screen, bounces back few times and settles in the middle of screen. I am new developer in android. Can anyone help me?</p>
| android | [4] |
1,794,375 | 1,794,376 | Python: Change Tuple Order in List Of Tuples | <p>I have a list of tuples like so:</p>
<pre><code>ListOfTuples = [(var1,var2,var3,var4,var5),
(var6,var7,var8,var9,var10),
(var11,var12,var13,var14,var15),
(var16,var17,var18,var19,var20)]
</code></pre>
<p>I want to swap two tuples, i.e. have the list like:</p>
<pre><code>ListOfTuples = [(var1,var2,var3,var4,var5),
(var6,var7,var8,var9,var10),
(var16,var17,var18,var19,var20)
(var11,var12,var13,var14,var15)]
</code></pre>
<p>I have tried the following unsuccessfully:</p>
<pre><code>ListOfTuples[2], ListOfTuples[3] = ListOfTuples[3] , ListOfTuples[2]
</code></pre>
<p>Can anyone tell me how to do this please?</p>
| python | [7] |
2,699,337 | 2,699,338 | android: how to register my app as "camera app" | <p>I was wondering how to tell android that my app is a camera app, so other apps know that they can start my app to get a picture.
E.g. with pixlr-o-matic you can either select an image from the gallery or you can request it from a camera app of your choice.</p>
<p>edit:
how do i return the picture to the calling app?</p>
| android | [4] |
1,717,025 | 1,717,026 | Pass Integers and Strings trough Activities in Android? | <p>How can I use Integers and Strings from ione Activity in an other?</p>
<p>Thanks</p>
| android | [4] |
3,811,827 | 3,811,828 | On studying Android | <p>What is the best way to learn Android? I'm reading Rogers's at al.'s book Android Application Development. However, as I tried the following code, nothing outputs except a mobile phone:</p>
<pre><code>package org.qwerty.com;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HelloWorld extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
}
}
</code></pre>
<p>I tried also search for the Dalvik Debug Monitor <a href="http://stackoverflow.com/questions/1108820/android-emulator-output">http://stackoverflow.com/questions/1108820/android-emulator-output</a> but I couldn't find the option where I can open my hello android project.</p>
| android | [4] |
1,949,277 | 1,949,278 | Function repeating when page not being viewed | <p>I have created a self-repeating function using JavaScript, however when I navigate to another tab open in my browser and go back to the tab containing the function; the function is repeating at a much faster pace than specified; can anybody shed any light on why this may happen?</p>
<p>Example of JavaScript Used:</p>
<pre><code>function aFunction() {
var aFunctionVar;
clearTimeout(aFunctionVar);
aFunctionVar = setTimeout(aFunction,8000);
if (condition) {
//More code to run...
return false;
}
if (condition) {
//More code to run...
return false;
}
};
aFunction();
</code></pre>
| javascript | [3] |
1,363,252 | 1,363,253 | php mail() function detected as spam | <p>I use a simple mail function for a contact form in my website.</p>
<pre><code>$name = stripslashes($_POST['name']);
$email = trim($_POST['email']);
$text = stripslashes($_POST['message']);
$message = '<html><body>'.nl2br($text)."</body></html>";
$mail = mail("info@domain.com", "Contact Form", $message,
"From: ".$name." <".$email.">\r\n"
."Reply-To: ".$email."\r\n"
."X-Mailer: PHP/" . phpversion()
."MIME-Version: 1.0\r\n"
."Content-Type: text/html; charset=utf-8");
</code></pre>
<p>The email is send BUT it is always detected as Spam which is not good.
Probably because the "FROM" is the email given by the visitor in the form.</p>
<p>How to solve this?</p>
| php | [2] |
2,116,632 | 2,116,633 | LogFactory not printing to console | <p>I used <code>LogFactory</code> as follows in my project: </p>
<pre><code>Log logger = LogFactory.getLog(ContentFactory.class);
logger.info("-info-");
</code></pre>
<p>Why didn't it print on the console when I executed it?</p>
| java | [1] |
824,603 | 824,604 | Derived destructor called before base destructor causes issue | <p>Here is my issue:</p>
<p>My base class has a constructor that takes in a class pointer, if that pointer is NULL, it knows to instance it itself and maintain it.</p>
<p>The problem is, in the base destructor, I have to unregister that pointer with something private of base. So what happens is when I try to make a call to the class pointer in the base destructor and the derived is maintaining it, it has already been freed. So that causes a problem. What could I do?</p>
<p>Thanks</p>
| c++ | [6] |
4,553,866 | 4,553,867 | Python doc issues | <p>I'm trying to learn Python. I'm coming from C++ and Ruby and basically, I'm struggling to understand the doc.</p>
<p><a href="http://www.ruby-doc.org/core-1.9.3/Array.html" rel="nofollow">This</a> Ruby doc lists all the methods and operators and gives an example and an explanation.</p>
<p><a href="http://www.cplusplus.com/reference/vector/vector/" rel="nofollow">This</a> C++ doc (though not official) does a similar thing.</p>
<p>My question is, where is this for python? I'm looking <a href="http://docs.python.org/2/tutorial/datastructures.html" rel="nofollow">here</a> at the moment; my issue, however, is that I cannot see where the examples are (is there an example of the use of, say, the <code>append</code> method -- I know it's a pretty easy and obvious method to use; however, I'm sure that there are methods which are not so obvious). Furthermore, I don't understand where the operators are documented. For example, the <code>+</code> operator when used with string appends a character, and when used with a list, appends an element. Where is this documented? Is there no doc similar to the Ruby or C++ one?</p>
<p>Thanks.</p>
| python | [7] |
1,734,973 | 1,734,974 | Shuffling a deck of cards? | <p>I am VERY new to c++ and I still haven't wrapped my head around the basic concepts yet but my professor wants us to write an algorithm to shuffle and display a deck of cards and the deck needs to be represented as a 2d array. </p>
<p>However I am having trouble just simulating the deck of cards!</p>
<pre><code> #include <iostream>
#include <vector>
using namespace std;
int main() {
vector<char> deck;
char suit[] = {'h','d','c','s'};
char card[] = {'2','3','4','5','6','7','8','9','T','J','Q','K','A'};
for (int j=0; j<13; j++) {
for (int i=0; i<4; i++) {
deck.push_back(card[j] suit[i]);
}
}
return 0;
}
</code></pre>
<p>I've seen a lot of card programs with classes but I'm not even sure if we are going to learn those this semester. </p>
| c++ | [6] |
1,112,387 | 1,112,388 | Stax parser dynamically changing xml version 1.0 to 1.1 in java | <p>I have an xml with version as 1.0 , with this version stax parser failing to parse the xml if the xml has control characters (, etc..). So when I googled it with xml version 1.1 we can avoid the parsing errors. But I want to change the xml version to 1.1 dynamically within the file. I don't to want to read the entire file and replace the version with 1.1 and writing new file which may lead to performance issues.</p>
<p>I just want to replace the version with 1.1 directly in existing file.</p>
<p>could you please help me out</p>
| java | [1] |
4,156,101 | 4,156,102 | PHP Fatal error: Call to undefined function when function is defined | <p>I have a basic code here:</p>
<pre><code>include('Core/dAmnPHP.php');
$tokenlist = array();
foreach($users as $username => $password) {
$socket[$username] = socket_create(AF_INET,SOCK_STREAM,SOL_TCP);
@socket_connect($socket[$username], "chat.deviantart.com", 3900);
$connected = TRUE;
send("dAmnClient 0.3\nagent=IdleClient\n".chr(0), $username);
$tokenarray = getCookie($username, $password);
$token = $tokenarray['cookie'];
$tokenlist[$username] = $token;
}
</code></pre>
<p>Inside of dAmnPHP.php, it includes a function called getCookie, however every time I run my script it tells me that the function is undefined. Any ideas? Thanks.</p>
| php | [2] |
3,350,446 | 3,350,447 | Is a file an image? | <p>In C# what is the best way to tell if a particular file is an image? </p>
| c# | [0] |
4,130,116 | 4,130,117 | How to compile scintilla in windows? | <p>I never compiled any open source project in Windows. I want to compile Scintilla on windows in Visual Studio or in any other way. Pleas write a step by step instruction to compile it.</p>
<p>I have googled for last 2 week but could not get any tutorial/guide. Please help.</p>
<p>I tried to compile in windows as per the instruction provided in README file in scintilla source and got following error.</p>
<p>D:\scintilla\win32>nmake -f scintilla.mak</p>
<p>Microsoft (R) Program Maintenance Utility Version 7.00.8882
Copyright (C) Microsoft Corp 1988-2000. All rights reserved.</p>
<pre><code> rc -fo.\ScintRes.res ScintRes.rc
</code></pre>
<p>ScintRes.rc(5) : fatal error RC1015: cannot open include file 'windows.h'.
NMAKE : fatal error U1077: 'rc' : return code '0x1'
Stop.</p>
<p>My OS is windows xp. I am using visual studio 2005 and also have installed Microsoft Platform SDK for Windows Server 2003 R2.</p>
| c++ | [6] |
1,634,647 | 1,634,648 | jQuery selector | <p>I have the following markup that will be repeated for several questions</p>
<pre><code><p id="questionOne">What are your tasks?</p>
<p id="copyLastYear"><a href="#">Copy from last year</a></p>
<div id="anserOne">
<div class="cleditorMain">
<div><!-- Editor tags here --></div>
<iframe>
<html>
<head></head>
<body></body>
</html>
</iframe>
</div>
</div>
</code></pre>
<p>When someone clicksthe copy from last year link I need to set the html in the body with the details from last years answer.</p>
<p>The problem I'm having is selecting the body tag</p>
<p>I tried the following but with no luck</p>
<pre><code>$('#answerOne .cleditorMain iframe html body').html('<p>New HTML value</p>');
</code></pre>
<p>Can anyone help with the selector part of this please.</p>
<p>Thanks</p>
| jquery | [5] |
439,097 | 439,098 | How to read events/entries added to calendar? | <p>I am able to add entries as of now. In my app, the user can enter an appointment/event on his calendar. But before he can do that, it should show him the events he has already added. it should fetch the events from calendar and show it to him. How to do this? I am stuck at this part.
Thanks in advance.</p>
| android | [4] |
4,546,271 | 4,546,272 | Randomly unable to hit my APIs on 1 phone | <p>I'm having an issue that is becoming increasingly annoying and I'm not sure what I can do about it.</p>
<p>I have a web site running and a subdomain of that which my APIs hit. The phone I'm using for testing (it is another person's phone) is an Epic 4G on the Sprint network. It is running Android 2.2.1.</p>
<p>Quite frequently, my Android app will become unable to hit my API over the Sprint network on this phone. Any calls to my API return UnknownHostException. Hitting any website in Browser (ex: www.google.com) works with no problem. Turning on wifi and hitting the API works fine.</p>
<p>After some time (this morning, about 30 minutes), it will start being able to connect again on the Sprint network. But now it doesn't work over wifi! When I turn wifi on and hit the API, I receive an org.apache.http.conn.HttpHostConnectException error (Connect to my API refused). Again, every other phone running my app can hit the API over network or wifi with no problem.</p>
<p>Here's the thing: None of the other phones running my App have this problem. In fact, a friend of mine has an Epic 4G on the Sprint network, too, and he's never had the issue. I even called him a moment ago and asked him to use my app to hit my API while this issue was happening to me and he successfully hit the API. That tells me it's something with the phone, but I've no idea what.</p>
<p>I'm looking for ideas as to why this is an issue. Ultimately, how I can handle it, but I'm not sure I can really do anything. It sounds like there may be some kind of connection profile happening behind the scenes and it is obviously very flawed. Is there some way I can turn it off? Is there some way I can get my app to clear my API url from this presumed cache upon a connection failure?</p>
| android | [4] |
5,025,616 | 5,025,617 | disabling deprecated errors | <p>I want to enable deprecated errors globally but disable them for a specific piece of third-party code, which I don't have the time to fix.
So, I have this in php.ini:
<code>error_reporting = E_ALL & ~E_NOTICE | E_DEPRECATED</code></p>
<p>and this right before the line where I want to disable the warnings
<code>error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);</code></p>
<p>However, it does not work, I'm still getting the warnings for that particular line. If I disable them globally in php.ini it works. I'm using PHP 5.3.10. Any ideas what might be wrong?</p>
| php | [2] |
4,102,188 | 4,102,189 | Android: How do I create a function that will be executed only once? | <p>How can i create a function that will be run only once, on first installation? I am trying to create an information that displays one time.</p>
<p>thanks in advance.</p>
| android | [4] |
3,964,345 | 3,964,346 | Why are certain elements of this python list ignored? | <p>I'm new to Python, and i'm struggling to understand the output of this simple program:</p>
<pre><code>list = os.listdir(os.getcwd())
print(list)
print()
for element in list:
print(element)
if 'txt' not in element: list.remove(element)
</code></pre>
<p>Which gives me this output :</p>
<pre><code>['examples_list.txt', 'generate_patterns.py', 'lehoczky_example_3.txt', 'patterns', 'test.py', 'test2.py']
examples_list.txt
generate_patterns.py
patterns
test2.py
</code></pre>
<p>why are certain elements (such as 'lehoczky_example_3.txt'), ignored by the "for" loop?</p>
| python | [7] |
2,689,974 | 2,689,975 | Where can I find file on Android (DDMS) | <p>I try to write string to file in my class, extends AsyncTask:</p>
<pre><code>protected void onPostExecute(String result) {
super.onPostExecute(result);
DataOutputStream out = null;
try {
out = new DataOutputStream(openFileOutput("1xdf.xml", Context.MODE_PRIVATE));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
for (int i=0; i<20; i++) {
try {
out.writeUTF(Integer.toString(i));
} catch (IOException e) {
e.printStackTrace();
}
}
try {
out.close();
Log.e(DEBUG_TAG, "6x");
} catch (IOException e) {
e.printStackTrace();
}
}
</code></pre>
<p>Where can I finde this file in DDMs? When I try search->file 1xdf.xml, I get </p>
<blockquote>
<p>Problems encountered during text search. File
'MainActivity/bin/jarlist.cache' has been skipped, problem while
reading: ('Resource is out of sync with the file system:
'/MainActivity/bin/jarlist.cache'.'). Resource is out of sync with the
file system: '/MainActivity/bin/jarlist.cache'.</p>
</blockquote>
| android | [4] |
3,965,758 | 3,965,759 | JavaScript select() method | <p>What does the <code>select()</code> method in JavaScript do? When should we use it?</p>
| javascript | [3] |
3,633,519 | 3,633,520 | What is a clever way to count number of unique items in array (PHP)? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1553809/unique-entries-in-an-array">Unique entries in an array</a> </p>
</blockquote>
<p>Let assume the array is sorted, how can I get number of counts for each unique items</p>
<p>Example:</p>
<pre><code> $array = array ("bye", "bye", "bye", "hello", "hello");
</code></pre>
<p>Output:</p>
<pre><code> bye = 3
hello = 2
</code></pre>
| php | [2] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.